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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 314 |
315 // We observe the frame owner element instead of the document element, because | 315 // We observe the frame owner element instead of the document element, because |
316 // if the document has no content we can falsely think the frame is invisible. | 316 // if the document has no content we can falsely think the frame is invisible. |
317 // Note that this means we cannot throttle top-level frames or (currently) | 317 // Note that this means we cannot throttle top-level frames or (currently) |
318 // frames whose owner element is remote. | 318 // frames whose owner element is remote. |
319 Element* targetElement = frame().deprecatedLocalOwner(); | 319 Element* targetElement = frame().deprecatedLocalOwner(); |
320 if (!targetElement) | 320 if (!targetElement) |
321 return; | 321 return; |
322 | 322 |
323 m_visibilityObserver = new ElementVisibilityObserver( | 323 m_visibilityObserver = new ElementVisibilityObserver( |
324 targetElement, WTF::bind( | 324 targetElement, |
325 [](FrameView* frameView, bool isVisible) { | 325 WTF::bind( |
326 if (!frameView) | 326 [](FrameView* frameView, bool isVisible) { |
327 return; | 327 if (!frameView) |
328 frameView->updateRenderThrottlingStatus( | 328 return; |
329 !isVisible, frameView->m_subtreeThrottled); | 329 frameView->updateRenderThrottlingStatus( |
330 frameView->maybeRecordLoadReason(); | 330 !isVisible, frameView->m_subtreeThrottled); |
331 }, | 331 frameView->maybeRecordLoadReason(); |
332 wrapWeakPersistent(this))); | 332 }, |
| 333 wrapWeakPersistent(this))); |
333 m_visibilityObserver->start(); | 334 m_visibilityObserver->start(); |
334 } | 335 } |
335 | 336 |
336 void FrameView::dispose() { | 337 void FrameView::dispose() { |
337 RELEASE_ASSERT(!isInPerformLayout()); | 338 RELEASE_ASSERT(!isInPerformLayout()); |
338 | 339 |
339 if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator()) | 340 if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator()) |
340 scrollAnimator->cancelAnimation(); | 341 scrollAnimator->cancelAnimation(); |
341 cancelProgrammaticScrollAnimation(); | 342 cancelProgrammaticScrollAnimation(); |
342 | 343 |
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2031 if (!RuntimeEnabledFeatures::compositedSelectionUpdateEnabled()) | 2032 if (!RuntimeEnabledFeatures::compositedSelectionUpdateEnabled()) |
2032 return; | 2033 return; |
2033 | 2034 |
2034 TRACE_EVENT0("blink", "FrameView::updateCompositedSelectionIfNeeded"); | 2035 TRACE_EVENT0("blink", "FrameView::updateCompositedSelectionIfNeeded"); |
2035 | 2036 |
2036 Page* page = frame().page(); | 2037 Page* page = frame().page(); |
2037 ASSERT(page); | 2038 ASSERT(page); |
2038 | 2039 |
2039 CompositedSelection selection; | 2040 CompositedSelection selection; |
2040 LocalFrame* focusedFrame = page->focusController().focusedFrame(); | 2041 LocalFrame* focusedFrame = page->focusController().focusedFrame(); |
2041 LocalFrame* localFrame = (focusedFrame && (focusedFrame->localFrameRoot() == | 2042 LocalFrame* localFrame = |
2042 m_frame->localFrameRoot())) | 2043 (focusedFrame && |
2043 ? focusedFrame | 2044 (focusedFrame->localFrameRoot() == m_frame->localFrameRoot())) |
2044 : nullptr; | 2045 ? focusedFrame |
| 2046 : nullptr; |
2045 | 2047 |
2046 if (localFrame && computeCompositedSelection(*localFrame, selection)) { | 2048 if (localFrame && computeCompositedSelection(*localFrame, selection)) { |
2047 page->chromeClient().updateCompositedSelection(localFrame, selection); | 2049 page->chromeClient().updateCompositedSelection(localFrame, selection); |
2048 } else { | 2050 } else { |
2049 if (!localFrame) { | 2051 if (!localFrame) { |
2050 // Clearing the mainframe when there is no focused frame (and hence | 2052 // Clearing the mainframe when there is no focused frame (and hence |
2051 // no localFrame) is legacy behaviour, and implemented here to | 2053 // no localFrame) is legacy behaviour, and implemented here to |
2052 // satisfy ParameterizedWebFrameTest.CompositedSelectionBoundsCleared's | 2054 // satisfy ParameterizedWebFrameTest.CompositedSelectionBoundsCleared's |
2053 // first check that the composited selection has been cleared even | 2055 // first check that the composited selection has been cleared even |
2054 // though no frame has focus yet. If this is not desired, then the | 2056 // though no frame has focus yet. If this is not desired, then the |
(...skipping 3136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5191 void FrameView::setAnimationHost( | 5193 void FrameView::setAnimationHost( |
5192 std::unique_ptr<CompositorAnimationHost> host) { | 5194 std::unique_ptr<CompositorAnimationHost> host) { |
5193 m_animationHost = std::move(host); | 5195 m_animationHost = std::move(host); |
5194 } | 5196 } |
5195 | 5197 |
5196 LayoutUnit FrameView::caretWidth() const { | 5198 LayoutUnit FrameView::caretWidth() const { |
5197 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); | 5199 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); |
5198 } | 5200 } |
5199 | 5201 |
5200 } // namespace blink | 5202 } // namespace blink |
OLD | NEW |