Closed
Bug 611922
Opened 14 years ago
Closed 14 years ago
"ABORT: aRelevantLinkVisited should only be set when we have a separate style"
Categories
(Core :: CSS Parsing and Computation, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla6
People
(Reporter: jruderman, Assigned: bzbarsky)
References
Details
(Keywords: assertion, testcase, Whiteboard: fixed-in-cedar)
Attachments
(4 files, 2 obsolete files)
###!!! ABORT: aRelevantLinkVisited should only be set when we have a separate style: 'aRulesIfVisited || !aRelevantLinkVisited', file layout/style/nsStyleContext.cpp, line 179
| Reporter | ||
Comment 1•14 years ago
|
||
| Reporter | ||
Comment 2•14 years ago
|
||
Bug 575675 shows another way to trigger this assertion (with a chrome document).
| Reporter | ||
Comment 3•14 years ago
|
||
Usually aborts within 5 seconds.
| Assignee | ||
Comment 4•14 years ago
|
||
We understand bug 575675 now. It has to do with the lack of :visited rules in the chrome preference stylesheet.... That doesn't seem likely to be relevant here.
What's happening here is that we assert when we're reparenting the style for the <span> as part of style reresolution. At this point, the <span>'s parent is an <a> which has no attributes. So presumably this is the reresolve for the href attribute removal. But since it has no attributes, it shouldn't in fact be visited. And we have |mLinkState = eLinkState_NotLink| for that <a>.
| Assignee | ||
Comment 5•14 years ago
|
||
Ah, the key, of course, is that nsStyleSet::ReparentStyleContext uses the RelevantLinkVisited() value of the old style context (aStyleContext) for the new one. But in this case, the visitedness actually changed. I should be able to write a simpler testcase for this...
| Assignee | ||
Comment 6•14 years ago
|
||
The timeout bit stinks, but async visited state lookup doesn't block onload (and ideally shouldn't be detectable at all), and I needed to make sure the script ran after we'd decided the link is visited.
| Assignee | ||
Comment 7•14 years ago
|
||
I think this should only happen when going from the visited state to the not-link state, since that's the case in which the <a>'s new style context won't have an if-visited style. In all other cases, this code in nsStyleSet::GetContext makes sure we have an if-visited rulenode to pass to FindChildWithRules:
nsStyleContext *parentIfVisited =
aParentContext ? aParentContext->GetStyleIfVisited() : nsnull;
if (parentIfVisited) {
if (!aVisitedRuleNode) {
aVisitedRuleNode = aRuleNode;
}
| Assignee | ||
Comment 8•14 years ago
|
||
The test still shows the problem for me even with the 100ms timeout. The worst that will happen with that timer is that the test won't catch a regression, so at least there shouldn't be any randomorange issues here... I really wish the visited state lookup blocked onload.
Attachment #501278 -
Flags: review?(dbaron)
| Assignee | ||
Updated•14 years ago
|
Attachment #501278 -
Attachment is obsolete: true
Attachment #501278 -
Flags: review?(dbaron)
| Assignee | ||
Comment 9•14 years ago
|
||
Attachment #501279 -
Flags: review?(dbaron)
| Assignee | ||
Comment 10•14 years ago
|
||
David, I'm not sure how serious this abort situation is; should I be considering this for 2.0?
Assignee: nobody → bzbarsky
Priority: -- → P1
| Assignee | ||
Comment 11•14 years ago
|
||
Though... two things.
1) Maybe we need to do this on any link state change. In particular, when going from "unvisited" to "visited", I'm not sure we end up with the right visited bit in the style context....
2) Maybe we can just make reparenting smarter? e.g. can it use the new parent's "is relevant link visited" bit unless it's a style context for a link or something?
(In reply to comment #11)
> Though... two things.
>
> 1) Maybe we need to do this on any link state change. In particular, when
> going from "unvisited" to "visited", I'm not sure we end up with the right
> visited bit in the style context....
I think we should if we at least reparent, given nsStyleSet::GetContext, at least with the fix below.
But what about the opposite case of the one you're patching in the bug: the case where we go from not-a-link to is-a-link?
> 2) Maybe we can just make reparenting smarter? e.g. can it use the new
> parent's "is relevant link visited" bit unless it's a style context for a link
> or something?
Er, yes, I agree that's a bug in nsStyleSet::ReparentStyleContext.
Would that also fix this bug? If so, it certainly seems like a better fix.
Comment on attachment 501279 [details] [diff] [review]
And with the test actually waiting so it can fail
Marking review- to elicit response.
Attachment #501279 -
Flags: review?(dbaron) → review-
| Assignee | ||
Comment 14•14 years ago
|
||
Yeah, response is coming up. I just had no power most of today, and need to think about the answers to you questions.
Comment 15•14 years ago
|
||
FYI, I see this consistently testing crash urls on www.ankama-shop.com and www.battlefieldheroes.com
| Assignee | ||
Comment 16•14 years ago
|
||
> But what about the opposite case of the one you're patching in the bug: the
> case where we go from not-a-link to is-a-link?
Comment 7 addresses this.
> Would that also fix this bug?
Sure seems to. I'll post a patch to this effect.
| Assignee | ||
Comment 17•14 years ago
|
||
Attachment #529763 -
Flags: review?(dbaron)
| Assignee | ||
Updated•14 years ago
|
Attachment #501279 -
Attachment is obsolete: true
| Assignee | ||
Updated•14 years ago
|
Whiteboard: [need review]
Comment on attachment 529763 [details] [diff] [review]
When reparenting style contexts, use the visitedness of our new parent unless we're the style context for a link. In that situation, assume that our visitedness did not change.
r=dbaron
Attachment #529763 -
Flags: review?(dbaron) → review+
| Assignee | ||
Updated•14 years ago
|
Whiteboard: [need review] → [need landing]
| Assignee | ||
Comment 19•14 years ago
|
||
Flags: in-testsuite+
Whiteboard: [need landing] → fixed-in-cedar
| Assignee | ||
Updated•14 years ago
|
Target Milestone: --- → mozilla6
Comment 20•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•