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

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: Added missing files Created 3 years, 7 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 #include "core/loader/ImageLoader.h" 196 #include "core/loader/ImageLoader.h"
197 #include "core/loader/NavigationScheduler.h" 197 #include "core/loader/NavigationScheduler.h"
198 #include "core/loader/PrerendererClient.h" 198 #include "core/loader/PrerendererClient.h"
199 #include "core/loader/appcache/ApplicationCacheHost.h" 199 #include "core/loader/appcache/ApplicationCacheHost.h"
200 #include "core/page/ChromeClient.h" 200 #include "core/page/ChromeClient.h"
201 #include "core/page/EventWithHitTestResults.h" 201 #include "core/page/EventWithHitTestResults.h"
202 #include "core/page/FocusController.h" 202 #include "core/page/FocusController.h"
203 #include "core/page/FrameTree.h" 203 #include "core/page/FrameTree.h"
204 #include "core/page/Page.h" 204 #include "core/page/Page.h"
205 #include "core/page/PointerLockController.h" 205 #include "core/page/PointerLockController.h"
206 #include "core/page/scrolling/OverscrollController.h"
206 #include "core/page/scrolling/RootScrollerController.h" 207 #include "core/page/scrolling/RootScrollerController.h"
207 #include "core/page/scrolling/ScrollStateCallback.h" 208 #include "core/page/scrolling/ScrollStateCallback.h"
208 #include "core/page/scrolling/ScrollingCoordinator.h" 209 #include "core/page/scrolling/ScrollingCoordinator.h"
209 #include "core/page/scrolling/SnapCoordinator.h" 210 #include "core/page/scrolling/SnapCoordinator.h"
210 #include "core/page/scrolling/TopDocumentRootScrollerController.h" 211 #include "core/page/scrolling/TopDocumentRootScrollerController.h"
211 #include "core/probe/CoreProbes.h" 212 #include "core/probe/CoreProbes.h"
212 #include "core/svg/SVGDocumentExtensions.h" 213 #include "core/svg/SVGDocumentExtensions.h"
213 #include "core/svg/SVGScriptElement.h" 214 #include "core/svg/SVGScriptElement.h"
214 #include "core/svg/SVGTitleElement.h" 215 #include "core/svg/SVGTitleElement.h"
215 #include "core/svg/SVGUseElement.h" 216 #include "core/svg/SVGUseElement.h"
(...skipping 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after
1933 if (overflow_anchor == EOverflowAnchor::kVisible) 1934 if (overflow_anchor == EOverflowAnchor::kVisible)
1934 overflow_anchor = EOverflowAnchor::kAuto; 1935 overflow_anchor = EOverflowAnchor::kAuto;
1935 // Column-gap is (ab)used by the current paged overflow implementation (in 1936 // Column-gap is (ab)used by the current paged overflow implementation (in
1936 // lack of other ways to specify gaps between pages), so we have to 1937 // lack of other ways to specify gaps between pages), so we have to
1937 // propagate it too. 1938 // propagate it too.
1938 column_gap = overflow_style->ColumnGap(); 1939 column_gap = overflow_style->ColumnGap();
1939 } 1940 }
1940 1941
1941 ScrollSnapType snap_type = overflow_style->GetScrollSnapType(); 1942 ScrollSnapType snap_type = overflow_style->GetScrollSnapType();
1942 const LengthPoint& snap_destination = overflow_style->ScrollSnapDestination(); 1943 const LengthPoint& snap_destination = overflow_style->ScrollSnapDestination();
1944 EScrollBoundaryBehavior scroll_boundary_behavior_x =
1945 overflow_style->ScrollBoundaryBehaviorX();
1946 EScrollBoundaryBehavior scroll_boundary_behavior_y =
1947 overflow_style->ScrollBoundaryBehaviorY();
1948 using ScrollBoundaryBehavior =
1949 WebScrollBoundaryBehavior::ScrollBoundaryBehaviorType;
majidvp 2017/05/18 15:26:10 Why not ScrollBoundaryBehaviorType? this seems in
sunyunjia 2017/05/19 20:14:23 Done.
1950 GetPage()->GetOverscrollController().SetScrollBoundaryBehavior(
1951 WebScrollBoundaryBehavior(
1952 static_cast<ScrollBoundaryBehavior>(scroll_boundary_behavior_x),
1953 static_cast<ScrollBoundaryBehavior>(scroll_boundary_behavior_y)));
1943 1954
1944 RefPtr<ComputedStyle> document_style = GetLayoutViewItem().MutableStyle(); 1955 RefPtr<ComputedStyle> document_style = GetLayoutViewItem().MutableStyle();
1945 if (document_style->GetWritingMode() != root_writing_mode || 1956 if (document_style->GetWritingMode() != root_writing_mode ||
1946 document_style->Direction() != root_direction || 1957 document_style->Direction() != root_direction ||
1947 document_style->VisitedDependentColor(CSSPropertyBackgroundColor) != 1958 document_style->VisitedDependentColor(CSSPropertyBackgroundColor) !=
1948 background_color || 1959 background_color ||
1949 document_style->BackgroundLayers() != background_layers || 1960 document_style->BackgroundLayers() != background_layers ||
1950 document_style->ImageRendering() != image_rendering || 1961 document_style->ImageRendering() != image_rendering ||
1951 document_style->OverflowAnchor() != overflow_anchor || 1962 document_style->OverflowAnchor() != overflow_anchor ||
1952 document_style->OverflowX() != overflow_x || 1963 document_style->OverflowX() != overflow_x ||
1953 document_style->OverflowY() != overflow_y || 1964 document_style->OverflowY() != overflow_y ||
1954 document_style->ColumnGap() != column_gap || 1965 document_style->ColumnGap() != column_gap ||
1955 document_style->GetScrollSnapType() != snap_type || 1966 document_style->GetScrollSnapType() != snap_type ||
1956 document_style->ScrollSnapDestination() != snap_destination) { 1967 document_style->ScrollSnapDestination() != snap_destination ||
1968 document_style->ScrollBoundaryBehaviorX() != scroll_boundary_behavior_x ||
1969 document_style->ScrollBoundaryBehaviorY() != scroll_boundary_behavior_y) {
1957 RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*document_style); 1970 RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*document_style);
1958 new_style->SetWritingMode(root_writing_mode); 1971 new_style->SetWritingMode(root_writing_mode);
1959 new_style->SetDirection(root_direction); 1972 new_style->SetDirection(root_direction);
1960 new_style->SetBackgroundColor(background_color); 1973 new_style->SetBackgroundColor(background_color);
1961 new_style->AccessBackgroundLayers() = background_layers; 1974 new_style->AccessBackgroundLayers() = background_layers;
1962 new_style->SetImageRendering(image_rendering); 1975 new_style->SetImageRendering(image_rendering);
1963 new_style->SetOverflowAnchor(overflow_anchor); 1976 new_style->SetOverflowAnchor(overflow_anchor);
1964 new_style->SetOverflowX(overflow_x); 1977 new_style->SetOverflowX(overflow_x);
1965 new_style->SetOverflowY(overflow_y); 1978 new_style->SetOverflowY(overflow_y);
1966 new_style->SetColumnGap(column_gap); 1979 new_style->SetColumnGap(column_gap);
1967 new_style->SetScrollSnapType(snap_type); 1980 new_style->SetScrollSnapType(snap_type);
1968 new_style->SetScrollSnapDestination(snap_destination); 1981 new_style->SetScrollSnapDestination(snap_destination);
1982 new_style->SetScrollBoundaryBehaviorX(scroll_boundary_behavior_x);
1983 new_style->SetScrollBoundaryBehaviorY(scroll_boundary_behavior_y);
1969 GetLayoutViewItem().SetStyle(new_style); 1984 GetLayoutViewItem().SetStyle(new_style);
1970 SetupFontBuilder(*new_style); 1985 SetupFontBuilder(*new_style);
1971 } 1986 }
1972 1987
1973 if (body) { 1988 if (body) {
1974 if (const ComputedStyle* style = body->GetComputedStyle()) { 1989 if (const ComputedStyle* style = body->GetComputedStyle()) {
1975 if (style->Direction() != root_direction || 1990 if (style->Direction() != root_direction ||
1976 style->GetWritingMode() != root_writing_mode) 1991 style->GetWritingMode() != root_writing_mode)
1977 body->SetNeedsStyleRecalc(kSubtreeStyleChange, 1992 body->SetNeedsStyleRecalc(kSubtreeStyleChange,
1978 StyleChangeReasonForTracing::Create( 1993 StyleChangeReasonForTracing::Create(
(...skipping 4835 matching lines...) Expand 10 before | Expand all | Expand 10 after
6814 } 6829 }
6815 6830
6816 void showLiveDocumentInstances() { 6831 void showLiveDocumentInstances() {
6817 WeakDocumentSet& set = liveDocumentSet(); 6832 WeakDocumentSet& set = liveDocumentSet();
6818 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6833 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6819 for (blink::Document* document : set) 6834 for (blink::Document* document : set)
6820 fprintf(stderr, "- Document %p URL: %s\n", document, 6835 fprintf(stderr, "- Document %p URL: %s\n", document,
6821 document->Url().GetString().Utf8().data()); 6836 document->Url().GetString().Utf8().data());
6822 } 6837 }
6823 #endif 6838 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698