Closed Bug 652268 Opened 14 years ago Closed 14 years ago

dynamic changes to link state of root element don't cause correct restyling

Categories

(Core :: CSS Parsing and Computation, defect, P4)

defect

Tracking

()

RESOLVED FIXED
mozilla6

People

(Reporter: dbaron, Assigned: dbaron)

Details

Attachments

(1 file)

Attached patch patchSplinter Review
Either bz pointed out this bug during reviews of some of the :visited work (bug 147777, etc.), or I noticed it while addressing comments. I wrote a patch to fix it ages ago, but never got around to writing a test, which I just did. In any case, when a style change on the root element includes a change only to the link visitedness or to link-ness, the style change doesn't take effect correctly because it's defeated by an incorrect check in the style context sharing code. This patch fixes it. I confirmed that the test fails without the patch and passes with it.
Attachment #527885 - Flags: review?(bzbarsky)
Comment on attachment 527885 [details] [diff] [review] patch I'm pretty sure I didn't point this out, but it certainly makes sense! r=me
Attachment #527885 - Flags: review?(bzbarsky) → review+
I wonder whether we can widen this optimization, by the way. Seems like it should be valid any time oldContext and newContext have the same parent, whether that parent is null or not. Though I don't know how often this situation arises.....
We already have the optimization for the other cases through sibling sharing, as long as we haven't blown past the cache length (currently 10). See nsStyleContext::FindChildWithRules.
Oh, right. OK, then!
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: