| 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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 // TODO(wjmaclean): find out why scrollbars fail to resize for complex | 535 // TODO(wjmaclean): find out why scrollbars fail to resize for complex |
| 536 // subframes after changing the zoom level. For now always calling | 536 // subframes after changing the zoom level. For now always calling |
| 537 // updateScrollbarsIfNeeded() here fixes the issue, but it would be good to | 537 // updateScrollbarsIfNeeded() here fixes the issue, but it would be good to |
| 538 // discover the deeper cause of this. http://crbug.com/607987. | 538 // discover the deeper cause of this. http://crbug.com/607987. |
| 539 updateScrollbarsIfNeeded(); | 539 updateScrollbarsIfNeeded(); |
| 540 | 540 |
| 541 frameRectsChanged(); | 541 frameRectsChanged(); |
| 542 | 542 |
| 543 updateParentScrollableAreaSet(); | 543 updateParentScrollableAreaSet(); |
| 544 | 544 |
| 545 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && |
| 546 !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
| 547 // The overflow clip property depends on the frame size and the pre |
| 548 // translation property depends on the frame location. |
| 549 setNeedsPaintPropertyUpdate(); |
| 550 } |
| 551 |
| 545 if (frameSizeChanged) { | 552 if (frameSizeChanged) { |
| 546 viewportSizeChanged(newRect.width() != oldRect.width(), | 553 viewportSizeChanged(newRect.width() != oldRect.width(), |
| 547 newRect.height() != oldRect.height()); | 554 newRect.height() != oldRect.height()); |
| 548 | 555 |
| 549 if (m_frame->isMainFrame()) | 556 if (m_frame->isMainFrame()) |
| 550 m_frame->host()->visualViewport().mainFrameDidChangeSize(); | 557 m_frame->host()->visualViewport().mainFrameDidChangeSize(); |
| 551 | 558 |
| 552 frame().loader().restoreScrollPositionAndViewState(); | 559 frame().loader().restoreScrollPositionAndViewState(); |
| 553 } | 560 } |
| 554 } | 561 } |
| (...skipping 3214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3769 if (!page || m_frame->eventHandler().isMousePositionUnknown()) | 3776 if (!page || m_frame->eventHandler().isMousePositionUnknown()) |
| 3770 return; | 3777 return; |
| 3771 page->chromeClient().setCursor(cursor, m_frame); | 3778 page->chromeClient().setCursor(cursor, m_frame); |
| 3772 } | 3779 } |
| 3773 | 3780 |
| 3774 void FrameView::frameRectsChanged() { | 3781 void FrameView::frameRectsChanged() { |
| 3775 TRACE_EVENT0("blink", "FrameView::frameRectsChanged"); | 3782 TRACE_EVENT0("blink", "FrameView::frameRectsChanged"); |
| 3776 if (layoutSizeFixedToFrameSize()) | 3783 if (layoutSizeFixedToFrameSize()) |
| 3777 setLayoutSizeInternal(frameRect().size()); | 3784 setLayoutSizeInternal(frameRect().size()); |
| 3778 | 3785 |
| 3779 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | |
| 3780 // The overflow clip property depends on the frame rect. | |
| 3781 setNeedsPaintPropertyUpdate(); | |
| 3782 } | |
| 3783 | |
| 3784 for (const auto& child : m_children) | 3786 for (const auto& child : m_children) |
| 3785 child->frameRectsChanged(); | 3787 child->frameRectsChanged(); |
| 3786 } | 3788 } |
| 3787 | 3789 |
| 3788 void FrameView::setLayoutSizeInternal(const IntSize& size) { | 3790 void FrameView::setLayoutSizeInternal(const IntSize& size) { |
| 3789 if (m_layoutSize == size) | 3791 if (m_layoutSize == size) |
| 3790 return; | 3792 return; |
| 3791 | 3793 |
| 3792 m_layoutSize = size; | 3794 m_layoutSize = size; |
| 3793 contentsResized(); | 3795 contentsResized(); |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4274 void FrameView::scrollContents(const IntSize& scrollDelta) { | 4276 void FrameView::scrollContents(const IntSize& scrollDelta) { |
| 4275 HostWindow* window = getHostWindow(); | 4277 HostWindow* window = getHostWindow(); |
| 4276 if (!window) | 4278 if (!window) |
| 4277 return; | 4279 return; |
| 4278 | 4280 |
| 4279 TRACE_EVENT0("blink", "FrameView::scrollContents"); | 4281 TRACE_EVENT0("blink", "FrameView::scrollContents"); |
| 4280 | 4282 |
| 4281 if (!scrollContentsFastPath(-scrollDelta)) | 4283 if (!scrollContentsFastPath(-scrollDelta)) |
| 4282 scrollContentsSlowPath(); | 4284 scrollContentsSlowPath(); |
| 4283 | 4285 |
| 4286 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && |
| 4287 !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
| 4288 // Need to update scroll translation property. |
| 4289 setNeedsPaintPropertyUpdate(); |
| 4290 } |
| 4291 |
| 4284 // This call will move children with native widgets (plugins) and invalidate | 4292 // This call will move children with native widgets (plugins) and invalidate |
| 4285 // them as well. | 4293 // them as well. |
| 4286 frameRectsChanged(); | 4294 frameRectsChanged(); |
| 4287 } | 4295 } |
| 4288 | 4296 |
| 4289 IntPoint FrameView::contentsToFrame(const IntPoint& pointInContentSpace) const { | 4297 IntPoint FrameView::contentsToFrame(const IntPoint& pointInContentSpace) const { |
| 4290 return pointInContentSpace - scrollOffsetInt(); | 4298 return pointInContentSpace - scrollOffsetInt(); |
| 4291 } | 4299 } |
| 4292 | 4300 |
| 4293 IntRect FrameView::contentsToFrame(const IntRect& rectInContentSpace) const { | 4301 IntRect FrameView::contentsToFrame(const IntRect& rectInContentSpace) const { |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4626 } | 4634 } |
| 4627 | 4635 |
| 4628 void FrameView::show() { | 4636 void FrameView::show() { |
| 4629 if (!isSelfVisible()) { | 4637 if (!isSelfVisible()) { |
| 4630 setSelfVisible(true); | 4638 setSelfVisible(true); |
| 4631 if (ScrollingCoordinator* scrollingCoordinator = | 4639 if (ScrollingCoordinator* scrollingCoordinator = |
| 4632 this->scrollingCoordinator()) | 4640 this->scrollingCoordinator()) |
| 4633 scrollingCoordinator->frameViewVisibilityDidChange(); | 4641 scrollingCoordinator->frameViewVisibilityDidChange(); |
| 4634 setNeedsCompositingUpdate(layoutViewItem(), CompositingUpdateRebuildTree); | 4642 setNeedsCompositingUpdate(layoutViewItem(), CompositingUpdateRebuildTree); |
| 4635 updateParentScrollableAreaSet(); | 4643 updateParentScrollableAreaSet(); |
| 4636 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | 4644 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && |
| 4645 !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
| 4637 // The existance of scrolling properties depends on visibility through | 4646 // The existance of scrolling properties depends on visibility through |
| 4638 // isScrollable() so ensure properties are updated if visibility changes. | 4647 // isScrollable() so ensure properties are updated if visibility changes. |
| 4639 setNeedsPaintPropertyUpdate(); | 4648 setNeedsPaintPropertyUpdate(); |
| 4640 } | 4649 } |
| 4641 if (isParentVisible()) { | 4650 if (isParentVisible()) { |
| 4642 for (const auto& child : m_children) | 4651 for (const auto& child : m_children) |
| 4643 child->setParentVisible(true); | 4652 child->setParentVisible(true); |
| 4644 } | 4653 } |
| 4645 } | 4654 } |
| 4646 | 4655 |
| 4647 Widget::show(); | 4656 Widget::show(); |
| 4648 } | 4657 } |
| 4649 | 4658 |
| 4650 void FrameView::hide() { | 4659 void FrameView::hide() { |
| 4651 if (isSelfVisible()) { | 4660 if (isSelfVisible()) { |
| 4652 if (isParentVisible()) { | 4661 if (isParentVisible()) { |
| 4653 for (const auto& child : m_children) | 4662 for (const auto& child : m_children) |
| 4654 child->setParentVisible(false); | 4663 child->setParentVisible(false); |
| 4655 } | 4664 } |
| 4656 setSelfVisible(false); | 4665 setSelfVisible(false); |
| 4657 if (ScrollingCoordinator* scrollingCoordinator = | 4666 if (ScrollingCoordinator* scrollingCoordinator = |
| 4658 this->scrollingCoordinator()) | 4667 this->scrollingCoordinator()) |
| 4659 scrollingCoordinator->frameViewVisibilityDidChange(); | 4668 scrollingCoordinator->frameViewVisibilityDidChange(); |
| 4660 setNeedsCompositingUpdate(layoutViewItem(), CompositingUpdateRebuildTree); | 4669 setNeedsCompositingUpdate(layoutViewItem(), CompositingUpdateRebuildTree); |
| 4661 updateParentScrollableAreaSet(); | 4670 updateParentScrollableAreaSet(); |
| 4662 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | 4671 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && |
| 4672 !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
| 4663 // The existance of scrolling properties depends on visibility through | 4673 // The existance of scrolling properties depends on visibility through |
| 4664 // isScrollable() so ensure properties are updated if visibility changes. | 4674 // isScrollable() so ensure properties are updated if visibility changes. |
| 4665 setNeedsPaintPropertyUpdate(); | 4675 setNeedsPaintPropertyUpdate(); |
| 4666 } | 4676 } |
| 4667 } | 4677 } |
| 4668 | 4678 |
| 4669 Widget::hide(); | 4679 Widget::hide(); |
| 4670 } | 4680 } |
| 4671 | 4681 |
| 4672 int FrameView::viewportWidth() const { | 4682 int FrameView::viewportWidth() const { |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5173 void FrameView::setAnimationHost( | 5183 void FrameView::setAnimationHost( |
| 5174 std::unique_ptr<CompositorAnimationHost> host) { | 5184 std::unique_ptr<CompositorAnimationHost> host) { |
| 5175 m_animationHost = std::move(host); | 5185 m_animationHost = std::move(host); |
| 5176 } | 5186 } |
| 5177 | 5187 |
| 5178 LayoutUnit FrameView::caretWidth() const { | 5188 LayoutUnit FrameView::caretWidth() const { |
| 5179 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); | 5189 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); |
| 5180 } | 5190 } |
| 5181 | 5191 |
| 5182 } // namespace blink | 5192 } // namespace blink |
| OLD | NEW |