Chromium Code Reviews| 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; |
|
esprehn
2015/02/24 02:31:32
reference.
| |
| 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); | |
|
esprehn
2015/02/24 02:31:32
This should really use a struct, but we can fix th
| |
| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 319 | 321 |
| 320 IntSize scrollOffsetForViewportConstrainedObjects() const; | 322 IntSize scrollOffsetForViewportConstrainedObjects() const; |
| 321 | 323 |
| 322 // Override scrollbar notifications to update the AXObject cache. | 324 // Override scrollbar notifications to update the AXObject cache. |
| 323 virtual void didAddScrollbar(Scrollbar*, ScrollbarOrientation) override; | 325 virtual void didAddScrollbar(Scrollbar*, ScrollbarOrientation) override; |
| 324 virtual void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) override; | 326 virtual void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) override; |
| 325 | 327 |
| 326 // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter | 328 // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter |
| 327 // passed around the FrameView layout methods can be true while this returns | 329 // passed around the FrameView layout methods can be true while this returns |
| 328 // false. | 330 // false. |
| 329 bool isSubtreeLayout() const { return !!m_layoutSubtreeRoot; } | 331 bool isSubtreeLayout() const { return m_isSubtreeLayout; } |
| 330 | 332 |
| 331 // Sets the tickmarks for the FrameView, overriding the default behavior | 333 // Sets the tickmarks for the FrameView, overriding the default behavior |
| 332 // which is to display the tickmarks corresponding to find results. | 334 // which is to display the tickmarks corresponding to find results. |
| 333 // If |m_tickmarks| is empty, the default behavior is restored. | 335 // If |m_tickmarks| is empty, the default behavior is restored. |
| 334 void setTickmarks(const Vector<IntRect>& tickmarks) { m_tickmarks = tickmark s; } | 336 void setTickmarks(const Vector<IntRect>& tickmarks) { m_tickmarks = tickmark s; } |
| 335 | 337 |
| 336 // Since the compositor can resize the viewport due to top controls and | 338 // Since the compositor can resize the viewport due to top controls and |
| 337 // commit scroll offsets before a WebView::resize occurs, we need to adjust | 339 // commit scroll offsets before a WebView::resize occurs, we need to adjust |
| 338 // our scroll extents to prevent clamping the scroll offsets. | 340 // our scroll extents to prevent clamping the scroll offsets. |
| 339 void setTopControlsViewportAdjustment(float); | 341 void setTopControlsViewportAdjustment(float); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 595 TemporaryChange<bool> m_scope; | 597 TemporaryChange<bool> m_scope; |
| 596 }; | 598 }; |
| 597 | 599 |
| 598 private: | 600 private: |
| 599 explicit FrameView(LocalFrame*); | 601 explicit FrameView(LocalFrame*); |
| 600 | 602 |
| 601 void dispose() override; | 603 void dispose() override; |
| 602 void reset(); | 604 void reset(); |
| 603 void init(); | 605 void init(); |
| 604 | 606 |
| 607 void clearLayoutSubtreeRootsAndMarkContainingBlocks(); | |
| 608 | |
| 605 // Called when our frame rect changes (or the rect/scroll position of an anc estor changes). | 609 // Called when our frame rect changes (or the rect/scroll position of an anc estor changes). |
| 606 virtual void frameRectsChanged() override; | 610 virtual void frameRectsChanged() override; |
| 607 | 611 |
| 608 friend class LayoutPart; | 612 friend class LayoutPart; |
| 609 | 613 |
| 610 bool contentsInCompositedLayer() const; | 614 bool contentsInCompositedLayer() const; |
| 611 | 615 |
| 612 void applyOverflowToViewportAndSetRenderer(LayoutObject*, ScrollbarMode& hMo de, ScrollbarMode& vMode); | 616 void applyOverflowToViewportAndSetRenderer(LayoutObject*, ScrollbarMode& hMo de, ScrollbarMode& vMode); |
| 613 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); | 617 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); |
| 614 | 618 |
| 615 void updateCounters(); | 619 void updateCounters(); |
| 616 void forceLayoutParentViewIfNeeded(); | 620 void forceLayoutParentViewIfNeeded(); |
| 617 void performPreLayoutTasks(); | 621 void performPreLayoutTasks(); |
| 618 void performLayout(LayoutObject* rootForThisLayout, bool inSubtreeLayout); | 622 void performLayout(bool inSubtreeLayout); |
| 619 void scheduleOrPerformPostLayoutTasks(); | 623 void scheduleOrPerformPostLayoutTasks(); |
| 620 void performPostLayoutTasks(); | 624 void performPostLayoutTasks(); |
| 621 | 625 |
| 622 void invalidateTreeIfNeeded(); | 626 void invalidateTreeIfNeeded(); |
| 623 | 627 |
| 624 void gatherDebugLayoutRects(LayoutObject* layoutRoot); | |
| 625 | |
| 626 DocumentLifecycle& lifecycle() const; | 628 DocumentLifecycle& lifecycle() const; |
| 627 | 629 |
| 628 void contentRectangleForPaintInvalidation(const IntRect&); | 630 void contentRectangleForPaintInvalidation(const IntRect&); |
| 629 virtual void contentsResized() override; | 631 virtual void contentsResized() override; |
| 630 void scrollbarExistenceDidChange(); | 632 void scrollbarExistenceDidChange(); |
| 631 | 633 |
| 632 // Override Widget methods to do point conversion via renderers, in order to | 634 // Override Widget methods to do point conversion via renderers, in order to |
| 633 // take transforms into account. | 635 // take transforms into account. |
| 634 virtual IntRect convertToContainingView(const IntRect&) const override; | 636 virtual IntRect convertToContainingView(const IntRect&) const override; |
| 635 virtual IntRect convertFromContainingView(const IntRect&) const override; | 637 virtual IntRect convertFromContainingView(const IntRect&) const override; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 712 RefPtrWillBeMember<LocalFrame> m_frame; | 714 RefPtrWillBeMember<LocalFrame> m_frame; |
| 713 | 715 |
| 714 WebDisplayMode m_displayMode; | 716 WebDisplayMode m_displayMode; |
| 715 | 717 |
| 716 bool m_doFullPaintInvalidation; | 718 bool m_doFullPaintInvalidation; |
| 717 | 719 |
| 718 bool m_canHaveScrollbars; | 720 bool m_canHaveScrollbars; |
| 719 unsigned m_slowRepaintObjectCount; | 721 unsigned m_slowRepaintObjectCount; |
| 720 | 722 |
| 721 bool m_hasPendingLayout; | 723 bool m_hasPendingLayout; |
| 722 LayoutObject* m_layoutSubtreeRoot; | 724 HashSet<LayoutObject*> m_layoutSubtreeRoots; |
| 725 bool m_isSubtreeLayout; | |
|
esprehn
2015/02/24 02:31:32
It seems like we should be able to get rid of this
| |
| 723 | 726 |
| 724 bool m_layoutSchedulingEnabled; | 727 bool m_layoutSchedulingEnabled; |
| 725 bool m_inPerformLayout; | 728 bool m_inPerformLayout; |
| 726 bool m_inSynchronousPostLayout; | 729 bool m_inSynchronousPostLayout; |
| 727 int m_layoutCount; | 730 int m_layoutCount; |
| 728 unsigned m_nestedLayoutCount; | 731 unsigned m_nestedLayoutCount; |
| 729 Timer<FrameView> m_postLayoutTasksTimer; | 732 Timer<FrameView> m_postLayoutTasksTimer; |
| 730 Timer<FrameView> m_updateWidgetsTimer; | 733 Timer<FrameView> m_updateWidgetsTimer; |
| 731 bool m_firstLayoutCallbackPending; | 734 bool m_firstLayoutCallbackPending; |
| 732 | 735 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 844 static const unsigned visualPixelThreshold = 32 * 32; | 847 static const unsigned visualPixelThreshold = 32 * 32; |
| 845 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) | 848 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) |
| 846 setIsVisuallyNonEmpty(); | 849 setIsVisuallyNonEmpty(); |
| 847 } | 850 } |
| 848 | 851 |
| 849 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView()); | 852 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView()); |
| 850 | 853 |
| 851 } // namespace blink | 854 } // namespace blink |
| 852 | 855 |
| 853 #endif // FrameView_h | 856 #endif // FrameView_h |
| OLD | NEW |