diff --git a/patch/patch.cfg b/patch/patch.cfg index 810de4845..f2b414322 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -251,4 +251,11 @@ patches = [ 'name': 'render_view_host_impl_1392', 'path': '../content/browser/renderer_host/', }, + { + # Fix crash when scrolling to the bottom of an iframe with + # --root-layer-scrolls + # https://codereview.chromium.org/2150153002 + 'name': 'viewport_2150153002', + 'path': '../', + }, ] diff --git a/patch/patches/viewport_2150153002.patch b/patch/patches/viewport_2150153002.patch new file mode 100644 index 000000000..bc22241cc --- /dev/null +++ b/patch/patches/viewport_2150153002.patch @@ -0,0 +1,24 @@ +diff --git cc/layers/viewport.cc cc/layers/viewport.cc +index d80d40c..30984592 100644 +--- cc/layers/viewport.cc ++++ cc/layers/viewport.cc +@@ -36,6 +36,9 @@ Viewport::ScrollResult Viewport::ScrollBy(const gfx::Vector2dF& delta, + const gfx::Point& viewport_point, + bool is_direct_manipulation, + bool affect_top_controls) { ++ if (!OuterScrollLayer()) ++ return ScrollResult(); ++ + gfx::Vector2dF content_delta = delta; + + if (affect_top_controls && ShouldTopControlsConsumeScroll(delta)) +@@ -74,6 +77,9 @@ bool Viewport::ShouldAnimateViewport(const gfx::Vector2dF& viewport_delta, + } + + gfx::Vector2dF Viewport::ScrollAnimated(const gfx::Vector2dF& delta) { ++ if (!OuterScrollLayer()) ++ return gfx::Vector2dF(0, 0); ++ + ScrollTree& scroll_tree = + host_impl_->active_tree()->property_trees()->scroll_tree; +