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 | 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
| 8 reserved. | 8 reserved. |
| 9 | 9 |
| 10 This library is free software; you can redistribute it and/or | 10 This library is free software; you can redistribute it and/or |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 int layoutCount() const { return m_layoutCount; } | 150 int layoutCount() const { return m_layoutCount; } |
| 151 | 151 |
| 152 void countObjectsNeedingLayout(unsigned& needsLayoutObjects, | 152 void countObjectsNeedingLayout(unsigned& needsLayoutObjects, |
| 153 unsigned& totalObjects, | 153 unsigned& totalObjects, |
| 154 bool& isPartial); | 154 bool& isPartial); |
| 155 | 155 |
| 156 bool needsLayout() const; | 156 bool needsLayout() const; |
| 157 bool checkDoesNotNeedLayout() const; | 157 bool checkDoesNotNeedLayout() const; |
| 158 void setNeedsLayout(); | 158 void setNeedsLayout(); |
| 159 | 159 |
| 160 void setNeedsUpdateWidgetGeometries() { | 160 void setNeedsUpdateFrameViewBaseGeometries() { |
|
haraken
2017/03/03 19:07:34
This sounds a bit too verbose. setNeedsUpdateGeome
joelhockey
2017/03/05 22:37:42
done
| |
| 161 m_needsUpdateWidgetGeometries = true; | 161 m_needsUpdateFrameViewBaseGeometries = true; |
| 162 } | 162 } |
| 163 | 163 |
| 164 // Methods for getting/setting the size Blink should use to layout the | 164 // Methods for getting/setting the size Blink should use to layout the |
| 165 // contents. | 165 // contents. |
| 166 // NOTE: Scrollbar exclusion is based on the FrameView's scrollbars. To | 166 // NOTE: Scrollbar exclusion is based on the FrameView's scrollbars. To |
| 167 // exclude scrollbars on the root PaintLayer, use LayoutView::layoutSize. | 167 // exclude scrollbars on the root PaintLayer, use LayoutView::layoutSize. |
| 168 IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const; | 168 IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const; |
| 169 void setLayoutSize(const IntSize&); | 169 void setLayoutSize(const IntSize&); |
| 170 | 170 |
| 171 // If this is set to false, the layout size will need to be explicitly set by | 171 // If this is set to false, the layout size will need to be explicitly set by |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 262 bool safeToPropagateScrollToParent() const { | 262 bool safeToPropagateScrollToParent() const { |
| 263 return m_safeToPropagateScrollToParent; | 263 return m_safeToPropagateScrollToParent; |
| 264 } | 264 } |
| 265 void setSafeToPropagateScrollToParent(bool isSafe) { | 265 void setSafeToPropagateScrollToParent(bool isSafe) { |
| 266 m_safeToPropagateScrollToParent = isSafe; | 266 m_safeToPropagateScrollToParent = isSafe; |
| 267 } | 267 } |
| 268 | 268 |
| 269 void addPart(LayoutPart*); | 269 void addPart(LayoutPart*); |
| 270 void removePart(LayoutPart*); | 270 void removePart(LayoutPart*); |
| 271 | 271 |
| 272 void updateWidgetGeometries(); | 272 void updateFrameViewBaseGeometries(); |
|
haraken
2017/03/03 19:07:34
updateGeometries ?
joelhockey
2017/03/05 22:37:42
done
| |
| 273 | 273 |
| 274 void addPartToUpdate(LayoutEmbeddedObject&); | 274 void addPartToUpdate(LayoutEmbeddedObject&); |
| 275 | 275 |
| 276 Color documentBackgroundColor() const; | 276 Color documentBackgroundColor() const; |
| 277 | 277 |
| 278 // Run all needed lifecycle stages. After calling this method, all frames will | 278 // Run all needed lifecycle stages. After calling this method, all frames will |
| 279 // be in the lifecycle state PaintInvalidationClean. If lifecycle throttling | 279 // be in the lifecycle state PaintInvalidationClean. If lifecycle throttling |
| 280 // is allowed (see DocumentLifecycle::AllowThrottlingScope), some frames may | 280 // is allowed (see DocumentLifecycle::AllowThrottlingScope), some frames may |
| 281 // skip the lifecycle update (e.g., based on visibility) and will not end up | 281 // skip the lifecycle update (e.g., based on visibility) and will not end up |
| 282 // being PaintInvalidationClean. | 282 // being PaintInvalidationClean. |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 435 bool shouldScrollOnMainThread() const override; | 435 bool shouldScrollOnMainThread() const override; |
| 436 PaintLayer* layer() const override; | 436 PaintLayer* layer() const override; |
| 437 GraphicsLayer* layerForScrolling() const override; | 437 GraphicsLayer* layerForScrolling() const override; |
| 438 GraphicsLayer* layerForHorizontalScrollbar() const override; | 438 GraphicsLayer* layerForHorizontalScrollbar() const override; |
| 439 GraphicsLayer* layerForVerticalScrollbar() const override; | 439 GraphicsLayer* layerForVerticalScrollbar() const override; |
| 440 GraphicsLayer* layerForScrollCorner() const override; | 440 GraphicsLayer* layerForScrollCorner() const override; |
| 441 int scrollSize(ScrollbarOrientation) const override; | 441 int scrollSize(ScrollbarOrientation) const override; |
| 442 bool isScrollCornerVisible() const override; | 442 bool isScrollCornerVisible() const override; |
| 443 bool userInputScrollable(ScrollbarOrientation) const override; | 443 bool userInputScrollable(ScrollbarOrientation) const override; |
| 444 bool shouldPlaceVerticalScrollbarOnLeft() const override; | 444 bool shouldPlaceVerticalScrollbarOnLeft() const override; |
| 445 FrameViewBase* getWidget() override; | 445 FrameViewBase* getFrameViewBase() override; |
| 446 CompositorAnimationHost* compositorAnimationHost() const override; | 446 CompositorAnimationHost* compositorAnimationHost() const override; |
| 447 CompositorAnimationTimeline* compositorAnimationTimeline() const override; | 447 CompositorAnimationTimeline* compositorAnimationTimeline() const override; |
| 448 LayoutBox* layoutBox() const override; | 448 LayoutBox* layoutBox() const override; |
| 449 FloatQuad localToVisibleContentQuad(const FloatQuad&, | 449 FloatQuad localToVisibleContentQuad(const FloatQuad&, |
| 450 const LayoutObject*, | 450 const LayoutObject*, |
| 451 unsigned = 0) const final; | 451 unsigned = 0) const final; |
| 452 RefPtr<WebTaskRunner> getTimerTaskRunner() const final; | 452 RefPtr<WebTaskRunner> getTimerTaskRunner() const final; |
| 453 | 453 |
| 454 LayoutRect scrollIntoView(const LayoutRect& rectInContent, | 454 LayoutRect scrollIntoView(const LayoutRect& rectInContent, |
| 455 const ScrollAlignment& alignX, | 455 const ScrollAlignment& alignX, |
| 456 const ScrollAlignment& alignY, | 456 const ScrollAlignment& alignY, |
| 457 ScrollType = ProgrammaticScroll) override; | 457 ScrollType = ProgrammaticScroll) override; |
| 458 | 458 |
| 459 // The window that hosts the FrameView. The FrameView will communicate scrolls | 459 // The window that hosts the FrameView. The FrameView will communicate scrolls |
| 460 // and repaints to the host window in the window's coordinate space. | 460 // and repaints to the host window in the window's coordinate space. |
| 461 HostWindow* getHostWindow() const; | 461 HostWindow* getHostWindow() const; |
| 462 | 462 |
| 463 typedef HeapHashSet<Member<FrameViewBase>> ChildrenWidgetSet; | 463 typedef HeapHashSet<Member<FrameViewBase>> ChildrenFrameViewBaseSet; |
| 464 | 464 |
| 465 // Functions for child manipulation and inspection. | 465 // Functions for child manipulation and inspection. |
| 466 void setParent(FrameViewBase*) override; | 466 void setParent(FrameViewBase*) override; |
| 467 void removeChild(FrameViewBase*); | 467 void removeChild(FrameViewBase*); |
| 468 void addChild(FrameViewBase*); | 468 void addChild(FrameViewBase*); |
| 469 const ChildrenWidgetSet* children() const { return &m_children; } | 469 const ChildrenFrameViewBaseSet* children() const { return &m_children; } |
| 470 | 470 |
| 471 // If the scroll view does not use a native widget, then it will have | 471 // If the scroll view does not use a native widget, then it will have |
| 472 // cross-platform Scrollbars. These functions can be used to obtain those | 472 // cross-platform Scrollbars. These functions can be used to obtain those |
| 473 // scrollbars. | 473 // scrollbars. |
| 474 Scrollbar* horizontalScrollbar() const override { | 474 Scrollbar* horizontalScrollbar() const override { |
| 475 return m_scrollbarManager.horizontalScrollbar(); | 475 return m_scrollbarManager.horizontalScrollbar(); |
| 476 } | 476 } |
| 477 Scrollbar* verticalScrollbar() const override { | 477 Scrollbar* verticalScrollbar() const override { |
| 478 return m_scrollbarManager.verticalScrollbar(); | 478 return m_scrollbarManager.verticalScrollbar(); |
| 479 } | 479 } |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 639 // FrameViewBase overrides to ensure that our children's visibility status is | 639 // FrameViewBase overrides to ensure that our children's visibility status is |
| 640 // kept up to date when we get shown and hidden. | 640 // kept up to date when we get shown and hidden. |
| 641 void show() override; | 641 void show() override; |
| 642 void hide() override; | 642 void hide() override; |
| 643 void setParentVisible(bool) override; | 643 void setParentVisible(bool) override; |
| 644 | 644 |
| 645 bool isPointInScrollbarCorner(const IntPoint&); | 645 bool isPointInScrollbarCorner(const IntPoint&); |
| 646 bool scrollbarCornerPresent() const; | 646 bool scrollbarCornerPresent() const; |
| 647 IntRect scrollCornerRect() const override; | 647 IntRect scrollCornerRect() const override; |
| 648 | 648 |
| 649 IntRect convertFromScrollbarToContainingWidget(const Scrollbar&, | 649 IntRect convertFromScrollbarToContainingFrameViewBase( |
| 650 const IntRect&) const override; | 650 const Scrollbar&, |
| 651 IntRect convertFromContainingWidgetToScrollbar(const Scrollbar&, | 651 const IntRect&) const override; |
| 652 const IntRect&) const override; | 652 IntRect convertFromContainingFrameViewBaseToScrollbar( |
| 653 IntPoint convertFromScrollbarToContainingWidget( | 653 const Scrollbar&, |
| 654 const IntRect&) const override; | |
| 655 IntPoint convertFromScrollbarToContainingFrameViewBase( | |
| 654 const Scrollbar&, | 656 const Scrollbar&, |
| 655 const IntPoint&) const override; | 657 const IntPoint&) const override; |
| 656 IntPoint convertFromContainingWidgetToScrollbar( | 658 IntPoint convertFromContainingFrameViewBaseToScrollbar( |
|
haraken
2017/03/03 19:07:34
Instead of renaming methods on a per-file basis, i
joelhockey
2017/03/05 22:37:42
Acknowledged. I'll try and use the approach for o
| |
| 657 const Scrollbar&, | 659 const Scrollbar&, |
| 658 const IntPoint&) const override; | 660 const IntPoint&) const override; |
| 659 | 661 |
| 660 bool isFrameView() const override { return true; } | 662 bool isFrameView() const override { return true; } |
| 661 | 663 |
| 662 DECLARE_VIRTUAL_TRACE(); | 664 DECLARE_VIRTUAL_TRACE(); |
| 663 void notifyPageThatContentAreaWillPaint() const; | 665 void notifyPageThatContentAreaWillPaint() const; |
| 664 FrameView* parentFrameView() const; | 666 FrameView* parentFrameView() const; |
| 665 | 667 |
| 666 // Returns the scrollable area for the frame. For the root frame, this will | 668 // Returns the scrollable area for the frame. For the root frame, this will |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 954 | 956 |
| 955 // Override FrameViewBase methods to do point conversion via layoutObjects, in | 957 // Override FrameViewBase methods to do point conversion via layoutObjects, in |
| 956 // order to take transforms into account. | 958 // order to take transforms into account. |
| 957 IntRect convertToContainingFrameViewBase(const IntRect&) const override; | 959 IntRect convertToContainingFrameViewBase(const IntRect&) const override; |
| 958 IntRect convertFromContainingFrameViewBase(const IntRect&) const override; | 960 IntRect convertFromContainingFrameViewBase(const IntRect&) const override; |
| 959 IntPoint convertToContainingFrameViewBase(const IntPoint&) const override; | 961 IntPoint convertToContainingFrameViewBase(const IntPoint&) const override; |
| 960 IntPoint convertFromContainingFrameViewBase(const IntPoint&) const override; | 962 IntPoint convertFromContainingFrameViewBase(const IntPoint&) const override; |
| 961 | 963 |
| 962 void didChangeGlobalRootScroller() override; | 964 void didChangeGlobalRootScroller() override; |
| 963 | 965 |
| 964 void updateWidgetGeometriesIfNeeded(); | 966 void updateFrameViewBaseGeometriesIfNeeded(); |
| 965 | 967 |
| 966 bool wasViewportResized(); | 968 bool wasViewportResized(); |
| 967 void sendResizeEventIfNeeded(); | 969 void sendResizeEventIfNeeded(); |
| 968 | 970 |
| 969 void updateParentScrollableAreaSet(); | 971 void updateParentScrollableAreaSet(); |
| 970 | 972 |
| 971 void scheduleUpdateWidgetsIfNecessary(); | 973 void scheduleUpdateFrameViewBasesIfNecessary(); |
| 972 void updateWidgetsTimerFired(TimerBase*); | 974 void updateFrameViewBasesTimerFired(TimerBase*); |
| 973 bool updateWidgets(); | 975 bool updateFrameViewBases(); |
| 974 | 976 |
| 975 bool processUrlFragmentHelper(const String&, UrlFragmentBehavior); | 977 bool processUrlFragmentHelper(const String&, UrlFragmentBehavior); |
| 976 void setFragmentAnchor(Node*); | 978 void setFragmentAnchor(Node*); |
| 977 void scrollToFragmentAnchor(); | 979 void scrollToFragmentAnchor(); |
| 978 void didScrollTimerFired(TimerBase*); | 980 void didScrollTimerFired(TimerBase*); |
| 979 | 981 |
| 980 void updateLayersAndCompositingAfterScrollIfNeeded(); | 982 void updateLayersAndCompositingAfterScrollIfNeeded(); |
| 981 | 983 |
| 982 static bool computeCompositedSelection(LocalFrame&, CompositedSelection&); | 984 static bool computeCompositedSelection(LocalFrame&, CompositedSelection&); |
| 983 void updateCompositedSelectionIfNeeded(); | 985 void updateCompositedSelectionIfNeeded(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1068 | 1070 |
| 1069 bool m_hasPendingLayout; | 1071 bool m_hasPendingLayout; |
| 1070 LayoutSubtreeRootList m_layoutSubtreeRootList; | 1072 LayoutSubtreeRootList m_layoutSubtreeRootList; |
| 1071 DepthOrderedLayoutObjectList m_orthogonalWritingModeRootList; | 1073 DepthOrderedLayoutObjectList m_orthogonalWritingModeRootList; |
| 1072 | 1074 |
| 1073 bool m_layoutSchedulingEnabled; | 1075 bool m_layoutSchedulingEnabled; |
| 1074 bool m_inSynchronousPostLayout; | 1076 bool m_inSynchronousPostLayout; |
| 1075 int m_layoutCount; | 1077 int m_layoutCount; |
| 1076 unsigned m_nestedLayoutCount; | 1078 unsigned m_nestedLayoutCount; |
| 1077 TaskRunnerTimer<FrameView> m_postLayoutTasksTimer; | 1079 TaskRunnerTimer<FrameView> m_postLayoutTasksTimer; |
| 1078 TaskRunnerTimer<FrameView> m_updateWidgetsTimer; | 1080 TaskRunnerTimer<FrameView> m_updateFrameViewBasesTimer; |
| 1079 | 1081 |
| 1080 bool m_firstLayout; | 1082 bool m_firstLayout; |
| 1081 bool m_isTransparent; | 1083 bool m_isTransparent; |
| 1082 Color m_baseBackgroundColor; | 1084 Color m_baseBackgroundColor; |
| 1083 IntSize m_lastViewportSize; | 1085 IntSize m_lastViewportSize; |
| 1084 float m_lastZoomFactor; | 1086 float m_lastZoomFactor; |
| 1085 | 1087 |
| 1086 AtomicString m_mediaType; | 1088 AtomicString m_mediaType; |
| 1087 AtomicString m_mediaTypeWhenNotPrinting; | 1089 AtomicString m_mediaTypeWhenNotPrinting; |
| 1088 | 1090 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 1110 float m_inputEventsScaleFactorForEmulation; | 1112 float m_inputEventsScaleFactorForEmulation; |
| 1111 | 1113 |
| 1112 IntSize m_layoutSize; | 1114 IntSize m_layoutSize; |
| 1113 IntSize m_initialViewportSize; | 1115 IntSize m_initialViewportSize; |
| 1114 bool m_layoutSizeFixedToFrameSize; | 1116 bool m_layoutSizeFixedToFrameSize; |
| 1115 | 1117 |
| 1116 TaskRunnerTimer<FrameView> m_didScrollTimer; | 1118 TaskRunnerTimer<FrameView> m_didScrollTimer; |
| 1117 | 1119 |
| 1118 Vector<IntRect> m_tickmarks; | 1120 Vector<IntRect> m_tickmarks; |
| 1119 | 1121 |
| 1120 bool m_needsUpdateWidgetGeometries; | 1122 bool m_needsUpdateFrameViewBaseGeometries; |
| 1121 | 1123 |
| 1122 #if DCHECK_IS_ON() | 1124 #if DCHECK_IS_ON() |
| 1123 // Verified when finalizing. | 1125 // Verified when finalizing. |
| 1124 bool m_hasBeenDisposed = false; | 1126 bool m_hasBeenDisposed = false; |
| 1125 #endif | 1127 #endif |
| 1126 | 1128 |
| 1127 ScrollbarMode m_horizontalScrollbarMode; | 1129 ScrollbarMode m_horizontalScrollbarMode; |
| 1128 ScrollbarMode m_verticalScrollbarMode; | 1130 ScrollbarMode m_verticalScrollbarMode; |
| 1129 | 1131 |
| 1130 bool m_horizontalScrollbarLock; | 1132 bool m_horizontalScrollbarLock; |
| 1131 bool m_verticalScrollbarLock; | 1133 bool m_verticalScrollbarLock; |
| 1132 | 1134 |
| 1133 ChildrenWidgetSet m_children; | 1135 ChildrenFrameViewBaseSet m_children; |
| 1134 | 1136 |
| 1135 ScrollOffset m_pendingScrollDelta; | 1137 ScrollOffset m_pendingScrollDelta; |
| 1136 ScrollOffset m_scrollOffset; | 1138 ScrollOffset m_scrollOffset; |
| 1137 IntSize m_contentsSize; | 1139 IntSize m_contentsSize; |
| 1138 | 1140 |
| 1139 bool m_scrollbarsSuppressed; | 1141 bool m_scrollbarsSuppressed; |
| 1140 | 1142 |
| 1141 bool m_inUpdateScrollbars; | 1143 bool m_inUpdateScrollbars; |
| 1142 | 1144 |
| 1143 std::unique_ptr<LayoutAnalyzer> m_analyzer; | 1145 std::unique_ptr<LayoutAnalyzer> m_analyzer; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1260 frameViewBase.isFrameView()); | 1262 frameViewBase.isFrameView()); |
| 1261 DEFINE_TYPE_CASTS(FrameView, | 1263 DEFINE_TYPE_CASTS(FrameView, |
| 1262 ScrollableArea, | 1264 ScrollableArea, |
| 1263 scrollableArea, | 1265 scrollableArea, |
| 1264 scrollableArea->isFrameView(), | 1266 scrollableArea->isFrameView(), |
| 1265 scrollableArea.isFrameView()); | 1267 scrollableArea.isFrameView()); |
| 1266 | 1268 |
| 1267 } // namespace blink | 1269 } // namespace blink |
| 1268 | 1270 |
| 1269 #endif // FrameView_h | 1271 #endif // FrameView_h |
| OLD | NEW |