Closed
Bug 1237825
Opened 8 years ago
Closed 8 years ago
Find the root scroll frame even if the root element doesn't have a primary frame
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla46
Tracking | Status | |
---|---|---|
firefox46 | --- | fixed |
People
(Reporter: tnikkel, Assigned: tnikkel)
Details
Attachments
(1 file)
1.87 KB,
patch
|
mstange
:
review+
|
Details | Diff | Splinter Review |
This is a weird and tricky case.
Assignee | ||
Comment 1•8 years ago
|
||
Typical structure is viewportframe mContent=null htmlscrollframe mContent=rootelement canvasframe mContent=rootelement blockframe mContent=rootelement ... with rootelement->GetPrimaryFrame() == blockframe But if the blockframe isn't created because it is displaynone (or it has a failed -moz-binding) we get viewportframe mContent=null htmlscrollframe mContent=rootelement canvasframe mContent=rootelement with rootelement->GetPrimaryFrame() == null So we just need to be able to get the presshell given the content node only.
Attachment #8705397 -
Flags: review?(mstange)
Assignee | ||
Comment 2•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5bcda7e04d00
Comment 3•8 years ago
|
||
Comment on attachment 8705397 [details] [diff] [review] patch Review of attachment 8705397 [details] [diff] [review]: ----------------------------------------------------------------- r+ assuming you add the null check or have a good justification for why it's not necessary. ::: layout/base/nsLayoutUtils.cpp @@ +857,5 @@ > nsIFrame* frame = aContent->GetPrimaryFrame(); > + if (aContent->OwnerDoc()->GetRootElement() == aContent) { > + nsIPresShell* presShell = frame ? frame->PresContext()->PresShell() : nullptr; > + if (!presShell) { > + presShell = aContent->OwnerDoc()->GetShell(); presShell can still be null after this line, right? Don't you need to null check it before using it below?
Attachment #8705397 -
Flags: review?(mstange) → review+
Assignee | ||
Comment 4•8 years ago
|
||
I'll add the null. Probably wasn't bitter by it because we likely only call it if we have a frame, and at least a presshell.
Comment 6•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/980596816271
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
Updated•6 years ago
|
Product: Core → Core Graveyard
Updated•6 years ago
|
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
You need to log in
before you can comment on or make changes to this bug.
Description
•