| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 #include "core/paint/FramePainter.h" | 98 #include "core/paint/FramePainter.h" |
| 99 #include "core/paint/PaintLayer.h" | 99 #include "core/paint/PaintLayer.h" |
| 100 #include "core/paint/PaintTiming.h" | 100 #include "core/paint/PaintTiming.h" |
| 101 #include "core/paint/PrePaintTreeWalk.h" | 101 #include "core/paint/PrePaintTreeWalk.h" |
| 102 #include "core/plugins/PluginView.h" | 102 #include "core/plugins/PluginView.h" |
| 103 #include "core/probe/CoreProbes.h" | 103 #include "core/probe/CoreProbes.h" |
| 104 #include "core/style/ComputedStyle.h" | 104 #include "core/style/ComputedStyle.h" |
| 105 #include "core/svg/SVGDocumentExtensions.h" | 105 #include "core/svg/SVGDocumentExtensions.h" |
| 106 #include "core/svg/SVGSVGElement.h" | 106 #include "core/svg/SVGSVGElement.h" |
| 107 #include "platform/Histogram.h" | 107 #include "platform/Histogram.h" |
| 108 #include "platform/HostWindow.h" | |
| 109 #include "platform/Language.h" | 108 #include "platform/Language.h" |
| 109 #include "platform/PlatformChromeClient.h" |
| 110 #include "platform/RuntimeEnabledFeatures.h" | 110 #include "platform/RuntimeEnabledFeatures.h" |
| 111 #include "platform/ScriptForbiddenScope.h" | 111 #include "platform/ScriptForbiddenScope.h" |
| 112 #include "platform/WebFrameScheduler.h" | 112 #include "platform/WebFrameScheduler.h" |
| 113 #include "platform/fonts/FontCache.h" | 113 #include "platform/fonts/FontCache.h" |
| 114 #include "platform/geometry/DoubleRect.h" | 114 #include "platform/geometry/DoubleRect.h" |
| 115 #include "platform/geometry/FloatRect.h" | 115 #include "platform/geometry/FloatRect.h" |
| 116 #include "platform/geometry/LayoutRect.h" | 116 #include "platform/geometry/LayoutRect.h" |
| 117 #include "platform/geometry/TransformState.h" | 117 #include "platform/geometry/TransformState.h" |
| 118 #include "platform/graphics/GraphicsContext.h" | 118 #include "platform/graphics/GraphicsContext.h" |
| 119 #include "platform/graphics/GraphicsLayer.h" | 119 #include "platform/graphics/GraphicsLayer.h" |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 #endif | 391 #endif |
| 392 } | 392 } |
| 393 | 393 |
| 394 void FrameView::DetachScrollbars() { | 394 void FrameView::DetachScrollbars() { |
| 395 // Previously, we detached custom scrollbars as early as possible to prevent | 395 // Previously, we detached custom scrollbars as early as possible to prevent |
| 396 // Document::detachLayoutTree() from messing with the view such that its | 396 // Document::detachLayoutTree() from messing with the view such that its |
| 397 // scroll bars won't be torn down. However, scripting in | 397 // scroll bars won't be torn down. However, scripting in |
| 398 // Document::detachLayoutTree() is forbidden | 398 // Document::detachLayoutTree() is forbidden |
| 399 // now, so it's not clear if these edge cases can still happen. | 399 // now, so it's not clear if these edge cases can still happen. |
| 400 // However, for Oilpan, we still need to remove the native scrollbars before | 400 // However, for Oilpan, we still need to remove the native scrollbars before |
| 401 // we lose the connection to the HostWindow, so we just unconditionally | 401 // we lose the connection to the ChromeClient, so we just unconditionally |
| 402 // detach any scrollbars now. | 402 // detach any scrollbars now. |
| 403 scrollbar_manager_.Dispose(); | 403 scrollbar_manager_.Dispose(); |
| 404 | 404 |
| 405 if (scroll_corner_) { | 405 if (scroll_corner_) { |
| 406 scroll_corner_->Destroy(); | 406 scroll_corner_->Destroy(); |
| 407 scroll_corner_ = nullptr; | 407 scroll_corner_ = nullptr; |
| 408 } | 408 } |
| 409 } | 409 } |
| 410 | 410 |
| 411 void FrameView::ScrollbarManager::SetHasHorizontalScrollbar( | 411 void FrameView::ScrollbarManager::SetHasHorizontalScrollbar( |
| (...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2118 // though no frame has focus yet. If this is not desired, then the | 2118 // though no frame has focus yet. If this is not desired, then the |
| 2119 // expectation needs to be removed from the test. | 2119 // expectation needs to be removed from the test. |
| 2120 local_frame = frame_->LocalFrameRoot(); | 2120 local_frame = frame_->LocalFrameRoot(); |
| 2121 } | 2121 } |
| 2122 | 2122 |
| 2123 if (local_frame) | 2123 if (local_frame) |
| 2124 page->GetChromeClient().ClearCompositedSelection(local_frame); | 2124 page->GetChromeClient().ClearCompositedSelection(local_frame); |
| 2125 } | 2125 } |
| 2126 } | 2126 } |
| 2127 | 2127 |
| 2128 HostWindow* FrameView::GetHostWindow() const { | 2128 PlatformChromeClient* FrameView::GetChromeClient() const { |
| 2129 Page* page = GetFrame().GetPage(); | 2129 Page* page = GetFrame().GetPage(); |
| 2130 if (!page) | 2130 if (!page) |
| 2131 return nullptr; | 2131 return nullptr; |
| 2132 return &page->GetChromeClient(); | 2132 return &page->GetChromeClient(); |
| 2133 } | 2133 } |
| 2134 | 2134 |
| 2135 void FrameView::ContentsResized() { | 2135 void FrameView::ContentsResized() { |
| 2136 if (frame_->IsMainFrame() && frame_->GetDocument()) { | 2136 if (frame_->IsMainFrame() && frame_->GetDocument()) { |
| 2137 if (TextAutosizer* text_autosizer = | 2137 if (TextAutosizer* text_autosizer = |
| 2138 frame_->GetDocument()->GetTextAutosizer()) | 2138 frame_->GetDocument()->GetTextAutosizer()) |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2741 // FIXME: Why does this only apply to the main frame? | 2741 // FIXME: Why does this only apply to the main frame? |
| 2742 if (!frame_->IsMainFrame()) | 2742 if (!frame_->IsMainFrame()) |
| 2743 return; | 2743 return; |
| 2744 AdjustScrollbarOpacity(); | 2744 AdjustScrollbarOpacity(); |
| 2745 ContentsResized(); | 2745 ContentsResized(); |
| 2746 UpdateScrollbars(); | 2746 UpdateScrollbars(); |
| 2747 PositionScrollbarLayers(); | 2747 PositionScrollbarLayers(); |
| 2748 } | 2748 } |
| 2749 | 2749 |
| 2750 bool FrameView::ScheduleAnimation() { | 2750 bool FrameView::ScheduleAnimation() { |
| 2751 if (HostWindow* window = GetHostWindow()) { | 2751 if (PlatformChromeClient* client = GetChromeClient()) { |
| 2752 window->ScheduleAnimation(frame_); | 2752 client->ScheduleAnimation(frame_); |
| 2753 return true; | 2753 return true; |
| 2754 } | 2754 } |
| 2755 return false; | 2755 return false; |
| 2756 } | 2756 } |
| 2757 | 2757 |
| 2758 void FrameView::NotifyPageThatContentAreaWillPaint() const { | 2758 void FrameView::NotifyPageThatContentAreaWillPaint() const { |
| 2759 Page* page = frame_->GetPage(); | 2759 Page* page = frame_->GetPage(); |
| 2760 if (!page) | 2760 if (!page) |
| 2761 return; | 2761 return; |
| 2762 | 2762 |
| (...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4376 void FrameView::ScrollContentsIfNeeded() { | 4376 void FrameView::ScrollContentsIfNeeded() { |
| 4377 if (pending_scroll_delta_.IsZero()) | 4377 if (pending_scroll_delta_.IsZero()) |
| 4378 return; | 4378 return; |
| 4379 ScrollOffset scroll_delta = pending_scroll_delta_; | 4379 ScrollOffset scroll_delta = pending_scroll_delta_; |
| 4380 pending_scroll_delta_ = ScrollOffset(); | 4380 pending_scroll_delta_ = ScrollOffset(); |
| 4381 // FIXME: Change scrollContents() to take DoubleSize. crbug.com/414283. | 4381 // FIXME: Change scrollContents() to take DoubleSize. crbug.com/414283. |
| 4382 ScrollContents(FlooredIntSize(scroll_delta)); | 4382 ScrollContents(FlooredIntSize(scroll_delta)); |
| 4383 } | 4383 } |
| 4384 | 4384 |
| 4385 void FrameView::ScrollContents(const IntSize& scroll_delta) { | 4385 void FrameView::ScrollContents(const IntSize& scroll_delta) { |
| 4386 HostWindow* window = GetHostWindow(); | 4386 PlatformChromeClient* client = GetChromeClient(); |
| 4387 if (!window) | 4387 if (!client) |
| 4388 return; | 4388 return; |
| 4389 | 4389 |
| 4390 TRACE_EVENT0("blink", "FrameView::scrollContents"); | 4390 TRACE_EVENT0("blink", "FrameView::scrollContents"); |
| 4391 | 4391 |
| 4392 if (!ScrollContentsFastPath(-scroll_delta)) | 4392 if (!ScrollContentsFastPath(-scroll_delta)) |
| 4393 ScrollContentsSlowPath(); | 4393 ScrollContentsSlowPath(); |
| 4394 | 4394 |
| 4395 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && | 4395 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && |
| 4396 !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 4396 !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
| 4397 // Need to update scroll translation property. | 4397 // Need to update scroll translation property. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4479 | 4479 |
| 4480 IntPoint FrameView::ContentsToViewport( | 4480 IntPoint FrameView::ContentsToViewport( |
| 4481 const IntPoint& point_in_contents) const { | 4481 const IntPoint& point_in_contents) const { |
| 4482 IntPoint point_in_frame = ContentsToFrame(point_in_contents); | 4482 IntPoint point_in_frame = ContentsToFrame(point_in_contents); |
| 4483 IntPoint point_in_root_frame = ConvertToRootFrame(point_in_frame); | 4483 IntPoint point_in_root_frame = ConvertToRootFrame(point_in_frame); |
| 4484 return frame_->GetPage()->GetVisualViewport().RootFrameToViewport( | 4484 return frame_->GetPage()->GetVisualViewport().RootFrameToViewport( |
| 4485 point_in_root_frame); | 4485 point_in_root_frame); |
| 4486 } | 4486 } |
| 4487 | 4487 |
| 4488 IntRect FrameView::ContentsToScreen(const IntRect& rect) const { | 4488 IntRect FrameView::ContentsToScreen(const IntRect& rect) const { |
| 4489 HostWindow* window = GetHostWindow(); | 4489 PlatformChromeClient* client = GetChromeClient(); |
| 4490 if (!window) | 4490 if (!client) |
| 4491 return IntRect(); | 4491 return IntRect(); |
| 4492 return window->ViewportToScreen(ContentsToViewport(rect), this); | 4492 return client->ViewportToScreen(ContentsToViewport(rect), this); |
| 4493 } | 4493 } |
| 4494 | 4494 |
| 4495 IntPoint FrameView::SoonToBeRemovedUnscaledViewportToContents( | 4495 IntPoint FrameView::SoonToBeRemovedUnscaledViewportToContents( |
| 4496 const IntPoint& point_in_viewport) const { | 4496 const IntPoint& point_in_viewport) const { |
| 4497 IntPoint point_in_root_frame = FlooredIntPoint( | 4497 IntPoint point_in_root_frame = FlooredIntPoint( |
| 4498 frame_->GetPage()->GetVisualViewport().ViewportCSSPixelsToRootFrame( | 4498 frame_->GetPage()->GetVisualViewport().ViewportCSSPixelsToRootFrame( |
| 4499 point_in_viewport)); | 4499 point_in_viewport)); |
| 4500 IntPoint point_in_this_frame = ConvertFromRootFrame(point_in_root_frame); | 4500 IntPoint point_in_this_frame = ConvertFromRootFrame(point_in_root_frame); |
| 4501 return FrameToContents(point_in_this_frame); | 4501 return FrameToContents(point_in_this_frame); |
| 4502 } | 4502 } |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5346 std::unique_ptr<CompositorAnimationTimeline> timeline) { | 5346 std::unique_ptr<CompositorAnimationTimeline> timeline) { |
| 5347 animation_timeline_ = std::move(timeline); | 5347 animation_timeline_ = std::move(timeline); |
| 5348 } | 5348 } |
| 5349 | 5349 |
| 5350 void FrameView::SetAnimationHost( | 5350 void FrameView::SetAnimationHost( |
| 5351 std::unique_ptr<CompositorAnimationHost> host) { | 5351 std::unique_ptr<CompositorAnimationHost> host) { |
| 5352 animation_host_ = std::move(host); | 5352 animation_host_ = std::move(host); |
| 5353 } | 5353 } |
| 5354 | 5354 |
| 5355 LayoutUnit FrameView::CaretWidth() const { | 5355 LayoutUnit FrameView::CaretWidth() const { |
| 5356 return LayoutUnit(GetHostWindow()->WindowToViewportScalar(1)); | 5356 return LayoutUnit(GetChromeClient()->WindowToViewportScalar(1)); |
| 5357 } | 5357 } |
| 5358 | 5358 |
| 5359 } // namespace blink | 5359 } // namespace blink |
| OLD | NEW |