| 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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 // We need to set m_doFullPaintInvalidation before triggering layout
as RenderObject::checkForPaintInvalidation | 945 // We need to set m_doFullPaintInvalidation before triggering layout
as RenderObject::checkForPaintInvalidation |
| 946 // checks the boolean to disable local paint invalidations. | 946 // checks the boolean to disable local paint invalidations. |
| 947 m_doFullPaintInvalidation |= renderView()->shouldDoFullRepaintForNex
tLayout(); | 947 m_doFullPaintInvalidation |= renderView()->shouldDoFullRepaintForNex
tLayout(); |
| 948 } | 948 } |
| 949 | 949 |
| 950 layer = rootForThisLayout->enclosingLayer(); | 950 layer = rootForThisLayout->enclosingLayer(); |
| 951 | 951 |
| 952 performLayout(rootForThisLayout, inSubtreeLayout); | 952 performLayout(rootForThisLayout, inSubtreeLayout); |
| 953 | 953 |
| 954 m_layoutSubtreeRoot = 0; | 954 m_layoutSubtreeRoot = 0; |
| 955 // We need to ensure that we mark up all renderers up to the RenderView |
| 956 // for paint invalidation. This simplifies our code as we just always |
| 957 // do a full tree walk. |
| 958 if (RenderObject* container = rootForThisLayout->container()) |
| 959 container->setMayNeedPaintInvalidation(true); |
| 955 } // Reset m_layoutSchedulingEnabled to its previous value. | 960 } // Reset m_layoutSchedulingEnabled to its previous value. |
| 956 | 961 |
| 957 if (!inSubtreeLayout && !toRenderView(rootForThisLayout)->document().printin
g()) | 962 if (!inSubtreeLayout && !toRenderView(rootForThisLayout)->document().printin
g()) |
| 958 adjustViewSize(); | 963 adjustViewSize(); |
| 959 | 964 |
| 960 layer->updateLayerPositionsAfterLayout(renderView()->layer(), updateLayerPos
itionFlags(layer, inSubtreeLayout, m_doFullPaintInvalidation)); | 965 layer->updateLayerPositionsAfterLayout(renderView()->layer(), updateLayerPos
itionFlags(layer, inSubtreeLayout, m_doFullPaintInvalidation)); |
| 961 renderView()->compositor()->didLayout(); | 966 renderView()->compositor()->didLayout(); |
| 962 | 967 |
| 963 m_layoutCount++; | 968 m_layoutCount++; |
| 964 | 969 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 977 scheduleOrPerformPostLayoutTasks(); | 982 scheduleOrPerformPostLayoutTasks(); |
| 978 | 983 |
| 979 TRACE_EVENT_END1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Layout", "
endData", InspectorLayoutEvent::endData(rootForThisLayout)); | 984 TRACE_EVENT_END1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Layout", "
endData", InspectorLayoutEvent::endData(rootForThisLayout)); |
| 980 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli
ne migrates to tracing. | 985 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli
ne migrates to tracing. |
| 981 InspectorInstrumentation::didLayout(cookie, rootForThisLayout); | 986 InspectorInstrumentation::didLayout(cookie, rootForThisLayout); |
| 982 | 987 |
| 983 m_nestedLayoutCount--; | 988 m_nestedLayoutCount--; |
| 984 if (m_nestedLayoutCount) | 989 if (m_nestedLayoutCount) |
| 985 return; | 990 return; |
| 986 | 991 |
| 987 invalidateTree(rootForThisLayout); | |
| 988 | |
| 989 m_doFullPaintInvalidation = false; | |
| 990 | |
| 991 #ifndef NDEBUG | 992 #ifndef NDEBUG |
| 992 // Post-layout assert that nobody was re-marked as needing layout during lay
out. | 993 // Post-layout assert that nobody was re-marked as needing layout during lay
out. |
| 993 document->renderView()->assertSubtreeIsLaidOut(); | 994 document->renderView()->assertSubtreeIsLaidOut(); |
| 994 #endif | 995 #endif |
| 995 | 996 |
| 996 // FIXME: It should be not possible to remove the FrameView from the frame/p
age during layout | 997 // FIXME: It should be not possible to remove the FrameView from the frame/p
age during layout |
| 997 // however m_inPerformLayout is not set for most of this function, so none o
f our RELEASE_ASSERTS | 998 // however m_inPerformLayout is not set for most of this function, so none o
f our RELEASE_ASSERTS |
| 998 // in LocalFrame/Page will fire. One of the post-layout tasks is disconnecti
ng the LocalFrame from | 999 // in LocalFrame/Page will fire. One of the post-layout tasks is disconnecti
ng the LocalFrame from |
| 999 // the page in fast/frames/crash-remove-iframe-during-object-beforeload-2.ht
ml | 1000 // the page in fast/frames/crash-remove-iframe-during-object-beforeload-2.ht
ml |
| 1000 // necessitating this check here. | 1001 // necessitating this check here. |
| 1001 // ASSERT(frame()->page()); | 1002 // ASSERT(frame()->page()); |
| 1002 if (frame().page()) | 1003 if (frame().page()) |
| 1003 frame().page()->chrome().client().layoutUpdated(m_frame.get()); | 1004 frame().page()->chrome().client().layoutUpdated(m_frame.get()); |
| 1004 } | 1005 } |
| 1005 | 1006 |
| 1006 // The plan is to move to compositor-queried paint invalidation, in which case t
his | 1007 // The plan is to move to compositor-queried paint invalidation, in which case t
his |
| 1007 // method would setNeedsRedraw on the GraphicsLayers with invalidations and | 1008 // method would setNeedsRedraw on the GraphicsLayers with invalidations and |
| 1008 // let the compositor pick which to actually draw. | 1009 // let the compositor pick which to actually draw. |
| 1009 // See http://crbug.com/306706 | 1010 // See http://crbug.com/306706 |
| 1010 void FrameView::invalidateTree(RenderObject* root) | 1011 void FrameView::invalidateTreeIfNeeded() |
| 1011 { | 1012 { |
| 1012 ASSERT(!root->needsLayout()); | 1013 RenderObject* rootForPaintInvalidation = renderView(); |
| 1013 // We should only invalidate paints for the outer most layout. This works as | 1014 ASSERT(!rootForPaintInvalidation->needsLayout()); |
| 1014 // we continue to track paint invalidation rects until this function is call
ed. | |
| 1015 ASSERT(!m_nestedLayoutCount); | |
| 1016 | 1015 |
| 1017 TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", root->debugName()
.ascii()); | 1016 TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInval
idation->debugName().ascii()); |
| 1018 | 1017 |
| 1019 // FIXME: really, we're in the paint invalidation phase here, and the compos
iting queries are legal. | 1018 LayoutState rootLayoutState(*rootForPaintInvalidation); |
| 1020 // Until those states are fully fledged, I'll just disable the ASSERTS. | |
| 1021 DisableCompositingQueryAsserts compositingQueryAssertsDisabler; | |
| 1022 | 1019 |
| 1023 LayoutState rootLayoutState(*root); | 1020 rootForPaintInvalidation->invalidateTreeAfterLayout(*rootForPaintInvalidatio
n->containerForPaintInvalidation()); |
| 1024 | |
| 1025 root->invalidateTreeAfterLayout(*root->containerForPaintInvalidation()); | |
| 1026 | 1021 |
| 1027 // Invalidate the paint of the frameviews scrollbars if needed | 1022 // Invalidate the paint of the frameviews scrollbars if needed |
| 1028 if (hasVerticalBarDamage()) | 1023 if (hasVerticalBarDamage()) |
| 1029 invalidateRect(verticalBarDamage()); | 1024 invalidateRect(verticalBarDamage()); |
| 1030 if (hasHorizontalBarDamage()) | 1025 if (hasHorizontalBarDamage()) |
| 1031 invalidateRect(horizontalBarDamage()); | 1026 invalidateRect(horizontalBarDamage()); |
| 1032 resetScrollbarDamage(); | 1027 resetScrollbarDamage(); |
| 1028 |
| 1029 m_doFullPaintInvalidation = false; |
| 1033 } | 1030 } |
| 1034 | 1031 |
| 1035 DocumentLifecycle& FrameView::lifecycle() const | 1032 DocumentLifecycle& FrameView::lifecycle() const |
| 1036 { | 1033 { |
| 1037 return m_frame->document()->lifecycle(); | 1034 return m_frame->document()->lifecycle(); |
| 1038 } | 1035 } |
| 1039 | 1036 |
| 1040 void FrameView::gatherDebugLayoutRects(RenderObject* layoutRoot) | 1037 void FrameView::gatherDebugLayoutRects(RenderObject* layoutRoot) |
| 1041 { | 1038 { |
| 1042 bool isTracing; | 1039 bool isTracing; |
| (...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2813 | 2810 |
| 2814 if (RenderView* view = renderView()) { | 2811 if (RenderView* view = renderView()) { |
| 2815 InspectorInstrumentation::willUpdateLayerTree(view->frame()); | 2812 InspectorInstrumentation::willUpdateLayerTree(view->frame()); |
| 2816 | 2813 |
| 2817 view->compositor()->updateIfNeededRecursive(); | 2814 view->compositor()->updateIfNeededRecursive(); |
| 2818 | 2815 |
| 2819 if (view->compositor()->inCompositingMode() && m_frame->isMainFrame()) | 2816 if (view->compositor()->inCompositingMode() && m_frame->isMainFrame()) |
| 2820 m_frame->page()->scrollingCoordinator()->updateAfterCompositingChang
eIfNeeded(); | 2817 m_frame->page()->scrollingCoordinator()->updateAfterCompositingChang
eIfNeeded(); |
| 2821 | 2818 |
| 2822 InspectorInstrumentation::didUpdateLayerTree(view->frame()); | 2819 InspectorInstrumentation::didUpdateLayerTree(view->frame()); |
| 2820 |
| 2821 invalidateTreeIfNeededRecursive(); |
| 2823 } | 2822 } |
| 2824 | 2823 |
| 2825 scrollContentsIfNeededRecursive(); | 2824 scrollContentsIfNeededRecursive(); |
| 2826 } | 2825 } |
| 2827 | 2826 |
| 2828 void FrameView::updateLayoutAndStyleIfNeededRecursive() | 2827 void FrameView::updateLayoutAndStyleIfNeededRecursive() |
| 2829 { | 2828 { |
| 2830 // We have to crawl our entire tree looking for any FrameViews that need | 2829 // We have to crawl our entire tree looking for any FrameViews that need |
| 2831 // layout and make sure they are up to date. | 2830 // layout and make sure they are up to date. |
| 2832 // Mac actually tests for intersection with the dirty region and tries not t
o | 2831 // Mac actually tests for intersection with the dirty region and tries not t
o |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2868 | 2867 |
| 2869 // These asserts ensure that parent frames are clean, when child frames fini
shed updating layout and style. | 2868 // These asserts ensure that parent frames are clean, when child frames fini
shed updating layout and style. |
| 2870 ASSERT(!needsLayout()); | 2869 ASSERT(!needsLayout()); |
| 2871 ASSERT(!m_frame->document()->hasSVGFilterElementsRequiringLayerUpdate()); | 2870 ASSERT(!m_frame->document()->hasSVGFilterElementsRequiringLayerUpdate()); |
| 2872 #ifndef NDEBUG | 2871 #ifndef NDEBUG |
| 2873 m_frame->document()->renderView()->assertRendererLaidOut(); | 2872 m_frame->document()->renderView()->assertRendererLaidOut(); |
| 2874 #endif | 2873 #endif |
| 2875 | 2874 |
| 2876 } | 2875 } |
| 2877 | 2876 |
| 2877 void FrameView::invalidateTreeIfNeededRecursive() |
| 2878 { |
| 2879 // FIXME: We should be more aggressive at cutting tree traversals. |
| 2880 invalidateTreeIfNeeded(); |
| 2881 |
| 2882 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree
().nextSibling()) { |
| 2883 if (!child->isLocalFrame()) |
| 2884 continue; |
| 2885 |
| 2886 toLocalFrame(child)->view()->invalidateTreeIfNeededRecursive(); |
| 2887 } |
| 2888 } |
| 2889 |
| 2878 void FrameView::enableAutoSizeMode(bool enable, const IntSize& minSize, const In
tSize& maxSize) | 2890 void FrameView::enableAutoSizeMode(bool enable, const IntSize& minSize, const In
tSize& maxSize) |
| 2879 { | 2891 { |
| 2880 ASSERT(!enable || !minSize.isEmpty()); | 2892 ASSERT(!enable || !minSize.isEmpty()); |
| 2881 ASSERT(minSize.width() <= maxSize.width()); | 2893 ASSERT(minSize.width() <= maxSize.width()); |
| 2882 ASSERT(minSize.height() <= maxSize.height()); | 2894 ASSERT(minSize.height() <= maxSize.height()); |
| 2883 | 2895 |
| 2884 if (m_shouldAutoSize == enable && m_minAutoSize == minSize && m_maxAutoSize
== maxSize) | 2896 if (m_shouldAutoSize == enable && m_minAutoSize == minSize && m_maxAutoSize
== maxSize) |
| 2885 return; | 2897 return; |
| 2886 | 2898 |
| 2887 | 2899 |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3259 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o
rientation) | 3271 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o
rientation) |
| 3260 { | 3272 { |
| 3261 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); | 3273 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); |
| 3262 if (AXObjectCache* cache = axObjectCache()) { | 3274 if (AXObjectCache* cache = axObjectCache()) { |
| 3263 cache->remove(scrollbar); | 3275 cache->remove(scrollbar); |
| 3264 cache->handleScrollbarUpdate(this); | 3276 cache->handleScrollbarUpdate(this); |
| 3265 } | 3277 } |
| 3266 } | 3278 } |
| 3267 | 3279 |
| 3268 } // namespace WebCore | 3280 } // namespace WebCore |
| OLD | NEW |