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

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: rebase Created 3 years, 5 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 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1966 overflow_y = EOverflow::kAuto; 1967 overflow_y = EOverflow::kAuto;
1967 if (overflow_anchor == EOverflowAnchor::kVisible) 1968 if (overflow_anchor == EOverflowAnchor::kVisible)
1968 overflow_anchor = EOverflowAnchor::kAuto; 1969 overflow_anchor = EOverflowAnchor::kAuto;
1969 // Column-gap is (ab)used by the current paged overflow implementation (in 1970 // Column-gap is (ab)used by the current paged overflow implementation (in
1970 // lack of other ways to specify gaps between pages), so we have to 1971 // lack of other ways to specify gaps between pages), so we have to
1971 // propagate it too. 1972 // propagate it too.
1972 column_gap = overflow_style->ColumnGap(); 1973 column_gap = overflow_style->ColumnGap();
1973 } 1974 }
1974 1975
1975 ScrollSnapType snap_type = overflow_style->GetScrollSnapType(); 1976 ScrollSnapType snap_type = overflow_style->GetScrollSnapType();
1977 EScrollBoundaryBehavior scroll_boundary_behavior_x =
1978 overflow_style->ScrollBoundaryBehaviorX();
1979 EScrollBoundaryBehavior scroll_boundary_behavior_y =
1980 overflow_style->ScrollBoundaryBehaviorY();
1981 using ScrollBoundaryBehaviorType =
1982 WebScrollBoundaryBehavior::ScrollBoundaryBehaviorType;
1983 if (RuntimeEnabledFeatures::CSSScrollBoundaryBehaviorEnabled() &&
1984 IsInMainFrame()) {
1985 GetPage()->GetOverscrollController().SetScrollBoundaryBehavior(
1986 WebScrollBoundaryBehavior(
1987 static_cast<ScrollBoundaryBehaviorType>(scroll_boundary_behavior_x),
1988 static_cast<ScrollBoundaryBehaviorType>(
1989 scroll_boundary_behavior_y)));
1990 }
1976 1991
1977 RefPtr<ComputedStyle> viewport_style = GetLayoutViewItem().MutableStyle(); 1992 RefPtr<ComputedStyle> viewport_style = GetLayoutViewItem().MutableStyle();
1978 if (viewport_style->GetWritingMode() != root_writing_mode || 1993 if (viewport_style->GetWritingMode() != root_writing_mode ||
1979 viewport_style->Direction() != root_direction || 1994 viewport_style->Direction() != root_direction ||
1980 viewport_style->VisitedDependentColor(CSSPropertyBackgroundColor) != 1995 viewport_style->VisitedDependentColor(CSSPropertyBackgroundColor) !=
1981 background_color || 1996 background_color ||
1982 viewport_style->BackgroundLayers() != background_layers || 1997 viewport_style->BackgroundLayers() != background_layers ||
1983 viewport_style->ImageRendering() != image_rendering || 1998 viewport_style->ImageRendering() != image_rendering ||
1984 viewport_style->OverflowAnchor() != overflow_anchor || 1999 viewport_style->OverflowAnchor() != overflow_anchor ||
1985 viewport_style->OverflowX() != overflow_x || 2000 viewport_style->OverflowX() != overflow_x ||
1986 viewport_style->OverflowY() != overflow_y || 2001 viewport_style->OverflowY() != overflow_y ||
1987 viewport_style->ColumnGap() != column_gap || 2002 viewport_style->ColumnGap() != column_gap ||
1988 viewport_style->GetScrollSnapType() != snap_type) { 2003 viewport_style->GetScrollSnapType() != snap_type ||
2004 viewport_style->ScrollBoundaryBehaviorX() != scroll_boundary_behavior_x ||
2005 viewport_style->ScrollBoundaryBehaviorY() != scroll_boundary_behavior_y) {
1989 RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*viewport_style); 2006 RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*viewport_style);
1990 new_style->SetWritingMode(root_writing_mode); 2007 new_style->SetWritingMode(root_writing_mode);
1991 new_style->SetDirection(root_direction); 2008 new_style->SetDirection(root_direction);
1992 new_style->SetBackgroundColor(background_color); 2009 new_style->SetBackgroundColor(background_color);
1993 new_style->AccessBackgroundLayers() = background_layers; 2010 new_style->AccessBackgroundLayers() = background_layers;
1994 new_style->SetImageRendering(image_rendering); 2011 new_style->SetImageRendering(image_rendering);
1995 new_style->SetOverflowAnchor(overflow_anchor); 2012 new_style->SetOverflowAnchor(overflow_anchor);
1996 new_style->SetOverflowX(overflow_x); 2013 new_style->SetOverflowX(overflow_x);
1997 new_style->SetOverflowY(overflow_y); 2014 new_style->SetOverflowY(overflow_y);
1998 new_style->SetColumnGap(column_gap); 2015 new_style->SetColumnGap(column_gap);
1999 new_style->SetScrollSnapType(snap_type); 2016 new_style->SetScrollSnapType(snap_type);
2017 new_style->SetScrollBoundaryBehaviorX(scroll_boundary_behavior_x);
2018 new_style->SetScrollBoundaryBehaviorY(scroll_boundary_behavior_y);
2000 GetLayoutViewItem().SetStyle(new_style); 2019 GetLayoutViewItem().SetStyle(new_style);
2001 SetupFontBuilder(*new_style); 2020 SetupFontBuilder(*new_style);
2002 } 2021 }
2003 2022
2004 if (body) { 2023 if (body) {
2005 if (const ComputedStyle* style = body->GetComputedStyle()) { 2024 if (const ComputedStyle* style = body->GetComputedStyle()) {
2006 if (style->Direction() != root_direction || 2025 if (style->Direction() != root_direction ||
2007 style->GetWritingMode() != root_writing_mode) 2026 style->GetWritingMode() != root_writing_mode)
2008 body->SetNeedsStyleRecalc(kSubtreeStyleChange, 2027 body->SetNeedsStyleRecalc(kSubtreeStyleChange,
2009 StyleChangeReasonForTracing::Create( 2028 StyleChangeReasonForTracing::Create(
(...skipping 4965 matching lines...) Expand 10 before | Expand all | Expand 10 after
6975 } 6994 }
6976 6995
6977 void showLiveDocumentInstances() { 6996 void showLiveDocumentInstances() {
6978 WeakDocumentSet& set = liveDocumentSet(); 6997 WeakDocumentSet& set = liveDocumentSet();
6979 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6998 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6980 for (blink::Document* document : set) 6999 for (blink::Document* document : set)
6981 fprintf(stderr, "- Document %p URL: %s\n", document, 7000 fprintf(stderr, "- Document %p URL: %s\n", document,
6982 document->Url().GetString().Utf8().data()); 7001 document->Url().GetString().Utf8().data());
6983 } 7002 }
6984 #endif 7003 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698