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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.h

Issue 2359063002: Add static root property tree nodes [spv2] (Closed)
Patch Set: Created 4 years, 3 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 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
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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 593
597 void setScrollTranslation(PassRefPtr<TransformPaintPropertyNode> scrollTrans lation) { m_scrollTranslation = scrollTranslation; } 594 void setScrollTranslation(PassRefPtr<TransformPaintPropertyNode> scrollTrans lation) { m_scrollTranslation = scrollTranslation; }
598 TransformPaintPropertyNode* scrollTranslation() const { return m_scrollTrans lation.get(); } 595 TransformPaintPropertyNode* scrollTranslation() const { return m_scrollTrans lation.get(); }
599 596
600 void setScroll(PassRefPtr<ScrollPaintPropertyNode> scroll) { m_scroll = scro ll; } 597 void setScroll(PassRefPtr<ScrollPaintPropertyNode> scroll) { m_scroll = scro ll; }
601 ScrollPaintPropertyNode* scroll() const { return m_scroll.get(); } 598 ScrollPaintPropertyNode* scroll() const { return m_scroll.get(); }
602 599
603 void setContentClip(PassRefPtr<ClipPaintPropertyNode> contentClip) { m_conte ntClip = contentClip; } 600 void setContentClip(PassRefPtr<ClipPaintPropertyNode> contentClip) { m_conte ntClip = contentClip; }
604 ClipPaintPropertyNode* contentClip() const { return m_contentClip.get(); } 601 ClipPaintPropertyNode* contentClip() const { return m_contentClip.get(); }
605 602
606 // We store no-op paint property tree nodes at the root of the tree. 603 // The property tree state that should be used for painting contents. These
607 // TODO(pdr): Remove this concept in favor of null nodes, see: crbug.com/645 615 604 // properties are either created by this FrameView or are inherited from
608 void setRootTransform(PassRefPtr<TransformPaintPropertyNode> rootTransform) { m_rootTransform = rootTransform; } 605 // an ancestor.
609 TransformPaintPropertyNode* rootTransform() const { return m_rootTransform.g et(); } 606 void setTotalPropertyTreeStateForContents(std::unique_ptr<PropertyTreeState> state) { m_totalPropertyTreeStateForContents = std::move(state); }
610 void setRootClip(PassRefPtr<ClipPaintPropertyNode> rootClip) { m_rootClip = rootClip; } 607 const PropertyTreeState* totalPropertyTreeStateForContents() const { return m_totalPropertyTreeStateForContents.get(); }
611 ClipPaintPropertyNode* rootClip() const { return m_rootClip.get(); }
612 void setRootEffect(PassRefPtr<EffectPaintPropertyNode> rootEffect) { m_rootE ffect = rootEffect; }
613 EffectPaintPropertyNode* rootEffect() const { return m_rootEffect.get(); }
614 void setRootScroll(PassRefPtr<ScrollPaintPropertyNode> rootScroll) { m_rootS croll = rootScroll; }
615 ScrollPaintPropertyNode* rootScroll() const { return m_rootScroll.get(); }
616 608
617 // TODO(ojan): Merge this with IntersectionObserver once it lands. 609 // TODO(ojan): Merge this with IntersectionObserver once it lands.
618 IntRect computeVisibleArea(); 610 IntRect computeVisibleArea();
619 611
620 // Viewport size that should be used for viewport units (i.e. 'vh'/'vw'). 612 // Viewport size that should be used for viewport units (i.e. 'vh'/'vw').
621 FloatSize viewportSizeForViewportUnits() const; 613 FloatSize viewportSizeForViewportUnits() const;
622 614
623 ScrollAnchor* scrollAnchor() override { return &m_scrollAnchor; } 615 ScrollAnchor* scrollAnchor() override { return &m_scrollAnchor; }
624 void clearScrollAnchor(); 616 void clearScrollAnchor();
625 bool shouldPerformScrollAnchoring() const override; 617 bool shouldPerformScrollAnchoring() const override;
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 // The hierarchy of transform subtree created by a FrameView. 911 // The hierarchy of transform subtree created by a FrameView.
920 // [ preTranslation ] The offset from Widget::frameRect. Estab lishes viewport. 912 // [ preTranslation ] The offset from Widget::frameRect. Estab lishes viewport.
921 // +---[ scrollTranslation ] Frame scrolling. 913 // +---[ scrollTranslation ] Frame scrolling.
922 // TODO(trchen): These will not be needed once settings->rootLayerScrolls() is enabled. 914 // TODO(trchen): These will not be needed once settings->rootLayerScrolls() is enabled.
923 RefPtr<TransformPaintPropertyNode> m_preTranslation; 915 RefPtr<TransformPaintPropertyNode> m_preTranslation;
924 RefPtr<TransformPaintPropertyNode> m_scrollTranslation; 916 RefPtr<TransformPaintPropertyNode> m_scrollTranslation;
925 RefPtr<ScrollPaintPropertyNode> m_scroll; 917 RefPtr<ScrollPaintPropertyNode> m_scroll;
926 // The content clip clips the document (= LayoutView) but not the scrollbars . 918 // The content clip clips the document (= LayoutView) but not the scrollbars .
927 // TODO(trchen): This will not be needed once settings->rootLayerScrolls() i s enabled. 919 // TODO(trchen): This will not be needed once settings->rootLayerScrolls() i s enabled.
928 RefPtr<ClipPaintPropertyNode> m_contentClip; 920 RefPtr<ClipPaintPropertyNode> m_contentClip;
929 921 // The property tree state that should be used for painting contents. These
930 // These nodes represent the root nodes of each property tree. 922 // properties are either created by this FrameView or are inherited from
931 // Only the root frame should create them and they will be no-op. 923 // an ancestor.
932 RefPtr<TransformPaintPropertyNode> m_rootTransform; 924 std::unique_ptr<PropertyTreeState> m_totalPropertyTreeStateForContents;
933 RefPtr<ClipPaintPropertyNode> m_rootClip;
934 RefPtr<EffectPaintPropertyNode> m_rootEffect;
935 RefPtr<ScrollPaintPropertyNode> m_rootScroll;
936 925
937 // This is set on the local root frame view only. 926 // This is set on the local root frame view only.
938 DocumentLifecycle::LifecycleState m_currentUpdateLifecyclePhasesTargetState; 927 DocumentLifecycle::LifecycleState m_currentUpdateLifecyclePhasesTargetState;
939 928
940 ScrollAnchor m_scrollAnchor; 929 ScrollAnchor m_scrollAnchor;
941 930
942 bool m_needsScrollbarsUpdate; 931 bool m_needsScrollbarsUpdate;
943 bool m_suppressAdjustViewSize; 932 bool m_suppressAdjustViewSize;
944 bool m_allowsLayoutInvalidationAfterLayoutClean; 933 bool m_allowsLayoutInvalidationAfterLayoutClean;
945 934
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) 966 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold)
978 setIsVisuallyNonEmpty(); 967 setIsVisuallyNonEmpty();
979 } 968 }
980 969
981 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView()); 970 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView());
982 DEFINE_TYPE_CASTS(FrameView, ScrollableArea, scrollableArea, scrollableArea->isF rameView(), scrollableArea.isFrameView()); 971 DEFINE_TYPE_CASTS(FrameView, ScrollableArea, scrollableArea, scrollableArea->isF rameView(), scrollableArea.isFrameView());
983 972
984 } // namespace blink 973 } // namespace blink
985 974
986 #endif // FrameView_h 975 #endif // FrameView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698