Closed Bug 571105 Opened 10 years ago Closed 10 years ago

"ASSERTION: Visited style has wrong parent" with <link> root

Categories

(Core :: Layout, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

(Keywords: assertion, regression, testcase)

Attachments

(2 files)

Attached file testcase
###!!! ASSERTION: Visited style has wrong parent: 'Error', file /builds/moz2_slave/mozilla-central-macosx-debug/build/layout/base/nsFrameManager.cpp, line 638
frame: ScrollbarFrame(scrollbar)(-1) (0x3b3bb70) style: 0x3b3a9d8 {}

This assertion was added in a patch in bug 558943.
So in this case aContext->GetParent()->GetStyleIfVisited() is null, but "childStyleIfVisited->GetRuleNode() == aContext->GetRuleNode()" is true.

The frame in question is the scrollbar frame.  The root scrollbar, of course.

Now the scrollbar's style context is parented to the scrollframe's style context.  The scrollframe's style context does NOT have a style if visited.  But the scrollbar does.  At the same time, the scrollbar's style context and its style if visited have the _same_ rulenode.

Should we perhaps treat aVisitedRuleNode == aRuleNode as being equivalent to aVisitedRuleNode == null in GetContext?
In particular, in this case it seems like we had a relevant link, but no difference in the rules that actually matched us with :visited vs not.

If we make the change I suggest in comment 1, we can remove the code in ReparentStyleContext that was doing that already.
Attached patch Like so, perhapsSplinter Review
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #450729 - Flags: review?(dbaron)
Er, I added the testcase as a crashtest locally.
Comment on attachment 450729 [details] [diff] [review]
Like so, perhaps

r=dbaron
Attachment #450729 - Flags: review?(dbaron) → review+
Pushed http://hg.mozilla.org/mozilla-central/rev/b0e7db4a20c7
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.