| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 class PaintInvalidationState; | 75 class PaintInvalidationState; |
| 76 class Page; | 76 class Page; |
| 77 class ScrollingCoordinator; | 77 class ScrollingCoordinator; |
| 78 class TracedValue; | 78 class TracedValue; |
| 79 struct AnnotatedRegionValue; | 79 struct AnnotatedRegionValue; |
| 80 struct CompositedSelection; | 80 struct CompositedSelection; |
| 81 | 81 |
| 82 typedef unsigned long long DOMTimeStamp; | 82 typedef unsigned long long DOMTimeStamp; |
| 83 | 83 |
| 84 class CORE_EXPORT FrameView final : public Widget, public PaintInvalidationCapab
leScrollableArea { | 84 class CORE_EXPORT FrameView final : public Widget, public PaintInvalidationCapab
leScrollableArea { |
| 85 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FrameView); | 85 USING_GARBAGE_COLLECTED_MIXIN(FrameView); |
| 86 | 86 |
| 87 friend class PaintControllerPaintTestBase; | 87 friend class PaintControllerPaintTestBase; |
| 88 friend class Internals; | 88 friend class Internals; |
| 89 friend class LayoutPart; // for invalidateTreeIfNeeded | 89 friend class LayoutPart; // for invalidateTreeIfNeeded |
| 90 | 90 |
| 91 public: | 91 public: |
| 92 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*); | 92 static RawPtr<FrameView> create(LocalFrame*); |
| 93 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*, const IntSize&
initialSize); | 93 static RawPtr<FrameView> create(LocalFrame*, const IntSize& initialSize); |
| 94 | 94 |
| 95 ~FrameView() override; | 95 ~FrameView() override; |
| 96 | 96 |
| 97 void invalidateRect(const IntRect&) override; | 97 void invalidateRect(const IntRect&) override; |
| 98 void setFrameRect(const IntRect&) override; | 98 void setFrameRect(const IntRect&) override; |
| 99 | 99 |
| 100 LocalFrame& frame() const | 100 LocalFrame& frame() const |
| 101 { | 101 { |
| 102 ASSERT(m_frame); | 102 ASSERT(m_frame); |
| 103 return *m_frame; | 103 return *m_frame; |
| 104 } | 104 } |
| 105 | 105 |
| 106 Page* page() const; | 106 Page* page() const; |
| 107 | 107 |
| 108 LayoutView* layoutView() const; | 108 LayoutView* layoutView() const; |
| 109 | 109 |
| 110 void setCanHaveScrollbars(bool); | 110 void setCanHaveScrollbars(bool); |
| 111 | 111 |
| 112 PassRefPtrWillBeRawPtr<Scrollbar> createScrollbar(ScrollbarOrientation); | 112 RawPtr<Scrollbar> createScrollbar(ScrollbarOrientation); |
| 113 | 113 |
| 114 void setContentsSize(const IntSize&); | 114 void setContentsSize(const IntSize&); |
| 115 | 115 |
| 116 void layout(); | 116 void layout(); |
| 117 bool didFirstLayout() const; | 117 bool didFirstLayout() const; |
| 118 void scheduleRelayout(); | 118 void scheduleRelayout(); |
| 119 void scheduleRelayoutOfSubtree(LayoutObject*); | 119 void scheduleRelayoutOfSubtree(LayoutObject*); |
| 120 bool layoutPending() const; | 120 bool layoutPending() const; |
| 121 bool isInPerformLayout() const; | 121 bool isInPerformLayout() const; |
| 122 | 122 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 void scrollbarStyleChanged() override; | 304 void scrollbarStyleChanged() override; |
| 305 | 305 |
| 306 LayoutBox* embeddedContentBox() const; | 306 LayoutBox* embeddedContentBox() const; |
| 307 | 307 |
| 308 static void setInitialTracksPaintInvalidationsForTesting(bool); | 308 static void setInitialTracksPaintInvalidationsForTesting(bool); |
| 309 | 309 |
| 310 void setTracksPaintInvalidations(bool); | 310 void setTracksPaintInvalidations(bool); |
| 311 bool isTrackingPaintInvalidations() const { return m_isTrackingPaintInvalida
tions; } | 311 bool isTrackingPaintInvalidations() const { return m_isTrackingPaintInvalida
tions; } |
| 312 void resetTrackedPaintInvalidations(); | 312 void resetTrackedPaintInvalidations(); |
| 313 | 313 |
| 314 using ScrollableAreaSet = WillBeHeapHashSet<RawPtrWillBeMember<ScrollableAre
a>>; | 314 using ScrollableAreaSet = HeapHashSet<Member<ScrollableArea>>; |
| 315 void addScrollableArea(ScrollableArea*); | 315 void addScrollableArea(ScrollableArea*); |
| 316 void removeScrollableArea(ScrollableArea*); | 316 void removeScrollableArea(ScrollableArea*); |
| 317 const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.
get(); } | 317 const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.
get(); } |
| 318 | 318 |
| 319 void addAnimatingScrollableArea(ScrollableArea*); | 319 void addAnimatingScrollableArea(ScrollableArea*); |
| 320 void removeAnimatingScrollableArea(ScrollableArea*); | 320 void removeAnimatingScrollableArea(ScrollableArea*); |
| 321 const ScrollableAreaSet* animatingScrollableAreas() const { return m_animati
ngScrollableAreas.get(); } | 321 const ScrollableAreaSet* animatingScrollableAreas() const { return m_animati
ngScrollableAreas.get(); } |
| 322 | 322 |
| 323 // With CSS style "resize:" enabled, a little resizer handle will appear at
the bottom | 323 // With CSS style "resize:" enabled, a little resizer handle will appear at
the bottom |
| 324 // right of the object. We keep track of these resizer areas for checking if
touches | 324 // right of the object. We keep track of these resizer areas for checking if
touches |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 const ScrollAlignment& alignY, | 383 const ScrollAlignment& alignY, |
| 384 ScrollType = ProgrammaticScroll) override; | 384 ScrollType = ProgrammaticScroll) override; |
| 385 | 385 |
| 386 // The window that hosts the FrameView. The FrameView will communicate scrol
ls and repaints to the | 386 // The window that hosts the FrameView. The FrameView will communicate scrol
ls and repaints to the |
| 387 // host window in the window's coordinate space. | 387 // host window in the window's coordinate space. |
| 388 HostWindow* hostWindow() const; | 388 HostWindow* hostWindow() const; |
| 389 | 389 |
| 390 // Returns a clip rect in host window coordinates. Used to clip the blit on
a scroll. | 390 // Returns a clip rect in host window coordinates. Used to clip the blit on
a scroll. |
| 391 IntRect windowClipRect(IncludeScrollbarsInRect = ExcludeScrollbars) const; | 391 IntRect windowClipRect(IncludeScrollbarsInRect = ExcludeScrollbars) const; |
| 392 | 392 |
| 393 typedef WillBeHeapHashSet<RefPtrWillBeMember<Widget>> ChildrenWidgetSet; | 393 typedef HeapHashSet<Member<Widget>> ChildrenWidgetSet; |
| 394 | 394 |
| 395 // Functions for child manipulation and inspection. | 395 // Functions for child manipulation and inspection. |
| 396 void setParent(Widget*) override; | 396 void setParent(Widget*) override; |
| 397 void removeChild(Widget*); | 397 void removeChild(Widget*); |
| 398 void addChild(PassRefPtrWillBeRawPtr<Widget>); | 398 void addChild(RawPtr<Widget>); |
| 399 const ChildrenWidgetSet* children() const { return &m_children; } | 399 const ChildrenWidgetSet* children() const { return &m_children; } |
| 400 | 400 |
| 401 // If the scroll view does not use a native widget, then it will have cross-
platform Scrollbars. These functions | 401 // If the scroll view does not use a native widget, then it will have cross-
platform Scrollbars. These functions |
| 402 // can be used to obtain those scrollbars. | 402 // can be used to obtain those scrollbars. |
| 403 Scrollbar* horizontalScrollbar() const override { return m_horizontalScrollb
ar.get(); } | 403 Scrollbar* horizontalScrollbar() const override { return m_horizontalScrollb
ar.get(); } |
| 404 Scrollbar* verticalScrollbar() const override { return m_verticalScrollbar.g
et(); } | 404 Scrollbar* verticalScrollbar() const override { return m_verticalScrollbar.g
et(); } |
| 405 LayoutScrollbarPart* scrollCorner() const override { return m_scrollCorner;
} | 405 LayoutScrollbarPart* scrollCorner() const override { return m_scrollCorner;
} |
| 406 | 406 |
| 407 void positionScrollbarLayers(); | 407 void positionScrollbarLayers(); |
| 408 | 408 |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 | 766 |
| 767 // PaintInvalidationCapableScrollableArea | 767 // PaintInvalidationCapableScrollableArea |
| 768 LayoutBox& boxForScrollControlPaintInvalidation() const override; | 768 LayoutBox& boxForScrollControlPaintInvalidation() const override; |
| 769 LayoutScrollbarPart* resizer() const override { return nullptr; } | 769 LayoutScrollbarPart* resizer() const override { return nullptr; } |
| 770 | 770 |
| 771 LayoutSize m_size; | 771 LayoutSize m_size; |
| 772 | 772 |
| 773 typedef HashSet<RefPtr<LayoutEmbeddedObject>> EmbeddedObjectSet; | 773 typedef HashSet<RefPtr<LayoutEmbeddedObject>> EmbeddedObjectSet; |
| 774 EmbeddedObjectSet m_partUpdateSet; | 774 EmbeddedObjectSet m_partUpdateSet; |
| 775 | 775 |
| 776 // FIXME: These are just "children" of the FrameView and should be RefPtrWil
lBeMember<Widget> instead. | 776 // FIXME: These are just "children" of the FrameView and should be Member<Wi
dget> instead. |
| 777 HashSet<RefPtr<LayoutPart>> m_parts; | 777 HashSet<RefPtr<LayoutPart>> m_parts; |
| 778 | 778 |
| 779 // The RefPtr cycle between LocalFrame and FrameView is broken | 779 // The RefPtr cycle between LocalFrame and FrameView is broken |
| 780 // when a LocalFrame is detached by LocalFrame::detach(). | 780 // when a LocalFrame is detached by LocalFrame::detach(). |
| 781 // It clears the LocalFrame's m_view reference via setView(nullptr). | 781 // It clears the LocalFrame's m_view reference via setView(nullptr). |
| 782 // | 782 // |
| 783 // For Oilpan, Member reference cycles pose no problem, but | 783 // For Oilpan, Member reference cycles pose no problem, but |
| 784 // LocalFrame's FrameView is also cleared by that setView(), so as to | 784 // LocalFrame's FrameView is also cleared by that setView(), so as to |
| 785 // keep the observable lifespan of LocalFrame::view() identical. | 785 // keep the observable lifespan of LocalFrame::view() identical. |
| 786 RefPtrWillBeMember<LocalFrame> m_frame; | 786 Member<LocalFrame> m_frame; |
| 787 | 787 |
| 788 WebDisplayMode m_displayMode; | 788 WebDisplayMode m_displayMode; |
| 789 | 789 |
| 790 bool m_doFullPaintInvalidation; | 790 bool m_doFullPaintInvalidation; |
| 791 | 791 |
| 792 bool m_canHaveScrollbars; | 792 bool m_canHaveScrollbars; |
| 793 | 793 |
| 794 bool m_hasPendingLayout; | 794 bool m_hasPendingLayout; |
| 795 LayoutSubtreeRootList m_layoutSubtreeRootList; | 795 LayoutSubtreeRootList m_layoutSubtreeRootList; |
| 796 DepthOrderedLayoutObjectList m_orthogonalWritingModeRootList; | 796 DepthOrderedLayoutObjectList m_orthogonalWritingModeRootList; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 816 | 816 |
| 817 bool m_isTrackingPaintInvalidations; // Used for testing. | 817 bool m_isTrackingPaintInvalidations; // Used for testing. |
| 818 | 818 |
| 819 // TODO(wangxianzhu): Use document cycle state for spv2 and synchronzied pai
nting. | 819 // TODO(wangxianzhu): Use document cycle state for spv2 and synchronzied pai
nting. |
| 820 mutable bool m_isPainting; | 820 mutable bool m_isPainting; |
| 821 | 821 |
| 822 unsigned m_visuallyNonEmptyCharacterCount; | 822 unsigned m_visuallyNonEmptyCharacterCount; |
| 823 unsigned m_visuallyNonEmptyPixelCount; | 823 unsigned m_visuallyNonEmptyPixelCount; |
| 824 bool m_isVisuallyNonEmpty; | 824 bool m_isVisuallyNonEmpty; |
| 825 | 825 |
| 826 RefPtrWillBeMember<Node> m_fragmentAnchor; | 826 Member<Node> m_fragmentAnchor; |
| 827 | 827 |
| 828 // layoutObject to hold our custom scroll corner. | 828 // layoutObject to hold our custom scroll corner. |
| 829 LayoutScrollbarPart* m_scrollCorner; | 829 LayoutScrollbarPart* m_scrollCorner; |
| 830 | 830 |
| 831 OwnPtrWillBeMember<ScrollableAreaSet> m_scrollableAreas; | 831 Member<ScrollableAreaSet> m_scrollableAreas; |
| 832 OwnPtrWillBeMember<ScrollableAreaSet> m_animatingScrollableAreas; | 832 Member<ScrollableAreaSet> m_animatingScrollableAreas; |
| 833 OwnPtr<ResizerAreaSet> m_resizerAreas; | 833 OwnPtr<ResizerAreaSet> m_resizerAreas; |
| 834 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects; | 834 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects; |
| 835 ViewportConstrainedObjectSet m_backgroundAttachmentFixedObjects; | 835 ViewportConstrainedObjectSet m_backgroundAttachmentFixedObjects; |
| 836 OwnPtrWillBeMember<FrameViewAutoSizeInfo> m_autoSizeInfo; | 836 Member<FrameViewAutoSizeInfo> m_autoSizeInfo; |
| 837 | 837 |
| 838 IntSize m_inputEventsOffsetForEmulation; | 838 IntSize m_inputEventsOffsetForEmulation; |
| 839 float m_inputEventsScaleFactorForEmulation; | 839 float m_inputEventsScaleFactorForEmulation; |
| 840 | 840 |
| 841 IntSize m_layoutSize; | 841 IntSize m_layoutSize; |
| 842 bool m_layoutSizeFixedToFrameSize; | 842 bool m_layoutSizeFixedToFrameSize; |
| 843 | 843 |
| 844 Timer<FrameView> m_didScrollTimer; | 844 Timer<FrameView> m_didScrollTimer; |
| 845 | 845 |
| 846 Vector<IntRect> m_tickmarks; | 846 Vector<IntRect> m_tickmarks; |
| 847 | 847 |
| 848 float m_topControlsViewportAdjustment; | 848 float m_topControlsViewportAdjustment; |
| 849 | 849 |
| 850 bool m_needsUpdateWidgetGeometries; | 850 bool m_needsUpdateWidgetGeometries; |
| 851 bool m_needsUpdateViewportIntersection; | 851 bool m_needsUpdateViewportIntersection; |
| 852 bool m_needsUpdateViewportIntersectionInSubtree; | 852 bool m_needsUpdateViewportIntersectionInSubtree; |
| 853 | 853 |
| 854 #if ENABLE(ASSERT) | 854 #if ENABLE(ASSERT) |
| 855 // Verified when finalizing. | 855 // Verified when finalizing. |
| 856 bool m_hasBeenDisposed; | 856 bool m_hasBeenDisposed; |
| 857 #endif | 857 #endif |
| 858 | 858 |
| 859 RefPtrWillBeMember<Scrollbar> m_horizontalScrollbar; | 859 Member<Scrollbar> m_horizontalScrollbar; |
| 860 RefPtrWillBeMember<Scrollbar> m_verticalScrollbar; | 860 Member<Scrollbar> m_verticalScrollbar; |
| 861 ScrollbarMode m_horizontalScrollbarMode; | 861 ScrollbarMode m_horizontalScrollbarMode; |
| 862 ScrollbarMode m_verticalScrollbarMode; | 862 ScrollbarMode m_verticalScrollbarMode; |
| 863 | 863 |
| 864 bool m_horizontalScrollbarLock; | 864 bool m_horizontalScrollbarLock; |
| 865 bool m_verticalScrollbarLock; | 865 bool m_verticalScrollbarLock; |
| 866 | 866 |
| 867 ChildrenWidgetSet m_children; | 867 ChildrenWidgetSet m_children; |
| 868 | 868 |
| 869 DoubleSize m_pendingScrollDelta; | 869 DoubleSize m_pendingScrollDelta; |
| 870 DoublePoint m_scrollPosition; | 870 DoublePoint m_scrollPosition; |
| 871 IntSize m_contentsSize; | 871 IntSize m_contentsSize; |
| 872 | 872 |
| 873 int m_scrollbarsAvoidingResizer; | 873 int m_scrollbarsAvoidingResizer; |
| 874 bool m_scrollbarsSuppressed; | 874 bool m_scrollbarsSuppressed; |
| 875 | 875 |
| 876 bool m_inUpdateScrollbars; | 876 bool m_inUpdateScrollbars; |
| 877 | 877 |
| 878 OwnPtr<LayoutAnalyzer> m_analyzer; | 878 OwnPtr<LayoutAnalyzer> m_analyzer; |
| 879 | 879 |
| 880 // Mark if something has changed in the mapping from Frame to GraphicsLayer | 880 // Mark if something has changed in the mapping from Frame to GraphicsLayer |
| 881 // and the Frame Timing regions should be recalculated. | 881 // and the Frame Timing regions should be recalculated. |
| 882 bool m_frameTimingRequestsDirty; | 882 bool m_frameTimingRequestsDirty; |
| 883 | 883 |
| 884 // Exists only on root frame. | 884 // Exists only on root frame. |
| 885 // TODO(bokan): crbug.com/484188. We should specialize FrameView for the | 885 // TODO(bokan): crbug.com/484188. We should specialize FrameView for the |
| 886 // main frame. | 886 // main frame. |
| 887 OwnPtrWillBeMember<ScrollableArea> m_viewportScrollableArea; | 887 Member<ScrollableArea> m_viewportScrollableArea; |
| 888 | 888 |
| 889 // This frame's bounds in the root frame's content coordinates, clipped | 889 // This frame's bounds in the root frame's content coordinates, clipped |
| 890 // recursively through every ancestor view. | 890 // recursively through every ancestor view. |
| 891 IntRect m_viewportIntersection; | 891 IntRect m_viewportIntersection; |
| 892 bool m_viewportIntersectionValid; | 892 bool m_viewportIntersectionValid; |
| 893 | 893 |
| 894 // The following members control rendering pipeline throttling for this | 894 // The following members control rendering pipeline throttling for this |
| 895 // frame. They are only updated in response to intersection observer | 895 // frame. They are only updated in response to intersection observer |
| 896 // notifications, i.e., not in the middle of the lifecycle. | 896 // notifications, i.e., not in the middle of the lifecycle. |
| 897 bool m_hiddenForThrottling; | 897 bool m_hiddenForThrottling; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) | 934 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) |
| 935 setIsVisuallyNonEmpty(); | 935 setIsVisuallyNonEmpty(); |
| 936 } | 936 } |
| 937 | 937 |
| 938 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); | 938 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); |
| 939 DEFINE_TYPE_CASTS(FrameView, ScrollableArea, scrollableArea, scrollableArea->isF
rameView(), scrollableArea.isFrameView()); | 939 DEFINE_TYPE_CASTS(FrameView, ScrollableArea, scrollableArea, scrollableArea->isF
rameView(), scrollableArea.isFrameView()); |
| 940 | 940 |
| 941 } // namespace blink | 941 } // namespace blink |
| 942 | 942 |
| 943 #endif // FrameView_h | 943 #endif // FrameView_h |
| OLD | NEW |