Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1964 overflow_y = EOverflow::kAuto; | 1965 overflow_y = EOverflow::kAuto; |
| 1965 if (overflow_anchor == EOverflowAnchor::kVisible) | 1966 if (overflow_anchor == EOverflowAnchor::kVisible) |
| 1966 overflow_anchor = EOverflowAnchor::kAuto; | 1967 overflow_anchor = EOverflowAnchor::kAuto; |
| 1967 // Column-gap is (ab)used by the current paged overflow implementation (in | 1968 // Column-gap is (ab)used by the current paged overflow implementation (in |
| 1968 // lack of other ways to specify gaps between pages), so we have to | 1969 // lack of other ways to specify gaps between pages), so we have to |
| 1969 // propagate it too. | 1970 // propagate it too. |
| 1970 column_gap = overflow_style->ColumnGap(); | 1971 column_gap = overflow_style->ColumnGap(); |
| 1971 } | 1972 } |
| 1972 | 1973 |
| 1973 ScrollSnapType snap_type = overflow_style->GetScrollSnapType(); | 1974 ScrollSnapType snap_type = overflow_style->GetScrollSnapType(); |
| 1975 EScrollBoundaryBehavior scroll_boundary_behavior_x = | |
| 1976 overflow_style->ScrollBoundaryBehaviorX(); | |
| 1977 EScrollBoundaryBehavior scroll_boundary_behavior_y = | |
| 1978 overflow_style->ScrollBoundaryBehaviorY(); | |
| 1979 using ScrollBoundaryBehaviorType = | |
| 1980 WebScrollBoundaryBehavior::ScrollBoundaryBehaviorType; | |
| 1981 if (RuntimeEnabledFeatures::CSSScrollBoundaryBehaviorEnabled()) { | |
| 1982 GetPage()->GetOverscrollController().SetScrollBoundaryBehavior( | |
|
majidvp
2017/07/21 15:24:12
If I understand this correctly, the current logic
sunyunjia
2017/07/25 20:20:55
Done.
| |
| 1983 WebScrollBoundaryBehavior( | |
| 1984 static_cast<ScrollBoundaryBehaviorType>(scroll_boundary_behavior_x), | |
| 1985 static_cast<ScrollBoundaryBehaviorType>( | |
| 1986 scroll_boundary_behavior_y))); | |
| 1987 } | |
| 1974 | 1988 |
| 1975 RefPtr<ComputedStyle> viewport_style = GetLayoutViewItem().MutableStyle(); | 1989 RefPtr<ComputedStyle> viewport_style = GetLayoutViewItem().MutableStyle(); |
| 1976 if (viewport_style->GetWritingMode() != root_writing_mode || | 1990 if (viewport_style->GetWritingMode() != root_writing_mode || |
| 1977 viewport_style->Direction() != root_direction || | 1991 viewport_style->Direction() != root_direction || |
| 1978 viewport_style->VisitedDependentColor(CSSPropertyBackgroundColor) != | 1992 viewport_style->VisitedDependentColor(CSSPropertyBackgroundColor) != |
| 1979 background_color || | 1993 background_color || |
| 1980 viewport_style->BackgroundLayers() != background_layers || | 1994 viewport_style->BackgroundLayers() != background_layers || |
| 1981 viewport_style->ImageRendering() != image_rendering || | 1995 viewport_style->ImageRendering() != image_rendering || |
| 1982 viewport_style->OverflowAnchor() != overflow_anchor || | 1996 viewport_style->OverflowAnchor() != overflow_anchor || |
| 1983 viewport_style->OverflowX() != overflow_x || | 1997 viewport_style->OverflowX() != overflow_x || |
| 1984 viewport_style->OverflowY() != overflow_y || | 1998 viewport_style->OverflowY() != overflow_y || |
| 1985 viewport_style->ColumnGap() != column_gap || | 1999 viewport_style->ColumnGap() != column_gap || |
| 1986 viewport_style->GetScrollSnapType() != snap_type) { | 2000 viewport_style->GetScrollSnapType() != snap_type || |
| 2001 viewport_style->ScrollBoundaryBehaviorX() != scroll_boundary_behavior_x || | |
| 2002 viewport_style->ScrollBoundaryBehaviorY() != scroll_boundary_behavior_y) { | |
| 1987 RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*viewport_style); | 2003 RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*viewport_style); |
| 1988 new_style->SetWritingMode(root_writing_mode); | 2004 new_style->SetWritingMode(root_writing_mode); |
| 1989 new_style->SetDirection(root_direction); | 2005 new_style->SetDirection(root_direction); |
| 1990 new_style->SetBackgroundColor(background_color); | 2006 new_style->SetBackgroundColor(background_color); |
| 1991 new_style->AccessBackgroundLayers() = background_layers; | 2007 new_style->AccessBackgroundLayers() = background_layers; |
| 1992 new_style->SetImageRendering(image_rendering); | 2008 new_style->SetImageRendering(image_rendering); |
| 1993 new_style->SetOverflowAnchor(overflow_anchor); | 2009 new_style->SetOverflowAnchor(overflow_anchor); |
| 1994 new_style->SetOverflowX(overflow_x); | 2010 new_style->SetOverflowX(overflow_x); |
| 1995 new_style->SetOverflowY(overflow_y); | 2011 new_style->SetOverflowY(overflow_y); |
| 1996 new_style->SetColumnGap(column_gap); | 2012 new_style->SetColumnGap(column_gap); |
| 1997 new_style->SetScrollSnapType(snap_type); | 2013 new_style->SetScrollSnapType(snap_type); |
| 2014 new_style->SetScrollBoundaryBehaviorX(scroll_boundary_behavior_x); | |
| 2015 new_style->SetScrollBoundaryBehaviorY(scroll_boundary_behavior_y); | |
| 1998 GetLayoutViewItem().SetStyle(new_style); | 2016 GetLayoutViewItem().SetStyle(new_style); |
| 1999 SetupFontBuilder(*new_style); | 2017 SetupFontBuilder(*new_style); |
| 2000 } | 2018 } |
| 2001 | 2019 |
| 2002 if (body) { | 2020 if (body) { |
| 2003 if (const ComputedStyle* style = body->GetComputedStyle()) { | 2021 if (const ComputedStyle* style = body->GetComputedStyle()) { |
| 2004 if (style->Direction() != root_direction || | 2022 if (style->Direction() != root_direction || |
| 2005 style->GetWritingMode() != root_writing_mode) | 2023 style->GetWritingMode() != root_writing_mode) |
| 2006 body->SetNeedsStyleRecalc(kSubtreeStyleChange, | 2024 body->SetNeedsStyleRecalc(kSubtreeStyleChange, |
| 2007 StyleChangeReasonForTracing::Create( | 2025 StyleChangeReasonForTracing::Create( |
| (...skipping 4960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6968 } | 6986 } |
| 6969 | 6987 |
| 6970 void showLiveDocumentInstances() { | 6988 void showLiveDocumentInstances() { |
| 6971 WeakDocumentSet& set = liveDocumentSet(); | 6989 WeakDocumentSet& set = liveDocumentSet(); |
| 6972 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6990 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6973 for (blink::Document* document : set) | 6991 for (blink::Document* document : set) |
| 6974 fprintf(stderr, "- Document %p URL: %s\n", document, | 6992 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6975 document->Url().GetString().Utf8().data()); | 6993 document->Url().GetString().Utf8().data()); |
| 6976 } | 6994 } |
| 6977 #endif | 6995 #endif |
| OLD | NEW |