I've tested generated content model in IE8b1 quite thoroughly, have found quite weird bugs and here's what I've come up with:
-
First bug I've noticed was happening when you set
position: relativefor the generated content rule. The tab where you have this page opened dies. And then due to newly introduced crash recovery system, it tries to recover the tab, loads the page and dies again and so on — an infinite loop that you can't break. But the weird thing is that it doesn't actually die — it shows a window promting to select a debugger. The kind of window that appears when you have errors in your javascript code.here's the code sample:
p:before {content: "test"; position: relative;}and the testcase.
-
I noted the bug and continued testing.
Next thing I came up with was the fact that if the page doesn't have IMG/OBJECT/IFRAME elements or an image set as a background for an element, generated content is created after
window.onload!Please have a look on the following testcases:
- Document contains None of the elements listed above, and generated content is not being generated till you press OK. It means that generated content is created after
window.onloadoccurred! - Generated content is created before
window.onloadas it should be in the following cases:
an element has CSSbackground-imagerule set, or page includes one of the elements: IMG,
OBJECT or an IFRAME
At this point I thought — wait — it's strange — all CSS rules were always applied before
window.onload! Anyway, I just went on testing. - Document contains None of the elements listed above, and generated content is not being generated till you press OK. It means that generated content is created after
-
And then there was another strange thing — when you use
content: attr(class), IE8b1 doesn't show the attribute value but showsnullinstead. But if you set the rule ascontent: attr(className), it actually shows the attribute value!Here's the testcase for this bug.
-
And another interesting thing is that
expressiondoesn't work in generated content rules.Please see the testcase.
Of course I can only guess but my feeling is that IE8b1 doesn't have proper support for the generated content, it's rather done by a hook somewhere firing off the function that generates the content. All these four bugs have something in common — debug window (that's usually shown for javascript errors); generating content after window.onload in some cases; reading class attribute value by its DOM name (className). Basically it's all about javascript.
And I can't help thinking that IE8b1 uses some hidden javascript code to support generated content. And this functionality is triggered by some hidden event like DomContentLoaded.
And if so I would be really happy if they could give us access to this handler