Closed Bug 1031149 Opened 10 years ago Closed 10 years ago

nsStyleContext::FindChildWithRules cache is passed an incorrect aRelevantLinkVisited parameter

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: dbaron, Assigned: dbaron)

References

Details

Attachments

(1 file)

nsStyleSet::GetContext passes nsStyleContext::FindChildWithRules an incorrect aRelevantLinkVisited parameter. This parameter should correspond to whether RelevantLinkVisited() will be set on the style context, since that's what FindChildWithRules assumes it means for the cache lookup. However, GetContext hasn't yet completed the computation of whether that will be set on the style context, so it can be incorrect for descendants of links. Some of GetContext's callers fix the value up correctly, but the primary one (ResolveStyleFor) doesn't. See patch to be attached. This might lead to some styling confusion. I should investigate whether this fixes any of: bug 554630, bug 557579, bug 575675, bug 618792, bug 868975, bug 931627, bug 952328.
Blocks: 996796
Comment on attachment 8447632 [details] [diff] [review] Consistently pass correct aRelevantLinkVisited to nsStyleContext::FindChildWithRules Review of attachment 8447632 [details] [diff] [review]: ----------------------------------------------------------------- Should we move the if (aOldStyle->RelevantLinkVisited()) { flags |= eIsVisitedLink; } block in nsStyleSet::ResolveStyleForRules into the if (aOldStyle->IsLinkContext()) block?
Attachment #8447632 - Flags: review?(cam) → review+
Bug 996796 patch 9 removes that function entirely (and later patches in that bug fix various bugs in it), so I'd rather not mess with it.
Fair enough.
And, er, actually, bug 996796 patch 11 does exactly that, in the moved code. (I wrote this patch while working on that part of the patch series there.)
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: