| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 using namespace HTMLNames; | 88 using namespace HTMLNames; |
| 89 | 89 |
| 90 double FrameView::s_currentFrameTimeStamp = 0.0; | 90 double FrameView::s_currentFrameTimeStamp = 0.0; |
| 91 bool FrameView::s_inPaintContents = false; | 91 bool FrameView::s_inPaintContents = false; |
| 92 | 92 |
| 93 // The maximum number of updateWidgets iterations that should be done before ret
urning. | 93 // The maximum number of updateWidgets iterations that should be done before ret
urning. |
| 94 static const unsigned maxUpdateWidgetsIterations = 2; | 94 static const unsigned maxUpdateWidgetsIterations = 2; |
| 95 static const double resourcePriorityUpdateDelayAfterScroll = 0.250; | 95 static const double resourcePriorityUpdateDelayAfterScroll = 0.250; |
| 96 | 96 |
| 97 static RenderLayer::UpdateLayerPositionsFlags updateLayerPositionFlags(RenderLay
er* layer, bool isRelayoutingSubtree, bool didFullRepaint) | 97 static RenderLayer::UpdateLayerPositionsFlags updateLayerPositionFlags(RenderLay
er* layer, bool isRelayoutingSubtree, bool didFullPaintInvalidation) |
| 98 { | 98 { |
| 99 RenderLayer::UpdateLayerPositionsFlags flags = didFullRepaint ? RenderLayer:
:NeedsFullRepaintInBacking : RenderLayer::CheckForRepaint; | 99 RenderLayer::UpdateLayerPositionsFlags flags = didFullPaintInvalidation ? Re
nderLayer::NeedsFullRepaintInBacking : RenderLayer::CheckForRepaint; |
| 100 | 100 |
| 101 if (isRelayoutingSubtree && (layer->isPaginated() || layer->enclosingPaginat
ionLayer())) | 101 if (isRelayoutingSubtree && (layer->isPaginated() || layer->enclosingPaginat
ionLayer())) |
| 102 flags |= RenderLayer::UpdatePagination; | 102 flags |= RenderLayer::UpdatePagination; |
| 103 | 103 |
| 104 return flags; | 104 return flags; |
| 105 } | 105 } |
| 106 | 106 |
| 107 class FrameViewLayoutStateMaintainer { | 107 class FrameViewLayoutStateMaintainer { |
| 108 WTF_MAKE_NONCOPYABLE(FrameViewLayoutStateMaintainer); | 108 WTF_MAKE_NONCOPYABLE(FrameViewLayoutStateMaintainer); |
| 109 public: | 109 public: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired) | 141 , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired) |
| 142 , m_updateWidgetsTimer(this, &FrameView::updateWidgetsTimerFired) | 142 , m_updateWidgetsTimer(this, &FrameView::updateWidgetsTimerFired) |
| 143 , m_isTransparent(false) | 143 , m_isTransparent(false) |
| 144 , m_baseBackgroundColor(Color::white) | 144 , m_baseBackgroundColor(Color::white) |
| 145 , m_mediaType("screen") | 145 , m_mediaType("screen") |
| 146 , m_overflowStatusDirty(true) | 146 , m_overflowStatusDirty(true) |
| 147 , m_viewportRenderer(0) | 147 , m_viewportRenderer(0) |
| 148 , m_wasScrolledByUser(false) | 148 , m_wasScrolledByUser(false) |
| 149 , m_inProgrammaticScroll(false) | 149 , m_inProgrammaticScroll(false) |
| 150 , m_safeToPropagateScrollToParent(true) | 150 , m_safeToPropagateScrollToParent(true) |
| 151 , m_isTrackingRepaints(false) | 151 , m_isTrackingPaintInvalidations(false) |
| 152 , m_scrollCorner(0) | 152 , m_scrollCorner(0) |
| 153 , m_shouldAutoSize(false) | 153 , m_shouldAutoSize(false) |
| 154 , m_inAutoSize(false) | 154 , m_inAutoSize(false) |
| 155 , m_didRunAutosize(false) | 155 , m_didRunAutosize(false) |
| 156 , m_hasSoftwareFilters(false) | 156 , m_hasSoftwareFilters(false) |
| 157 , m_visibleContentScaleFactor(1) | 157 , m_visibleContentScaleFactor(1) |
| 158 , m_inputEventsScaleFactorForEmulation(1) | 158 , m_inputEventsScaleFactorForEmulation(1) |
| 159 , m_layoutSizeFixedToFrameSize(true) | 159 , m_layoutSizeFixedToFrameSize(true) |
| 160 , m_didScrollTimer(this, &FrameView::didScrollTimerFired) | 160 , m_didScrollTimer(this, &FrameView::didScrollTimerFired) |
| 161 { | 161 { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 ownerElement->setWidget(nullptr); | 214 ownerElement->setWidget(nullptr); |
| 215 } | 215 } |
| 216 | 216 |
| 217 void FrameView::reset() | 217 void FrameView::reset() |
| 218 { | 218 { |
| 219 m_cannotBlitToWindow = false; | 219 m_cannotBlitToWindow = false; |
| 220 m_isOverlapped = false; | 220 m_isOverlapped = false; |
| 221 m_contentIsOpaque = false; | 221 m_contentIsOpaque = false; |
| 222 m_hasPendingLayout = false; | 222 m_hasPendingLayout = false; |
| 223 m_layoutSubtreeRoot = 0; | 223 m_layoutSubtreeRoot = 0; |
| 224 m_doFullRepaint = false; | 224 m_doFullPaintInvalidation = false; |
| 225 m_layoutSchedulingEnabled = true; | 225 m_layoutSchedulingEnabled = true; |
| 226 m_inPerformLayout = false; | 226 m_inPerformLayout = false; |
| 227 m_canInvalidatePaintDuringPerformLayout = false; | 227 m_canInvalidatePaintDuringPerformLayout = false; |
| 228 m_inSynchronousPostLayout = false; | 228 m_inSynchronousPostLayout = false; |
| 229 m_layoutCount = 0; | 229 m_layoutCount = 0; |
| 230 m_nestedLayoutCount = 0; | 230 m_nestedLayoutCount = 0; |
| 231 m_postLayoutTasksTimer.stop(); | 231 m_postLayoutTasksTimer.stop(); |
| 232 m_updateWidgetsTimer.stop(); | 232 m_updateWidgetsTimer.stop(); |
| 233 m_firstLayout = true; | 233 m_firstLayout = true; |
| 234 m_firstLayoutCallbackPending = false; | 234 m_firstLayoutCallbackPending = false; |
| 235 m_wasScrolledByUser = false; | 235 m_wasScrolledByUser = false; |
| 236 m_safeToPropagateScrollToParent = true; | 236 m_safeToPropagateScrollToParent = true; |
| 237 m_lastViewportSize = IntSize(); | 237 m_lastViewportSize = IntSize(); |
| 238 m_lastZoomFactor = 1.0f; | 238 m_lastZoomFactor = 1.0f; |
| 239 m_isTrackingRepaints = false; | 239 m_isTrackingPaintInvalidations = false; |
| 240 m_trackedRepaintRects.clear(); | 240 m_trackedPaintInvalidationRects.clear(); |
| 241 m_lastPaintTime = 0; | 241 m_lastPaintTime = 0; |
| 242 m_paintBehavior = PaintBehaviorNormal; | 242 m_paintBehavior = PaintBehaviorNormal; |
| 243 m_isPainting = false; | 243 m_isPainting = false; |
| 244 m_visuallyNonEmptyCharacterCount = 0; | 244 m_visuallyNonEmptyCharacterCount = 0; |
| 245 m_visuallyNonEmptyPixelCount = 0; | 245 m_visuallyNonEmptyPixelCount = 0; |
| 246 m_isVisuallyNonEmpty = false; | 246 m_isVisuallyNonEmpty = false; |
| 247 m_firstVisuallyNonEmptyLayoutCallbackPending = true; | 247 m_firstVisuallyNonEmptyLayoutCallbackPending = true; |
| 248 m_maintainScrollPositionAnchor = nullptr; | 248 m_maintainScrollPositionAnchor = nullptr; |
| 249 m_viewportConstrainedObjects.clear(); | 249 m_viewportConstrainedObjects.clear(); |
| 250 } | 250 } |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 if (!parent()) { | 351 if (!parent()) { |
| 352 if (HostWindow* window = hostWindow()) | 352 if (HostWindow* window = hostWindow()) |
| 353 window->invalidateContentsAndRootView(rect); | 353 window->invalidateContentsAndRootView(rect); |
| 354 return; | 354 return; |
| 355 } | 355 } |
| 356 | 356 |
| 357 RenderPart* renderer = m_frame->ownerRenderer(); | 357 RenderPart* renderer = m_frame->ownerRenderer(); |
| 358 if (!renderer) | 358 if (!renderer) |
| 359 return; | 359 return; |
| 360 | 360 |
| 361 IntRect repaintRect = rect; | 361 IntRect paintInvalidationRect = rect; |
| 362 repaintRect.move(renderer->borderLeft() + renderer->paddingLeft(), | 362 paintInvalidationRect.move(renderer->borderLeft() + renderer->paddingLeft(), |
| 363 renderer->borderTop() + renderer->paddingTop()); | 363 renderer->borderTop() + renderer->paddingTop()); |
| 364 renderer->repaintRectangle(repaintRect); | 364 renderer->repaintRectangle(paintInvalidationRect); |
| 365 } | 365 } |
| 366 | 366 |
| 367 void FrameView::setFrameRect(const IntRect& newRect) | 367 void FrameView::setFrameRect(const IntRect& newRect) |
| 368 { | 368 { |
| 369 IntRect oldRect = frameRect(); | 369 IntRect oldRect = frameRect(); |
| 370 if (newRect == oldRect) | 370 if (newRect == oldRect) |
| 371 return; | 371 return; |
| 372 | 372 |
| 373 // Autosized font sizes depend on the width of the viewing area. | 373 // Autosized font sizes depend on the width of the viewing area. |
| 374 bool autosizerNeedsUpdating = false; | 374 bool autosizerNeedsUpdating = false; |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 | 803 |
| 804 // FIXME (crbug.com/256657): Do not do two layouts for text autosizing. | 804 // FIXME (crbug.com/256657): Do not do two layouts for text autosizing. |
| 805 rootForThisLayout->layout(); | 805 rootForThisLayout->layout(); |
| 806 gatherDebugLayoutRects(rootForThisLayout); | 806 gatherDebugLayoutRects(rootForThisLayout); |
| 807 | 807 |
| 808 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->updateAllIma
geResourcePriorities(); | 808 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->updateAllIma
geResourcePriorities(); |
| 809 | 809 |
| 810 TextAutosizer* textAutosizer = frame().document()->textAutosizer(); | 810 TextAutosizer* textAutosizer = frame().document()->textAutosizer(); |
| 811 bool autosized; | 811 bool autosized; |
| 812 { | 812 { |
| 813 AllowPaintInvalidationScope repaintAllowed(this); | 813 AllowPaintInvalidationScope paintInvalidationAllowed(this); |
| 814 autosized = textAutosizer && textAutosizer->processSubtree(rootForThisLa
yout); | 814 autosized = textAutosizer && textAutosizer->processSubtree(rootForThisLa
yout); |
| 815 } | 815 } |
| 816 | 816 |
| 817 if (autosized && rootForThisLayout->needsLayout()) { | 817 if (autosized && rootForThisLayout->needsLayout()) { |
| 818 TRACE_EVENT0("webkit", "2nd layout due to Text Autosizing"); | 818 TRACE_EVENT0("webkit", "2nd layout due to Text Autosizing"); |
| 819 UseCounter::count(*frame().document(), UseCounter::TextAutosizingLayout)
; | 819 UseCounter::count(*frame().document(), UseCounter::TextAutosizingLayout)
; |
| 820 rootForThisLayout->layout(); | 820 rootForThisLayout->layout(); |
| 821 gatherDebugLayoutRects(rootForThisLayout); | 821 gatherDebugLayoutRects(rootForThisLayout); |
| 822 } | 822 } |
| 823 | 823 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 calculateScrollbarModesForLayoutAndSetViewportRenderer(hMode, vMode); | 923 calculateScrollbarModesForLayoutAndSetViewportRenderer(hMode, vMode); |
| 924 | 924 |
| 925 if (!inSubtreeLayout) { | 925 if (!inSubtreeLayout) { |
| 926 // Now set our scrollbar state for the layout. | 926 // Now set our scrollbar state for the layout. |
| 927 ScrollbarMode currentHMode = horizontalScrollbarMode(); | 927 ScrollbarMode currentHMode = horizontalScrollbarMode(); |
| 928 ScrollbarMode currentVMode = verticalScrollbarMode(); | 928 ScrollbarMode currentVMode = verticalScrollbarMode(); |
| 929 | 929 |
| 930 if (m_firstLayout) { | 930 if (m_firstLayout) { |
| 931 setScrollbarsSuppressed(true); | 931 setScrollbarsSuppressed(true); |
| 932 | 932 |
| 933 m_doFullRepaint = true; | 933 m_doFullPaintInvalidation = true; |
| 934 m_firstLayout = false; | 934 m_firstLayout = false; |
| 935 m_firstLayoutCallbackPending = true; | 935 m_firstLayoutCallbackPending = true; |
| 936 m_lastViewportSize = layoutSize(IncludeScrollbars); | 936 m_lastViewportSize = layoutSize(IncludeScrollbars); |
| 937 m_lastZoomFactor = rootForThisLayout->style()->zoom(); | 937 m_lastZoomFactor = rootForThisLayout->style()->zoom(); |
| 938 | 938 |
| 939 // Set the initial vMode to AlwaysOn if we're auto. | 939 // Set the initial vMode to AlwaysOn if we're auto. |
| 940 if (vMode == ScrollbarAuto) | 940 if (vMode == ScrollbarAuto) |
| 941 setVerticalScrollbarMode(ScrollbarAlwaysOn); // This causes
a vertical scrollbar to appear. | 941 setVerticalScrollbarMode(ScrollbarAlwaysOn); // This causes
a vertical scrollbar to appear. |
| 942 // Set the initial hMode to AlwaysOff if we're auto. | 942 // Set the initial hMode to AlwaysOff if we're auto. |
| 943 if (hMode == ScrollbarAuto) | 943 if (hMode == ScrollbarAuto) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 955 | 955 |
| 956 if (oldSize != m_size && !m_firstLayout) { | 956 if (oldSize != m_size && !m_firstLayout) { |
| 957 RenderBox* rootRenderer = document->documentElement() ? document
->documentElement()->renderBox() : 0; | 957 RenderBox* rootRenderer = document->documentElement() ? document
->documentElement()->renderBox() : 0; |
| 958 RenderBox* bodyRenderer = rootRenderer && document->body() ? doc
ument->body()->renderBox() : 0; | 958 RenderBox* bodyRenderer = rootRenderer && document->body() ? doc
ument->body()->renderBox() : 0; |
| 959 if (bodyRenderer && bodyRenderer->stretchesToViewport()) | 959 if (bodyRenderer && bodyRenderer->stretchesToViewport()) |
| 960 bodyRenderer->setChildNeedsLayout(); | 960 bodyRenderer->setChildNeedsLayout(); |
| 961 else if (rootRenderer && rootRenderer->stretchesToViewport()) | 961 else if (rootRenderer && rootRenderer->stretchesToViewport()) |
| 962 rootRenderer->setChildNeedsLayout(); | 962 rootRenderer->setChildNeedsLayout(); |
| 963 } | 963 } |
| 964 | 964 |
| 965 // We need to set m_doFullRepaint before triggering layout as Render
Object::checkForRepaint | 965 // We need to set m_doFullPaintInvalidation before triggering layout
as RenderObject::checkForRepaint |
| 966 // checks the boolean to disable local repaints. | 966 // checks the boolean to disable local paint invalidations. |
| 967 m_doFullRepaint |= renderView()->shouldDoFullRepaintForNextLayout(); | 967 m_doFullPaintInvalidation |= renderView()->shouldDoFullRepaintForNex
tLayout(); |
| 968 } | 968 } |
| 969 | 969 |
| 970 layer = rootForThisLayout->enclosingLayer(); | 970 layer = rootForThisLayout->enclosingLayer(); |
| 971 | 971 |
| 972 performLayout(rootForThisLayout, inSubtreeLayout); | 972 performLayout(rootForThisLayout, inSubtreeLayout); |
| 973 | 973 |
| 974 m_layoutSubtreeRoot = 0; | 974 m_layoutSubtreeRoot = 0; |
| 975 } // Reset m_layoutSchedulingEnabled to its previous value. | 975 } // Reset m_layoutSchedulingEnabled to its previous value. |
| 976 | 976 |
| 977 if (!inSubtreeLayout && !toRenderView(rootForThisLayout)->document().printin
g()) | 977 if (!inSubtreeLayout && !toRenderView(rootForThisLayout)->document().printin
g()) |
| 978 adjustViewSize(); | 978 adjustViewSize(); |
| 979 | 979 |
| 980 layer->updateLayerPositionsAfterLayout(renderView()->layer(), updateLayerPos
itionFlags(layer, inSubtreeLayout, m_doFullRepaint)); | 980 layer->updateLayerPositionsAfterLayout(renderView()->layer(), updateLayerPos
itionFlags(layer, inSubtreeLayout, m_doFullPaintInvalidation)); |
| 981 renderView()->compositor()->setNeedsCompositingUpdate(CompositingUpdateAfter
Layout); | 981 renderView()->compositor()->setNeedsCompositingUpdate(CompositingUpdateAfter
Layout); |
| 982 | 982 |
| 983 m_layoutCount++; | 983 m_layoutCount++; |
| 984 | 984 |
| 985 if (AXObjectCache* cache = rootForThisLayout->document().axObjectCache()) { | 985 if (AXObjectCache* cache = rootForThisLayout->document().axObjectCache()) { |
| 986 const KURL& url = rootForThisLayout->document().url(); | 986 const KURL& url = rootForThisLayout->document().url(); |
| 987 if (url.isValid() && !url.isAboutBlankURL()) | 987 if (url.isValid() && !url.isAboutBlankURL()) |
| 988 cache->handleLayoutComplete(rootForThisLayout); | 988 cache->handleLayoutComplete(rootForThisLayout); |
| 989 } | 989 } |
| 990 updateAnnotatedRegions(); | 990 updateAnnotatedRegions(); |
| 991 | 991 |
| 992 ASSERT(!rootForThisLayout->needsLayout()); | 992 ASSERT(!rootForThisLayout->needsLayout()); |
| 993 | 993 |
| 994 if (document->hasListenerType(Document::OVERFLOWCHANGED_LISTENER)) | 994 if (document->hasListenerType(Document::OVERFLOWCHANGED_LISTENER)) |
| 995 updateOverflowStatus(layoutSize().width() < contentsWidth(), layoutSize(
).height() < contentsHeight()); | 995 updateOverflowStatus(layoutSize().width() < contentsWidth(), layoutSize(
).height() < contentsHeight()); |
| 996 | 996 |
| 997 scheduleOrPerformPostLayoutTasks(); | 997 scheduleOrPerformPostLayoutTasks(); |
| 998 | 998 |
| 999 TRACE_EVENT_END1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Layout", "
endData", InspectorLayoutEvent::endData(rootForThisLayout)); | 999 TRACE_EVENT_END1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Layout", "
endData", InspectorLayoutEvent::endData(rootForThisLayout)); |
| 1000 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli
ne migrates to tracing. | 1000 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli
ne migrates to tracing. |
| 1001 InspectorInstrumentation::didLayout(cookie, rootForThisLayout); | 1001 InspectorInstrumentation::didLayout(cookie, rootForThisLayout); |
| 1002 | 1002 |
| 1003 m_nestedLayoutCount--; | 1003 m_nestedLayoutCount--; |
| 1004 if (m_nestedLayoutCount) | 1004 if (m_nestedLayoutCount) |
| 1005 return; | 1005 return; |
| 1006 | 1006 |
| 1007 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { | 1007 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { |
| 1008 invalidateTree(rootForThisLayout); | 1008 invalidateTree(rootForThisLayout); |
| 1009 } else if (m_doFullRepaint) { | 1009 } else if (m_doFullPaintInvalidation) { |
| 1010 // FIXME: This isn't really right, since the RenderView doesn't fully en
compass | 1010 // FIXME: This isn't really right, since the RenderView doesn't fully en
compass |
| 1011 // the visibleContentRect(). It just happens to work out most of the tim
e, | 1011 // the visibleContentRect(). It just happens to work out most of the tim
e, |
| 1012 // since first layouts and printing don't have you scrolled anywhere. | 1012 // since first layouts and printing don't have you scrolled anywhere. |
| 1013 renderView()->repaint(); | 1013 renderView()->repaint(); |
| 1014 } | 1014 } |
| 1015 | 1015 |
| 1016 m_doFullRepaint = false; | 1016 m_doFullPaintInvalidation = false; |
| 1017 | 1017 |
| 1018 #ifndef NDEBUG | 1018 #ifndef NDEBUG |
| 1019 // Post-layout assert that nobody was re-marked as needing layout during lay
out. | 1019 // Post-layout assert that nobody was re-marked as needing layout during lay
out. |
| 1020 document->renderView()->assertSubtreeIsLaidOut(); | 1020 document->renderView()->assertSubtreeIsLaidOut(); |
| 1021 #endif | 1021 #endif |
| 1022 | 1022 |
| 1023 // FIXME: It should be not possible to remove the FrameView from the frame/p
age during layout | 1023 // FIXME: It should be not possible to remove the FrameView from the frame/p
age during layout |
| 1024 // however m_inPerformLayout is not set for most of this function, so none o
f our RELEASE_ASSERTS | 1024 // however m_inPerformLayout is not set for most of this function, so none o
f our RELEASE_ASSERTS |
| 1025 // in LocalFrame/Page will fire. One of the post-layout tasks is disconnecti
ng the LocalFrame from | 1025 // in LocalFrame/Page will fire. One of the post-layout tasks is disconnecti
ng the LocalFrame from |
| 1026 // the page in fast/frames/crash-remove-iframe-during-object-beforeload-2.ht
ml | 1026 // the page in fast/frames/crash-remove-iframe-during-object-beforeload-2.ht
ml |
| 1027 // necessitating this check here. | 1027 // necessitating this check here. |
| 1028 // ASSERT(frame()->page()); | 1028 // ASSERT(frame()->page()); |
| 1029 if (frame().page()) | 1029 if (frame().page()) |
| 1030 frame().page()->chrome().client().layoutUpdated(m_frame.get()); | 1030 frame().page()->chrome().client().layoutUpdated(m_frame.get()); |
| 1031 } | 1031 } |
| 1032 | 1032 |
| 1033 // The plan is to move to compositor-queried repainting, in which case this | 1033 // The plan is to move to compositor-queried paint invalidation, in which case t
his |
| 1034 // method would setNeedsRedraw on the GraphicsLayers with invalidations and | 1034 // method would setNeedsRedraw on the GraphicsLayers with invalidations and |
| 1035 // let the compositor pick which to actually draw. | 1035 // let the compositor pick which to actually draw. |
| 1036 // See http://crbug.com/306706 | 1036 // See http://crbug.com/306706 |
| 1037 void FrameView::invalidateTree(RenderObject* root) | 1037 void FrameView::invalidateTree(RenderObject* root) |
| 1038 { | 1038 { |
| 1039 ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled()); | 1039 ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled()); |
| 1040 ASSERT(!root->needsLayout()); | 1040 ASSERT(!root->needsLayout()); |
| 1041 // We should only repaint for the outer most layout. This works as | 1041 // We should only invalidate paints for the outer most layout. This works as |
| 1042 // we continue to track repaint rects until this function is called. | 1042 // we continue to track paint invalidation rects until this function is call
ed. |
| 1043 ASSERT(!m_nestedLayoutCount); | 1043 ASSERT(!m_nestedLayoutCount); |
| 1044 | 1044 |
| 1045 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "FrameView::re
paintTree", | 1045 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "FrameView::in
validateTree", |
| 1046 "root", TRACE_STR_COPY(root->debugName().ascii().data())); | 1046 "root", TRACE_STR_COPY(root->debugName().ascii().data())); |
| 1047 | 1047 |
| 1048 // FIXME: really, we're in the repaint phase here, and the compositing queri
es are legal. | 1048 // FIXME: really, we're in the paint invalidation phase here, and the compos
iting queries are legal. |
| 1049 // Until those states are fully fledged, I'll just disable the ASSERTS. | 1049 // Until those states are fully fledged, I'll just disable the ASSERTS. |
| 1050 DisableCompositingQueryAsserts compositingQueryAssertsDisabler; | 1050 DisableCompositingQueryAsserts compositingQueryAssertsDisabler; |
| 1051 | 1051 |
| 1052 RootLayoutStateScope rootLayoutStateScope(*root); | 1052 RootLayoutStateScope rootLayoutStateScope(*root); |
| 1053 | 1053 |
| 1054 root->invalidateTreeAfterLayout(*root->containerForRepaint()); | 1054 root->invalidateTreeAfterLayout(*root->containerForRepaint()); |
| 1055 | 1055 |
| 1056 // Repaint the frameviews scrollbars if needed | 1056 // Invalidate the paint of the frameviews scrollbars if needed |
| 1057 if (hasVerticalBarDamage()) | 1057 if (hasVerticalBarDamage()) |
| 1058 invalidateRect(verticalBarDamage()); | 1058 invalidateRect(verticalBarDamage()); |
| 1059 if (hasHorizontalBarDamage()) | 1059 if (hasHorizontalBarDamage()) |
| 1060 invalidateRect(horizontalBarDamage()); | 1060 invalidateRect(horizontalBarDamage()); |
| 1061 resetScrollbarDamage(); | 1061 resetScrollbarDamage(); |
| 1062 } | 1062 } |
| 1063 | 1063 |
| 1064 DocumentLifecycle& FrameView::lifecycle() const | 1064 DocumentLifecycle& FrameView::lifecycle() const |
| 1065 { | 1065 { |
| 1066 return m_frame->document()->lifecycle(); | 1066 return m_frame->document()->lifecycle(); |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1368 if (FrameView* view = child->view()) | 1368 if (FrameView* view = child->view()) |
| 1369 view->scrollContentsIfNeededRecursive(); | 1369 view->scrollContentsIfNeededRecursive(); |
| 1370 } | 1370 } |
| 1371 } | 1371 } |
| 1372 | 1372 |
| 1373 void FrameView::scrollContentsIfNeeded() | 1373 void FrameView::scrollContentsIfNeeded() |
| 1374 { | 1374 { |
| 1375 bool didScroll = !pendingScrollDelta().isZero(); | 1375 bool didScroll = !pendingScrollDelta().isZero(); |
| 1376 ScrollView::scrollContentsIfNeeded(); | 1376 ScrollView::scrollContentsIfNeeded(); |
| 1377 if (didScroll) | 1377 if (didScroll) |
| 1378 updateFixedElementRepaintRectsAfterScroll(); | 1378 updateFixedElementPaintInvalidationRectsAfterScroll(); |
| 1379 } | 1379 } |
| 1380 | 1380 |
| 1381 bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
& rectToScroll, const IntRect& clipRect) | 1381 bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
& rectToScroll, const IntRect& clipRect) |
| 1382 { | 1382 { |
| 1383 if (!m_viewportConstrainedObjects || m_viewportConstrainedObjects->isEmpty()
) { | 1383 if (!m_viewportConstrainedObjects || m_viewportConstrainedObjects->isEmpty()
) { |
| 1384 hostWindow()->scroll(scrollDelta, rectToScroll, clipRect); | 1384 hostWindow()->scroll(scrollDelta, rectToScroll, clipRect); |
| 1385 return true; | 1385 return true; |
| 1386 } | 1386 } |
| 1387 | 1387 |
| 1388 const bool isCompositedContentLayer = contentsInCompositedLayer(); | 1388 const bool isCompositedContentLayer = contentsInCompositedLayer(); |
| 1389 | 1389 |
| 1390 // Get the rects of the fixed objects visible in the rectToScroll | 1390 // Get the rects of the fixed objects visible in the rectToScroll |
| 1391 Region regionToUpdate; | 1391 Region regionToUpdate; |
| 1392 ViewportConstrainedObjectSet::const_iterator end = m_viewportConstrainedObje
cts->end(); | 1392 ViewportConstrainedObjectSet::const_iterator end = m_viewportConstrainedObje
cts->end(); |
| 1393 for (ViewportConstrainedObjectSet::const_iterator it = m_viewportConstrained
Objects->begin(); it != end; ++it) { | 1393 for (ViewportConstrainedObjectSet::const_iterator it = m_viewportConstrained
Objects->begin(); it != end; ++it) { |
| 1394 RenderObject* renderer = *it; | 1394 RenderObject* renderer = *it; |
| 1395 // m_viewportConstrainedObjects should not contain non-viewport constrai
ned objects. | 1395 // m_viewportConstrainedObjects should not contain non-viewport constrai
ned objects. |
| 1396 ASSERT(renderer->style()->hasViewportConstrainedPosition()); | 1396 ASSERT(renderer->style()->hasViewportConstrainedPosition()); |
| 1397 | 1397 |
| 1398 // Fixed items should always have layers. | 1398 // Fixed items should always have layers. |
| 1399 ASSERT(renderer->hasLayer()); | 1399 ASSERT(renderer->hasLayer()); |
| 1400 RenderLayer* layer = toRenderBoxModelObject(renderer)->layer(); | 1400 RenderLayer* layer = toRenderBoxModelObject(renderer)->layer(); |
| 1401 | 1401 |
| 1402 // Layers that paint into their ancestor or into a grouped backing will
still need | 1402 // Layers that paint into their ancestor or into a grouped backing will
still need |
| 1403 // to apply a repaint invalidation. If the layer paints into its own bac
king, then | 1403 // to apply a paint invalidation. If the layer paints into its own backi
ng, then |
| 1404 // it does not need repainting just to scroll. | 1404 // it does not need paint invalidation just to scroll. |
| 1405 if (layer->compositingState() == PaintsIntoOwnBacking) | 1405 if (layer->compositingState() == PaintsIntoOwnBacking) |
| 1406 continue; | 1406 continue; |
| 1407 | 1407 |
| 1408 if (layer->viewportConstrainedNotCompositedReason() == RenderLayer::NotC
ompositedForBoundsOutOfView | 1408 if (layer->viewportConstrainedNotCompositedReason() == RenderLayer::NotC
ompositedForBoundsOutOfView |
| 1409 || layer->viewportConstrainedNotCompositedReason() == RenderLayer::N
otCompositedForNoVisibleContent) { | 1409 || layer->viewportConstrainedNotCompositedReason() == RenderLayer::N
otCompositedForNoVisibleContent) { |
| 1410 // Don't invalidate for invisible fixed layers. | 1410 // Don't invalidate for invisible fixed layers. |
| 1411 continue; | 1411 continue; |
| 1412 } | 1412 } |
| 1413 | 1413 |
| 1414 if (layer->hasAncestorWithFilterOutsets()) { | 1414 if (layer->hasAncestorWithFilterOutsets()) { |
| 1415 // If the fixed layer has a blur/drop-shadow filter applied on at le
ast one of its parents, we cannot | 1415 // If the fixed layer has a blur/drop-shadow filter applied on at le
ast one of its parents, we cannot |
| 1416 // scroll using the fast path, otherwise the outsets of the filter w
ill be moved around the page. | 1416 // scroll using the fast path, otherwise the outsets of the filter w
ill be moved around the page. |
| 1417 return false; | 1417 return false; |
| 1418 } | 1418 } |
| 1419 | 1419 |
| 1420 IntRect updateRect = pixelSnappedIntRect(layer->repainter().repaintRectI
ncludingNonCompositingDescendants()); | 1420 IntRect updateRect = pixelSnappedIntRect(layer->repainter().repaintRectI
ncludingNonCompositingDescendants()); |
| 1421 | 1421 |
| 1422 RenderLayer* enclosingCompositingLayer = layer->enclosingCompositingLaye
r(ExcludeSelf); | 1422 RenderLayer* enclosingCompositingLayer = layer->enclosingCompositingLaye
r(ExcludeSelf); |
| 1423 if (enclosingCompositingLayer && !enclosingCompositingLayer->renderer()-
>isRenderView()) { | 1423 if (enclosingCompositingLayer && !enclosingCompositingLayer->renderer()-
>isRenderView()) { |
| 1424 // If the fixed-position layer is contained by a composited layer th
at is not its containing block, | 1424 // If the fixed-position layer is contained by a composited layer th
at is not its containing block, |
| 1425 // then we have to invalidate that enclosing layer, not the RenderVi
ew. | 1425 // then we have to invalidate that enclosing layer, not the RenderVi
ew. |
| 1426 // FIXME: Why do we need to issue this invalidation? Won't the fixed
position element just scroll | 1426 // FIXME: Why do we need to issue this invalidation? Won't the fixed
position element just scroll |
| 1427 // with the enclosing layer. | 1427 // with the enclosing layer. |
| 1428 updateRect.moveBy(scrollPosition()); | 1428 updateRect.moveBy(scrollPosition()); |
| 1429 IntRect previousRect = updateRect; | 1429 IntRect previousRect = updateRect; |
| 1430 previousRect.move(scrollDelta); | 1430 previousRect.move(scrollDelta); |
| 1431 updateRect.unite(previousRect); | 1431 updateRect.unite(previousRect); |
| 1432 enclosingCompositingLayer->repainter().setBackingNeedsRepaintInRect(
updateRect); | 1432 enclosingCompositingLayer->repainter().setBackingNeedsRepaintInRect(
updateRect); |
| 1433 } else { | 1433 } else { |
| 1434 // Coalesce the repaints that will be issued to the renderView. | 1434 // Coalesce the paint invalidations that will be issued to the rende
rView. |
| 1435 updateRect = contentsToRootView(updateRect); | 1435 updateRect = contentsToRootView(updateRect); |
| 1436 if (!isCompositedContentLayer && clipsRepaints()) | 1436 if (!isCompositedContentLayer && clipsPaintInvalidations()) |
| 1437 updateRect.intersect(rectToScroll); | 1437 updateRect.intersect(rectToScroll); |
| 1438 if (!updateRect.isEmpty()) | 1438 if (!updateRect.isEmpty()) |
| 1439 regionToUpdate.unite(updateRect); | 1439 regionToUpdate.unite(updateRect); |
| 1440 } | 1440 } |
| 1441 } | 1441 } |
| 1442 | 1442 |
| 1443 // 1) scroll | 1443 // 1) scroll |
| 1444 hostWindow()->scroll(scrollDelta, rectToScroll, clipRect); | 1444 hostWindow()->scroll(scrollDelta, rectToScroll, clipRect); |
| 1445 | 1445 |
| 1446 // 2) update the area of fixed objects that has been invalidated | 1446 // 2) update the area of fixed objects that has been invalidated |
| 1447 Vector<IntRect> subRectsToUpdate = regionToUpdate.rects(); | 1447 Vector<IntRect> subRectsToUpdate = regionToUpdate.rects(); |
| 1448 size_t viewportConstrainedObjectsCount = subRectsToUpdate.size(); | 1448 size_t viewportConstrainedObjectsCount = subRectsToUpdate.size(); |
| 1449 for (size_t i = 0; i < viewportConstrainedObjectsCount; ++i) { | 1449 for (size_t i = 0; i < viewportConstrainedObjectsCount; ++i) { |
| 1450 IntRect updateRect = subRectsToUpdate[i]; | 1450 IntRect updateRect = subRectsToUpdate[i]; |
| 1451 IntRect scrolledRect = updateRect; | 1451 IntRect scrolledRect = updateRect; |
| 1452 scrolledRect.move(-scrollDelta); | 1452 scrolledRect.move(-scrollDelta); |
| 1453 updateRect.unite(scrolledRect); | 1453 updateRect.unite(scrolledRect); |
| 1454 if (isCompositedContentLayer) { | 1454 if (isCompositedContentLayer) { |
| 1455 updateRect = rootViewToContents(updateRect); | 1455 updateRect = rootViewToContents(updateRect); |
| 1456 ASSERT(renderView()); | 1456 ASSERT(renderView()); |
| 1457 renderView()->layer()->repainter().setBackingNeedsRepaintInRect(upda
teRect); | 1457 renderView()->layer()->repainter().setBackingNeedsRepaintInRect(upda
teRect); |
| 1458 continue; | 1458 continue; |
| 1459 } | 1459 } |
| 1460 if (clipsRepaints()) | 1460 if (clipsPaintInvalidations()) |
| 1461 updateRect.intersect(rectToScroll); | 1461 updateRect.intersect(rectToScroll); |
| 1462 hostWindow()->invalidateContentsAndRootView(updateRect); | 1462 hostWindow()->invalidateContentsAndRootView(updateRect); |
| 1463 } | 1463 } |
| 1464 | 1464 |
| 1465 return true; | 1465 return true; |
| 1466 } | 1466 } |
| 1467 | 1467 |
| 1468 void FrameView::scrollContentsSlowPath(const IntRect& updateRect) | 1468 void FrameView::scrollContentsSlowPath(const IntRect& updateRect) |
| 1469 { | 1469 { |
| 1470 if (contentsInCompositedLayer()) { | 1470 if (contentsInCompositedLayer()) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1498 | 1498 |
| 1499 void FrameView::restoreScrollbar() | 1499 void FrameView::restoreScrollbar() |
| 1500 { | 1500 { |
| 1501 setScrollbarsSuppressed(false); | 1501 setScrollbarsSuppressed(false); |
| 1502 } | 1502 } |
| 1503 | 1503 |
| 1504 bool FrameView::scrollToFragment(const KURL& url) | 1504 bool FrameView::scrollToFragment(const KURL& url) |
| 1505 { | 1505 { |
| 1506 // If our URL has no ref, then we have no place we need to jump to. | 1506 // If our URL has no ref, then we have no place we need to jump to. |
| 1507 // OTOH If CSS target was set previously, we want to set it to 0, recalc | 1507 // OTOH If CSS target was set previously, we want to set it to 0, recalc |
| 1508 // and possibly repaint because :target pseudo class may have been | 1508 // and possibly paint invalidation because :target pseudo class may have bee
n |
| 1509 // set (see bug 11321). | 1509 // set (see bug 11321). |
| 1510 if (!url.hasFragmentIdentifier() && !m_frame->document()->cssTarget()) | 1510 if (!url.hasFragmentIdentifier() && !m_frame->document()->cssTarget()) |
| 1511 return false; | 1511 return false; |
| 1512 | 1512 |
| 1513 String fragmentIdentifier = url.fragmentIdentifier(); | 1513 String fragmentIdentifier = url.fragmentIdentifier(); |
| 1514 if (scrollToAnchor(fragmentIdentifier)) | 1514 if (scrollToAnchor(fragmentIdentifier)) |
| 1515 return true; | 1515 return true; |
| 1516 | 1516 |
| 1517 // Try again after decoding the ref, based on the document's encoding. | 1517 // Try again after decoding the ref, based on the document's encoding. |
| 1518 if (m_frame->document()->encoding().isValid()) | 1518 if (m_frame->document()->encoding().isValid()) |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1692 if (RenderView* renderView = this->renderView()) | 1692 if (RenderView* renderView = this->renderView()) |
| 1693 renderView->layer()->updateLayerPositionsAfterDocumentScroll(); | 1693 renderView->layer()->updateLayerPositionsAfterDocumentScroll(); |
| 1694 } | 1694 } |
| 1695 | 1695 |
| 1696 // Compositing layers may change after scrolling. | 1696 // Compositing layers may change after scrolling. |
| 1697 // FIXME: Maybe no longer needed after we land squashing and kill overlap te
sting? | 1697 // FIXME: Maybe no longer needed after we land squashing and kill overlap te
sting? |
| 1698 if (RenderView* renderView = this->renderView()) | 1698 if (RenderView* renderView = this->renderView()) |
| 1699 renderView->compositor()->setNeedsCompositingUpdate(CompositingUpdateOnS
croll); | 1699 renderView->compositor()->setNeedsCompositingUpdate(CompositingUpdateOnS
croll); |
| 1700 } | 1700 } |
| 1701 | 1701 |
| 1702 void FrameView::updateFixedElementRepaintRectsAfterScroll() | 1702 void FrameView::updateFixedElementPaintInvalidationRectsAfterScroll() |
| 1703 { | 1703 { |
| 1704 if (!hasViewportConstrainedObjects()) | 1704 if (!hasViewportConstrainedObjects()) |
| 1705 return; | 1705 return; |
| 1706 | 1706 |
| 1707 // Update the repaint rects for fixed elements after scrolling and invalidat
ion to reflect | 1707 // Update the paint invalidation rects for fixed elements after scrolling an
d invalidation to reflect |
| 1708 // the new scroll position. | 1708 // the new scroll position. |
| 1709 ViewportConstrainedObjectSet::const_iterator end = m_viewportConstrainedObje
cts->end(); | 1709 ViewportConstrainedObjectSet::const_iterator end = m_viewportConstrainedObje
cts->end(); |
| 1710 for (ViewportConstrainedObjectSet::const_iterator it = m_viewportConstrained
Objects->begin(); it != end; ++it) { | 1710 for (ViewportConstrainedObjectSet::const_iterator it = m_viewportConstrained
Objects->begin(); it != end; ++it) { |
| 1711 RenderObject* renderer = *it; | 1711 RenderObject* renderer = *it; |
| 1712 // m_viewportConstrainedObjects should not contain non-viewport constrai
ned objects. | 1712 // m_viewportConstrainedObjects should not contain non-viewport constrai
ned objects. |
| 1713 ASSERT(renderer->style()->hasViewportConstrainedPosition()); | 1713 ASSERT(renderer->style()->hasViewportConstrainedPosition()); |
| 1714 | 1714 |
| 1715 // Fixed items should always have layers. | 1715 // Fixed items should always have layers. |
| 1716 ASSERT(renderer->hasLayer()); | 1716 ASSERT(renderer->hasLayer()); |
| 1717 | 1717 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1744 } | 1744 } |
| 1745 | 1745 |
| 1746 HostWindow* FrameView::hostWindow() const | 1746 HostWindow* FrameView::hostWindow() const |
| 1747 { | 1747 { |
| 1748 Page* page = frame().page(); | 1748 Page* page = frame().page(); |
| 1749 if (!page) | 1749 if (!page) |
| 1750 return 0; | 1750 return 0; |
| 1751 return &page->chrome(); | 1751 return &page->chrome(); |
| 1752 } | 1752 } |
| 1753 | 1753 |
| 1754 void FrameView::repaintContentRectangle(const IntRect& r) | 1754 void FrameView::contentRectangleForPaintInvalidation(const IntRect& r) |
| 1755 { | 1755 { |
| 1756 ASSERT(repaintAllowed()); | 1756 ASSERT(paintInvalidationIsAllowed()); |
| 1757 ASSERT(!m_frame->owner()); | 1757 ASSERT(!m_frame->owner()); |
| 1758 | 1758 |
| 1759 if (m_isTrackingRepaints) { | 1759 if (m_isTrackingPaintInvalidations) { |
| 1760 IntRect repaintRect = r; | 1760 IntRect paintInvalidationRect = r; |
| 1761 repaintRect.move(-scrollOffset()); | 1761 paintInvalidationRect.move(-scrollOffset()); |
| 1762 m_trackedRepaintRects.append(repaintRect); | 1762 m_trackedPaintInvalidationRects.append(paintInvalidationRect); |
| 1763 // FIXME: http://crbug.com/368518. Eventually, repaintContentRectangle | 1763 // FIXME: http://crbug.com/368518. Eventually, invalidateContentRectangl
eForPaint |
| 1764 // is going away entirely once all layout tests are FCM. In the short | 1764 // is going away entirely once all layout tests are FCM. In the short |
| 1765 // term, no code should be tracking non-composited FrameView repaints. | 1765 // term, no code should be tracking non-composited FrameView paint inval
idations. |
| 1766 RELEASE_ASSERT_NOT_REACHED(); | 1766 RELEASE_ASSERT_NOT_REACHED(); |
| 1767 } | 1767 } |
| 1768 | 1768 |
| 1769 ScrollView::repaintContentRectangle(r); | 1769 ScrollView::contentRectangleForPaintInvalidation(r); |
| 1770 } | 1770 } |
| 1771 | 1771 |
| 1772 void FrameView::contentsResized() | 1772 void FrameView::contentsResized() |
| 1773 { | 1773 { |
| 1774 if (m_frame->isMainFrame() && m_frame->document()) { | 1774 if (m_frame->isMainFrame() && m_frame->document()) { |
| 1775 if (FastTextAutosizer* textAutosizer = m_frame->document()->fastTextAuto
sizer()) | 1775 if (FastTextAutosizer* textAutosizer = m_frame->document()->fastTextAuto
sizer()) |
| 1776 textAutosizer->updatePageInfoInAllFrames(); | 1776 textAutosizer->updatePageInfoInAllFrames(); |
| 1777 } | 1777 } |
| 1778 | 1778 |
| 1779 ScrollView::contentsResized(); | 1779 ScrollView::contentsResized(); |
| (...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3108 -renderer->borderTop() - renderer->paddingTop()); | 3108 -renderer->borderTop() - renderer->paddingTop()); |
| 3109 return point; | 3109 return point; |
| 3110 } | 3110 } |
| 3111 | 3111 |
| 3112 return Widget::convertFromContainingView(parentPoint); | 3112 return Widget::convertFromContainingView(parentPoint); |
| 3113 } | 3113 } |
| 3114 | 3114 |
| 3115 return parentPoint; | 3115 return parentPoint; |
| 3116 } | 3116 } |
| 3117 | 3117 |
| 3118 void FrameView::setTracksRepaints(bool trackRepaints) | 3118 void FrameView::setTracksPaintInvalidations(bool trackPaintInvalidations) |
| 3119 { | 3119 { |
| 3120 if (trackRepaints == m_isTrackingRepaints) | 3120 if (trackPaintInvalidations == m_isTrackingPaintInvalidations) |
| 3121 return; | 3121 return; |
| 3122 | 3122 |
| 3123 for (LocalFrame* frame = m_frame->tree().top(); frame; frame = frame->tree()
.traverseNext()) { | 3123 for (LocalFrame* frame = m_frame->tree().top(); frame; frame = frame->tree()
.traverseNext()) { |
| 3124 if (RenderView* renderView = frame->contentRenderer()) | 3124 if (RenderView* renderView = frame->contentRenderer()) |
| 3125 renderView->compositor()->setTracksRepaints(trackRepaints); | 3125 renderView->compositor()->setTracksRepaints(trackPaintInvalidations)
; |
| 3126 } | 3126 } |
| 3127 | 3127 |
| 3128 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), | 3128 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), |
| 3129 "FrameView::setTracksRepaints", "enabled", trackRepaints); | 3129 "FrameView::setTracksPaintInvalidations", "enabled", trackPaintInvalidat
ions); |
| 3130 | 3130 |
| 3131 resetTrackedRepaints(); | 3131 resetTrackedPaintInvalidations(); |
| 3132 m_isTrackingRepaints = trackRepaints; | 3132 m_isTrackingPaintInvalidations = trackPaintInvalidations; |
| 3133 } | 3133 } |
| 3134 | 3134 |
| 3135 void FrameView::resetTrackedRepaints() | 3135 void FrameView::resetTrackedPaintInvalidations() |
| 3136 { | 3136 { |
| 3137 m_trackedRepaintRects.clear(); | 3137 m_trackedPaintInvalidationRects.clear(); |
| 3138 if (RenderView* renderView = this->renderView()) | 3138 if (RenderView* renderView = this->renderView()) |
| 3139 renderView->compositor()->resetTrackedRepaintRects(); | 3139 renderView->compositor()->resetTrackedRepaintRects(); |
| 3140 } | 3140 } |
| 3141 | 3141 |
| 3142 String FrameView::trackedRepaintRectsAsText() const | 3142 String FrameView::trackedPaintInvalidationRectsAsText() const |
| 3143 { | 3143 { |
| 3144 TextStream ts; | 3144 TextStream ts; |
| 3145 if (!m_trackedRepaintRects.isEmpty()) { | 3145 if (!m_trackedPaintInvalidationRects.isEmpty()) { |
| 3146 ts << "(repaint rects\n"; | 3146 ts << "(repaint rects\n"; |
| 3147 for (size_t i = 0; i < m_trackedRepaintRects.size(); ++i) | 3147 for (size_t i = 0; i < m_trackedPaintInvalidationRects.size(); ++i) |
| 3148 ts << " (rect " << m_trackedRepaintRects[i].x() << " " << m_tracked
RepaintRects[i].y() << " " << m_trackedRepaintRects[i].width() << " " << m_track
edRepaintRects[i].height() << ")\n"; | 3148 ts << " (rect " << m_trackedPaintInvalidationRects[i].x() << " " <<
m_trackedPaintInvalidationRects[i].y() << " " << m_trackedPaintInvalidationRect
s[i].width() << " " << m_trackedPaintInvalidationRects[i].height() << ")\n"; |
| 3149 ts << ")\n"; | 3149 ts << ")\n"; |
| 3150 } | 3150 } |
| 3151 return ts.release(); | 3151 return ts.release(); |
| 3152 } | 3152 } |
| 3153 | 3153 |
| 3154 void FrameView::addResizerArea(RenderBox& resizerBox) | 3154 void FrameView::addResizerArea(RenderBox& resizerBox) |
| 3155 { | 3155 { |
| 3156 if (!m_resizerAreas) | 3156 if (!m_resizerAreas) |
| 3157 m_resizerAreas = adoptPtr(new ResizerAreaSet); | 3157 m_resizerAreas = adoptPtr(new ResizerAreaSet); |
| 3158 m_resizerAreas->add(&resizerBox); | 3158 m_resizerAreas->add(&resizerBox); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3273 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o
rientation) | 3273 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o
rientation) |
| 3274 { | 3274 { |
| 3275 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); | 3275 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); |
| 3276 if (AXObjectCache* cache = axObjectCache()) { | 3276 if (AXObjectCache* cache = axObjectCache()) { |
| 3277 cache->remove(scrollbar); | 3277 cache->remove(scrollbar); |
| 3278 cache->handleScrollbarUpdate(this); | 3278 cache->handleScrollbarUpdate(this); |
| 3279 } | 3279 } |
| 3280 } | 3280 } |
| 3281 | 3281 |
| 3282 } // namespace WebCore | 3282 } // namespace WebCore |
| OLD | NEW |