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 14 matching lines...) Expand all Loading... |
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/ScrollAnchor.h" | 33 #include "core/layout/ScrollAnchor.h" |
34 #include "core/paint/FirstMeaningfulPaintDetector.h" | 34 #include "core/paint/FirstMeaningfulPaintDetector.h" |
| 35 #include "core/paint/ObjectPaintProperties.h" |
35 #include "core/paint/PaintInvalidationCapableScrollableArea.h" | 36 #include "core/paint/PaintInvalidationCapableScrollableArea.h" |
36 #include "core/paint/PaintPhase.h" | 37 #include "core/paint/PaintPhase.h" |
37 #include "platform/RuntimeEnabledFeatures.h" | 38 #include "platform/RuntimeEnabledFeatures.h" |
38 #include "platform/Widget.h" | 39 #include "platform/Widget.h" |
39 #include "platform/geometry/IntRect.h" | 40 #include "platform/geometry/IntRect.h" |
40 #include "platform/geometry/LayoutRect.h" | 41 #include "platform/geometry/LayoutRect.h" |
41 #include "platform/graphics/Color.h" | 42 #include "platform/graphics/Color.h" |
42 #include "platform/graphics/paint/ClipPaintPropertyNode.h" | |
43 #include "platform/graphics/paint/EffectPaintPropertyNode.h" | |
44 #include "platform/graphics/paint/ScrollPaintPropertyNode.h" | |
45 #include "platform/graphics/paint/TransformPaintPropertyNode.h" | |
46 #include "platform/scroll/ScrollTypes.h" | 43 #include "platform/scroll/ScrollTypes.h" |
47 #include "platform/scroll/Scrollbar.h" | 44 #include "platform/scroll/Scrollbar.h" |
48 #include "public/platform/WebDisplayMode.h" | 45 #include "public/platform/WebDisplayMode.h" |
49 #include "public/platform/WebRect.h" | 46 #include "public/platform/WebRect.h" |
50 #include "wtf/Allocator.h" | 47 #include "wtf/Allocator.h" |
51 #include "wtf/AutoReset.h" | 48 #include "wtf/AutoReset.h" |
52 #include "wtf/Forward.h" | 49 #include "wtf/Forward.h" |
53 #include "wtf/HashSet.h" | 50 #include "wtf/HashSet.h" |
54 #include "wtf/ListHashSet.h" | 51 #include "wtf/ListHashSet.h" |
55 #include "wtf/text/WTFString.h" | 52 #include "wtf/text/WTFString.h" |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 | 599 |
603 void setScrollTranslation(PassRefPtr<TransformPaintPropertyNode> scrollTrans
lation) { m_scrollTranslation = scrollTranslation; } | 600 void setScrollTranslation(PassRefPtr<TransformPaintPropertyNode> scrollTrans
lation) { m_scrollTranslation = scrollTranslation; } |
604 TransformPaintPropertyNode* scrollTranslation() const { return m_scrollTrans
lation.get(); } | 601 TransformPaintPropertyNode* scrollTranslation() const { return m_scrollTrans
lation.get(); } |
605 | 602 |
606 void setScroll(PassRefPtr<ScrollPaintPropertyNode> scroll) { m_scroll = scro
ll; } | 603 void setScroll(PassRefPtr<ScrollPaintPropertyNode> scroll) { m_scroll = scro
ll; } |
607 ScrollPaintPropertyNode* scroll() const { return m_scroll.get(); } | 604 ScrollPaintPropertyNode* scroll() const { return m_scroll.get(); } |
608 | 605 |
609 void setContentClip(PassRefPtr<ClipPaintPropertyNode> contentClip) { m_conte
ntClip = contentClip; } | 606 void setContentClip(PassRefPtr<ClipPaintPropertyNode> contentClip) { m_conte
ntClip = contentClip; } |
610 ClipPaintPropertyNode* contentClip() const { return m_contentClip.get(); } | 607 ClipPaintPropertyNode* contentClip() const { return m_contentClip.get(); } |
611 | 608 |
612 // We store no-op paint property tree nodes at the root of the tree. | 609 // The property tree state that should be used for painting contents. These |
613 // TODO(pdr): Remove this concept in favor of null nodes, see: crbug.com/645
615 | 610 // properties are either created by this FrameView or are inherited from |
614 void setRootTransform(PassRefPtr<TransformPaintPropertyNode> rootTransform)
{ m_rootTransform = rootTransform; } | 611 // an ancestor. |
615 TransformPaintPropertyNode* rootTransform() const { return m_rootTransform.g
et(); } | 612 void setTotalPropertyTreeStateForContents(std::unique_ptr<PropertyTreeState>
state) { m_totalPropertyTreeStateForContents = std::move(state); } |
616 void setRootClip(PassRefPtr<ClipPaintPropertyNode> rootClip) { m_rootClip =
rootClip; } | 613 const PropertyTreeState* totalPropertyTreeStateForContents() const { return
m_totalPropertyTreeStateForContents.get(); } |
617 ClipPaintPropertyNode* rootClip() const { return m_rootClip.get(); } | |
618 void setRootEffect(PassRefPtr<EffectPaintPropertyNode> rootEffect) { m_rootE
ffect = rootEffect; } | |
619 EffectPaintPropertyNode* rootEffect() const { return m_rootEffect.get(); } | |
620 void setRootScroll(PassRefPtr<ScrollPaintPropertyNode> rootScroll) { m_rootS
croll = rootScroll; } | |
621 ScrollPaintPropertyNode* rootScroll() const { return m_rootScroll.get(); } | |
622 | 614 |
623 // TODO(ojan): Merge this with IntersectionObserver once it lands. | 615 // TODO(ojan): Merge this with IntersectionObserver once it lands. |
624 IntRect computeVisibleArea(); | 616 IntRect computeVisibleArea(); |
625 | 617 |
626 // Viewport size that should be used for viewport units (i.e. 'vh'/'vw'). | 618 // Viewport size that should be used for viewport units (i.e. 'vh'/'vw'). |
627 FloatSize viewportSizeForViewportUnits() const; | 619 FloatSize viewportSizeForViewportUnits() const; |
628 | 620 |
629 ScrollAnchor* scrollAnchor() override { return &m_scrollAnchor; } | 621 ScrollAnchor* scrollAnchor() override { return &m_scrollAnchor; } |
630 void clearScrollAnchor(); | 622 void clearScrollAnchor(); |
631 bool shouldPerformScrollAnchoring() const override; | 623 bool shouldPerformScrollAnchoring() const override; |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 // The hierarchy of transform subtree created by a FrameView. | 917 // The hierarchy of transform subtree created by a FrameView. |
926 // [ preTranslation ] The offset from Widget::frameRect. Estab
lishes viewport. | 918 // [ preTranslation ] The offset from Widget::frameRect. Estab
lishes viewport. |
927 // +---[ scrollTranslation ] Frame scrolling. | 919 // +---[ scrollTranslation ] Frame scrolling. |
928 // TODO(trchen): These will not be needed once settings->rootLayerScrolls()
is enabled. | 920 // TODO(trchen): These will not be needed once settings->rootLayerScrolls()
is enabled. |
929 RefPtr<TransformPaintPropertyNode> m_preTranslation; | 921 RefPtr<TransformPaintPropertyNode> m_preTranslation; |
930 RefPtr<TransformPaintPropertyNode> m_scrollTranslation; | 922 RefPtr<TransformPaintPropertyNode> m_scrollTranslation; |
931 RefPtr<ScrollPaintPropertyNode> m_scroll; | 923 RefPtr<ScrollPaintPropertyNode> m_scroll; |
932 // The content clip clips the document (= LayoutView) but not the scrollbars
. | 924 // The content clip clips the document (= LayoutView) but not the scrollbars
. |
933 // TODO(trchen): This will not be needed once settings->rootLayerScrolls() i
s enabled. | 925 // TODO(trchen): This will not be needed once settings->rootLayerScrolls() i
s enabled. |
934 RefPtr<ClipPaintPropertyNode> m_contentClip; | 926 RefPtr<ClipPaintPropertyNode> m_contentClip; |
935 | 927 // The property tree state that should be used for painting contents. These |
936 // These nodes represent the root nodes of each property tree. | 928 // properties are either created by this FrameView or are inherited from |
937 // Only the root frame should create them and they will be no-op. | 929 // an ancestor. |
938 RefPtr<TransformPaintPropertyNode> m_rootTransform; | 930 std::unique_ptr<PropertyTreeState> m_totalPropertyTreeStateForContents; |
939 RefPtr<ClipPaintPropertyNode> m_rootClip; | |
940 RefPtr<EffectPaintPropertyNode> m_rootEffect; | |
941 RefPtr<ScrollPaintPropertyNode> m_rootScroll; | |
942 | 931 |
943 // This is set on the local root frame view only. | 932 // This is set on the local root frame view only. |
944 DocumentLifecycle::LifecycleState m_currentUpdateLifecyclePhasesTargetState; | 933 DocumentLifecycle::LifecycleState m_currentUpdateLifecyclePhasesTargetState; |
945 | 934 |
946 ScrollAnchor m_scrollAnchor; | 935 ScrollAnchor m_scrollAnchor; |
947 | 936 |
948 bool m_needsScrollbarsUpdate; | 937 bool m_needsScrollbarsUpdate; |
949 bool m_suppressAdjustViewSize; | 938 bool m_suppressAdjustViewSize; |
950 bool m_allowsLayoutInvalidationAfterLayoutClean; | 939 bool m_allowsLayoutInvalidationAfterLayoutClean; |
951 | 940 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) | 972 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) |
984 setIsVisuallyNonEmpty(); | 973 setIsVisuallyNonEmpty(); |
985 } | 974 } |
986 | 975 |
987 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); | 976 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); |
988 DEFINE_TYPE_CASTS(FrameView, ScrollableArea, scrollableArea, scrollableArea->isF
rameView(), scrollableArea.isFrameView()); | 977 DEFINE_TYPE_CASTS(FrameView, ScrollableArea, scrollableArea, scrollableArea->isF
rameView(), scrollableArea.isFrameView()); |
989 | 978 |
990 } // namespace blink | 979 } // namespace blink |
991 | 980 |
992 #endif // FrameView_h | 981 #endif // FrameView_h |
OLD | NEW |