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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.h

Issue 2531603003: Only scroll on main if the targeted frames need to scroll on main (Closed)
Patch Set: Fix compiling error due to using backslash at the end of a commenting line" Created 4 years 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) 1997 Martin Jones (mjones@kde.org) 2 Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 (C) 1998 Waldo Bastian (bastian@kde.org) 3 (C) 1998 Waldo Bastian (bastian@kde.org)
4 (C) 1998, 1999 Torben Weis (weis@kde.org) 4 (C) 1998, 1999 Torben Weis (weis@kde.org)
5 (C) 1999 Lars Knoll (knoll@kde.org) 5 (C) 1999 Lars Knoll (knoll@kde.org)
6 (C) 1999 Antti Koivisto (koivisto@kde.org) 6 (C) 1999 Antti Koivisto (koivisto@kde.org)
7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
8 reserved. 8 reserved.
9 9
10 This library is free software; you can redistribute it and/or 10 This library is free software; you can redistribute it and/or
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 #include <memory> 57 #include <memory>
58 58
59 namespace blink { 59 namespace blink {
60 60
61 class AXObjectCache; 61 class AXObjectCache;
62 class ComputedStyle; 62 class ComputedStyle;
63 class DocumentLifecycle; 63 class DocumentLifecycle;
64 class Cursor; 64 class Cursor;
65 class Element; 65 class Element;
66 class ElementVisibilityObserver; 66 class ElementVisibilityObserver;
67 class Frame;
67 class FloatSize; 68 class FloatSize;
68 class JSONArray; 69 class JSONArray;
69 class JSONObject; 70 class JSONObject;
70 class LayoutItem; 71 class LayoutItem;
71 class LayoutViewItem; 72 class LayoutViewItem;
72 class LayoutPart; 73 class LayoutPart;
73 class LocalFrame; 74 class LocalFrame;
74 class KURL; 75 class KURL;
75 class Node; 76 class Node;
76 class LayoutAnalyzer; 77 class LayoutAnalyzer;
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 return m_scrollCorner == scrollCorner; 325 return m_scrollCorner == scrollCorner;
325 } 326 }
326 327
327 enum ScrollingReasons { 328 enum ScrollingReasons {
328 Scrollable, 329 Scrollable,
329 NotScrollableNoOverflow, 330 NotScrollableNoOverflow,
330 NotScrollableNotVisible, 331 NotScrollableNotVisible,
331 NotScrollableExplicitlyDisabled 332 NotScrollableExplicitlyDisabled
332 }; 333 };
333 334
334 ScrollingReasons getScrollingReasons(); 335 ScrollingReasons getScrollingReasons() const;
335 bool isScrollable() override; 336 bool isScrollable() override;
336 bool isProgrammaticallyScrollable() override; 337 bool isProgrammaticallyScrollable() override;
337 338
338 enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule }; 339 enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule };
339 void calculateScrollbarModes(ScrollbarMode& hMode, 340 void calculateScrollbarModes(
340 ScrollbarMode& vMode, 341 ScrollbarMode& hMode,
341 ScrollbarModesCalculationStrategy = AnyRule); 342 ScrollbarMode& vMode,
343 ScrollbarModesCalculationStrategy = AnyRule) const;
342 344
343 IntPoint lastKnownMousePosition() const override; 345 IntPoint lastKnownMousePosition() const override;
344 bool shouldSetCursor() const; 346 bool shouldSetCursor() const;
345 347
346 void setCursor(const Cursor&); 348 void setCursor(const Cursor&);
347 349
348 bool scrollbarsCanBeActive() const override; 350 bool scrollbarsCanBeActive() const override;
349 void scrollbarVisibilityChanged() override; 351 void scrollbarVisibilityChanged() override;
350 352
351 // FIXME: Remove this method once plugin loading is decoupled from layout. 353 // FIXME: Remove this method once plugin loading is decoupled from layout.
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 void enqueueScrollAnchoringAdjustment(ScrollableArea*); 779 void enqueueScrollAnchoringAdjustment(ScrollableArea*);
778 void performScrollAnchoringAdjustments(); 780 void performScrollAnchoringAdjustments();
779 781
780 // For PaintInvalidator temporarily. TODO(wangxianzhu): Move into 782 // For PaintInvalidator temporarily. TODO(wangxianzhu): Move into
781 // PaintInvalidator. 783 // PaintInvalidator.
782 void invalidatePaintIfNeeded(const PaintInvalidationState&); 784 void invalidatePaintIfNeeded(const PaintInvalidationState&);
783 785
784 // Only for SPv2. 786 // Only for SPv2.
785 std::unique_ptr<JSONObject> compositedLayersAsJSON(LayerTreeFlags); 787 std::unique_ptr<JSONObject> compositedLayersAsJSON(LayerTreeFlags);
786 788
789 // Recursively update frame tree. Each frame has its only
790 // scroll on main reason. Given the following frame tree
791 //.. A...
792 //../.\..
793 //.B...C.
794 //.|.....
795 //.D.....
796 // If B has fixed background-attachment but other frames
797 // don't, both A and C should scroll on cc. Frame D should
798 // scrolled on main thread as its ancestor B.
799 void updateSubFrameScrollOnMainReason(const Frame&,
800 MainThreadScrollingReasons);
801 String mainThreadScrollingReasonsAsText() const;
802 // Main thread scrolling reasons including reasons from ancestors.
803 MainThreadScrollingReasons mainThreadScrollingReasons() const;
804 // Main thread scrolling reasons for this object only. For all reasons,
805 // see: mainThreadScrollingReasons().
806 MainThreadScrollingReasons mainThreadScrollingReasonsPerFrame() const;
807 bool hasVisibleSlowRepaintViewportConstrainedObjects() const;
808
787 protected: 809 protected:
788 // Scroll the content via the compositor. 810 // Scroll the content via the compositor.
789 bool scrollContentsFastPath(const IntSize& scrollDelta); 811 bool scrollContentsFastPath(const IntSize& scrollDelta);
790 812
791 // Scroll the content by invalidating everything. 813 // Scroll the content by invalidating everything.
792 void scrollContentsSlowPath(); 814 void scrollContentsSlowPath();
793 815
794 ScrollBehavior scrollBehaviorStyle() const override; 816 ScrollBehavior scrollBehaviorStyle() const override;
795 817
796 void scrollContentsIfNeeded(); 818 void scrollContentsIfNeeded();
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 void clearLayoutSubtreeRootsAndMarkContainingBlocks(); 888 void clearLayoutSubtreeRootsAndMarkContainingBlocks();
867 889
868 // Called when our frame rect changes (or the rect/scroll offset of an 890 // Called when our frame rect changes (or the rect/scroll offset of an
869 // ancestor changes). 891 // ancestor changes).
870 void frameRectsChanged() override; 892 void frameRectsChanged() override;
871 893
872 bool contentsInCompositedLayer() const; 894 bool contentsInCompositedLayer() const;
873 895
874 void calculateScrollbarModesFromOverflowStyle(const ComputedStyle*, 896 void calculateScrollbarModesFromOverflowStyle(const ComputedStyle*,
875 ScrollbarMode& hMode, 897 ScrollbarMode& hMode,
876 ScrollbarMode& vMode); 898 ScrollbarMode& vMode) const;
877 899
878 void updateCounters(); 900 void updateCounters();
879 void forceLayoutParentViewIfNeeded(); 901 void forceLayoutParentViewIfNeeded();
880 void performPreLayoutTasks(); 902 void performPreLayoutTasks();
881 void performLayout(bool inSubtreeLayout); 903 void performLayout(bool inSubtreeLayout);
882 void scheduleOrPerformPostLayoutTasks(); 904 void scheduleOrPerformPostLayoutTasks();
883 void performPostLayoutTasks(); 905 void performPostLayoutTasks();
884 906
885 void maybeRecordLoadReason(); 907 void maybeRecordLoadReason();
886 908
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 struct ObjectPaintInvalidation { 1165 struct ObjectPaintInvalidation {
1144 String name; 1166 String name;
1145 PaintInvalidationReason reason; 1167 PaintInvalidationReason reason;
1146 }; 1168 };
1147 std::unique_ptr<Vector<ObjectPaintInvalidation>> 1169 std::unique_ptr<Vector<ObjectPaintInvalidation>>
1148 m_trackedObjectPaintInvalidations; 1170 m_trackedObjectPaintInvalidations;
1149 1171
1150 // For Slimming Paint v2 only. 1172 // For Slimming Paint v2 only.
1151 std::unique_ptr<PaintController> m_paintController; 1173 std::unique_ptr<PaintController> m_paintController;
1152 std::unique_ptr<PaintArtifactCompositor> m_paintArtifactCompositor; 1174 std::unique_ptr<PaintArtifactCompositor> m_paintArtifactCompositor;
1175
1153 bool m_isStoringCompositedLayerDebugInfo; 1176 bool m_isStoringCompositedLayerDebugInfo;
1177 MainThreadScrollingReasons m_mainThreadScrollingReasons;
1154 }; 1178 };
1155 1179
1156 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) { 1180 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) {
1157 if (m_isVisuallyNonEmpty) 1181 if (m_isVisuallyNonEmpty)
1158 return; 1182 return;
1159 m_visuallyNonEmptyCharacterCount += count; 1183 m_visuallyNonEmptyCharacterCount += count;
1160 // Use a threshold value to prevent very small amounts of visible content from 1184 // Use a threshold value to prevent very small amounts of visible content from
1161 // triggering didMeaningfulLayout. The first few hundred characters rarely 1185 // triggering didMeaningfulLayout. The first few hundred characters rarely
1162 // contain the interesting content of the page. 1186 // contain the interesting content of the page.
1163 static const unsigned visualCharacterThreshold = 200; 1187 static const unsigned visualCharacterThreshold = 200;
(...skipping 20 matching lines...) Expand all
1184 widget.isFrameView()); 1208 widget.isFrameView());
1185 DEFINE_TYPE_CASTS(FrameView, 1209 DEFINE_TYPE_CASTS(FrameView,
1186 ScrollableArea, 1210 ScrollableArea,
1187 scrollableArea, 1211 scrollableArea,
1188 scrollableArea->isFrameView(), 1212 scrollableArea->isFrameView(),
1189 scrollableArea.isFrameView()); 1213 scrollableArea.isFrameView());
1190 1214
1191 } // namespace blink 1215 } // namespace blink
1192 1216
1193 #endif // FrameView_h 1217 #endif // FrameView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698