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

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: Resolve conflict Created 3 years, 12 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) 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(); 336 bool isScrollable();
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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 void enqueueScrollAnchoringAdjustment(ScrollableArea*); 780 void enqueueScrollAnchoringAdjustment(ScrollableArea*);
779 void performScrollAnchoringAdjustments(); 781 void performScrollAnchoringAdjustments();
780 782
781 // For PaintInvalidator temporarily. TODO(wangxianzhu): Move into 783 // For PaintInvalidator temporarily. TODO(wangxianzhu): Move into
782 // PaintInvalidator. 784 // PaintInvalidator.
783 void invalidatePaintIfNeeded(const PaintInvalidationState&); 785 void invalidatePaintIfNeeded(const PaintInvalidationState&);
784 786
785 // Only for SPv2. 787 // Only for SPv2.
786 std::unique_ptr<JSONObject> compositedLayersAsJSON(LayerTreeFlags); 788 std::unique_ptr<JSONObject> compositedLayersAsJSON(LayerTreeFlags);
787 789
790 // Recursively update frame tree. Each frame has its only
791 // scroll on main reason. Given the following frame tree
792 //.. A...
793 //../.\..
794 //.B...C.
795 //.|.....
796 //.D.....
797 // If B has fixed background-attachment but other frames
798 // don't, both A and C should scroll on cc. Frame D should
799 // scrolled on main thread as its ancestor B.
800 void updateSubFrameScrollOnMainReason(const Frame&,
801 MainThreadScrollingReasons);
802 String mainThreadScrollingReasonsAsText() const;
803 // Main thread scrolling reasons including reasons from ancestors.
804 MainThreadScrollingReasons mainThreadScrollingReasons() const;
805 // Main thread scrolling reasons for this object only. For all reasons,
806 // see: mainThreadScrollingReasons().
807 MainThreadScrollingReasons mainThreadScrollingReasonsPerFrame() const;
808 bool hasVisibleSlowRepaintViewportConstrainedObjects() const;
809
788 protected: 810 protected:
789 // Scroll the content via the compositor. 811 // Scroll the content via the compositor.
790 bool scrollContentsFastPath(const IntSize& scrollDelta); 812 bool scrollContentsFastPath(const IntSize& scrollDelta);
791 813
792 // Scroll the content by invalidating everything. 814 // Scroll the content by invalidating everything.
793 void scrollContentsSlowPath(); 815 void scrollContentsSlowPath();
794 816
795 ScrollBehavior scrollBehaviorStyle() const override; 817 ScrollBehavior scrollBehaviorStyle() const override;
796 818
797 void scrollContentsIfNeeded(); 819 void scrollContentsIfNeeded();
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 void clearLayoutSubtreeRootsAndMarkContainingBlocks(); 889 void clearLayoutSubtreeRootsAndMarkContainingBlocks();
868 890
869 // Called when our frame rect changes (or the rect/scroll offset of an 891 // Called when our frame rect changes (or the rect/scroll offset of an
870 // ancestor changes). 892 // ancestor changes).
871 void frameRectsChanged() override; 893 void frameRectsChanged() override;
872 894
873 bool contentsInCompositedLayer() const; 895 bool contentsInCompositedLayer() const;
874 896
875 void calculateScrollbarModesFromOverflowStyle(const ComputedStyle*, 897 void calculateScrollbarModesFromOverflowStyle(const ComputedStyle*,
876 ScrollbarMode& hMode, 898 ScrollbarMode& hMode,
877 ScrollbarMode& vMode); 899 ScrollbarMode& vMode) const;
878 900
879 void updateCounters(); 901 void updateCounters();
880 void forceLayoutParentViewIfNeeded(); 902 void forceLayoutParentViewIfNeeded();
881 void performPreLayoutTasks(); 903 void performPreLayoutTasks();
882 void performLayout(bool inSubtreeLayout); 904 void performLayout(bool inSubtreeLayout);
883 void scheduleOrPerformPostLayoutTasks(); 905 void scheduleOrPerformPostLayoutTasks();
884 void performPostLayoutTasks(); 906 void performPostLayoutTasks();
885 907
886 void maybeRecordLoadReason(); 908 void maybeRecordLoadReason();
887 909
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 struct ObjectPaintInvalidation { 1166 struct ObjectPaintInvalidation {
1145 String name; 1167 String name;
1146 PaintInvalidationReason reason; 1168 PaintInvalidationReason reason;
1147 }; 1169 };
1148 std::unique_ptr<Vector<ObjectPaintInvalidation>> 1170 std::unique_ptr<Vector<ObjectPaintInvalidation>>
1149 m_trackedObjectPaintInvalidations; 1171 m_trackedObjectPaintInvalidations;
1150 1172
1151 // For Slimming Paint v2 only. 1173 // For Slimming Paint v2 only.
1152 std::unique_ptr<PaintController> m_paintController; 1174 std::unique_ptr<PaintController> m_paintController;
1153 std::unique_ptr<PaintArtifactCompositor> m_paintArtifactCompositor; 1175 std::unique_ptr<PaintArtifactCompositor> m_paintArtifactCompositor;
1176
1154 bool m_isStoringCompositedLayerDebugInfo; 1177 bool m_isStoringCompositedLayerDebugInfo;
1178 MainThreadScrollingReasons m_mainThreadScrollingReasons;
1155 }; 1179 };
1156 1180
1157 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) { 1181 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) {
1158 if (m_isVisuallyNonEmpty) 1182 if (m_isVisuallyNonEmpty)
1159 return; 1183 return;
1160 m_visuallyNonEmptyCharacterCount += count; 1184 m_visuallyNonEmptyCharacterCount += count;
1161 // Use a threshold value to prevent very small amounts of visible content from 1185 // Use a threshold value to prevent very small amounts of visible content from
1162 // triggering didMeaningfulLayout. The first few hundred characters rarely 1186 // triggering didMeaningfulLayout. The first few hundred characters rarely
1163 // contain the interesting content of the page. 1187 // contain the interesting content of the page.
1164 static const unsigned visualCharacterThreshold = 200; 1188 static const unsigned visualCharacterThreshold = 200;
(...skipping 20 matching lines...) Expand all
1185 widget.isFrameView()); 1209 widget.isFrameView());
1186 DEFINE_TYPE_CASTS(FrameView, 1210 DEFINE_TYPE_CASTS(FrameView,
1187 ScrollableArea, 1211 ScrollableArea,
1188 scrollableArea, 1212 scrollableArea,
1189 scrollableArea->isFrameView(), 1213 scrollableArea->isFrameView(),
1190 scrollableArea.isFrameView()); 1214 scrollableArea.isFrameView());
1191 1215
1192 } // namespace blink 1216 } // namespace blink
1193 1217
1194 #endif // FrameView_h 1218 #endif // FrameView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698