| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 , m_previous(0) | 130 , m_previous(0) |
| 131 , m_next(0) | 131 , m_next(0) |
| 132 , m_first(0) | 132 , m_first(0) |
| 133 , m_last(0) | 133 , m_last(0) |
| 134 , m_staticInlinePosition(0) | 134 , m_staticInlinePosition(0) |
| 135 , m_staticBlockPosition(0) | 135 , m_staticBlockPosition(0) |
| 136 , m_enclosingPaginationLayer(0) | 136 , m_enclosingPaginationLayer(0) |
| 137 , m_potentialCompositingReasonsFromStyle(CompositingReasonNone) | 137 , m_potentialCompositingReasonsFromStyle(CompositingReasonNone) |
| 138 , m_compositingReasons(CompositingReasonNone) | 138 , m_compositingReasons(CompositingReasonNone) |
| 139 , m_groupedMapping(0) | 139 , m_groupedMapping(0) |
| 140 , m_repainter(*renderer) | 140 , m_paintInvalidator(*renderer) |
| 141 , m_clipper(*renderer) | 141 , m_clipper(*renderer) |
| 142 { | 142 { |
| 143 updateStackingNode(); | 143 updateStackingNode(); |
| 144 | 144 |
| 145 m_isSelfPaintingLayer = shouldBeSelfPaintingLayer(); | 145 m_isSelfPaintingLayer = shouldBeSelfPaintingLayer(); |
| 146 | 146 |
| 147 if (!renderer->slowFirstChild() && renderer->style()) { | 147 if (!renderer->slowFirstChild() && renderer->style()) { |
| 148 m_visibleContentStatusDirty = false; | 148 m_visibleContentStatusDirty = false; |
| 149 m_hasVisibleContent = renderer->style()->visibility() == VISIBLE; | 149 m_hasVisibleContent = renderer->style()->visibility() == VISIBLE; |
| 150 } | 150 } |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 RenderLayer* paintInvalidationLayer = paintInvalidationContainer->layer(); | 549 RenderLayer* paintInvalidationLayer = paintInvalidationContainer->layer(); |
| 550 if (!paintInvalidationLayer->groupedMapping()) { | 550 if (!paintInvalidationLayer->groupedMapping()) { |
| 551 rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffse
tInCompositingLayer()); | 551 rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffse
tInCompositingLayer()); |
| 552 return; | 552 return; |
| 553 } | 553 } |
| 554 | 554 |
| 555 RenderLayerModelObject* transformedAncestor = paintInvalidationLayer->enclos
ingTransformedAncestor()->renderer(); | 555 RenderLayerModelObject* transformedAncestor = paintInvalidationLayer->enclos
ingTransformedAncestor()->renderer(); |
| 556 if (!transformedAncestor) | 556 if (!transformedAncestor) |
| 557 return; | 557 return; |
| 558 | 558 |
| 559 // |repaintContainer| may have a local 2D transform on it, so take that into
account when mapping into the space of the | 559 // |paintInvalidationContainer| may have a local 2D transform on it, so take
that into account when mapping into the space of the |
| 560 // transformed ancestor. | 560 // transformed ancestor. |
| 561 rect = LayoutRect(paintInvalidationContainer->localToContainerQuad(FloatRect
(rect), transformedAncestor).boundingBox()); | 561 rect = LayoutRect(paintInvalidationContainer->localToContainerQuad(FloatRect
(rect), transformedAncestor).boundingBox()); |
| 562 | 562 |
| 563 rect.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTr
ansformedAncestor()); | 563 rect.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTr
ansformedAncestor()); |
| 564 } | 564 } |
| 565 | 565 |
| 566 void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb
ject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect
, const PaintInvalidationState* paintInvalidationState) | 566 void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb
ject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect
, const PaintInvalidationState* paintInvalidationState) |
| 567 { | 567 { |
| 568 if (!paintInvalidationContainer->layer()->groupedMapping()) { | 568 if (!paintInvalidationContainer->layer()->groupedMapping()) { |
| 569 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContain
er, rect, paintInvalidationState); | 569 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContain
er, rect, paintInvalidationState); |
| 570 return; | 570 return; |
| 571 } | 571 } |
| 572 | 572 |
| 573 // This code adjusts the repaint rectangle to be in the space of the transfo
rmed ancestor of the grouped (i.e. squashed) | 573 // This code adjusts the paint invalidation rectangle to be in the space of
the transformed ancestor of the grouped (i.e. squashed) |
| 574 // layer. This is because all layers that squash together need to repaint w.
r.t. a single container that is | 574 // layer. This is because all layers that squash together need to issue pain
t invalidations w.r.t. a single container that is |
| 575 // an ancestor of all of them, in order to properly take into account any lo
cal transforms etc. | 575 // an ancestor of all of them, in order to properly take into account any lo
cal transforms etc. |
| 576 // FIXME: remove this special-case code that works around the repainting cod
e structure. | 576 // FIXME: remove this special-case code that works around the paint invalida
tion code structure. |
| 577 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer,
rect, paintInvalidationState); | 577 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer,
rect, paintInvalidationState); |
| 578 | 578 |
| 579 RenderLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, re
ct); | 579 RenderLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, re
ct); |
| 580 } | 580 } |
| 581 | 581 |
| 582 LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderO
bject, const RenderLayer* paintInvalidationContainer, const PaintInvalidationSta
te* paintInvalidationState) | 582 LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderO
bject, const RenderLayer* paintInvalidationContainer, const PaintInvalidationSta
te* paintInvalidationState) |
| 583 { | 583 { |
| 584 if (!paintInvalidationContainer->groupedMapping()) | 584 if (!paintInvalidationContainer->groupedMapping()) |
| 585 return renderObject->computePaintInvalidationRect(paintInvalidationConta
iner->renderer(), paintInvalidationState); | 585 return renderObject->computePaintInvalidationRect(paintInvalidationConta
iner->renderer(), paintInvalidationState); |
| 586 LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(pain
tInvalidationContainer->renderer()); | 586 LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(pain
tInvalidationContainer->renderer()); |
| (...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1575 { | 1575 { |
| 1576 if (clipRect.rect() == paintDirtyRect && !clipRect.hasRadius()) | 1576 if (clipRect.rect() == paintDirtyRect && !clipRect.hasRadius()) |
| 1577 return; | 1577 return; |
| 1578 context->restore(); | 1578 context->restore(); |
| 1579 } | 1579 } |
| 1580 | 1580 |
| 1581 static inline bool shouldSuppressPaintingLayer(RenderLayer* layer) | 1581 static inline bool shouldSuppressPaintingLayer(RenderLayer* layer) |
| 1582 { | 1582 { |
| 1583 // Avoid painting descendants of the root layer when stylesheets haven't loa
ded. This eliminates FOUC. | 1583 // Avoid painting descendants of the root layer when stylesheets haven't loa
ded. This eliminates FOUC. |
| 1584 // It's ok not to draw, because later on, when all the stylesheets do load,
updateStyleSelector on the Document | 1584 // It's ok not to draw, because later on, when all the stylesheets do load,
updateStyleSelector on the Document |
| 1585 // will do a full repaint(). | 1585 // will do a full paintInvalidationForWholeRenderer(). |
| 1586 if (layer->renderer()->document().didLayoutWithPendingStylesheets() && !laye
r->isRootLayer() && !layer->renderer()->isDocumentElement()) | 1586 if (layer->renderer()->document().didLayoutWithPendingStylesheets() && !laye
r->isRootLayer() && !layer->renderer()->isDocumentElement()) |
| 1587 return true; | 1587 return true; |
| 1588 | 1588 |
| 1589 return false; | 1589 return false; |
| 1590 } | 1590 } |
| 1591 | 1591 |
| 1592 static bool paintForFixedRootBackground(const RenderLayer* layer, PaintLayerFlag
s paintFlags) | 1592 static bool paintForFixedRootBackground(const RenderLayer* layer, PaintLayerFlag
s paintFlags) |
| 1593 { | 1593 { |
| 1594 return layer->renderer()->isDocumentElement() && (paintFlags & PaintLayerPai
ntingRootBackgroundOnly); | 1594 return layer->renderer()->isDocumentElement() && (paintFlags & PaintLayerPai
ntingRootBackgroundOnly); |
| 1595 } | 1595 } |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1695 bool isSelfPaintingLayer = this->isSelfPaintingLayer(); | 1695 bool isSelfPaintingLayer = this->isSelfPaintingLayer(); |
| 1696 bool isPaintingOverlayScrollbars = paintFlags & PaintLayerPaintingOverlayScr
ollbars; | 1696 bool isPaintingOverlayScrollbars = paintFlags & PaintLayerPaintingOverlayScr
ollbars; |
| 1697 bool isPaintingScrollingContent = paintFlags & PaintLayerPaintingCompositing
ScrollingPhase; | 1697 bool isPaintingScrollingContent = paintFlags & PaintLayerPaintingCompositing
ScrollingPhase; |
| 1698 bool isPaintingCompositedForeground = paintFlags & PaintLayerPaintingComposi
tingForegroundPhase; | 1698 bool isPaintingCompositedForeground = paintFlags & PaintLayerPaintingComposi
tingForegroundPhase; |
| 1699 bool isPaintingCompositedBackground = paintFlags & PaintLayerPaintingComposi
tingBackgroundPhase; | 1699 bool isPaintingCompositedBackground = paintFlags & PaintLayerPaintingComposi
tingBackgroundPhase; |
| 1700 bool isPaintingOverflowContents = paintFlags & PaintLayerPaintingOverflowCon
tents; | 1700 bool isPaintingOverflowContents = paintFlags & PaintLayerPaintingOverflowCon
tents; |
| 1701 // Outline always needs to be painted even if we have no visible content. Al
so, | 1701 // Outline always needs to be painted even if we have no visible content. Al
so, |
| 1702 // the outline is painted in the background phase during composited scrollin
g. | 1702 // the outline is painted in the background phase during composited scrollin
g. |
| 1703 // If it were painted in the foreground phase, it would move with the scroll
ed | 1703 // If it were painted in the foreground phase, it would move with the scroll
ed |
| 1704 // content. When not composited scrolling, the outline is painted in the | 1704 // content. When not composited scrolling, the outline is painted in the |
| 1705 // foreground phase. Since scrolled contents are moved by repainting in this | 1705 // foreground phase. Since scrolled contents are moved by paint invalidation
in this |
| 1706 // case, the outline won't get 'dragged along'. | 1706 // case, the outline won't get 'dragged along'. |
| 1707 bool shouldPaintOutline = isSelfPaintingLayer && !isPaintingOverlayScrollbar
s | 1707 bool shouldPaintOutline = isSelfPaintingLayer && !isPaintingOverlayScrollbar
s |
| 1708 && ((isPaintingScrollingContent && isPaintingCompositedBackground) | 1708 && ((isPaintingScrollingContent && isPaintingCompositedBackground) |
| 1709 || (!isPaintingScrollingContent && isPaintingCompositedForeground)); | 1709 || (!isPaintingScrollingContent && isPaintingCompositedForeground)); |
| 1710 bool shouldPaintContent = m_hasVisibleContent && isSelfPaintingLayer && !isP
aintingOverlayScrollbars; | 1710 bool shouldPaintContent = m_hasVisibleContent && isSelfPaintingLayer && !isP
aintingOverlayScrollbars; |
| 1711 | 1711 |
| 1712 float deviceScaleFactor = blink::deviceScaleFactor(renderer()->frame()); | 1712 float deviceScaleFactor = blink::deviceScaleFactor(renderer()->frame()); |
| 1713 context->setDeviceScaleFactor(deviceScaleFactor); | 1713 context->setDeviceScaleFactor(deviceScaleFactor); |
| 1714 | 1714 |
| 1715 GraphicsContext* transparencyLayerContext = context; | 1715 GraphicsContext* transparencyLayerContext = context; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1793 | 1793 |
| 1794 if (filterPainter.prepareFilterEffect(this, rootRelativeBounds, painting
Info.paintDirtyRect)) { | 1794 if (filterPainter.prepareFilterEffect(this, rootRelativeBounds, painting
Info.paintDirtyRect)) { |
| 1795 // Rewire the old context to a memory buffer, so that we can capture
the contents of the layer. | 1795 // Rewire the old context to a memory buffer, so that we can capture
the contents of the layer. |
| 1796 // NOTE: We saved the old context in the "transparencyLayerContext"
local variable, to be able to start a transparency layer | 1796 // NOTE: We saved the old context in the "transparencyLayerContext"
local variable, to be able to start a transparency layer |
| 1797 // on the original context and avoid duplicating "beginFilterEffect"
after each transparency layer call. Also, note that | 1797 // on the original context and avoid duplicating "beginFilterEffect"
after each transparency layer call. Also, note that |
| 1798 // beginTransparencyLayers will only create a single lazy transparen
cy layer, even though it is called twice in this method. | 1798 // beginTransparencyLayers will only create a single lazy transparen
cy layer, even though it is called twice in this method. |
| 1799 context = filterPainter.beginFilterEffect(context); | 1799 context = filterPainter.beginFilterEffect(context); |
| 1800 | 1800 |
| 1801 // Check that we didn't fail to allocate the graphics context for th
e offscreen buffer. | 1801 // Check that we didn't fail to allocate the graphics context for th
e offscreen buffer. |
| 1802 if (filterPainter.hasStartedFilterEffect()) { | 1802 if (filterPainter.hasStartedFilterEffect()) { |
| 1803 localPaintingInfo.paintDirtyRect = filterPainter.repaintRect(); | 1803 localPaintingInfo.paintDirtyRect = filterPainter.paintInvalidati
onRect(); |
| 1804 // If the filter needs the full source image, we need to avoid u
sing the clip rectangles. | 1804 // If the filter needs the full source image, we need to avoid u
sing the clip rectangles. |
| 1805 // Otherwise, if for example this layer has overflow:hidden, a d
rop shadow will not compute correctly. | 1805 // Otherwise, if for example this layer has overflow:hidden, a d
rop shadow will not compute correctly. |
| 1806 // Note that we will still apply the clipping on the final rende
ring of the filter. | 1806 // Note that we will still apply the clipping on the final rende
ring of the filter. |
| 1807 localPaintingInfo.clipToDirtyRect = !filterRenderer()->hasFilter
ThatMovesPixels(); | 1807 localPaintingInfo.clipToDirtyRect = !filterRenderer()->hasFilter
ThatMovesPixels(); |
| 1808 } | 1808 } |
| 1809 } | 1809 } |
| 1810 } | 1810 } |
| 1811 | 1811 |
| 1812 if (filterPainter.hasStartedFilterEffect() && haveTransparency) { | 1812 if (filterPainter.hasStartedFilterEffect() && haveTransparency) { |
| 1813 // If we have a filter and transparency, we have to eagerly start a tran
sparency layer here, rather than risk a child layer lazily starts one with the w
rong context. | 1813 // If we have a filter and transparency, we have to eagerly start a tran
sparency layer here, rather than risk a child layer lazily starts one with the w
rong context. |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2139 break; | 2139 break; |
| 2140 } | 2140 } |
| 2141 } | 2141 } |
| 2142 } | 2142 } |
| 2143 | 2143 |
| 2144 // Optimize clipping for the single fragment case. | 2144 // Optimize clipping for the single fragment case. |
| 2145 bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size()
== 1 && layerFragments[0].shouldPaintContent && !layerFragments[0].foregroundRe
ct.isEmpty(); | 2145 bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size()
== 1 && layerFragments[0].shouldPaintContent && !layerFragments[0].foregroundRe
ct.isEmpty(); |
| 2146 if (shouldClip) | 2146 if (shouldClip) |
| 2147 clipToRect(localPaintingInfo, context, layerFragments[0].foregroundRect,
paintFlags); | 2147 clipToRect(localPaintingInfo, context, layerFragments[0].foregroundRect,
paintFlags); |
| 2148 | 2148 |
| 2149 // We have to loop through every fragment multiple times, since we have to r
epaint in each specific phase in order for | 2149 // We have to loop through every fragment multiple times, since we have to i
ssue paint invalidations in each specific phase in order for |
| 2150 // interleaving of the fragments to work properly. | 2150 // interleaving of the fragments to work properly. |
| 2151 paintForegroundForFragmentsWithPhase(selectionOnly ? PaintPhaseSelection : P
aintPhaseChildBlockBackgrounds, layerFragments, | 2151 paintForegroundForFragmentsWithPhase(selectionOnly ? PaintPhaseSelection : P
aintPhaseChildBlockBackgrounds, layerFragments, |
| 2152 context, localPaintingInfo, paintBehavior, paintingRootForRenderer, pain
tFlags); | 2152 context, localPaintingInfo, paintBehavior, paintingRootForRenderer, pain
tFlags); |
| 2153 | 2153 |
| 2154 if (!selectionOnly) { | 2154 if (!selectionOnly) { |
| 2155 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments, co
ntext, localPaintingInfo, paintBehavior, paintingRootForRenderer, paintFlags); | 2155 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments, co
ntext, localPaintingInfo, paintBehavior, paintingRootForRenderer, paintFlags); |
| 2156 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment
s, context, localPaintingInfo, paintBehavior, paintingRootForRenderer, paintFlag
s); | 2156 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment
s, context, localPaintingInfo, paintBehavior, paintingRootForRenderer, paintFlag
s); |
| 2157 paintForegroundForFragmentsWithPhase(PaintPhaseChildOutlines, layerFragm
ents, context, localPaintingInfo, paintBehavior, paintingRootForRenderer, paintF
lags); | 2157 paintForegroundForFragmentsWithPhase(PaintPhaseChildOutlines, layerFragm
ents, context, localPaintingInfo, paintBehavior, paintingRootForRenderer, paintF
lags); |
| 2158 } | 2158 } |
| 2159 | 2159 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2257 RenderLayerStackingNode* ancestorNode = m_stackingNode->isNormalFlowOnly() ?
parent()->stackingNode() : m_stackingNode->ancestorStackingContextNode(); | 2257 RenderLayerStackingNode* ancestorNode = m_stackingNode->isNormalFlowOnly() ?
parent()->stackingNode() : m_stackingNode->ancestorStackingContextNode(); |
| 2258 for (RenderLayer* curr = childLayer->parent(); curr; curr = curr->parent())
{ | 2258 for (RenderLayer* curr = childLayer->parent(); curr; curr = curr->parent())
{ |
| 2259 if (curr->renderer()->hasColumns() && checkContainingBlockChainForPagina
tion(childLayer->renderer(), curr->renderBox())) | 2259 if (curr->renderer()->hasColumns() && checkContainingBlockChainForPagina
tion(childLayer->renderer(), curr->renderBox())) |
| 2260 columnLayers.append(curr); | 2260 columnLayers.append(curr); |
| 2261 if (curr->stackingNode() == ancestorNode) | 2261 if (curr->stackingNode() == ancestorNode) |
| 2262 break; | 2262 break; |
| 2263 } | 2263 } |
| 2264 | 2264 |
| 2265 // It is possible for paintLayer() to be called after the child layer ceases
to be paginated but before | 2265 // It is possible for paintLayer() to be called after the child layer ceases
to be paginated but before |
| 2266 // updatePaginationRecusive() is called and resets the isPaginated() flag, s
ee <rdar://problem/10098679>. | 2266 // updatePaginationRecusive() is called and resets the isPaginated() flag, s
ee <rdar://problem/10098679>. |
| 2267 // If this is the case, just bail out, since the upcoming call to updatePagi
nationRecusive() will repaint the layer. | 2267 // If this is the case, just bail out, since the upcoming call to updatePagi
nationRecusive() will paint invalidate the layer. |
| 2268 // FIXME: Is this true anymore? This seems very suspicious. | 2268 // FIXME: Is this true anymore? This seems very suspicious. |
| 2269 if (!columnLayers.size()) | 2269 if (!columnLayers.size()) |
| 2270 return; | 2270 return; |
| 2271 | 2271 |
| 2272 paintChildLayerIntoColumns(childLayer, context, paintingInfo, paintFlags, co
lumnLayers, columnLayers.size() - 1); | 2272 paintChildLayerIntoColumns(childLayer, context, paintingInfo, paintFlags, co
lumnLayers, columnLayers.size() - 1); |
| 2273 } | 2273 } |
| 2274 | 2274 |
| 2275 void RenderLayer::paintChildLayerIntoColumns(RenderLayer* childLayer, GraphicsCo
ntext* context, const LayerPaintingInfo& paintingInfo, | 2275 void RenderLayer::paintChildLayerIntoColumns(RenderLayer* childLayer, GraphicsCo
ntext* context, const LayerPaintingInfo& paintingInfo, |
| 2276 PaintLayerFlags paintFlags, const Vector<RenderLayer*>& columnLayers, size_t
colIndex) | 2276 PaintLayerFlags paintFlags, const Vector<RenderLayer*>& columnLayers, size_t
colIndex) |
| 2277 { | 2277 { |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2976 if (!rect.isEmpty()) | 2976 if (!rect.isEmpty()) |
| 2977 renderer()->invalidatePaintRectangle(rect); | 2977 renderer()->invalidatePaintRectangle(rect); |
| 2978 } | 2978 } |
| 2979 | 2979 |
| 2980 IntRect RenderLayer::blockSelectionGapsBounds() const | 2980 IntRect RenderLayer::blockSelectionGapsBounds() const |
| 2981 { | 2981 { |
| 2982 if (!renderer()->isRenderBlock()) | 2982 if (!renderer()->isRenderBlock()) |
| 2983 return IntRect(); | 2983 return IntRect(); |
| 2984 | 2984 |
| 2985 RenderBlock* renderBlock = toRenderBlock(renderer()); | 2985 RenderBlock* renderBlock = toRenderBlock(renderer()); |
| 2986 LayoutRect gapRects = renderBlock->selectionGapRectsForRepaint(renderBlock); | 2986 LayoutRect gapRects = renderBlock->selectionGapRectsForPaintInvalidation(ren
derBlock); |
| 2987 | 2987 |
| 2988 return pixelSnappedIntRect(gapRects); | 2988 return pixelSnappedIntRect(gapRects); |
| 2989 } | 2989 } |
| 2990 | 2990 |
| 2991 bool RenderLayer::hasBlockSelectionGapBounds() const | 2991 bool RenderLayer::hasBlockSelectionGapBounds() const |
| 2992 { | 2992 { |
| 2993 // FIXME: it would be more accurate to return !blockSelectionGapsBounds().is
Empty(), but this is impossible | 2993 // FIXME: it would be more accurate to return !blockSelectionGapsBounds().is
Empty(), but this is impossible |
| 2994 // at the moment because it causes invalid queries to layout-dependent code
(crbug.com/372802). | 2994 // at the moment because it causes invalid queries to layout-dependent code
(crbug.com/372802). |
| 2995 // ASSERT(renderer()->document().lifecycle().state() >= DocumentLifecycle::L
ayoutClean); | 2995 // ASSERT(renderer()->document().lifecycle().state() >= DocumentLifecycle::L
ayoutClean); |
| 2996 | 2996 |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3686 } | 3686 } |
| 3687 } | 3687 } |
| 3688 | 3688 |
| 3689 void showLayerTree(const blink::RenderObject* renderer) | 3689 void showLayerTree(const blink::RenderObject* renderer) |
| 3690 { | 3690 { |
| 3691 if (!renderer) | 3691 if (!renderer) |
| 3692 return; | 3692 return; |
| 3693 showLayerTree(renderer->enclosingLayer()); | 3693 showLayerTree(renderer->enclosingLayer()); |
| 3694 } | 3694 } |
| 3695 #endif | 3695 #endif |
| OLD | NEW |