Bug 1562105 - Bail out if the style frame for the scrollable frame is null in ScrollFrameHelper::IsSmoothScroll. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D36303

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Hiroyuki Ikezoe 2019-06-28 16:45:54 +00:00
parent b53fa7eb49
commit cc47e0d6ef
3 changed files with 17 additions and 3 deletions

View File

@ -0,0 +1,6 @@
<script>
document.addEventListener("DOMContentLoaded", function(){
document.documentElement.hidden = 'true'
window.scrollBy(9, 13)
})
</script>

View File

@ -734,3 +734,4 @@ load 1542441.html
pref(layout.css.grid-template-subgrid-value.enabled,true) load 1553824.html
load 1346454-1.html
load 1346454-2.html
load 1562105.html

View File

@ -7161,8 +7161,15 @@ bool ScrollFrameHelper::SmoothScrollVisual(
}
bool ScrollFrameHelper::IsSmoothScroll(dom::ScrollBehavior aBehavior) const {
return aBehavior == dom::ScrollBehavior::Smooth ||
(aBehavior == dom::ScrollBehavior::Auto &&
GetFrameForStyle()->StyleDisplay()->mScrollBehavior ==
if (aBehavior == dom::ScrollBehavior::Smooth) {
return true;
}
nsIFrame* styleFrame = GetFrameForStyle();
if (!styleFrame) {
return false;
}
return (aBehavior == dom::ScrollBehavior::Auto &&
styleFrame->StyleDisplay()->mScrollBehavior ==
NS_STYLE_SCROLL_BEHAVIOR_SMOOTH);
}