This tests elements affected by CSS pseudo class selectors are updated after a dynamic DOM change. This test currently passes in ToT, it is just being upstreamed.
Created attachment 51929 [details] [TEST] Upstreamed Test
Comment on attachment 51929 [details] [TEST] Upstreamed Test > +// Need to test after the initial layout to force a dynamic recalc. > +setTimeout(makeDynamicChanges, 0); I don't think this is true. I think you just need a way to force style calculate both before and after. I think that a call to getComputedStyle both before and after would do the trick.
Let me know if I should make this test more extensive. It currently tests :only-child, and not first/last/nth. However, that should be enough given what this test is trying to prevent. This test was used to catch a situation where a RenderStyle is cloned and reapply without copying the RenderStyle's state information, which used for pseudo class styling.
(In reply to comment #2) > (From update of attachment 51929 [details]) > > +// Need to test after the initial layout to force a dynamic recalc. > > +setTimeout(makeDynamicChanges, 0); > > I don't think this is true. I think you just need a way to force style > calculate both before and after. I think that a call to getComputedStyle both > before and after would do the trick. Good idea. It makes the test clearer as well. Committed r56733 A LayoutTests/fast/css/dynamic-pseudo-class-expected.txt A LayoutTests/fast/css/dynamic-pseudo-class.html M LayoutTests/ChangeLog r56733 = 0db386c4456b0761bc7058857117c0c130da56e0 (trunk) http://trac.webkit.org/changeset/56733