Bug 1237086. When getting the displayport for a content node if there is no root scroll frame just use the primary frame of the content node. r=botond

XUL documents don't have a root scroll frame, so this would early return and prevent any of the tiling and max texture size code from running.

The root element of XUL documents likely only ever has zero-margin displayports, and they are not scrollable, so it may not be important.
This commit is contained in:
Timothy Nikkel 2016-01-06 20:51:01 -06:00
parent e9f77a4e94
commit cb06741b61

View File

@ -883,10 +883,9 @@ GetDisplayPortFromMarginsData(nsIContent* aContent,
if (aContent->OwnerDoc()->GetRootElement() == aContent) {
// We want the scroll frame, the root scroll frame differs from all
// others in that the primary frame is not the scroll frame.
frame = frame->PresContext()->PresShell()->GetRootScrollFrame();
if (!frame) {
// If there is no root scrollframe, just exit.
return base;
if (nsIFrame* rootScrollFrame =
frame->PresContext()->PresShell()->GetRootScrollFrame()) {
frame = rootScrollFrame;
}
isRoot = true;