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 reserv
ed. | 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
8 | 8 |
9 This library is free software; you can redistribute it and/or | 9 This library is free software; you can redistribute it and/or |
10 modify it under the terms of the GNU Library General Public | 10 modify it under the terms of the GNU Library General Public |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 // Viewport size that should be used for viewport units (i.e. 'vh'/'vw'). | 615 // Viewport size that should be used for viewport units (i.e. 'vh'/'vw'). |
616 FloatSize viewportSizeForViewportUnits() const; | 616 FloatSize viewportSizeForViewportUnits() const; |
617 | 617 |
618 ScrollAnchor& scrollAnchor() { return m_scrollAnchor; } | 618 ScrollAnchor& scrollAnchor() { return m_scrollAnchor; } |
619 void clearScrollAnchor(); | 619 void clearScrollAnchor(); |
620 bool shouldPerformScrollAnchoring() const override; | 620 bool shouldPerformScrollAnchoring() const override; |
621 | 621 |
622 // For PaintInvalidator temporarily. TODO(wangxianzhu): Move into PaintInval
idator. | 622 // For PaintInvalidator temporarily. TODO(wangxianzhu): Move into PaintInval
idator. |
623 void invalidatePaintIfNeeded(const PaintInvalidationState&); | 623 void invalidatePaintIfNeeded(const PaintInvalidationState&); |
624 | 624 |
| 625 void setUserMayHaveDragged(bool dragged) override { m_userMayHaveDragged = d
ragged; } |
| 626 bool userMayHaveDragged() const { return m_userMayHaveDragged; } |
| 627 |
625 protected: | 628 protected: |
626 // Scroll the content via the compositor. | 629 // Scroll the content via the compositor. |
627 bool scrollContentsFastPath(const IntSize& scrollDelta); | 630 bool scrollContentsFastPath(const IntSize& scrollDelta); |
628 | 631 |
629 // Scroll the content by invalidating everything. | 632 // Scroll the content by invalidating everything. |
630 void scrollContentsSlowPath(const IntRect& updateRect); | 633 void scrollContentsSlowPath(const IntRect& updateRect); |
631 | 634 |
632 // These functions are used to create/destroy scrollbars. | 635 // These functions are used to create/destroy scrollbars. |
633 void setHasHorizontalScrollbar(bool); | 636 void setHasHorizontalScrollbar(bool); |
634 void setHasVerticalScrollbar(bool); | 637 void setHasVerticalScrollbar(bool); |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 bool m_needsScrollbarsUpdate; | 936 bool m_needsScrollbarsUpdate; |
934 bool m_suppressAdjustViewSize; | 937 bool m_suppressAdjustViewSize; |
935 bool m_allowsLayoutInvalidationAfterLayoutClean; | 938 bool m_allowsLayoutInvalidationAfterLayoutClean; |
936 | 939 |
937 // For testing. | 940 // For testing. |
938 struct ObjectPaintInvalidation { | 941 struct ObjectPaintInvalidation { |
939 String name; | 942 String name; |
940 PaintInvalidationReason reason; | 943 PaintInvalidationReason reason; |
941 }; | 944 }; |
942 std::unique_ptr<Vector<ObjectPaintInvalidation>> m_trackedObjectPaintInvalid
ations; | 945 std::unique_ptr<Vector<ObjectPaintInvalidation>> m_trackedObjectPaintInvalid
ations; |
| 946 |
| 947 bool m_userMayHaveDragged; |
943 }; | 948 }; |
944 | 949 |
945 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) | 950 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) |
946 { | 951 { |
947 if (m_isVisuallyNonEmpty) | 952 if (m_isVisuallyNonEmpty) |
948 return; | 953 return; |
949 m_visuallyNonEmptyCharacterCount += count; | 954 m_visuallyNonEmptyCharacterCount += count; |
950 // Use a threshold value to prevent very small amounts of visible content fr
om triggering didMeaningfulLayout. | 955 // Use a threshold value to prevent very small amounts of visible content fr
om triggering didMeaningfulLayout. |
951 // The first few hundred characters rarely contain the interesting content o
f the page. | 956 // The first few hundred characters rarely contain the interesting content o
f the page. |
952 static const unsigned visualCharacterThreshold = 200; | 957 static const unsigned visualCharacterThreshold = 200; |
(...skipping 11 matching lines...) Expand all Loading... |
964 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) | 969 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) |
965 setIsVisuallyNonEmpty(); | 970 setIsVisuallyNonEmpty(); |
966 } | 971 } |
967 | 972 |
968 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); | 973 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); |
969 DEFINE_TYPE_CASTS(FrameView, ScrollableArea, scrollableArea, scrollableArea->isF
rameView(), scrollableArea.isFrameView()); | 974 DEFINE_TYPE_CASTS(FrameView, ScrollableArea, scrollableArea, scrollableArea->isF
rameView(), scrollableArea.isFrameView()); |
970 | 975 |
971 } // namespace blink | 976 } // namespace blink |
972 | 977 |
973 #endif // FrameView_h | 978 #endif // FrameView_h |
OLD | NEW |