Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2441683002: Prevent AutoscrollForSelection when selecting text in a fixed-position element. (Closed)
Patch Set: Edited the test. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/autoscroll-disabled-in-fix.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 9bb04a993e62ab288ebeb0f8cc56f97fcd5c7f9d..e153ccf0f34b2f3620ca35fdab86cfc7341012be 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1008,6 +1008,12 @@ LayoutBox* LayoutBox::findAutoscrollable(LayoutObject* layoutObject) {
while (
layoutObject &&
!(layoutObject->isBox() && toLayoutBox(layoutObject)->canAutoscroll())) {
+ // Do not start autoscroll when the node is inside a fixed-position element.
+ if (layoutObject->isBox() && toLayoutBox(layoutObject)->hasLayer() &&
+ toLayoutBox(layoutObject)->layer()->scrollsWithViewport()) {
+ return 0;
bokan 2016/10/24 14:11:29 nit: return nullptr
+ }
+
if (!layoutObject->parent() &&
layoutObject->node() == layoutObject->document() &&
layoutObject->document().localOwner())
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/autoscroll-disabled-in-fix.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698