OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 #include "core/page/Page.h" | 94 #include "core/page/Page.h" |
95 #include "core/page/PrintContext.h" | 95 #include "core/page/PrintContext.h" |
96 #include "core/page/scrolling/RootScrollerUtil.h" | 96 #include "core/page/scrolling/RootScrollerUtil.h" |
97 #include "core/page/scrolling/ScrollingCoordinator.h" | 97 #include "core/page/scrolling/ScrollingCoordinator.h" |
98 #include "core/page/scrolling/TopDocumentRootScrollerController.h" | 98 #include "core/page/scrolling/TopDocumentRootScrollerController.h" |
99 #include "core/paint/BlockPaintInvalidator.h" | 99 #include "core/paint/BlockPaintInvalidator.h" |
100 #include "core/paint/FramePainter.h" | 100 #include "core/paint/FramePainter.h" |
101 #include "core/paint/PaintLayer.h" | 101 #include "core/paint/PaintLayer.h" |
102 #include "core/paint/PaintTiming.h" | 102 #include "core/paint/PaintTiming.h" |
103 #include "core/paint/PrePaintTreeWalk.h" | 103 #include "core/paint/PrePaintTreeWalk.h" |
104 #include "core/plugins/PluginView.h" | |
105 #include "core/style/ComputedStyle.h" | 104 #include "core/style/ComputedStyle.h" |
106 #include "core/svg/SVGDocumentExtensions.h" | 105 #include "core/svg/SVGDocumentExtensions.h" |
107 #include "core/svg/SVGSVGElement.h" | 106 #include "core/svg/SVGSVGElement.h" |
108 #include "platform/Histogram.h" | 107 #include "platform/Histogram.h" |
109 #include "platform/HostWindow.h" | 108 #include "platform/HostWindow.h" |
110 #include "platform/RuntimeEnabledFeatures.h" | 109 #include "platform/RuntimeEnabledFeatures.h" |
111 #include "platform/ScriptForbiddenScope.h" | 110 #include "platform/ScriptForbiddenScope.h" |
112 #include "platform/WebFrameScheduler.h" | 111 #include "platform/WebFrameScheduler.h" |
113 #include "platform/fonts/FontCache.h" | 112 #include "platform/fonts/FontCache.h" |
114 #include "platform/geometry/DoubleRect.h" | 113 #include "platform/geometry/DoubleRect.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
231 ASSERT(m_hasBeenDisposed); | 230 ASSERT(m_hasBeenDisposed); |
232 } | 231 } |
233 | 232 |
234 DEFINE_TRACE(FrameView) { | 233 DEFINE_TRACE(FrameView) { |
235 visitor->trace(m_frame); | 234 visitor->trace(m_frame); |
236 visitor->trace(m_fragmentAnchor); | 235 visitor->trace(m_fragmentAnchor); |
237 visitor->trace(m_scrollableAreas); | 236 visitor->trace(m_scrollableAreas); |
238 visitor->trace(m_animatingScrollableAreas); | 237 visitor->trace(m_animatingScrollableAreas); |
239 visitor->trace(m_autoSizeInfo); | 238 visitor->trace(m_autoSizeInfo); |
240 visitor->trace(m_children); | 239 visitor->trace(m_children); |
240 visitor->trace(m_plugins); | |
241 visitor->trace(m_viewportScrollableArea); | 241 visitor->trace(m_viewportScrollableArea); |
242 visitor->trace(m_visibilityObserver); | 242 visitor->trace(m_visibilityObserver); |
243 visitor->trace(m_scrollAnchor); | 243 visitor->trace(m_scrollAnchor); |
244 visitor->trace(m_anchoringAdjustmentQueue); | 244 visitor->trace(m_anchoringAdjustmentQueue); |
245 visitor->trace(m_scrollbarManager); | 245 visitor->trace(m_scrollbarManager); |
246 visitor->trace(m_printContext); | 246 visitor->trace(m_printContext); |
247 FrameViewBase::trace(visitor); | 247 FrameViewBase::trace(visitor); |
248 ScrollableArea::trace(visitor); | 248 ScrollableArea::trace(visitor); |
249 } | 249 } |
250 | 250 |
(...skipping 3062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3313 if (needsLayout()) | 3313 if (needsLayout()) |
3314 layout(); | 3314 layout(); |
3315 | 3315 |
3316 checkDoesNotNeedLayout(); | 3316 checkDoesNotNeedLayout(); |
3317 | 3317 |
3318 // WebView plugins need to update regardless of whether the | 3318 // WebView plugins need to update regardless of whether the |
3319 // LayoutEmbeddedObject that owns them needed layout. | 3319 // LayoutEmbeddedObject that owns them needed layout. |
3320 // TODO(leviw): This currently runs the entire lifecycle on plugin WebViews. | 3320 // TODO(leviw): This currently runs the entire lifecycle on plugin WebViews. |
3321 // We should have a way to only run these other Documents to the same | 3321 // We should have a way to only run these other Documents to the same |
3322 // lifecycle stage as this frame. | 3322 // lifecycle stage as this frame. |
3323 const ChildrenSet* viewChildren = children(); | 3323 for (const Member<PluginView>& plugin : *plugins()) { |
3324 for (const Member<FrameViewBase>& child : *viewChildren) { | 3324 plugin->updateAllLifecyclePhases(); |
3325 if ((*child).isPluginContainer()) | |
3326 toPluginView(child.get())->updateAllLifecyclePhases(); | |
3327 } | 3325 } |
3328 checkDoesNotNeedLayout(); | 3326 checkDoesNotNeedLayout(); |
3329 | 3327 |
3330 // FIXME: Calling layout() shouldn't trigger script execution or have any | 3328 // FIXME: Calling layout() shouldn't trigger script execution or have any |
3331 // observable effects on the frame tree but we're not quite there yet. | 3329 // observable effects on the frame tree but we're not quite there yet. |
3332 HeapVector<Member<FrameView>> frameViews; | 3330 HeapVector<Member<FrameView>> frameViews; |
3333 for (Frame* child = m_frame->tree().firstChild(); child; | 3331 for (Frame* child = m_frame->tree().firstChild(); child; |
3334 child = child->tree().nextSibling()) { | 3332 child = child->tree().nextSibling()) { |
3335 if (!child->isLocalFrame()) | 3333 if (!child->isLocalFrame()) |
3336 continue; | 3334 continue; |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3777 ASSERT(child->parent() == this); | 3775 ASSERT(child->parent() == this); |
3778 | 3776 |
3779 if (child->isFrameView() && | 3777 if (child->isFrameView() && |
3780 !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) | 3778 !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) |
3781 removeScrollableArea(toFrameView(child)); | 3779 removeScrollableArea(toFrameView(child)); |
3782 | 3780 |
3783 child->setParent(0); | 3781 child->setParent(0); |
3784 m_children.erase(child); | 3782 m_children.erase(child); |
3785 } | 3783 } |
3786 | 3784 |
3785 void FrameView::removePlugin(PluginView* plugin) { | |
3786 m_plugins.erase(plugin); | |
haraken
2017/03/28 07:39:41
DCHECK(m_plugins.contains(plugin));
joelhockey
2017/03/28 22:56:23
Done
| |
3787 } | |
3788 | |
3789 void FrameView::addPlugin(PluginView* plugin) { | |
3790 m_plugins.insert(plugin); | |
haraken
2017/03/28 07:39:41
DCHECK(!m_plugins.contains(plugin));
joelhockey
2017/03/28 22:56:23
Done
| |
3791 } | |
3792 | |
3787 bool FrameView::visualViewportSuppliesScrollbars() { | 3793 bool FrameView::visualViewportSuppliesScrollbars() { |
3788 // On desktop, we always use the layout viewport's scrollbars. | 3794 // On desktop, we always use the layout viewport's scrollbars. |
3789 if (!m_frame->settings() || !m_frame->settings()->getViewportEnabled() || | 3795 if (!m_frame->settings() || !m_frame->settings()->getViewportEnabled() || |
3790 !m_frame->document() || !m_frame->page()) | 3796 !m_frame->document() || !m_frame->page()) |
3791 return false; | 3797 return false; |
3792 | 3798 |
3793 const TopDocumentRootScrollerController& controller = | 3799 const TopDocumentRootScrollerController& controller = |
3794 m_frame->page()->globalRootScrollerController(); | 3800 m_frame->page()->globalRootScrollerController(); |
3795 | 3801 |
3796 if (!layoutViewportScrollableArea()) | 3802 if (!layoutViewportScrollableArea()) |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3863 page->globalRootScrollerController(); | 3869 page->globalRootScrollerController(); |
3864 if (layoutViewport == controller.rootScrollerArea()) | 3870 if (layoutViewport == controller.rootScrollerArea()) |
3865 visibleSize = controller.rootScrollerVisibleArea(); | 3871 visibleSize = controller.rootScrollerVisibleArea(); |
3866 | 3872 |
3867 IntSize maximumOffset = | 3873 IntSize maximumOffset = |
3868 toIntSize(-scrollOrigin() + (contentBounds - visibleSize)); | 3874 toIntSize(-scrollOrigin() + (contentBounds - visibleSize)); |
3869 return maximumOffset.expandedTo(minimumScrollOffsetInt()); | 3875 return maximumOffset.expandedTo(minimumScrollOffsetInt()); |
3870 } | 3876 } |
3871 | 3877 |
3872 void FrameView::addChild(FrameViewBase* child) { | 3878 void FrameView::addChild(FrameViewBase* child) { |
3873 ASSERT(child != this && !child->parent()); | 3879 DCHECK(child != this && !child->parent()); |
3880 DCHECK(!child->isPluginView()); | |
3874 child->setParent(this); | 3881 child->setParent(this); |
3875 m_children.insert(child); | 3882 m_children.insert(child); |
3876 } | 3883 } |
3877 | 3884 |
3878 void FrameView::setScrollbarModes(ScrollbarMode horizontalMode, | 3885 void FrameView::setScrollbarModes(ScrollbarMode horizontalMode, |
3879 ScrollbarMode verticalMode, | 3886 ScrollbarMode verticalMode, |
3880 bool horizontalLock, | 3887 bool horizontalLock, |
3881 bool verticalLock) { | 3888 bool verticalLock) { |
3882 bool needsUpdate = false; | 3889 bool needsUpdate = false; |
3883 | 3890 |
(...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5261 void FrameView::setAnimationHost( | 5268 void FrameView::setAnimationHost( |
5262 std::unique_ptr<CompositorAnimationHost> host) { | 5269 std::unique_ptr<CompositorAnimationHost> host) { |
5263 m_animationHost = std::move(host); | 5270 m_animationHost = std::move(host); |
5264 } | 5271 } |
5265 | 5272 |
5266 LayoutUnit FrameView::caretWidth() const { | 5273 LayoutUnit FrameView::caretWidth() const { |
5267 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); | 5274 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); |
5268 } | 5275 } |
5269 | 5276 |
5270 } // namespace blink | 5277 } // namespace blink |
OLD | NEW |