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

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 the test Created 3 years, 6 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/svg/SVGDocumentExtensions.h" 211 #include "core/svg/SVGDocumentExtensions.h"
211 #include "core/svg/SVGScriptElement.h" 212 #include "core/svg/SVGScriptElement.h"
212 #include "core/svg/SVGTitleElement.h" 213 #include "core/svg/SVGTitleElement.h"
213 #include "core/svg/SVGUseElement.h" 214 #include "core/svg/SVGUseElement.h"
(...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after
1942 if (overflow_anchor == EOverflowAnchor::kVisible) 1943 if (overflow_anchor == EOverflowAnchor::kVisible)
1943 overflow_anchor = EOverflowAnchor::kAuto; 1944 overflow_anchor = EOverflowAnchor::kAuto;
1944 // Column-gap is (ab)used by the current paged overflow implementation (in 1945 // Column-gap is (ab)used by the current paged overflow implementation (in
1945 // lack of other ways to specify gaps between pages), so we have to 1946 // lack of other ways to specify gaps between pages), so we have to
1946 // propagate it too. 1947 // propagate it too.
1947 column_gap = overflow_style->ColumnGap(); 1948 column_gap = overflow_style->ColumnGap();
1948 } 1949 }
1949 1950
1950 ScrollSnapType snap_type = overflow_style->GetScrollSnapType(); 1951 ScrollSnapType snap_type = overflow_style->GetScrollSnapType();
1951 const LengthPoint& snap_destination = overflow_style->ScrollSnapDestination(); 1952 const LengthPoint& snap_destination = overflow_style->ScrollSnapDestination();
1953 EScrollBoundaryBehavior scroll_boundary_behavior_x =
1954 overflow_style->ScrollBoundaryBehaviorX();
1955 EScrollBoundaryBehavior scroll_boundary_behavior_y =
1956 overflow_style->ScrollBoundaryBehaviorY();
1957 using ScrollBoundaryBehaviorType =
1958 WebScrollBoundaryBehavior::ScrollBoundaryBehaviorType;
1959 if (RuntimeEnabledFeatures::CSSScrollBoundaryBehaviorEnabled()) {
1960 GetPage()->GetOverscrollController().SetScrollBoundaryBehavior(
1961 WebScrollBoundaryBehavior(
1962 static_cast<ScrollBoundaryBehaviorType>(scroll_boundary_behavior_x),
1963 static_cast<ScrollBoundaryBehaviorType>(
1964 scroll_boundary_behavior_y)));
1965 }
1952 1966
1953 RefPtr<ComputedStyle> document_style = GetLayoutViewItem().MutableStyle(); 1967 RefPtr<ComputedStyle> document_style = GetLayoutViewItem().MutableStyle();
1954 if (document_style->GetWritingMode() != root_writing_mode || 1968 if (document_style->GetWritingMode() != root_writing_mode ||
1955 document_style->Direction() != root_direction || 1969 document_style->Direction() != root_direction ||
1956 document_style->VisitedDependentColor(CSSPropertyBackgroundColor) != 1970 document_style->VisitedDependentColor(CSSPropertyBackgroundColor) !=
1957 background_color || 1971 background_color ||
1958 document_style->BackgroundLayers() != background_layers || 1972 document_style->BackgroundLayers() != background_layers ||
1959 document_style->ImageRendering() != image_rendering || 1973 document_style->ImageRendering() != image_rendering ||
1960 document_style->OverflowAnchor() != overflow_anchor || 1974 document_style->OverflowAnchor() != overflow_anchor ||
1961 document_style->OverflowX() != overflow_x || 1975 document_style->OverflowX() != overflow_x ||
1962 document_style->OverflowY() != overflow_y || 1976 document_style->OverflowY() != overflow_y ||
1963 document_style->ColumnGap() != column_gap || 1977 document_style->ColumnGap() != column_gap ||
1964 document_style->GetScrollSnapType() != snap_type || 1978 document_style->GetScrollSnapType() != snap_type ||
1965 document_style->ScrollSnapDestination() != snap_destination) { 1979 document_style->ScrollSnapDestination() != snap_destination ||
1980 document_style->ScrollBoundaryBehaviorX() != scroll_boundary_behavior_x ||
1981 document_style->ScrollBoundaryBehaviorY() != scroll_boundary_behavior_y) {
1966 RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*document_style); 1982 RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*document_style);
1967 new_style->SetWritingMode(root_writing_mode); 1983 new_style->SetWritingMode(root_writing_mode);
1968 new_style->SetDirection(root_direction); 1984 new_style->SetDirection(root_direction);
1969 new_style->SetBackgroundColor(background_color); 1985 new_style->SetBackgroundColor(background_color);
1970 new_style->AccessBackgroundLayers() = background_layers; 1986 new_style->AccessBackgroundLayers() = background_layers;
1971 new_style->SetImageRendering(image_rendering); 1987 new_style->SetImageRendering(image_rendering);
1972 new_style->SetOverflowAnchor(overflow_anchor); 1988 new_style->SetOverflowAnchor(overflow_anchor);
1973 new_style->SetOverflowX(overflow_x); 1989 new_style->SetOverflowX(overflow_x);
1974 new_style->SetOverflowY(overflow_y); 1990 new_style->SetOverflowY(overflow_y);
1975 new_style->SetColumnGap(column_gap); 1991 new_style->SetColumnGap(column_gap);
1976 new_style->SetScrollSnapType(snap_type); 1992 new_style->SetScrollSnapType(snap_type);
1977 new_style->SetScrollSnapDestination(snap_destination); 1993 new_style->SetScrollSnapDestination(snap_destination);
1994 new_style->SetScrollBoundaryBehaviorX(scroll_boundary_behavior_x);
1995 new_style->SetScrollBoundaryBehaviorY(scroll_boundary_behavior_y);
1978 GetLayoutViewItem().SetStyle(new_style); 1996 GetLayoutViewItem().SetStyle(new_style);
1979 SetupFontBuilder(*new_style); 1997 SetupFontBuilder(*new_style);
1980 } 1998 }
1981 1999
1982 if (body) { 2000 if (body) {
1983 if (const ComputedStyle* style = body->GetComputedStyle()) { 2001 if (const ComputedStyle* style = body->GetComputedStyle()) {
1984 if (style->Direction() != root_direction || 2002 if (style->Direction() != root_direction ||
1985 style->GetWritingMode() != root_writing_mode) 2003 style->GetWritingMode() != root_writing_mode)
1986 body->SetNeedsStyleRecalc(kSubtreeStyleChange, 2004 body->SetNeedsStyleRecalc(kSubtreeStyleChange,
1987 StyleChangeReasonForTracing::Create( 2005 StyleChangeReasonForTracing::Create(
(...skipping 4886 matching lines...) Expand 10 before | Expand all | Expand 10 after
6874 } 6892 }
6875 6893
6876 void showLiveDocumentInstances() { 6894 void showLiveDocumentInstances() {
6877 WeakDocumentSet& set = liveDocumentSet(); 6895 WeakDocumentSet& set = liveDocumentSet();
6878 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6896 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6879 for (blink::Document* document : set) 6897 for (blink::Document* document : set)
6880 fprintf(stderr, "- Document %p URL: %s\n", document, 6898 fprintf(stderr, "- Document %p URL: %s\n", document,
6881 document->Url().GetString().Utf8().data()); 6899 document->Url().GetString().Utf8().data());
6882 } 6900 }
6883 #endif 6901 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698