Bug 1544060 - Bail out from ScrollFrameHelper::GetScrollPadding in the case where no corresponding frame exists. r=botond
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 15 Apr 2019 21:15:53 +0000
changeset 469572 a7c8897aea6f
parent 469571 9bf188c86f9c
child 469573 5bf26403f3a9
push id35874
push userccoroiu@mozilla.com
push dateTue, 16 Apr 2019 04:04:58 +0000
treeherdermozilla-central@be3f40425b52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1544060
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1544060 - Bail out from ScrollFrameHelper::GetScrollPadding in the case where no corresponding frame exists. r=botond Differential Revision: https://phabricator.services.mozilla.com/D27423
layout/generic/crashtests/1544060-2.html
layout/generic/crashtests/crashtests.list
layout/generic/nsGfxScrollFrame.cpp
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/1544060-2.html
@@ -0,0 +1,1 @@
+<html hidden style="scroll-snap-type:both proximity!important"></html>
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -724,8 +724,9 @@ pref(layout.css.column-span.enabled,true
 pref(layout.css.column-span.enabled,true) load 1507196.html
 load 1515124.html
 pref(layout.css.column-span.enabled,true) load 1517033.html
 pref(layout.css.column-span.enabled,true) load 1517297.html
 load 1520798-1.xul
 load 1520798-2.html
 load 1539656.html
 load 1544060-1.html
+load 1544060-2.html
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -6780,17 +6780,20 @@ nsMargin ScrollFrameHelper::GetScrollPad
   if (mIsRoot) {
     if (const Element* rootElement =
             mOuter->PresContext()->Document()->GetRootElement()) {
       styleFrame = rootElement->GetPrimaryFrame();
     }
   } else {
     styleFrame = mOuter;
   }
-  MOZ_ASSERT(styleFrame);
+
+  if (!styleFrame) {
+    return nsMargin();
+  }
 
   // The spec says percentage values are relative to the scroll port size.
   // https://drafts.csswg.org/css-scroll-snap-1/#scroll-padding
   return ResolveScrollPaddingStyle(styleFrame->StylePadding()->mScrollPadding,
                                    GetScrollPortRect().Size());
 }
 
 layers::ScrollSnapInfo ScrollFrameHelper::ComputeScrollSnapInfo(