Bug 36765 - Test for Ensuring Pseudo Class's are Respected on Dynamic Changes
Summary: Test for Ensuring Pseudo Class's are Respected on Dynamic Changes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-29 10:44 PDT by Joseph Pecoraro
Modified: 2010-03-29 11:11 PDT (History)
1 user (show)

See Also:


Attachments
[TEST] Upstreamed Test (2.54 KB, patch)
2010-03-29 10:49 PDT, Joseph Pecoraro
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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