OLD | NEW |
---|---|
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 Loading... | |
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 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
760 void enqueueScrollAnchoringAdjustment(ScrollableArea*); | 761 void enqueueScrollAnchoringAdjustment(ScrollableArea*); |
761 void performScrollAnchoringAdjustments(); | 762 void performScrollAnchoringAdjustments(); |
762 | 763 |
763 // For PaintInvalidator temporarily. TODO(wangxianzhu): Move into | 764 // For PaintInvalidator temporarily. TODO(wangxianzhu): Move into |
764 // PaintInvalidator. | 765 // PaintInvalidator. |
765 void invalidatePaintIfNeeded(const PaintInvalidationState&); | 766 void invalidatePaintIfNeeded(const PaintInvalidationState&); |
766 | 767 |
767 // Only for SPv2. | 768 // Only for SPv2. |
768 std::unique_ptr<JSONObject> compositedLayersAsJSON(LayerTreeFlags); | 769 std::unique_ptr<JSONObject> compositedLayersAsJSON(LayerTreeFlags); |
769 | 770 |
771 // Recursively update frame tree. Each frame has its only | |
pdr.
2016/12/17 05:50:16
+1, nice comment.
yigu
2016/12/18 17:57:11
Thanks for your previous suggestion on this :)
| |
772 // scroll on main reason. Given the following frame tree | |
773 // A | |
774 // / \ | |
775 // B C | |
776 // | | |
777 // D | |
778 // If B has fixed background-attachment but other frames | |
779 // don't, both A and C should scroll on cc. Frame D should | |
780 // scrolled on main thread as its ancestor B. | |
781 void updateSubFrameScrollOnMainReason(const Frame&, | |
782 MainThreadScrollingReasons); | |
783 String mainThreadScrollingReasonsAsText() const; | |
784 MainThreadScrollingReasons mainThreadScrollingReasons() const; | |
785 MainThreadScrollingReasons mainThreadScrollingReasonsPerFrame( | |
786 const LocalFrame&) const; | |
787 bool hasVisibleSlowRepaintViewportConstrainedObjects(const FrameView&) const; | |
788 | |
770 protected: | 789 protected: |
771 // Scroll the content via the compositor. | 790 // Scroll the content via the compositor. |
772 bool scrollContentsFastPath(const IntSize& scrollDelta); | 791 bool scrollContentsFastPath(const IntSize& scrollDelta); |
773 | 792 |
774 // Scroll the content by invalidating everything. | 793 // Scroll the content by invalidating everything. |
775 void scrollContentsSlowPath(); | 794 void scrollContentsSlowPath(); |
776 | 795 |
777 ScrollBehavior scrollBehaviorStyle() const override; | 796 ScrollBehavior scrollBehaviorStyle() const override; |
778 | 797 |
779 void scrollContentsIfNeeded(); | 798 void scrollContentsIfNeeded(); |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1125 struct ObjectPaintInvalidation { | 1144 struct ObjectPaintInvalidation { |
1126 String name; | 1145 String name; |
1127 PaintInvalidationReason reason; | 1146 PaintInvalidationReason reason; |
1128 }; | 1147 }; |
1129 std::unique_ptr<Vector<ObjectPaintInvalidation>> | 1148 std::unique_ptr<Vector<ObjectPaintInvalidation>> |
1130 m_trackedObjectPaintInvalidations; | 1149 m_trackedObjectPaintInvalidations; |
1131 | 1150 |
1132 // For Slimming Paint v2 only. | 1151 // For Slimming Paint v2 only. |
1133 std::unique_ptr<PaintController> m_paintController; | 1152 std::unique_ptr<PaintController> m_paintController; |
1134 std::unique_ptr<PaintArtifactCompositor> m_paintArtifactCompositor; | 1153 std::unique_ptr<PaintArtifactCompositor> m_paintArtifactCompositor; |
1154 | |
1155 MainThreadScrollingReasons m_lastMainThreadScrollingReasons; | |
pdr.
2016/12/17 05:50:16
Is "last" important? m_mainThreadScrollingReasons
yigu
2016/12/18 17:57:11
Done.
| |
1135 }; | 1156 }; |
1136 | 1157 |
1137 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) { | 1158 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) { |
1138 if (m_isVisuallyNonEmpty) | 1159 if (m_isVisuallyNonEmpty) |
1139 return; | 1160 return; |
1140 m_visuallyNonEmptyCharacterCount += count; | 1161 m_visuallyNonEmptyCharacterCount += count; |
1141 // Use a threshold value to prevent very small amounts of visible content from | 1162 // Use a threshold value to prevent very small amounts of visible content from |
1142 // triggering didMeaningfulLayout. The first few hundred characters rarely | 1163 // triggering didMeaningfulLayout. The first few hundred characters rarely |
1143 // contain the interesting content of the page. | 1164 // contain the interesting content of the page. |
1144 static const unsigned visualCharacterThreshold = 200; | 1165 static const unsigned visualCharacterThreshold = 200; |
(...skipping 20 matching lines...) Expand all Loading... | |
1165 widget.isFrameView()); | 1186 widget.isFrameView()); |
1166 DEFINE_TYPE_CASTS(FrameView, | 1187 DEFINE_TYPE_CASTS(FrameView, |
1167 ScrollableArea, | 1188 ScrollableArea, |
1168 scrollableArea, | 1189 scrollableArea, |
1169 scrollableArea->isFrameView(), | 1190 scrollableArea->isFrameView(), |
1170 scrollableArea.isFrameView()); | 1191 scrollableArea.isFrameView()); |
1171 | 1192 |
1172 } // namespace blink | 1193 } // namespace blink |
1173 | 1194 |
1174 #endif // FrameView_h | 1195 #endif // FrameView_h |
OLD | NEW |