| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 m_baseBackgroundColor(Color::white), | 179 m_baseBackgroundColor(Color::white), |
| 180 m_mediaType(MediaTypeNames::screen), | 180 m_mediaType(MediaTypeNames::screen), |
| 181 m_safeToPropagateScrollToParent(true), | 181 m_safeToPropagateScrollToParent(true), |
| 182 m_scrollCorner(nullptr), | 182 m_scrollCorner(nullptr), |
| 183 m_stickyPositionObjectCount(0), | 183 m_stickyPositionObjectCount(0), |
| 184 m_inputEventsScaleFactorForEmulation(1), | 184 m_inputEventsScaleFactorForEmulation(1), |
| 185 m_layoutSizeFixedToFrameSize(true), | 185 m_layoutSizeFixedToFrameSize(true), |
| 186 m_didScrollTimer(TaskRunnerHelper::get(TaskType::UnspecedTimer, &frame), | 186 m_didScrollTimer(TaskRunnerHelper::get(TaskType::UnspecedTimer, &frame), |
| 187 this, | 187 this, |
| 188 &FrameView::didScrollTimerFired), | 188 &FrameView::didScrollTimerFired), |
| 189 m_needsUpdateWidgetGeometries(false), | 189 m_needsUpdateGeometries(false), |
| 190 m_horizontalScrollbarMode(ScrollbarAuto), | 190 m_horizontalScrollbarMode(ScrollbarAuto), |
| 191 m_verticalScrollbarMode(ScrollbarAuto), | 191 m_verticalScrollbarMode(ScrollbarAuto), |
| 192 m_horizontalScrollbarLock(false), | 192 m_horizontalScrollbarLock(false), |
| 193 m_verticalScrollbarLock(false), | 193 m_verticalScrollbarLock(false), |
| 194 m_scrollbarsSuppressed(false), | 194 m_scrollbarsSuppressed(false), |
| 195 m_inUpdateScrollbars(false), | 195 m_inUpdateScrollbars(false), |
| 196 m_frameTimingRequestsDirty(true), | 196 m_frameTimingRequestsDirty(true), |
| 197 m_hiddenForThrottling(false), | 197 m_hiddenForThrottling(false), |
| 198 m_subtreeThrottled(false), | 198 m_subtreeThrottled(false), |
| 199 m_lifecycleUpdatesThrottled(false), | 199 m_lifecycleUpdatesThrottled(false), |
| (...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1456 } | 1456 } |
| 1457 | 1457 |
| 1458 void FrameView::addPart(LayoutPart* object) { | 1458 void FrameView::addPart(LayoutPart* object) { |
| 1459 m_parts.insert(object); | 1459 m_parts.insert(object); |
| 1460 } | 1460 } |
| 1461 | 1461 |
| 1462 void FrameView::removePart(LayoutPart* object) { | 1462 void FrameView::removePart(LayoutPart* object) { |
| 1463 m_parts.erase(object); | 1463 m_parts.erase(object); |
| 1464 } | 1464 } |
| 1465 | 1465 |
| 1466 void FrameView::updateWidgetGeometries() { | 1466 void FrameView::updateGeometries() { |
| 1467 Vector<RefPtr<LayoutPart>> parts; | 1467 Vector<RefPtr<LayoutPart>> parts; |
| 1468 copyToVector(m_parts, parts); | 1468 copyToVector(m_parts, parts); |
| 1469 | 1469 |
| 1470 for (auto part : parts) { | 1470 for (auto part : parts) { |
| 1471 // Script or plugins could detach the frame so abort processing if that | 1471 // Script or plugins could detach the frame so abort processing if that |
| 1472 // happens. | 1472 // happens. |
| 1473 if (layoutViewItem().isNull()) | 1473 if (layoutViewItem().isNull()) |
| 1474 break; | 1474 break; |
| 1475 | 1475 |
| 1476 if (FrameViewBase* frameViewBase = part->widget()) { | 1476 if (FrameViewBase* frameViewBase = part->widget()) { |
| 1477 if (frameViewBase->isFrameView()) { | 1477 if (frameViewBase->isFrameView()) { |
| 1478 FrameView* frameView = toFrameView(frameViewBase); | 1478 FrameView* frameView = toFrameView(frameViewBase); |
| 1479 bool didNeedLayout = frameView->needsLayout(); | 1479 bool didNeedLayout = frameView->needsLayout(); |
| 1480 part->updateWidgetGeometry(); | 1480 part->updateGeometry(); |
| 1481 if (!didNeedLayout && !frameView->shouldThrottleRendering()) | 1481 if (!didNeedLayout && !frameView->shouldThrottleRendering()) |
| 1482 frameView->checkDoesNotNeedLayout(); | 1482 frameView->checkDoesNotNeedLayout(); |
| 1483 } else { | 1483 } else { |
| 1484 part->updateWidgetGeometry(); | 1484 part->updateGeometry(); |
| 1485 } | 1485 } |
| 1486 } | 1486 } |
| 1487 } | 1487 } |
| 1488 } | 1488 } |
| 1489 | 1489 |
| 1490 void FrameView::addPartToUpdate(LayoutEmbeddedObject& object) { | 1490 void FrameView::addPartToUpdate(LayoutEmbeddedObject& object) { |
| 1491 ASSERT(isInPerformLayout()); | 1491 ASSERT(isInPerformLayout()); |
| 1492 // Tell the DOM element that it needs a FrameViewBase update. | 1492 // Tell the DOM element that it needs a FrameViewBase update. |
| 1493 Node* node = object.node(); | 1493 Node* node = object.node(); |
| 1494 ASSERT(node); | 1494 ASSERT(node); |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1995 DisableCompositingQueryAsserts disabler; | 1995 DisableCompositingQueryAsserts disabler; |
| 1996 layer->updateLayerPositionsAfterOverflowScroll(); | 1996 layer->updateLayerPositionsAfterOverflowScroll(); |
| 1997 layoutObject->setMayNeedPaintInvalidationSubtree(); | 1997 layoutObject->setMayNeedPaintInvalidationSubtree(); |
| 1998 } | 1998 } |
| 1999 } | 1999 } |
| 2000 | 2000 |
| 2001 // If there fixed position elements, scrolling may cause compositing layers to | 2001 // If there fixed position elements, scrolling may cause compositing layers to |
| 2002 // change. Update FrameViewBase and layer positions after scrolling, but only | 2002 // change. Update FrameViewBase and layer positions after scrolling, but only |
| 2003 // if we're not inside of layout. | 2003 // if we're not inside of layout. |
| 2004 if (!m_nestedLayoutCount) { | 2004 if (!m_nestedLayoutCount) { |
| 2005 updateWidgetGeometries(); | 2005 updateGeometries(); |
| 2006 LayoutViewItem layoutViewItem = this->layoutViewItem(); | 2006 LayoutViewItem layoutViewItem = this->layoutViewItem(); |
| 2007 if (!layoutViewItem.isNull()) | 2007 if (!layoutViewItem.isNull()) |
| 2008 layoutViewItem.layer()->setNeedsCompositingInputsUpdate(); | 2008 layoutViewItem.layer()->setNeedsCompositingInputsUpdate(); |
| 2009 } | 2009 } |
| 2010 } | 2010 } |
| 2011 | 2011 |
| 2012 bool FrameView::computeCompositedSelection(LocalFrame& frame, | 2012 bool FrameView::computeCompositedSelection(LocalFrame& frame, |
| 2013 CompositedSelection& selection) { | 2013 CompositedSelection& selection) { |
| 2014 if (!frame.view() || frame.view()->shouldThrottleRendering()) | 2014 if (!frame.view() || frame.view()->shouldThrottleRendering()) |
| 2015 return false; | 2015 return false; |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2432 // but FrameView holds a manual ref, so it won't have been deleted. | 2432 // but FrameView holds a manual ref, so it won't have been deleted. |
| 2433 if (!element) | 2433 if (!element) |
| 2434 continue; | 2434 continue; |
| 2435 | 2435 |
| 2436 // No need to update if it's already crashed or known to be missing. | 2436 // No need to update if it's already crashed or known to be missing. |
| 2437 if (object.showsUnavailablePluginIndicator()) | 2437 if (object.showsUnavailablePluginIndicator()) |
| 2438 continue; | 2438 continue; |
| 2439 | 2439 |
| 2440 if (element->needsWidgetUpdate()) | 2440 if (element->needsWidgetUpdate()) |
| 2441 element->updateWidget(); | 2441 element->updateWidget(); |
| 2442 object.updateWidgetGeometry(); | 2442 object.updateGeometry(); |
| 2443 | 2443 |
| 2444 // Prevent plugins from causing infinite updates of themselves. | 2444 // Prevent plugins from causing infinite updates of themselves. |
| 2445 // FIXME: Do we really need to prevent this? | 2445 // FIXME: Do we really need to prevent this? |
| 2446 m_partUpdateSet.erase(&object); | 2446 m_partUpdateSet.erase(&object); |
| 2447 } | 2447 } |
| 2448 | 2448 |
| 2449 return m_partUpdateSet.isEmpty(); | 2449 return m_partUpdateSet.isEmpty(); |
| 2450 } | 2450 } |
| 2451 | 2451 |
| 2452 void FrameView::updateWidgetsTimerFired(TimerBase*) { | 2452 void FrameView::updateWidgetsTimerFired(TimerBase*) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2491 | 2491 |
| 2492 ASSERT(m_frame->document()); | 2492 ASSERT(m_frame->document()); |
| 2493 | 2493 |
| 2494 FontFaceSet::didLayout(*m_frame->document()); | 2494 FontFaceSet::didLayout(*m_frame->document()); |
| 2495 // Cursor update scheduling is done by the local root, which is the main frame | 2495 // Cursor update scheduling is done by the local root, which is the main frame |
| 2496 // if there are no RemoteFrame ancestors in the frame tree. Use of | 2496 // if there are no RemoteFrame ancestors in the frame tree. Use of |
| 2497 // localFrameRoot() is discouraged but will change when cursor update | 2497 // localFrameRoot() is discouraged but will change when cursor update |
| 2498 // scheduling is moved from EventHandler to PageEventHandler. | 2498 // scheduling is moved from EventHandler to PageEventHandler. |
| 2499 frame().localFrameRoot()->eventHandler().scheduleCursorUpdate(); | 2499 frame().localFrameRoot()->eventHandler().scheduleCursorUpdate(); |
| 2500 | 2500 |
| 2501 updateWidgetGeometries(); | 2501 updateGeometries(); |
| 2502 | 2502 |
| 2503 // Plugins could have torn down the page inside updateWidgetGeometries(). | 2503 // Plugins could have torn down the page inside updateGeometries(). |
| 2504 if (layoutViewItem().isNull()) | 2504 if (layoutViewItem().isNull()) |
| 2505 return; | 2505 return; |
| 2506 | 2506 |
| 2507 scheduleUpdateWidgetsIfNecessary(); | 2507 scheduleUpdateWidgetsIfNecessary(); |
| 2508 | 2508 |
| 2509 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) | 2509 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
| 2510 scrollingCoordinator->notifyGeometryChanged(); | 2510 scrollingCoordinator->notifyGeometryChanged(); |
| 2511 | 2511 |
| 2512 scrollToFragmentAnchor(); | 2512 scrollToFragmentAnchor(); |
| 2513 sendResizeEventIfNeeded(); | 2513 sendResizeEventIfNeeded(); |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2849 | 2849 |
| 2850 if (hasHorizontalScrollbar != shouldHaveHorizontalScrollbar || | 2850 if (hasHorizontalScrollbar != shouldHaveHorizontalScrollbar || |
| 2851 hasVerticalScrollbar != shouldHaveVerticalScrollbar) { | 2851 hasVerticalScrollbar != shouldHaveVerticalScrollbar) { |
| 2852 scrollbarExistenceDidChange(); | 2852 scrollbarExistenceDidChange(); |
| 2853 | 2853 |
| 2854 if (!visualViewportSuppliesScrollbars()) | 2854 if (!visualViewportSuppliesScrollbars()) |
| 2855 updateScrollbarGeometry(); | 2855 updateScrollbarGeometry(); |
| 2856 } | 2856 } |
| 2857 } | 2857 } |
| 2858 | 2858 |
| 2859 void FrameView::updateWidgetGeometriesIfNeeded() { | 2859 void FrameView::updateGeometriesIfNeeded() { |
| 2860 if (!m_needsUpdateWidgetGeometries) | 2860 if (!m_needsUpdateGeometries) |
| 2861 return; | 2861 return; |
| 2862 | 2862 |
| 2863 m_needsUpdateWidgetGeometries = false; | 2863 m_needsUpdateGeometries = false; |
| 2864 | 2864 |
| 2865 updateWidgetGeometries(); | 2865 updateGeometries(); |
| 2866 } | 2866 } |
| 2867 | 2867 |
| 2868 GeometryMapper& FrameView::geometryMapper() { | 2868 GeometryMapper& FrameView::geometryMapper() { |
| 2869 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); | 2869 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
| 2870 DCHECK(lifecycle().state() >= DocumentLifecycle::InPrePaint); | 2870 DCHECK(lifecycle().state() >= DocumentLifecycle::InPrePaint); |
| 2871 | 2871 |
| 2872 if (m_frame->isLocalRoot()) { | 2872 if (m_frame->isLocalRoot()) { |
| 2873 if (!m_geometryMapper) | 2873 if (!m_geometryMapper) |
| 2874 m_geometryMapper = GeometryMapper::create(); | 2874 m_geometryMapper = GeometryMapper::create(); |
| 2875 return *m_geometryMapper.get(); | 2875 return *m_geometryMapper.get(); |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3328 for (const auto& frameView : frameViews) | 3328 for (const auto& frameView : frameViews) |
| 3329 frameView->updateStyleAndLayoutIfNeededRecursiveInternal(); | 3329 frameView->updateStyleAndLayoutIfNeededRecursiveInternal(); |
| 3330 | 3330 |
| 3331 // These asserts ensure that parent frames are clean, when child frames | 3331 // These asserts ensure that parent frames are clean, when child frames |
| 3332 // finished updating layout and style. | 3332 // finished updating layout and style. |
| 3333 checkDoesNotNeedLayout(); | 3333 checkDoesNotNeedLayout(); |
| 3334 #if DCHECK_IS_ON() | 3334 #if DCHECK_IS_ON() |
| 3335 m_frame->document()->layoutView()->assertLaidOut(); | 3335 m_frame->document()->layoutView()->assertLaidOut(); |
| 3336 #endif | 3336 #endif |
| 3337 | 3337 |
| 3338 updateWidgetGeometriesIfNeeded(); | 3338 updateGeometriesIfNeeded(); |
| 3339 | 3339 |
| 3340 if (lifecycle().state() < DocumentLifecycle::LayoutClean) | 3340 if (lifecycle().state() < DocumentLifecycle::LayoutClean) |
| 3341 lifecycle().advanceTo(DocumentLifecycle::LayoutClean); | 3341 lifecycle().advanceTo(DocumentLifecycle::LayoutClean); |
| 3342 | 3342 |
| 3343 // Ensure that we become visually non-empty eventually. | 3343 // Ensure that we become visually non-empty eventually. |
| 3344 // TODO(esprehn): This should check isRenderingReady() instead. | 3344 // TODO(esprehn): This should check isRenderingReady() instead. |
| 3345 if (frame().document()->hasFinishedParsing() && | 3345 if (frame().document()->hasFinishedParsing() && |
| 3346 frame().loader().stateMachine()->committedFirstRealDocumentLoad()) | 3346 frame().loader().stateMachine()->committedFirstRealDocumentLoad()) |
| 3347 m_isVisuallyNonEmpty = true; | 3347 m_isVisuallyNonEmpty = true; |
| 3348 | 3348 |
| (...skipping 1901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5250 void FrameView::setAnimationHost( | 5250 void FrameView::setAnimationHost( |
| 5251 std::unique_ptr<CompositorAnimationHost> host) { | 5251 std::unique_ptr<CompositorAnimationHost> host) { |
| 5252 m_animationHost = std::move(host); | 5252 m_animationHost = std::move(host); |
| 5253 } | 5253 } |
| 5254 | 5254 |
| 5255 LayoutUnit FrameView::caretWidth() const { | 5255 LayoutUnit FrameView::caretWidth() const { |
| 5256 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); | 5256 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); |
| 5257 } | 5257 } |
| 5258 | 5258 |
| 5259 } // namespace blink | 5259 } // namespace blink |
| OLD | NEW |