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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 m_baseBackgroundColor(Color::white), | 168 m_baseBackgroundColor(Color::white), |
169 m_mediaType(MediaTypeNames::screen), | 169 m_mediaType(MediaTypeNames::screen), |
170 m_safeToPropagateScrollToParent(true), | 170 m_safeToPropagateScrollToParent(true), |
171 m_scrollCorner(nullptr), | 171 m_scrollCorner(nullptr), |
172 m_stickyPositionObjectCount(0), | 172 m_stickyPositionObjectCount(0), |
173 m_inputEventsScaleFactorForEmulation(1), | 173 m_inputEventsScaleFactorForEmulation(1), |
174 m_layoutSizeFixedToFrameSize(true), | 174 m_layoutSizeFixedToFrameSize(true), |
175 m_didScrollTimer(this, &FrameView::didScrollTimerFired), | 175 m_didScrollTimer(this, &FrameView::didScrollTimerFired), |
176 m_browserControlsViewportAdjustment(0), | 176 m_browserControlsViewportAdjustment(0), |
177 m_needsUpdateWidgetGeometries(false), | 177 m_needsUpdateWidgetGeometries(false), |
178 m_needsUpdateViewportIntersection(true), | |
179 #if ENABLE(ASSERT) | 178 #if ENABLE(ASSERT) |
180 m_hasBeenDisposed(false), | 179 m_hasBeenDisposed(false), |
181 #endif | 180 #endif |
182 m_horizontalScrollbarMode(ScrollbarAuto), | 181 m_horizontalScrollbarMode(ScrollbarAuto), |
183 m_verticalScrollbarMode(ScrollbarAuto), | 182 m_verticalScrollbarMode(ScrollbarAuto), |
184 m_horizontalScrollbarLock(false), | 183 m_horizontalScrollbarLock(false), |
185 m_verticalScrollbarLock(false), | 184 m_verticalScrollbarLock(false), |
186 m_scrollbarsSuppressed(false), | 185 m_scrollbarsSuppressed(false), |
187 m_inUpdateScrollbars(false), | 186 m_inUpdateScrollbars(false), |
188 m_frameTimingRequestsDirty(true), | 187 m_frameTimingRequestsDirty(true), |
(...skipping 3388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3577 m_animatingScrollableAreas->remove(scrollableArea); | 3576 m_animatingScrollableAreas->remove(scrollableArea); |
3578 } | 3577 } |
3579 | 3578 |
3580 void FrameView::setParent(Widget* parentView) { | 3579 void FrameView::setParent(Widget* parentView) { |
3581 if (parentView == parent()) | 3580 if (parentView == parent()) |
3582 return; | 3581 return; |
3583 | 3582 |
3584 Widget::setParent(parentView); | 3583 Widget::setParent(parentView); |
3585 | 3584 |
3586 updateParentScrollableAreaSet(); | 3585 updateParentScrollableAreaSet(); |
3587 setNeedsUpdateViewportIntersection(); | |
3588 setupRenderThrottling(); | 3586 setupRenderThrottling(); |
3589 | 3587 |
3590 if (parentFrameView()) | 3588 if (parentFrameView()) |
3591 m_subtreeThrottled = parentFrameView()->canThrottleRendering(); | 3589 m_subtreeThrottled = parentFrameView()->canThrottleRendering(); |
3592 } | 3590 } |
3593 | 3591 |
3594 void FrameView::removeChild(Widget* child) { | 3592 void FrameView::removeChild(Widget* child) { |
3595 ASSERT(child->parent() == this); | 3593 ASSERT(child->parent() == this); |
3596 | 3594 |
3597 if (child->isFrameView()) | 3595 if (child->isFrameView()) |
(...skipping 30 matching lines...) Expand all Loading... |
3628 if (!page || m_frame->eventHandler().isMousePositionUnknown()) | 3626 if (!page || m_frame->eventHandler().isMousePositionUnknown()) |
3629 return; | 3627 return; |
3630 page->chromeClient().setCursor(cursor, m_frame); | 3628 page->chromeClient().setCursor(cursor, m_frame); |
3631 } | 3629 } |
3632 | 3630 |
3633 void FrameView::frameRectsChanged() { | 3631 void FrameView::frameRectsChanged() { |
3634 TRACE_EVENT0("blink", "FrameView::frameRectsChanged"); | 3632 TRACE_EVENT0("blink", "FrameView::frameRectsChanged"); |
3635 if (layoutSizeFixedToFrameSize()) | 3633 if (layoutSizeFixedToFrameSize()) |
3636 setLayoutSizeInternal(frameRect().size()); | 3634 setLayoutSizeInternal(frameRect().size()); |
3637 | 3635 |
3638 setNeedsUpdateViewportIntersection(); | |
3639 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | 3636 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
3640 // The overflow clip property depends on the frame rect. | 3637 // The overflow clip property depends on the frame rect. |
3641 setNeedsPaintPropertyUpdate(); | 3638 setNeedsPaintPropertyUpdate(); |
3642 } | 3639 } |
3643 | 3640 |
3644 for (const auto& child : m_children) | 3641 for (const auto& child : m_children) |
3645 child->frameRectsChanged(); | 3642 child->frameRectsChanged(); |
3646 } | 3643 } |
3647 | 3644 |
3648 void FrameView::setLayoutSizeInternal(const IntSize& size) { | 3645 void FrameView::setLayoutSizeInternal(const IntSize& size) { |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4543 // so we don't want to include them. | 4540 // so we don't want to include them. |
4544 if (layoutObject.isText()) | 4541 if (layoutObject.isText()) |
4545 return; | 4542 return; |
4546 | 4543 |
4547 layoutObject.addAnnotatedRegions(regions); | 4544 layoutObject.addAnnotatedRegions(regions); |
4548 for (LayoutObject* curr = layoutObject.slowFirstChild(); curr; | 4545 for (LayoutObject* curr = layoutObject.slowFirstChild(); curr; |
4549 curr = curr->nextSibling()) | 4546 curr = curr->nextSibling()) |
4550 collectAnnotatedRegions(*curr, regions); | 4547 collectAnnotatedRegions(*curr, regions); |
4551 } | 4548 } |
4552 | 4549 |
4553 void FrameView::setNeedsUpdateViewportIntersection() { | |
4554 for (FrameView* parent = parentFrameView(); parent; | |
4555 parent = parent->parentFrameView()) | |
4556 parent->m_needsUpdateViewportIntersectionInSubtree = true; | |
4557 } | |
4558 | |
4559 void FrameView::updateViewportIntersectionsForSubtree( | 4550 void FrameView::updateViewportIntersectionsForSubtree( |
4560 DocumentLifecycle::LifecycleState targetState) { | 4551 DocumentLifecycle::LifecycleState targetState) { |
4561 // TODO(dcheng): Since widget tree updates are deferred, FrameViews might | 4552 // TODO(dcheng): Since widget tree updates are deferred, FrameViews might |
4562 // still be in the widget hierarchy even though the associated Document is | 4553 // still be in the widget hierarchy even though the associated Document is |
4563 // already detached. Investigate if this check and a similar check in | 4554 // already detached. Investigate if this check and a similar check in |
4564 // lifecycle updates are still needed when there are no more deferred widget | 4555 // lifecycle updates are still needed when there are no more deferred widget |
4565 // updates: https://crbug.com/561683 | 4556 // updates: https://crbug.com/561683 |
4566 if (!frame().document()->isActive()) | 4557 if (!frame().document()->isActive()) |
4567 return; | 4558 return; |
4568 | 4559 |
4569 // Notify javascript IntersectionObservers | 4560 // Notify javascript IntersectionObservers |
4570 if (targetState == DocumentLifecycle::PaintClean && | 4561 if (targetState == DocumentLifecycle::PaintClean && |
4571 frame().document()->intersectionObserverController()) | 4562 frame().document()->intersectionObserverController()) |
4572 frame() | 4563 frame() |
4573 .document() | 4564 .document() |
4574 ->intersectionObserverController() | 4565 ->intersectionObserverController() |
4575 ->computeTrackedIntersectionObservations(); | 4566 ->computeTrackedIntersectionObservations(); |
4576 | 4567 |
4577 if (!m_needsUpdateViewportIntersectionInSubtree) | |
4578 return; | |
4579 m_needsUpdateViewportIntersectionInSubtree = false; | |
4580 | |
4581 for (Frame* child = m_frame->tree().firstChild(); child; | 4568 for (Frame* child = m_frame->tree().firstChild(); child; |
4582 child = child->tree().nextSibling()) { | 4569 child = child->tree().nextSibling()) { |
4583 if (!child->isLocalFrame()) | 4570 if (!child->isLocalFrame()) |
4584 continue; | 4571 continue; |
4585 if (FrameView* view = toLocalFrame(child)->view()) | 4572 if (FrameView* view = toLocalFrame(child)->view()) |
4586 view->updateViewportIntersectionsForSubtree(targetState); | 4573 view->updateViewportIntersectionsForSubtree(targetState); |
4587 } | 4574 } |
4588 } | 4575 } |
4589 | 4576 |
4590 void FrameView::updateRenderThrottlingStatusForTesting() { | 4577 void FrameView::updateRenderThrottlingStatusForTesting() { |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4916 reason < MainThreadScrollingReason::kMainThreadScrollingReasonCount; | 4903 reason < MainThreadScrollingReason::kMainThreadScrollingReasonCount; |
4917 ++reason) { | 4904 ++reason) { |
4918 if (m_mainThreadScrollingReasonsCounter[reason] > 0) { | 4905 if (m_mainThreadScrollingReasonsCounter[reason] > 0) { |
4919 reasons |= 1 << (reason - 1); | 4906 reasons |= 1 << (reason - 1); |
4920 } | 4907 } |
4921 } | 4908 } |
4922 return reasons; | 4909 return reasons; |
4923 } | 4910 } |
4924 | 4911 |
4925 } // namespace blink | 4912 } // namespace blink |
OLD | NEW |