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

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: findAutoscrollable should return 0 for fixed-position elements 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
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 a240f8a112be65e8281829b5e91e3cc0048964ac..2d8f951adcbe93d9c152b6404f1c878127c7013e 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() &&
bokan 2016/10/24 13:22:00 Could you confirm that a scroller inside a positio
sunyunjia 2016/10/24 14:10:25 Confirmed!
+ toLayoutBox(layoutObject)->layer()->scrollsWithViewport()) {
+ return 0;
+ }
+
if (!layoutObject->parent() &&
layoutObject->node() == layoutObject->document() &&
layoutObject->document().localOwner())

Powered by Google App Engine
This is Rietveld 408576698