| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 class Cursor; | 49 class Cursor; |
| 50 class Element; | 50 class Element; |
| 51 class FloatSize; | 51 class FloatSize; |
| 52 class HTMLFrameOwnerElement; | 52 class HTMLFrameOwnerElement; |
| 53 class LocalFrame; | 53 class LocalFrame; |
| 54 class KURL; | 54 class KURL; |
| 55 class Node; | 55 class Node; |
| 56 class Page; | 56 class Page; |
| 57 class RenderBox; | 57 class RenderBox; |
| 58 class RenderEmbeddedObject; | 58 class RenderEmbeddedObject; |
| 59 class RenderObject; | 59 class LayoutObject; |
| 60 class RenderPart; | 60 class RenderPart; |
| 61 class RenderScrollbarPart; | 61 class RenderScrollbarPart; |
| 62 class RenderView; | 62 class RenderView; |
| 63 class ScrollingCoordinator; | 63 class ScrollingCoordinator; |
| 64 struct CompositedSelectionBound; | 64 struct CompositedSelectionBound; |
| 65 | 65 |
| 66 typedef unsigned long long DOMTimeStamp; | 66 typedef unsigned long long DOMTimeStamp; |
| 67 | 67 |
| 68 class FrameView final : public Widget, public ScrollableArea { | 68 class FrameView final : public Widget, public ScrollableArea { |
| 69 public: | 69 public: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 91 void setCanHaveScrollbars(bool); | 91 void setCanHaveScrollbars(bool); |
| 92 | 92 |
| 93 PassRefPtrWillBeRawPtr<Scrollbar> createScrollbar(ScrollbarOrientation); | 93 PassRefPtrWillBeRawPtr<Scrollbar> createScrollbar(ScrollbarOrientation); |
| 94 | 94 |
| 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(bool allowSubtree = true); | 98 void layout(bool allowSubtree = true); |
| 99 bool didFirstLayout() const; | 99 bool didFirstLayout() const; |
| 100 void scheduleRelayout(); | 100 void scheduleRelayout(); |
| 101 void scheduleRelayoutOfSubtree(RenderObject*); | 101 void scheduleRelayoutOfSubtree(LayoutObject*); |
| 102 bool layoutPending() const; | 102 bool layoutPending() const; |
| 103 bool isInPerformLayout() const; | 103 bool isInPerformLayout() const; |
| 104 | 104 |
| 105 void setCanInvalidatePaintDuringPerformLayout(bool b) { m_canInvalidatePaint
DuringPerformLayout = b; } | 105 void setCanInvalidatePaintDuringPerformLayout(bool b) { m_canInvalidatePaint
DuringPerformLayout = b; } |
| 106 bool canInvalidatePaintDuringPerformLayout() const { return m_canInvalidateP
aintDuringPerformLayout; } | 106 bool canInvalidatePaintDuringPerformLayout() const { return m_canInvalidateP
aintDuringPerformLayout; } |
| 107 | 107 |
| 108 RenderObject* layoutRoot(bool onlyDuringLayout = false) const; | 108 LayoutObject* layoutRoot(bool onlyDuringLayout = false) const; |
| 109 void clearLayoutSubtreeRoot() { m_layoutSubtreeRoot = nullptr; } | 109 void clearLayoutSubtreeRoot() { m_layoutSubtreeRoot = nullptr; } |
| 110 int layoutCount() const { return m_layoutCount; } | 110 int layoutCount() const { return m_layoutCount; } |
| 111 | 111 |
| 112 bool needsLayout() const; | 112 bool needsLayout() const; |
| 113 void setNeedsLayout(); | 113 void setNeedsLayout(); |
| 114 | 114 |
| 115 void setNeedsUpdateWidgetPositions() { m_needsUpdateWidgetPositions = true;
} | 115 void setNeedsUpdateWidgetPositions() { m_needsUpdateWidgetPositions = true;
} |
| 116 | 116 |
| 117 // Methods for getting/setting the size Blink should use to layout the conte
nts. | 117 // Methods for getting/setting the size Blink should use to layout the conte
nts. |
| 118 IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const; | 118 IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 void adjustMediaTypeForPrinting(bool printing); | 182 void adjustMediaTypeForPrinting(bool printing); |
| 183 | 183 |
| 184 WebDisplayMode displayMode() { return m_displayMode; } | 184 WebDisplayMode displayMode() { return m_displayMode; } |
| 185 void setDisplayMode(WebDisplayMode); | 185 void setDisplayMode(WebDisplayMode); |
| 186 | 186 |
| 187 void addSlowRepaintObject(); | 187 void addSlowRepaintObject(); |
| 188 void removeSlowRepaintObject(); | 188 void removeSlowRepaintObject(); |
| 189 bool hasSlowRepaintObjects() const { return m_slowRepaintObjectCount; } | 189 bool hasSlowRepaintObjects() const { return m_slowRepaintObjectCount; } |
| 190 | 190 |
| 191 // Fixed-position objects. | 191 // Fixed-position objects. |
| 192 typedef HashSet<RenderObject*> ViewportConstrainedObjectSet; | 192 typedef HashSet<LayoutObject*> ViewportConstrainedObjectSet; |
| 193 void addViewportConstrainedObject(RenderObject*); | 193 void addViewportConstrainedObject(LayoutObject*); |
| 194 void removeViewportConstrainedObject(RenderObject*); | 194 void removeViewportConstrainedObject(LayoutObject*); |
| 195 const ViewportConstrainedObjectSet* viewportConstrainedObjects() const { ret
urn m_viewportConstrainedObjects.get(); } | 195 const ViewportConstrainedObjectSet* viewportConstrainedObjects() const { ret
urn m_viewportConstrainedObjects.get(); } |
| 196 bool hasViewportConstrainedObjects() const { return m_viewportConstrainedObj
ects && m_viewportConstrainedObjects->size() > 0; } | 196 bool hasViewportConstrainedObjects() const { return m_viewportConstrainedObj
ects && m_viewportConstrainedObjects->size() > 0; } |
| 197 | 197 |
| 198 void handleLoadCompleted(); | 198 void handleLoadCompleted(); |
| 199 | 199 |
| 200 void updateAnnotatedRegions(); | 200 void updateAnnotatedRegions(); |
| 201 | 201 |
| 202 void restoreScrollbar(); | 202 void restoreScrollbar(); |
| 203 | 203 |
| 204 void postLayoutTimerFired(Timer<FrameView>*); | 204 void postLayoutTimerFired(Timer<FrameView>*); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 void forceLayout(bool allowSubtree = false); | 244 void forceLayout(bool allowSubtree = false); |
| 245 void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& or
iginalPageSize, float maximumShrinkFactor); | 245 void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& or
iginalPageSize, float maximumShrinkFactor); |
| 246 | 246 |
| 247 bool scrollToFragment(const KURL&); | 247 bool scrollToFragment(const KURL&); |
| 248 bool scrollToAnchor(const String&); | 248 bool scrollToAnchor(const String&); |
| 249 void maintainScrollPositionAtAnchor(Node*); | 249 void maintainScrollPositionAtAnchor(Node*); |
| 250 void scrollElementToRect(Element*, const IntRect&); | 250 void scrollElementToRect(Element*, const IntRect&); |
| 251 void scrollContentsIfNeededRecursive(); | 251 void scrollContentsIfNeededRecursive(); |
| 252 | 252 |
| 253 // Methods to convert points and rects between the coordinate space of the r
enderer, and this view. | 253 // Methods to convert points and rects between the coordinate space of the r
enderer, and this view. |
| 254 IntRect convertFromRenderer(const RenderObject&, const IntRect&) const; | 254 IntRect convertFromRenderer(const LayoutObject&, const IntRect&) const; |
| 255 IntRect convertToRenderer(const RenderObject&, const IntRect&) const; | 255 IntRect convertToRenderer(const LayoutObject&, const IntRect&) const; |
| 256 IntPoint convertFromRenderer(const RenderObject&, const IntPoint&) const; | 256 IntPoint convertFromRenderer(const LayoutObject&, const IntPoint&) const; |
| 257 IntPoint convertToRenderer(const RenderObject&, const IntPoint&) const; | 257 IntPoint convertToRenderer(const LayoutObject&, const IntPoint&) const; |
| 258 | 258 |
| 259 bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { retu
rn m_scrollCorner == scrollCorner; } | 259 bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { retu
rn m_scrollCorner == scrollCorner; } |
| 260 | 260 |
| 261 enum ScrollingReasons { | 261 enum ScrollingReasons { |
| 262 Scrollable, | 262 Scrollable, |
| 263 NotScrollableNoOverflow, | 263 NotScrollableNoOverflow, |
| 264 NotScrollableNotVisible, | 264 NotScrollableNotVisible, |
| 265 NotScrollableExplicitlyDisabled | 265 NotScrollableExplicitlyDisabled |
| 266 }; | 266 }; |
| 267 | 267 |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 void reset(); | 604 void reset(); |
| 605 void init(); | 605 void init(); |
| 606 | 606 |
| 607 // Called when our frame rect changes (or the rect/scroll position of an anc
estor changes). | 607 // Called when our frame rect changes (or the rect/scroll position of an anc
estor changes). |
| 608 virtual void frameRectsChanged() override; | 608 virtual void frameRectsChanged() override; |
| 609 | 609 |
| 610 friend class RenderPart; | 610 friend class RenderPart; |
| 611 | 611 |
| 612 bool contentsInCompositedLayer() const; | 612 bool contentsInCompositedLayer() const; |
| 613 | 613 |
| 614 void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMo
de, ScrollbarMode& vMode); | 614 void applyOverflowToViewportAndSetRenderer(LayoutObject*, ScrollbarMode& hMo
de, ScrollbarMode& vMode); |
| 615 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); | 615 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); |
| 616 | 616 |
| 617 void updateCounters(); | 617 void updateCounters(); |
| 618 void forceLayoutParentViewIfNeeded(); | 618 void forceLayoutParentViewIfNeeded(); |
| 619 void performPreLayoutTasks(); | 619 void performPreLayoutTasks(); |
| 620 void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout); | 620 void performLayout(LayoutObject* rootForThisLayout, bool inSubtreeLayout); |
| 621 void scheduleOrPerformPostLayoutTasks(); | 621 void scheduleOrPerformPostLayoutTasks(); |
| 622 void performPostLayoutTasks(); | 622 void performPostLayoutTasks(); |
| 623 | 623 |
| 624 void invalidateTreeIfNeeded(); | 624 void invalidateTreeIfNeeded(); |
| 625 | 625 |
| 626 void gatherDebugLayoutRects(RenderObject* layoutRoot); | 626 void gatherDebugLayoutRects(LayoutObject* layoutRoot); |
| 627 | 627 |
| 628 DocumentLifecycle& lifecycle() const; | 628 DocumentLifecycle& lifecycle() const; |
| 629 | 629 |
| 630 void contentRectangleForPaintInvalidation(const IntRect&); | 630 void contentRectangleForPaintInvalidation(const IntRect&); |
| 631 virtual void contentsResized() override; | 631 virtual void contentsResized() override; |
| 632 void scrollbarExistenceDidChange(); | 632 void scrollbarExistenceDidChange(); |
| 633 | 633 |
| 634 // 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 |
| 635 // take transforms into account. | 635 // take transforms into account. |
| 636 virtual IntRect convertToContainingView(const IntRect&) const override; | 636 virtual IntRect convertToContainingView(const IntRect&) const override; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 RefPtrWillBeMember<LocalFrame> m_frame; | 716 RefPtrWillBeMember<LocalFrame> m_frame; |
| 717 | 717 |
| 718 WebDisplayMode m_displayMode; | 718 WebDisplayMode m_displayMode; |
| 719 | 719 |
| 720 bool m_doFullPaintInvalidation; | 720 bool m_doFullPaintInvalidation; |
| 721 | 721 |
| 722 bool m_canHaveScrollbars; | 722 bool m_canHaveScrollbars; |
| 723 unsigned m_slowRepaintObjectCount; | 723 unsigned m_slowRepaintObjectCount; |
| 724 | 724 |
| 725 bool m_hasPendingLayout; | 725 bool m_hasPendingLayout; |
| 726 RenderObject* m_layoutSubtreeRoot; | 726 LayoutObject* m_layoutSubtreeRoot; |
| 727 | 727 |
| 728 bool m_layoutSchedulingEnabled; | 728 bool m_layoutSchedulingEnabled; |
| 729 bool m_inPerformLayout; | 729 bool m_inPerformLayout; |
| 730 bool m_canInvalidatePaintDuringPerformLayout; | 730 bool m_canInvalidatePaintDuringPerformLayout; |
| 731 bool m_inSynchronousPostLayout; | 731 bool m_inSynchronousPostLayout; |
| 732 int m_layoutCount; | 732 int m_layoutCount; |
| 733 unsigned m_nestedLayoutCount; | 733 unsigned m_nestedLayoutCount; |
| 734 Timer<FrameView> m_postLayoutTasksTimer; | 734 Timer<FrameView> m_postLayoutTasksTimer; |
| 735 Timer<FrameView> m_updateWidgetsTimer; | 735 Timer<FrameView> m_updateWidgetsTimer; |
| 736 bool m_firstLayoutCallbackPending; | 736 bool m_firstLayoutCallbackPending; |
| 737 | 737 |
| 738 bool m_firstLayout; | 738 bool m_firstLayout; |
| 739 bool m_isTransparent; | 739 bool m_isTransparent; |
| 740 Color m_baseBackgroundColor; | 740 Color m_baseBackgroundColor; |
| 741 IntSize m_lastViewportSize; | 741 IntSize m_lastViewportSize; |
| 742 float m_lastZoomFactor; | 742 float m_lastZoomFactor; |
| 743 | 743 |
| 744 AtomicString m_mediaType; | 744 AtomicString m_mediaType; |
| 745 AtomicString m_mediaTypeWhenNotPrinting; | 745 AtomicString m_mediaTypeWhenNotPrinting; |
| 746 | 746 |
| 747 bool m_overflowStatusDirty; | 747 bool m_overflowStatusDirty; |
| 748 bool m_horizontalOverflow; | 748 bool m_horizontalOverflow; |
| 749 bool m_verticalOverflow; | 749 bool m_verticalOverflow; |
| 750 RenderObject* m_viewportRenderer; | 750 LayoutObject* m_viewportRenderer; |
| 751 | 751 |
| 752 bool m_wasScrolledByUser; | 752 bool m_wasScrolledByUser; |
| 753 bool m_inProgrammaticScroll; | 753 bool m_inProgrammaticScroll; |
| 754 bool m_safeToPropagateScrollToParent; | 754 bool m_safeToPropagateScrollToParent; |
| 755 | 755 |
| 756 double m_lastPaintTime; | 756 double m_lastPaintTime; |
| 757 | 757 |
| 758 bool m_isTrackingPaintInvalidations; // Used for testing. | 758 bool m_isTrackingPaintInvalidations; // Used for testing. |
| 759 Vector<IntRect> m_trackedPaintInvalidationRects; | 759 Vector<IntRect> m_trackedPaintInvalidationRects; |
| 760 | 760 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 } | 873 } |
| 874 | 874 |
| 875 private: | 875 private: |
| 876 RawPtrWillBeMember<FrameView> m_view; | 876 RawPtrWillBeMember<FrameView> m_view; |
| 877 bool m_originalValue; | 877 bool m_originalValue; |
| 878 }; | 878 }; |
| 879 | 879 |
| 880 } // namespace blink | 880 } // namespace blink |
| 881 | 881 |
| 882 #endif // FrameView_h | 882 #endif // FrameView_h |
| OLD | NEW |