The default bug view has changed. See this FAQ.

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

RESOLVED FIXED in mozilla6

Status

()

Core
CSS Parsing and Computation
P4
normal
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

Trunk
mozilla6
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
Created attachment 527885 [details] [diff] [review]
patch

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.....
(Assignee)

Comment 3

6 years ago
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!
(Assignee)

Comment 5

6 years ago
https://hg.mozilla.org/mozilla-central/rev/c73c4d6907fe
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.