Fix crash when scrolling to the bottom of an iframe with --root-layer-scrolls

This commit is contained in:
Marshall Greenblatt 2016-08-22 17:13:48 +03:00
parent f5be340d57
commit 90ba67d8ea
2 changed files with 31 additions and 0 deletions

View File

@ -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': '../',
},
]

View File

@ -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;