Bug 36765

Summary: Test for Ensuring Pseudo Class's are Respected on Dynamic Changes
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: joepeck
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
[TEST] Upstreamed Test darin: review+

Description Joseph Pecoraro 2010-03-29 10:44:24 PDT
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.
Comment 1 Joseph Pecoraro 2010-03-29 10:49:12 PDT
Created attachment 51929 [details]
[TEST] Upstreamed Test
Comment 2 Darin Adler 2010-03-29 10:53:24 PDT
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.
Comment 3 Joseph Pecoraro 2010-03-29 10:54:27 PDT
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.
Comment 4 Joseph Pecoraro 2010-03-29 11:11:31 PDT
(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