| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 void setContentsSize(const IntSize&); | 95 void setContentsSize(const IntSize&); |
| 96 IntPoint clampOffsetAtScale(const IntPoint& offset, float scale) const; | 96 IntPoint clampOffsetAtScale(const IntPoint& offset, float scale) const; |
| 97 | 97 |
| 98 void layout(); | 98 void layout(); |
| 99 bool didFirstLayout() const; | 99 bool didFirstLayout() const; |
| 100 void scheduleRelayout(); | 100 void scheduleRelayout(); |
| 101 void scheduleRelayoutOfSubtree(LayoutObject*); | 101 void scheduleRelayoutOfSubtree(LayoutObject*); |
| 102 bool layoutPending() const; | 102 bool layoutPending() const; |
| 103 bool isInPerformLayout() const; | 103 bool isInPerformLayout() const; |
| 104 | 104 |
| 105 LayoutObject* layoutRoot(bool onlyDuringLayout = false) const; | 105 bool isLayoutRoot(const LayoutObject&) const; |
| 106 void clearLayoutSubtreeRoot() { m_layoutSubtreeRoot = nullptr; } | 106 void clearLayoutSubtreeRoot(const LayoutObject&); |
| 107 int layoutCount() const { return m_layoutCount; } | 107 int layoutCount() const { return m_layoutCount; } |
| 108 | 108 |
| 109 void countObjectsNeedingLayout(unsigned& needsLayoutObjects, unsigned& total
Objects, bool& isPartial); |
| 110 |
| 109 bool needsLayout() const; | 111 bool needsLayout() const; |
| 110 void setNeedsLayout(); | 112 void setNeedsLayout(); |
| 111 | 113 |
| 112 void setNeedsUpdateWidgetPositions() { m_needsUpdateWidgetPositions = true;
} | 114 void setNeedsUpdateWidgetPositions() { m_needsUpdateWidgetPositions = true;
} |
| 113 | 115 |
| 114 // Methods for getting/setting the size Blink should use to layout the conte
nts. | 116 // Methods for getting/setting the size Blink should use to layout the conte
nts. |
| 115 IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const; | 117 IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const; |
| 116 void setLayoutSize(const IntSize&); | 118 void setLayoutSize(const IntSize&); |
| 117 | 119 |
| 118 // If this is set to false, the layout size will need to be explicitly set b
y the owner. | 120 // If this is set to false, the layout size will need to be explicitly set b
y the owner. |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 322 |
| 321 IntSize scrollOffsetForViewportConstrainedObjects() const; | 323 IntSize scrollOffsetForViewportConstrainedObjects() const; |
| 322 | 324 |
| 323 // Override scrollbar notifications to update the AXObject cache. | 325 // Override scrollbar notifications to update the AXObject cache. |
| 324 virtual void didAddScrollbar(Scrollbar*, ScrollbarOrientation) override; | 326 virtual void didAddScrollbar(Scrollbar*, ScrollbarOrientation) override; |
| 325 virtual void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) override; | 327 virtual void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) override; |
| 326 | 328 |
| 327 // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter | 329 // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter |
| 328 // passed around the FrameView layout methods can be true while this returns | 330 // passed around the FrameView layout methods can be true while this returns |
| 329 // false. | 331 // false. |
| 330 bool isSubtreeLayout() const { return !!m_layoutSubtreeRoot; } | 332 bool isSubtreeLayout() const { return !m_layoutSubtreeRoots.isEmpty(); } |
| 331 | 333 |
| 332 // Sets the tickmarks for the FrameView, overriding the default behavior | 334 // Sets the tickmarks for the FrameView, overriding the default behavior |
| 333 // which is to display the tickmarks corresponding to find results. | 335 // which is to display the tickmarks corresponding to find results. |
| 334 // If |m_tickmarks| is empty, the default behavior is restored. | 336 // If |m_tickmarks| is empty, the default behavior is restored. |
| 335 void setTickmarks(const Vector<IntRect>& tickmarks) { m_tickmarks = tickmark
s; } | 337 void setTickmarks(const Vector<IntRect>& tickmarks) { m_tickmarks = tickmark
s; } |
| 336 | 338 |
| 337 // Since the compositor can resize the viewport due to top controls and | 339 // Since the compositor can resize the viewport due to top controls and |
| 338 // commit scroll offsets before a WebView::resize occurs, we need to adjust | 340 // commit scroll offsets before a WebView::resize occurs, we need to adjust |
| 339 // our scroll extents to prevent clamping the scroll offsets. | 341 // our scroll extents to prevent clamping the scroll offsets. |
| 340 void setTopControlsViewportAdjustment(float); | 342 void setTopControlsViewportAdjustment(float); |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 TemporaryChange<bool> m_scope; | 609 TemporaryChange<bool> m_scope; |
| 608 }; | 610 }; |
| 609 | 611 |
| 610 private: | 612 private: |
| 611 explicit FrameView(LocalFrame*); | 613 explicit FrameView(LocalFrame*); |
| 612 | 614 |
| 613 void dispose() override; | 615 void dispose() override; |
| 614 void reset(); | 616 void reset(); |
| 615 void init(); | 617 void init(); |
| 616 | 618 |
| 619 void clearLayoutSubtreeRootsAndMarkContainingBlocks(); |
| 620 |
| 617 // Called when our frame rect changes (or the rect/scroll position of an anc
estor changes). | 621 // Called when our frame rect changes (or the rect/scroll position of an anc
estor changes). |
| 618 virtual void frameRectsChanged() override; | 622 virtual void frameRectsChanged() override; |
| 619 | 623 |
| 620 friend class LayoutPart; | 624 friend class LayoutPart; |
| 621 | 625 |
| 622 bool contentsInCompositedLayer() const; | 626 bool contentsInCompositedLayer() const; |
| 623 | 627 |
| 624 void applyOverflowToViewportAndSetRenderer(LayoutObject*, ScrollbarMode& hMo
de, ScrollbarMode& vMode); | 628 void applyOverflowToViewportAndSetRenderer(LayoutObject*, ScrollbarMode& hMo
de, ScrollbarMode& vMode); |
| 625 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); | 629 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); |
| 626 | 630 |
| 627 void updateCounters(); | 631 void updateCounters(); |
| 628 void forceLayoutParentViewIfNeeded(); | 632 void forceLayoutParentViewIfNeeded(); |
| 629 void performPreLayoutTasks(); | 633 void performPreLayoutTasks(); |
| 630 void performLayout(LayoutObject* rootForThisLayout, bool inSubtreeLayout); | 634 void performLayout(bool inSubtreeLayout); |
| 631 void scheduleOrPerformPostLayoutTasks(); | 635 void scheduleOrPerformPostLayoutTasks(); |
| 632 void performPostLayoutTasks(); | 636 void performPostLayoutTasks(); |
| 633 | 637 |
| 634 void invalidateTreeIfNeeded(); | 638 void invalidateTreeIfNeeded(); |
| 635 | 639 |
| 636 void gatherDebugLayoutRects(LayoutObject* layoutRoot); | |
| 637 | |
| 638 DocumentLifecycle& lifecycle() const; | 640 DocumentLifecycle& lifecycle() const; |
| 639 | 641 |
| 640 void contentRectangleForPaintInvalidation(const IntRect&); | 642 void contentRectangleForPaintInvalidation(const IntRect&); |
| 641 virtual void contentsResized() override; | 643 virtual void contentsResized() override; |
| 642 void scrollbarExistenceDidChange(); | 644 void scrollbarExistenceDidChange(); |
| 643 | 645 |
| 644 // Override Widget methods to do point conversion via renderers, in order to | 646 // Override Widget methods to do point conversion via renderers, in order to |
| 645 // take transforms into account. | 647 // take transforms into account. |
| 646 virtual IntRect convertToContainingView(const IntRect&) const override; | 648 virtual IntRect convertToContainingView(const IntRect&) const override; |
| 647 virtual IntRect convertFromContainingView(const IntRect&) const override; | 649 virtual IntRect convertFromContainingView(const IntRect&) const override; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 RefPtrWillBeMember<LocalFrame> m_frame; | 728 RefPtrWillBeMember<LocalFrame> m_frame; |
| 727 | 729 |
| 728 WebDisplayMode m_displayMode; | 730 WebDisplayMode m_displayMode; |
| 729 | 731 |
| 730 bool m_doFullPaintInvalidation; | 732 bool m_doFullPaintInvalidation; |
| 731 | 733 |
| 732 bool m_canHaveScrollbars; | 734 bool m_canHaveScrollbars; |
| 733 unsigned m_slowRepaintObjectCount; | 735 unsigned m_slowRepaintObjectCount; |
| 734 | 736 |
| 735 bool m_hasPendingLayout; | 737 bool m_hasPendingLayout; |
| 736 LayoutObject* m_layoutSubtreeRoot; | 738 HashSet<LayoutObject*> m_layoutSubtreeRoots; |
| 737 | 739 |
| 738 bool m_layoutSchedulingEnabled; | 740 bool m_layoutSchedulingEnabled; |
| 739 bool m_inPerformLayout; | 741 bool m_inPerformLayout; |
| 740 bool m_inSynchronousPostLayout; | 742 bool m_inSynchronousPostLayout; |
| 741 int m_layoutCount; | 743 int m_layoutCount; |
| 742 unsigned m_nestedLayoutCount; | 744 unsigned m_nestedLayoutCount; |
| 743 Timer<FrameView> m_postLayoutTasksTimer; | 745 Timer<FrameView> m_postLayoutTasksTimer; |
| 744 Timer<FrameView> m_updateWidgetsTimer; | 746 Timer<FrameView> m_updateWidgetsTimer; |
| 745 bool m_firstLayoutCallbackPending; | 747 bool m_firstLayoutCallbackPending; |
| 746 | 748 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 static const unsigned visualPixelThreshold = 32 * 32; | 862 static const unsigned visualPixelThreshold = 32 * 32; |
| 861 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) | 863 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) |
| 862 setIsVisuallyNonEmpty(); | 864 setIsVisuallyNonEmpty(); |
| 863 } | 865 } |
| 864 | 866 |
| 865 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); | 867 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); |
| 866 | 868 |
| 867 } // namespace blink | 869 } // namespace blink |
| 868 | 870 |
| 869 #endif // FrameView_h | 871 #endif // FrameView_h |
| OLD | NEW |