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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2884423003: Use scroll-boundary-behavior to control overscroll-refresh/glow on android. (Closed)
Patch Set: Update input_messages with the order in the enum. Created 3 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 #include "core/loader/FrameLoader.h" 194 #include "core/loader/FrameLoader.h"
195 #include "core/loader/NavigationScheduler.h" 195 #include "core/loader/NavigationScheduler.h"
196 #include "core/loader/PrerendererClient.h" 196 #include "core/loader/PrerendererClient.h"
197 #include "core/loader/appcache/ApplicationCacheHost.h" 197 #include "core/loader/appcache/ApplicationCacheHost.h"
198 #include "core/page/ChromeClient.h" 198 #include "core/page/ChromeClient.h"
199 #include "core/page/EventWithHitTestResults.h" 199 #include "core/page/EventWithHitTestResults.h"
200 #include "core/page/FocusController.h" 200 #include "core/page/FocusController.h"
201 #include "core/page/FrameTree.h" 201 #include "core/page/FrameTree.h"
202 #include "core/page/Page.h" 202 #include "core/page/Page.h"
203 #include "core/page/PointerLockController.h" 203 #include "core/page/PointerLockController.h"
204 #include "core/page/scrolling/OverscrollController.h"
204 #include "core/page/scrolling/RootScrollerController.h" 205 #include "core/page/scrolling/RootScrollerController.h"
205 #include "core/page/scrolling/ScrollStateCallback.h" 206 #include "core/page/scrolling/ScrollStateCallback.h"
206 #include "core/page/scrolling/ScrollingCoordinator.h" 207 #include "core/page/scrolling/ScrollingCoordinator.h"
207 #include "core/page/scrolling/SnapCoordinator.h" 208 #include "core/page/scrolling/SnapCoordinator.h"
208 #include "core/page/scrolling/TopDocumentRootScrollerController.h" 209 #include "core/page/scrolling/TopDocumentRootScrollerController.h"
209 #include "core/probe/CoreProbes.h" 210 #include "core/probe/CoreProbes.h"
210 #include "core/resize_observer/ResizeObserverController.h" 211 #include "core/resize_observer/ResizeObserverController.h"
211 #include "core/svg/SVGDocumentExtensions.h" 212 #include "core/svg/SVGDocumentExtensions.h"
212 #include "core/svg/SVGScriptElement.h" 213 #include "core/svg/SVGScriptElement.h"
213 #include "core/svg/SVGTitleElement.h" 214 #include "core/svg/SVGTitleElement.h"
(...skipping 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after
1971 overflow_y = EOverflow::kAuto; 1972 overflow_y = EOverflow::kAuto;
1972 if (overflow_anchor == EOverflowAnchor::kVisible) 1973 if (overflow_anchor == EOverflowAnchor::kVisible)
1973 overflow_anchor = EOverflowAnchor::kAuto; 1974 overflow_anchor = EOverflowAnchor::kAuto;
1974 // Column-gap is (ab)used by the current paged overflow implementation (in 1975 // Column-gap is (ab)used by the current paged overflow implementation (in
1975 // lack of other ways to specify gaps between pages), so we have to 1976 // lack of other ways to specify gaps between pages), so we have to
1976 // propagate it too. 1977 // propagate it too.
1977 column_gap = overflow_style->ColumnGap(); 1978 column_gap = overflow_style->ColumnGap();
1978 } 1979 }
1979 1980
1980 ScrollSnapType snap_type = overflow_style->GetScrollSnapType(); 1981 ScrollSnapType snap_type = overflow_style->GetScrollSnapType();
1982 EScrollBoundaryBehavior scroll_boundary_behavior_x =
1983 overflow_style->ScrollBoundaryBehaviorX();
1984 EScrollBoundaryBehavior scroll_boundary_behavior_y =
1985 overflow_style->ScrollBoundaryBehaviorY();
1986 using ScrollBoundaryBehaviorType =
1987 WebScrollBoundaryBehavior::ScrollBoundaryBehaviorType;
1988 if (RuntimeEnabledFeatures::CSSScrollBoundaryBehaviorEnabled() &&
1989 IsInMainFrame()) {
1990 GetPage()->GetOverscrollController().SetScrollBoundaryBehavior(
1991 WebScrollBoundaryBehavior(
1992 static_cast<ScrollBoundaryBehaviorType>(scroll_boundary_behavior_x),
1993 static_cast<ScrollBoundaryBehaviorType>(
1994 scroll_boundary_behavior_y)));
1995 }
1981 1996
1982 RefPtr<ComputedStyle> viewport_style = GetLayoutViewItem().MutableStyle(); 1997 RefPtr<ComputedStyle> viewport_style = GetLayoutViewItem().MutableStyle();
1983 if (viewport_style->GetWritingMode() != root_writing_mode || 1998 if (viewport_style->GetWritingMode() != root_writing_mode ||
1984 viewport_style->Direction() != root_direction || 1999 viewport_style->Direction() != root_direction ||
1985 viewport_style->VisitedDependentColor(CSSPropertyBackgroundColor) != 2000 viewport_style->VisitedDependentColor(CSSPropertyBackgroundColor) !=
1986 background_color || 2001 background_color ||
1987 viewport_style->BackgroundLayers() != background_layers || 2002 viewport_style->BackgroundLayers() != background_layers ||
1988 viewport_style->ImageRendering() != image_rendering || 2003 viewport_style->ImageRendering() != image_rendering ||
1989 viewport_style->OverflowAnchor() != overflow_anchor || 2004 viewport_style->OverflowAnchor() != overflow_anchor ||
1990 viewport_style->OverflowX() != overflow_x || 2005 viewport_style->OverflowX() != overflow_x ||
1991 viewport_style->OverflowY() != overflow_y || 2006 viewport_style->OverflowY() != overflow_y ||
1992 viewport_style->ColumnGap() != column_gap || 2007 viewport_style->ColumnGap() != column_gap ||
1993 viewport_style->GetScrollSnapType() != snap_type) { 2008 viewport_style->GetScrollSnapType() != snap_type ||
2009 viewport_style->ScrollBoundaryBehaviorX() != scroll_boundary_behavior_x ||
2010 viewport_style->ScrollBoundaryBehaviorY() != scroll_boundary_behavior_y) {
1994 RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*viewport_style); 2011 RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*viewport_style);
1995 new_style->SetWritingMode(root_writing_mode); 2012 new_style->SetWritingMode(root_writing_mode);
1996 new_style->SetDirection(root_direction); 2013 new_style->SetDirection(root_direction);
1997 new_style->SetBackgroundColor(background_color); 2014 new_style->SetBackgroundColor(background_color);
1998 new_style->AccessBackgroundLayers() = background_layers; 2015 new_style->AccessBackgroundLayers() = background_layers;
1999 new_style->SetImageRendering(image_rendering); 2016 new_style->SetImageRendering(image_rendering);
2000 new_style->SetOverflowAnchor(overflow_anchor); 2017 new_style->SetOverflowAnchor(overflow_anchor);
2001 new_style->SetOverflowX(overflow_x); 2018 new_style->SetOverflowX(overflow_x);
2002 new_style->SetOverflowY(overflow_y); 2019 new_style->SetOverflowY(overflow_y);
2003 new_style->SetColumnGap(column_gap); 2020 new_style->SetColumnGap(column_gap);
2004 new_style->SetScrollSnapType(snap_type); 2021 new_style->SetScrollSnapType(snap_type);
2022 new_style->SetScrollBoundaryBehaviorX(scroll_boundary_behavior_x);
2023 new_style->SetScrollBoundaryBehaviorY(scroll_boundary_behavior_y);
2005 GetLayoutViewItem().SetStyle(new_style); 2024 GetLayoutViewItem().SetStyle(new_style);
2006 SetupFontBuilder(*new_style); 2025 SetupFontBuilder(*new_style);
2007 } 2026 }
2008 2027
2009 if (body) { 2028 if (body) {
2010 if (const ComputedStyle* style = body->GetComputedStyle()) { 2029 if (const ComputedStyle* style = body->GetComputedStyle()) {
2011 if (style->Direction() != root_direction || 2030 if (style->Direction() != root_direction ||
2012 style->GetWritingMode() != root_writing_mode) 2031 style->GetWritingMode() != root_writing_mode)
2013 body->SetNeedsStyleRecalc(kSubtreeStyleChange, 2032 body->SetNeedsStyleRecalc(kSubtreeStyleChange,
2014 StyleChangeReasonForTracing::Create( 2033 StyleChangeReasonForTracing::Create(
(...skipping 4952 matching lines...) Expand 10 before | Expand all | Expand 10 after
6967 } 6986 }
6968 6987
6969 void showLiveDocumentInstances() { 6988 void showLiveDocumentInstances() {
6970 WeakDocumentSet& set = liveDocumentSet(); 6989 WeakDocumentSet& set = liveDocumentSet();
6971 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6990 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6972 for (blink::Document* document : set) 6991 for (blink::Document* document : set)
6973 fprintf(stderr, "- Document %p URL: %s\n", document, 6992 fprintf(stderr, "- Document %p URL: %s\n", document,
6974 document->Url().GetString().Utf8().data()); 6993 document->Url().GetString().Utf8().data());
6975 } 6994 }
6976 #endif 6995 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698