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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 #ifndef FrameView_h | 25 #ifndef FrameView_h |
26 #define FrameView_h | 26 #define FrameView_h |
27 | 27 |
28 #include "core/CoreExport.h" | 28 #include "core/CoreExport.h" |
29 #include "core/dom/DocumentLifecycle.h" | 29 #include "core/dom/DocumentLifecycle.h" |
30 #include "core/frame/FrameViewAutoSizeInfo.h" | 30 #include "core/frame/FrameViewAutoSizeInfo.h" |
31 #include "core/frame/LayoutSubtreeRootList.h" | 31 #include "core/frame/LayoutSubtreeRootList.h" |
32 #include "core/frame/RootFrameViewport.h" | 32 #include "core/frame/RootFrameViewport.h" |
33 #include "core/layout/LayoutAnalyzer.h" | 33 #include "core/layout/LayoutAnalyzer.h" |
| 34 #include "core/layout/ScrollAnchor.h" |
34 #include "core/paint/PaintInvalidationCapableScrollableArea.h" | 35 #include "core/paint/PaintInvalidationCapableScrollableArea.h" |
35 #include "core/paint/PaintPhase.h" | 36 #include "core/paint/PaintPhase.h" |
36 #include "platform/RuntimeEnabledFeatures.h" | 37 #include "platform/RuntimeEnabledFeatures.h" |
37 #include "platform/Widget.h" | 38 #include "platform/Widget.h" |
38 #include "platform/geometry/IntRect.h" | 39 #include "platform/geometry/IntRect.h" |
39 #include "platform/geometry/LayoutRect.h" | 40 #include "platform/geometry/LayoutRect.h" |
40 #include "platform/graphics/Color.h" | 41 #include "platform/graphics/Color.h" |
41 #include "platform/graphics/paint/ClipPaintPropertyNode.h" | 42 #include "platform/graphics/paint/ClipPaintPropertyNode.h" |
42 #include "platform/graphics/paint/TransformPaintPropertyNode.h" | 43 #include "platform/graphics/paint/TransformPaintPropertyNode.h" |
43 #include "platform/scroll/ScrollTypes.h" | 44 #include "platform/scroll/ScrollTypes.h" |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 | 588 |
588 void setContentClip(PassRefPtr<ClipPaintPropertyNode> contentClip) { m_conte
ntClip = contentClip; } | 589 void setContentClip(PassRefPtr<ClipPaintPropertyNode> contentClip) { m_conte
ntClip = contentClip; } |
589 ClipPaintPropertyNode* contentClip() const { return m_contentClip.get(); } | 590 ClipPaintPropertyNode* contentClip() const { return m_contentClip.get(); } |
590 | 591 |
591 // TODO(ojan): Merge this with IntersectionObserver once it lands. | 592 // TODO(ojan): Merge this with IntersectionObserver once it lands. |
592 IntRect computeVisibleArea(); | 593 IntRect computeVisibleArea(); |
593 | 594 |
594 // Viewport size that should be used for viewport units (i.e. 'vh'/'vw'). | 595 // Viewport size that should be used for viewport units (i.e. 'vh'/'vw'). |
595 FloatSize viewportSizeForViewportUnits() const; | 596 FloatSize viewportSizeForViewportUnits() const; |
596 | 597 |
| 598 ScrollAnchor& scrollAnchor() { return m_scrollAnchor; } |
| 599 |
597 protected: | 600 protected: |
598 // Scroll the content via the compositor. | 601 // Scroll the content via the compositor. |
599 bool scrollContentsFastPath(const IntSize& scrollDelta); | 602 bool scrollContentsFastPath(const IntSize& scrollDelta); |
600 | 603 |
601 // Scroll the content by invalidating everything. | 604 // Scroll the content by invalidating everything. |
602 void scrollContentsSlowPath(const IntRect& updateRect); | 605 void scrollContentsSlowPath(const IntRect& updateRect); |
603 | 606 |
604 // These functions are used to create/destroy scrollbars. | 607 // These functions are used to create/destroy scrollbars. |
605 void setHasHorizontalScrollbar(bool); | 608 void setHasHorizontalScrollbar(bool); |
606 void setHasVerticalScrollbar(bool); | 609 void setHasVerticalScrollbar(bool); |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 // [ preTranslation ] The offset from Widget::frameRect. Estab
lishes viewport. | 902 // [ preTranslation ] The offset from Widget::frameRect. Estab
lishes viewport. |
900 // +---[ scrollTranslation ] Frame scrolling. | 903 // +---[ scrollTranslation ] Frame scrolling. |
901 // TODO(trchen): These will not be needed once settings->rootLayerScrolls()
is enabled. | 904 // TODO(trchen): These will not be needed once settings->rootLayerScrolls()
is enabled. |
902 RefPtr<TransformPaintPropertyNode> m_preTranslation; | 905 RefPtr<TransformPaintPropertyNode> m_preTranslation; |
903 RefPtr<TransformPaintPropertyNode> m_scrollTranslation; | 906 RefPtr<TransformPaintPropertyNode> m_scrollTranslation; |
904 // The content clip clips the document (= LayoutView) but not the scrollbars
. | 907 // The content clip clips the document (= LayoutView) but not the scrollbars
. |
905 // TODO(trchen): This will not be needed once settings->rootLayerScrolls() i
s enabled. | 908 // TODO(trchen): This will not be needed once settings->rootLayerScrolls() i
s enabled. |
906 RefPtr<ClipPaintPropertyNode> m_contentClip; | 909 RefPtr<ClipPaintPropertyNode> m_contentClip; |
907 | 910 |
908 bool m_isUpdatingAllLifecyclePhases; | 911 bool m_isUpdatingAllLifecyclePhases; |
| 912 ScrollAnchor m_scrollAnchor; |
909 }; | 913 }; |
910 | 914 |
911 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) | 915 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) |
912 { | 916 { |
913 if (m_isVisuallyNonEmpty) | 917 if (m_isVisuallyNonEmpty) |
914 return; | 918 return; |
915 m_visuallyNonEmptyCharacterCount += count; | 919 m_visuallyNonEmptyCharacterCount += count; |
916 // Use a threshold value to prevent very small amounts of visible content fr
om triggering didMeaningfulLayout. | 920 // Use a threshold value to prevent very small amounts of visible content fr
om triggering didMeaningfulLayout. |
917 // The first few hundred characters rarely contain the interesting content o
f the page. | 921 // The first few hundred characters rarely contain the interesting content o
f the page. |
918 static const unsigned visualCharacterThreshold = 200; | 922 static const unsigned visualCharacterThreshold = 200; |
(...skipping 11 matching lines...) Expand all Loading... |
930 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) | 934 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) |
931 setIsVisuallyNonEmpty(); | 935 setIsVisuallyNonEmpty(); |
932 } | 936 } |
933 | 937 |
934 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); | 938 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); |
935 DEFINE_TYPE_CASTS(FrameView, ScrollableArea, scrollableArea, scrollableArea->isF
rameView(), scrollableArea.isFrameView()); | 939 DEFINE_TYPE_CASTS(FrameView, ScrollableArea, scrollableArea, scrollableArea->isF
rameView(), scrollableArea.isFrameView()); |
936 | 940 |
937 } // namespace blink | 941 } // namespace blink |
938 | 942 |
939 #endif // FrameView_h | 943 #endif // FrameView_h |
OLD | NEW |