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 20 matching lines...) Expand all Loading... |
31 #include "core/css/FontFaceSet.h" | 31 #include "core/css/FontFaceSet.h" |
32 #include "core/css/resolver/StyleResolver.h" | 32 #include "core/css/resolver/StyleResolver.h" |
33 #include "core/dom/AXObjectCache.h" | 33 #include "core/dom/AXObjectCache.h" |
34 #include "core/dom/DOMNodeIds.h" | 34 #include "core/dom/DOMNodeIds.h" |
35 #include "core/dom/Fullscreen.h" | 35 #include "core/dom/Fullscreen.h" |
36 #include "core/dom/IntersectionObserverController.h" | 36 #include "core/dom/IntersectionObserverController.h" |
37 #include "core/editing/EditingUtilities.h" | 37 #include "core/editing/EditingUtilities.h" |
38 #include "core/editing/FrameSelection.h" | 38 #include "core/editing/FrameSelection.h" |
39 #include "core/editing/RenderedPosition.h" | 39 #include "core/editing/RenderedPosition.h" |
40 #include "core/editing/markers/DocumentMarkerController.h" | 40 #include "core/editing/markers/DocumentMarkerController.h" |
41 #include "core/events/ErrorEvent.h" | |
42 #include "core/fetch/ResourceFetcher.h" | 41 #include "core/fetch/ResourceFetcher.h" |
43 #include "core/frame/EventHandlerRegistry.h" | 42 #include "core/frame/EventHandlerRegistry.h" |
44 #include "core/frame/FrameHost.h" | 43 #include "core/frame/FrameHost.h" |
45 #include "core/frame/LocalFrame.h" | 44 #include "core/frame/LocalFrame.h" |
46 #include "core/frame/Location.h" | 45 #include "core/frame/Location.h" |
47 #include "core/frame/PageScaleConstraintsSet.h" | 46 #include "core/frame/PageScaleConstraintsSet.h" |
48 #include "core/frame/Settings.h" | 47 #include "core/frame/Settings.h" |
49 #include "core/frame/TopControls.h" | 48 #include "core/frame/TopControls.h" |
50 #include "core/frame/VisualViewport.h" | 49 #include "core/frame/VisualViewport.h" |
51 #include "core/html/HTMLFrameElement.h" | 50 #include "core/html/HTMLFrameElement.h" |
(...skipping 17 matching lines...) Expand all Loading... |
69 #include "core/layout/api/LayoutItem.h" | 68 #include "core/layout/api/LayoutItem.h" |
70 #include "core/layout/api/LayoutPartItem.h" | 69 #include "core/layout/api/LayoutPartItem.h" |
71 #include "core/layout/api/LayoutViewItem.h" | 70 #include "core/layout/api/LayoutViewItem.h" |
72 #include "core/layout/compositing/CompositedLayerMapping.h" | 71 #include "core/layout/compositing/CompositedLayerMapping.h" |
73 #include "core/layout/compositing/CompositedSelection.h" | 72 #include "core/layout/compositing/CompositedSelection.h" |
74 #include "core/layout/compositing/PaintLayerCompositor.h" | 73 #include "core/layout/compositing/PaintLayerCompositor.h" |
75 #include "core/layout/svg/LayoutSVGRoot.h" | 74 #include "core/layout/svg/LayoutSVGRoot.h" |
76 #include "core/loader/DocumentLoader.h" | 75 #include "core/loader/DocumentLoader.h" |
77 #include "core/loader/FrameLoader.h" | 76 #include "core/loader/FrameLoader.h" |
78 #include "core/loader/FrameLoaderClient.h" | 77 #include "core/loader/FrameLoaderClient.h" |
79 #include "core/observer/ResizeObserverController.h" | |
80 #include "core/page/AutoscrollController.h" | 78 #include "core/page/AutoscrollController.h" |
81 #include "core/page/ChromeClient.h" | 79 #include "core/page/ChromeClient.h" |
82 #include "core/page/FocusController.h" | 80 #include "core/page/FocusController.h" |
83 #include "core/page/FrameTree.h" | 81 #include "core/page/FrameTree.h" |
84 #include "core/page/Page.h" | 82 #include "core/page/Page.h" |
85 #include "core/page/scrolling/ChildViewportScrollCallback.h" | 83 #include "core/page/scrolling/ChildViewportScrollCallback.h" |
86 #include "core/page/scrolling/RootScrollerController.h" | 84 #include "core/page/scrolling/RootScrollerController.h" |
87 #include "core/page/scrolling/RootViewportScrollCallback.h" | 85 #include "core/page/scrolling/RootViewportScrollCallback.h" |
88 #include "core/page/scrolling/ScrollingCoordinator.h" | 86 #include "core/page/scrolling/ScrollingCoordinator.h" |
89 #include "core/paint/FramePainter.h" | 87 #include "core/paint/FramePainter.h" |
(...skipping 2414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2504 { | 2502 { |
2505 LocalFrame* localFrameRoot = frame().localFrameRoot(); | 2503 LocalFrame* localFrameRoot = frame().localFrameRoot(); |
2506 if (localFrameRoot->view()->m_currentUpdateLifecyclePhasesTargetState < Docu
mentLifecycle::PaintInvalidationClean | 2504 if (localFrameRoot->view()->m_currentUpdateLifecyclePhasesTargetState < Docu
mentLifecycle::PaintInvalidationClean |
2507 || lifecycle().state() >= DocumentLifecycle::PrePaintClean) { | 2505 || lifecycle().state() >= DocumentLifecycle::PrePaintClean) { |
2508 // Schedule visual update to process the paint invalidation in the next
cycle. | 2506 // Schedule visual update to process the paint invalidation in the next
cycle. |
2509 localFrameRoot->scheduleVisualUpdateUnlessThrottled(); | 2507 localFrameRoot->scheduleVisualUpdateUnlessThrottled(); |
2510 } | 2508 } |
2511 // Otherwise the paint invalidation will be handled in paint invalidation ph
ase of this cycle. | 2509 // Otherwise the paint invalidation will be handled in paint invalidation ph
ase of this cycle. |
2512 } | 2510 } |
2513 | 2511 |
2514 void FrameView::notifyResizeObservers() | |
2515 { | |
2516 // Controller exists only if ResizeObserver was created. | |
2517 if (!frame().document()->resizeObserverController()) | |
2518 return; | |
2519 | |
2520 ResizeObserverController& resizeController = m_frame->document()->ensureResi
zeObserverController(); | |
2521 | |
2522 DCHECK(lifecycle().state() >= DocumentLifecycle::LayoutClean); | |
2523 | |
2524 size_t minDepth = 0; | |
2525 for (minDepth = resizeController.gatherObservations(0); | |
2526 minDepth != ResizeObserverController::kDepthBottom; | |
2527 minDepth = resizeController.gatherObservations(minDepth)) { | |
2528 resizeController.deliverObservations(); | |
2529 frame().document()->updateStyleAndLayout(); | |
2530 } | |
2531 | |
2532 if (resizeController.skippedObservations()) { | |
2533 resizeController.clearObservations(); | |
2534 ErrorEvent * error = ErrorEvent::create("ResizeObserver loop limit excee
ded", SourceLocation::capture(m_frame->document()), nullptr); | |
2535 m_frame->document()->reportException(error, NotSharableCrossOrigin); | |
2536 // Ensure notifications will get delivered in next cycle. | |
2537 if (FrameView* frameView = m_frame->view()) | |
2538 frameView->scheduleAnimation(); | |
2539 } | |
2540 | |
2541 DCHECK(!layoutView()->needsLayout()); | |
2542 } | |
2543 | |
2544 // TODO(leviw): We don't assert lifecycle information from documents in child Pl
uginViews. | 2512 // TODO(leviw): We don't assert lifecycle information from documents in child Pl
uginViews. |
2545 void FrameView::updateLifecyclePhasesInternal(DocumentLifecycle::LifecycleState
targetState) | 2513 void FrameView::updateLifecyclePhasesInternal(DocumentLifecycle::LifecycleState
targetState) |
2546 { | 2514 { |
2547 // This must be called from the root frame, since it recurses down, not up. | 2515 // This must be called from the root frame, since it recurses down, not up. |
2548 // Otherwise the lifecycles of the frames might be out of sync. | 2516 // Otherwise the lifecycles of the frames might be out of sync. |
2549 DCHECK(m_frame->isLocalRoot()); | 2517 DCHECK(m_frame->isLocalRoot()); |
2550 | 2518 |
2551 // Only the following target states are supported. | 2519 // Only the following target states are supported. |
2552 DCHECK(targetState == DocumentLifecycle::LayoutClean | 2520 DCHECK(targetState == DocumentLifecycle::LayoutClean |
2553 || targetState == DocumentLifecycle::CompositingClean | 2521 || targetState == DocumentLifecycle::CompositingClean |
(...skipping 11 matching lines...) Expand all Loading... |
2565 } | 2533 } |
2566 | 2534 |
2567 updateStyleAndLayoutIfNeededRecursive(); | 2535 updateStyleAndLayoutIfNeededRecursive(); |
2568 DCHECK(lifecycle().state() >= DocumentLifecycle::LayoutClean); | 2536 DCHECK(lifecycle().state() >= DocumentLifecycle::LayoutClean); |
2569 | 2537 |
2570 if (targetState == DocumentLifecycle::LayoutClean) { | 2538 if (targetState == DocumentLifecycle::LayoutClean) { |
2571 updateViewportIntersectionsForSubtree(targetState); | 2539 updateViewportIntersectionsForSubtree(targetState); |
2572 return; | 2540 return; |
2573 } | 2541 } |
2574 | 2542 |
2575 if (targetState == DocumentLifecycle::PaintClean) { | |
2576 forAllNonThrottledFrameViews([](FrameView& frameView) { | |
2577 frameView.notifyResizeObservers(); | |
2578 }); | |
2579 } | |
2580 | |
2581 if (LayoutViewItem view = layoutViewItem()) { | 2543 if (LayoutViewItem view = layoutViewItem()) { |
2582 forAllNonThrottledFrameViews([](FrameView& frameView) { | 2544 forAllNonThrottledFrameViews([](FrameView& frameView) { |
2583 frameView.checkDoesNotNeedLayout(); | 2545 frameView.checkDoesNotNeedLayout(); |
2584 frameView.m_allowsLayoutInvalidationAfterLayoutClean = false; | 2546 frameView.m_allowsLayoutInvalidationAfterLayoutClean = false; |
2585 }); | 2547 }); |
2586 | 2548 |
2587 { | 2549 { |
2588 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", Inspect
orUpdateLayerTreeEvent::data(m_frame.get())); | 2550 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", Inspect
orUpdateLayerTreeEvent::data(m_frame.get())); |
2589 | 2551 |
2590 // This was required for slimming paint v1 but is only temporarily | 2552 // This was required for slimming paint v1 but is only temporarily |
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4297 } | 4259 } |
4298 | 4260 |
4299 bool FrameView::canThrottleRendering() const | 4261 bool FrameView::canThrottleRendering() const |
4300 { | 4262 { |
4301 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) | 4263 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) |
4302 return false; | 4264 return false; |
4303 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); | 4265 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); |
4304 } | 4266 } |
4305 | 4267 |
4306 } // namespace blink | 4268 } // namespace blink |
OLD | NEW |