OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 return style()->paddingStart().isPercent() || style()->paddingEnd().isPercen
t(); | 867 return style()->paddingStart().isPercent() || style()->paddingEnd().isPercen
t(); |
868 } | 868 } |
869 | 869 |
870 IntSize RenderBox::scrolledContentOffset() const | 870 IntSize RenderBox::scrolledContentOffset() const |
871 { | 871 { |
872 ASSERT(hasOverflowClip()); | 872 ASSERT(hasOverflowClip()); |
873 ASSERT(hasLayer()); | 873 ASSERT(hasLayer()); |
874 return layer()->scrollableArea()->scrollOffset(); | 874 return layer()->scrollableArea()->scrollOffset(); |
875 } | 875 } |
876 | 876 |
877 void RenderBox::applyCachedClipAndScrollOffsetForRepaint(LayoutRect& paintRect)
const | 877 void RenderBox::applyCachedClipAndScrollOffsetForPaintInvalidation(LayoutRect& p
aintRect) const |
878 { | 878 { |
879 ASSERT(hasLayer()); | 879 ASSERT(hasLayer()); |
880 ASSERT(hasOverflowClip()); | 880 ASSERT(hasOverflowClip()); |
881 | 881 |
882 flipForWritingMode(paintRect); | 882 flipForWritingMode(paintRect); |
883 paintRect.move(-scrolledContentOffset()); // For overflow:auto/scroll/hidden
. | 883 paintRect.move(-scrolledContentOffset()); // For overflow:auto/scroll/hidden
. |
884 | 884 |
885 // Do not clip scroll layer contents to reduce the number of repaints while
scrolling. | 885 // Do not clip scroll layer contents to reduce the number of paint invalidat
ions while scrolling. |
886 if (usesCompositedScrolling()) { | 886 if (usesCompositedScrolling()) { |
887 flipForWritingMode(paintRect); | 887 flipForWritingMode(paintRect); |
888 return; | 888 return; |
889 } | 889 } |
890 | 890 |
891 // height() is inaccurate if we're in the middle of a layout of this RenderB
ox, so use the | 891 // height() is inaccurate if we're in the middle of a layout of this RenderB
ox, so use the |
892 // layer's size instead. Even if the layer's size is wrong, the layer itself
will repaint | 892 // layer's size instead. Even if the layer's size is wrong, the layer itself
will issue paint invalidations |
893 // anyway if its size does change. | 893 // anyway if its size does change. |
894 LayoutRect clipRect(LayoutPoint(), layer()->size()); | 894 LayoutRect clipRect(LayoutPoint(), layer()->size()); |
895 paintRect = intersection(paintRect, clipRect); | 895 paintRect = intersection(paintRect, clipRect); |
896 flipForWritingMode(paintRect); | 896 flipForWritingMode(paintRect); |
897 } | 897 } |
898 | 898 |
899 void RenderBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layou
tUnit& maxLogicalWidth) const | 899 void RenderBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layou
tUnit& maxLogicalWidth) const |
900 { | 900 { |
901 minLogicalWidth = minPreferredLogicalWidth() - borderAndPaddingLogicalWidth(
); | 901 minLogicalWidth = minPreferredLogicalWidth() - borderAndPaddingLogicalWidth(
); |
902 maxLogicalWidth = maxPreferredLogicalWidth() - borderAndPaddingLogicalWidth(
); | 902 maxLogicalWidth = maxPreferredLogicalWidth() - borderAndPaddingLogicalWidth(
); |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1478 paintInvalidationForWholeRenderer(); | 1478 paintInvalidationForWholeRenderer(); |
1479 return; | 1479 return; |
1480 } | 1480 } |
1481 | 1481 |
1482 ShapeValue* shapeOutsideValue = style()->shapeOutside(); | 1482 ShapeValue* shapeOutsideValue = style()->shapeOutside(); |
1483 if (!frameView()->isInPerformLayout() && isFloating() && shapeOutsideValue &
& shapeOutsideValue->image() && shapeOutsideValue->image()->data() == image) { | 1483 if (!frameView()->isInPerformLayout() && isFloating() && shapeOutsideValue &
& shapeOutsideValue->image() && shapeOutsideValue->image()->data() == image) { |
1484 ShapeOutsideInfo::ensureInfo(*this).markShapeAsDirty(); | 1484 ShapeOutsideInfo::ensureInfo(*this).markShapeAsDirty(); |
1485 markShapeOutsideDependentsForLayout(); | 1485 markShapeOutsideDependentsForLayout(); |
1486 } | 1486 } |
1487 | 1487 |
1488 bool didFullRepaint = repaintLayerRectsForImage(image, style()->backgroundLa
yers(), true); | 1488 if (!paintInvalidationLayerRectsForImage(image, style()->backgroundLayers(),
true)) |
1489 if (!didFullRepaint) | 1489 paintInvalidationLayerRectsForImage(image, style()->maskLayers(), false)
; |
1490 repaintLayerRectsForImage(image, style()->maskLayers(), false); | |
1491 } | 1490 } |
1492 | 1491 |
1493 bool RenderBox::repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer
& layers, bool drawingBackground) | 1492 bool RenderBox::paintInvalidationLayerRectsForImage(WrappedImagePtr image, const
FillLayer& layers, bool drawingBackground) |
1494 { | 1493 { |
1495 LayoutRect rendererRect; | 1494 LayoutRect rendererRect; |
1496 RenderBox* layerRenderer = 0; | 1495 RenderBox* layerRenderer = 0; |
1497 | 1496 |
1498 for (const FillLayer* curLayer = &layers; curLayer; curLayer = curLayer->nex
t()) { | 1497 for (const FillLayer* curLayer = &layers; curLayer; curLayer = curLayer->nex
t()) { |
1499 if (curLayer->image() && image == curLayer->image()->data() && curLayer-
>image()->canRender(*this, style()->effectiveZoom())) { | 1498 if (curLayer->image() && image == curLayer->image()->data() && curLayer-
>image()->canRender(*this, style()->effectiveZoom())) { |
1500 // Now that we know this image is being used, compute the renderer a
nd the rect if we haven't already. | 1499 // Now that we know this image is being used, compute the renderer a
nd the rect if we haven't already. |
1501 if (!layerRenderer) { | 1500 if (!layerRenderer) { |
1502 bool drawingRootBackground = drawingBackground && (isDocumentEle
ment() || (isBody() && !document().documentElement()->renderer()->hasBackground(
))); | 1501 bool drawingRootBackground = drawingBackground && (isDocumentEle
ment() || (isBody() && !document().documentElement()->renderer()->hasBackground(
))); |
1503 if (drawingRootBackground) { | 1502 if (drawingRootBackground) { |
(...skipping 16 matching lines...) Expand all Loading... |
1520 } else { | 1519 } else { |
1521 layerRenderer = this; | 1520 layerRenderer = this; |
1522 rendererRect = borderBoxRect(); | 1521 rendererRect = borderBoxRect(); |
1523 } | 1522 } |
1524 } | 1523 } |
1525 | 1524 |
1526 BackgroundImageGeometry geometry; | 1525 BackgroundImageGeometry geometry; |
1527 layerRenderer->calculateBackgroundImageGeometry(0, *curLayer, render
erRect, geometry); | 1526 layerRenderer->calculateBackgroundImageGeometry(0, *curLayer, render
erRect, geometry); |
1528 if (geometry.hasNonLocalGeometry()) { | 1527 if (geometry.hasNonLocalGeometry()) { |
1529 // Rather than incur the costs of computing the paintContainer f
or renderers with fixed backgrounds | 1528 // Rather than incur the costs of computing the paintContainer f
or renderers with fixed backgrounds |
1530 // in order to get the right destRect, just repaint the entire r
enderer. | 1529 // in order to get the right destRect, just issue paint invalida
tions for the entire renderer. |
1531 layerRenderer->paintInvalidationForWholeRenderer(); | 1530 layerRenderer->paintInvalidationForWholeRenderer(); |
1532 return true; | 1531 return true; |
1533 } | 1532 } |
1534 | 1533 |
1535 layerRenderer->invalidatePaintRectangle(geometry.destRect()); | 1534 layerRenderer->invalidatePaintRectangle(geometry.destRect()); |
1536 if (geometry.destRect() == rendererRect) | 1535 if (geometry.destRect() == rendererRect) |
1537 return true; | 1536 return true; |
1538 } | 1537 } |
1539 } | 1538 } |
1540 return false; | 1539 return false; |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1768 if (!logicalHeightLength.isFixed()) { | 1767 if (!logicalHeightLength.isFixed()) { |
1769 LayoutUnit fillFallbackExtent = containingBlockStyle->isHorizontalWritin
gMode() ? view()->frameView()->visibleHeight() : view()->frameView()->visibleWid
th(); | 1768 LayoutUnit fillFallbackExtent = containingBlockStyle->isHorizontalWritin
gMode() ? view()->frameView()->visibleHeight() : view()->frameView()->visibleWid
th(); |
1770 LayoutUnit fillAvailableExtent = containingBlock()->availableLogicalHeig
ht(ExcludeMarginBorderPadding); | 1769 LayoutUnit fillAvailableExtent = containingBlock()->availableLogicalHeig
ht(ExcludeMarginBorderPadding); |
1771 return std::min(fillAvailableExtent, fillFallbackExtent); | 1770 return std::min(fillAvailableExtent, fillFallbackExtent); |
1772 } | 1771 } |
1773 | 1772 |
1774 // Use the content box logical height as specified by the style. | 1773 // Use the content box logical height as specified by the style. |
1775 return cb->adjustContentBoxLogicalHeightForBoxSizing(logicalHeightLength.val
ue()); | 1774 return cb->adjustContentBoxLogicalHeightForBoxSizing(logicalHeightLength.val
ue()); |
1776 } | 1775 } |
1777 | 1776 |
1778 void RenderBox::mapLocalToContainer(const RenderLayerModelObject* repaintContain
er, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed, co
nst PaintInvalidationState* paintInvalidationState) const | 1777 void RenderBox::mapLocalToContainer(const RenderLayerModelObject* paintInvalidat
ionContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wa
sFixed, const PaintInvalidationState* paintInvalidationState) const |
1779 { | 1778 { |
1780 if (repaintContainer == this) | 1779 if (paintInvalidationContainer == this) |
1781 return; | 1780 return; |
1782 | 1781 |
1783 if (paintInvalidationState && paintInvalidationState->canMapToContainer(repa
intContainer)) { | 1782 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain
tInvalidationContainer)) { |
1784 LayoutSize offset = paintInvalidationState->paintOffset() + locationOffs
et(); | 1783 LayoutSize offset = paintInvalidationState->paintOffset() + locationOffs
et(); |
1785 if (style()->hasInFlowPosition() && layer()) | 1784 if (style()->hasInFlowPosition() && layer()) |
1786 offset += layer()->offsetForInFlowPosition(); | 1785 offset += layer()->offsetForInFlowPosition(); |
1787 transformState.move(offset); | 1786 transformState.move(offset); |
1788 return; | 1787 return; |
1789 } | 1788 } |
1790 | 1789 |
1791 bool containerSkipped; | 1790 bool containerSkipped; |
1792 RenderObject* o = container(repaintContainer, &containerSkipped); | 1791 RenderObject* o = container(paintInvalidationContainer, &containerSkipped); |
1793 if (!o) | 1792 if (!o) |
1794 return; | 1793 return; |
1795 | 1794 |
1796 bool isFixedPos = style()->position() == FixedPosition; | 1795 bool isFixedPos = style()->position() == FixedPosition; |
1797 bool hasTransform = hasLayer() && layer()->transform(); | 1796 bool hasTransform = hasLayer() && layer()->transform(); |
1798 // If this box has a transform, it acts as a fixed position container for fi
xed descendants, | 1797 // If this box has a transform, it acts as a fixed position container for fi
xed descendants, |
1799 // and may itself also be fixed position. So propagate 'fixed' up only if th
is box is fixed position. | 1798 // and may itself also be fixed position. So propagate 'fixed' up only if th
is box is fixed position. |
1800 if (hasTransform && !isFixedPos) | 1799 if (hasTransform && !isFixedPos) |
1801 mode &= ~IsFixed; | 1800 mode &= ~IsFixed; |
1802 else if (isFixedPos) | 1801 else if (isFixedPos) |
1803 mode |= IsFixed; | 1802 mode |= IsFixed; |
1804 | 1803 |
1805 if (wasFixed) | 1804 if (wasFixed) |
1806 *wasFixed = mode & IsFixed; | 1805 *wasFixed = mode & IsFixed; |
1807 | 1806 |
1808 LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(trans
formState.mappedPoint())); | 1807 LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(trans
formState.mappedPoint())); |
1809 | 1808 |
1810 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl
e()->preserves3D()); | 1809 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl
e()->preserves3D()); |
1811 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { | 1810 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { |
1812 TransformationMatrix t; | 1811 TransformationMatrix t; |
1813 getTransformFromContainer(o, containerOffset, t); | 1812 getTransformFromContainer(o, containerOffset, t); |
1814 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate
Transform : TransformState::FlattenTransform); | 1813 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate
Transform : TransformState::FlattenTransform); |
1815 } else | 1814 } else |
1816 transformState.move(containerOffset.width(), containerOffset.height(), p
reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo
rm); | 1815 transformState.move(containerOffset.width(), containerOffset.height(), p
reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo
rm); |
1817 | 1816 |
1818 if (containerSkipped) { | 1817 if (containerSkipped) { |
1819 // There can't be a transform between repaintContainer and o, because tr
ansforms create containers, so it should be safe | 1818 // There can't be a transform between paintInvalidationContainer and o,
because transforms create containers, so it should be safe |
1820 // to just subtract the delta between the repaintContainer and o. | 1819 // to just subtract the delta between the paintInvalidationContainer and
o. |
1821 LayoutSize containerOffset = repaintContainer->offsetFromAncestorContain
er(o); | 1820 LayoutSize containerOffset = paintInvalidationContainer->offsetFromAnces
torContainer(o); |
1822 transformState.move(-containerOffset.width(), -containerOffset.height(),
preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTrans
form); | 1821 transformState.move(-containerOffset.width(), -containerOffset.height(),
preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTrans
form); |
1823 return; | 1822 return; |
1824 } | 1823 } |
1825 | 1824 |
1826 mode &= ~ApplyContainerFlip; | 1825 mode &= ~ApplyContainerFlip; |
1827 | 1826 |
1828 o->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed); | 1827 o->mapLocalToContainer(paintInvalidationContainer, transformState, mode, was
Fixed); |
1829 } | 1828 } |
1830 | 1829 |
1831 void RenderBox::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState
& transformState) const | 1830 void RenderBox::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState
& transformState) const |
1832 { | 1831 { |
1833 bool isFixedPos = style()->position() == FixedPosition; | 1832 bool isFixedPos = style()->position() == FixedPosition; |
1834 bool hasTransform = hasLayer() && layer()->transform(); | 1833 bool hasTransform = hasLayer() && layer()->transform(); |
1835 if (hasTransform && !isFixedPos) { | 1834 if (hasTransform && !isFixedPos) { |
1836 // If this box has a transform, it acts as a fixed position container fo
r fixed descendants, | 1835 // If this box has a transform, it acts as a fixed position container fo
r fixed descendants, |
1837 // and may itself also be fixed position. So propagate 'fixed' up only i
f this box is fixed position. | 1836 // and may itself also be fixed position. So propagate 'fixed' up only i
f this box is fixed position. |
1838 mode &= ~IsFixed; | 1837 mode &= ~IsFixed; |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1972 | 1971 |
1973 LayoutRect r = visualOverflowRect(); | 1972 LayoutRect r = visualOverflowRect(); |
1974 mapRectToPaintInvalidationBacking(paintInvalidationContainer, r, false /*fix
ed*/, paintInvalidationState); | 1973 mapRectToPaintInvalidationBacking(paintInvalidationContainer, r, false /*fix
ed*/, paintInvalidationState); |
1975 return r; | 1974 return r; |
1976 } | 1975 } |
1977 | 1976 |
1978 void RenderBox::mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalidatio
nState* paintInvalidationState) const | 1977 void RenderBox::mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalidatio
nState* paintInvalidationState) const |
1979 { | 1978 { |
1980 // The rect we compute at each step is shifted by our x/y offset in the pare
nt container's coordinate space. | 1979 // The rect we compute at each step is shifted by our x/y offset in the pare
nt container's coordinate space. |
1981 // Only when we cross a writing mode boundary will we have to possibly flipF
orWritingMode (to convert into a more appropriate | 1980 // Only when we cross a writing mode boundary will we have to possibly flipF
orWritingMode (to convert into a more appropriate |
1982 // offset corner for the enclosing container). This allows for a fully RL o
r BT document to repaint | 1981 // offset corner for the enclosing container). This allows for a fully RL or
BT document to issue paint invalidations |
1983 // properly even during layout, since the rect remains flipped all the way u
ntil the end. | 1982 // properly even during layout, since the rect remains flipped all the way u
ntil the end. |
1984 // | 1983 // |
1985 // RenderView::computeRectForRepaint then converts the rect to physical coor
dinates. We also convert to | 1984 // RenderView::computeRectForPaintInvalidation then converts the rect to phy
sical coordinates. We also convert to |
1986 // physical when we hit a paintInvalidationContainer boundary. Therefore the
final rect returned is always in the | 1985 // physical when we hit a paintInvalidationContainer boundary. Therefore the
final rect returned is always in the |
1987 // physical coordinate space of the paintInvalidationContainer. | 1986 // physical coordinate space of the paintInvalidationContainer. |
1988 RenderStyle* styleToUse = style(); | 1987 RenderStyle* styleToUse = style(); |
1989 | 1988 |
1990 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain
tInvalidationContainer) && styleToUse->position() != FixedPosition) { | 1989 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain
tInvalidationContainer) && styleToUse->position() != FixedPosition) { |
1991 if (layer() && layer()->transform()) | 1990 if (layer() && layer()->transform()) |
1992 rect = layer()->transform()->mapRect(pixelSnappedIntRect(rect)); | 1991 rect = layer()->transform()->mapRect(pixelSnappedIntRect(rect)); |
1993 | 1992 |
1994 // We can't trust the bits on RenderObject, because this might be called
while re-resolving style. | 1993 // We can't trust the bits on RenderObject, because this might be called
while re-resolving style. |
1995 if (styleToUse->hasInFlowPosition() && layer()) | 1994 if (styleToUse->hasInFlowPosition() && layer()) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2038 topLeft += toRenderInline(o)->offsetForInFlowPositionedInline(*this); | 2037 topLeft += toRenderInline(o)->offsetForInFlowPositionedInline(*this); |
2039 } else if (styleToUse->hasInFlowPosition() && layer()) { | 2038 } else if (styleToUse->hasInFlowPosition() && layer()) { |
2040 // Apply the relative position offset when invalidating a rectangle. Th
e layer | 2039 // Apply the relative position offset when invalidating a rectangle. Th
e layer |
2041 // is translated, but the render box isn't, so we need to do this to get
the | 2040 // is translated, but the render box isn't, so we need to do this to get
the |
2042 // right dirty rect. Since this is called from RenderObject::setStyle,
the relative position | 2041 // right dirty rect. Since this is called from RenderObject::setStyle,
the relative position |
2043 // flag on the RenderObject has been cleared, so use the one on the styl
e(). | 2042 // flag on the RenderObject has been cleared, so use the one on the styl
e(). |
2044 topLeft += layer()->offsetForInFlowPosition(); | 2043 topLeft += layer()->offsetForInFlowPosition(); |
2045 } | 2044 } |
2046 | 2045 |
2047 if (position != AbsolutePosition && position != FixedPosition && o->hasColum
ns() && o->isRenderBlockFlow()) { | 2046 if (position != AbsolutePosition && position != FixedPosition && o->hasColum
ns() && o->isRenderBlockFlow()) { |
2048 LayoutRect repaintRect(topLeft, rect.size()); | 2047 LayoutRect paintInvalidationRect(topLeft, rect.size()); |
2049 toRenderBlock(o)->adjustRectForColumns(repaintRect); | 2048 toRenderBlock(o)->adjustRectForColumns(paintInvalidationRect); |
2050 topLeft = repaintRect.location(); | 2049 topLeft = paintInvalidationRect.location(); |
2051 rect = repaintRect; | 2050 rect = paintInvalidationRect; |
2052 } | 2051 } |
2053 | 2052 |
2054 // FIXME: We ignore the lightweight clipping rect that controls use, since i
f |o| is in mid-layout, | 2053 // FIXME: We ignore the lightweight clipping rect that controls use, since i
f |o| is in mid-layout, |
2055 // its controlClipRect will be wrong. For overflow clip we use the values ca
ched by the layer. | 2054 // its controlClipRect will be wrong. For overflow clip we use the values ca
ched by the layer. |
2056 rect.setLocation(topLeft); | 2055 rect.setLocation(topLeft); |
2057 if (o->hasOverflowClip() && !shouldDoFullPaintInvalidationIfSelfPaintingLaye
r()) { | 2056 if (o->hasOverflowClip() && !shouldDoFullPaintInvalidationIfSelfPaintingLaye
r()) { |
2058 RenderBox* containerBox = toRenderBox(o); | 2057 RenderBox* containerBox = toRenderBox(o); |
2059 containerBox->applyCachedClipAndScrollOffsetForRepaint(rect); | 2058 containerBox->applyCachedClipAndScrollOffsetForPaintInvalidation(rect); |
2060 if (rect.isEmpty()) | 2059 if (rect.isEmpty()) |
2061 return; | 2060 return; |
2062 } | 2061 } |
2063 | 2062 |
2064 if (containerSkipped) { | 2063 if (containerSkipped) { |
2065 // If the paintInvalidationContainer is below o, then we need to map the
rect into paintInvalidationContainer's coordinates. | 2064 // If the paintInvalidationContainer is below o, then we need to map the
rect into paintInvalidationContainer's coordinates. |
2066 LayoutSize containerOffset = paintInvalidationContainer->offsetFromAnces
torContainer(o); | 2065 LayoutSize containerOffset = paintInvalidationContainer->offsetFromAnces
torContainer(o); |
2067 rect.move(-containerOffset); | 2066 rect.move(-containerOffset); |
2068 return; | 2067 return; |
2069 } | 2068 } |
(...skipping 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4088 LayoutSize newBorderBoxSize = size(); | 4087 LayoutSize newBorderBoxSize = size(); |
4089 | 4088 |
4090 if (oldBorderBoxSize == newBorderBoxSize) | 4089 if (oldBorderBoxSize == newBorderBoxSize) |
4091 return invalidationReason; | 4090 return invalidationReason; |
4092 | 4091 |
4093 if (oldBorderBoxSize.width() != newBorderBoxSize.width() && mustInvalidateBa
ckgroundOrBorderPaintOnWidthChange()) | 4092 if (oldBorderBoxSize.width() != newBorderBoxSize.width() && mustInvalidateBa
ckgroundOrBorderPaintOnWidthChange()) |
4094 return InvalidationBorderBoxChange; | 4093 return InvalidationBorderBoxChange; |
4095 if (oldBorderBoxSize.height() != newBorderBoxSize.height() && mustInvalidate
BackgroundOrBorderPaintOnHeightChange()) | 4094 if (oldBorderBoxSize.height() != newBorderBoxSize.height() && mustInvalidate
BackgroundOrBorderPaintOnHeightChange()) |
4096 return InvalidationBorderBoxChange; | 4095 return InvalidationBorderBoxChange; |
4097 | 4096 |
4098 // If size of repaint rect equals to size of border box, RenderObject::incre
mentallyInvalidatePaint() | 4097 // If size of the paint invalidation rect equals to size of border box, Rend
erObject::incrementallyInvalidatePaint() |
4099 // is good for boxes having background without box decorations. | 4098 // is good for boxes having background without box decorations. |
4100 if (oldBorderBoxSize == oldBounds.size() && newBorderBoxSize == newBounds.si
ze() && !style()->hasBoxDecorations()) | 4099 if (oldBorderBoxSize == oldBounds.size() && newBorderBoxSize == newBounds.si
ze() && !style()->hasBoxDecorations()) |
4101 return invalidationReason; | 4100 return invalidationReason; |
4102 | 4101 |
4103 // FIXME: Since we have accurate old border box size, we could do more accur
ate | 4102 // FIXME: Since we have accurate old border box size, we could do more accur
ate |
4104 // incremental invalidation instead of full invalidation. | 4103 // incremental invalidation instead of full invalidation. |
4105 return InvalidationBorderBoxChange; | 4104 return InvalidationBorderBoxChange; |
4106 } | 4105 } |
4107 | 4106 |
4108 void RenderBox::markForPaginationRelayoutIfNeeded(SubtreeLayoutScope& layoutScop
e) | 4107 void RenderBox::markForPaginationRelayoutIfNeeded(SubtreeLayoutScope& layoutScop
e) |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4631 RenderBox* boxToSplit = toRenderBox(beforeChild->parent()); | 4630 RenderBox* boxToSplit = toRenderBox(beforeChild->parent()); |
4632 if (boxToSplit->slowFirstChild() != beforeChild && boxToSplit->isAnonymo
us()) { | 4631 if (boxToSplit->slowFirstChild() != beforeChild && boxToSplit->isAnonymo
us()) { |
4633 didSplitParentAnonymousBoxes = true; | 4632 didSplitParentAnonymousBoxes = true; |
4634 | 4633 |
4635 // We have to split the parent box into two boxes and move children | 4634 // We have to split the parent box into two boxes and move children |
4636 // from |beforeChild| to end into the new post box. | 4635 // from |beforeChild| to end into the new post box. |
4637 RenderBox* postBox = boxToSplit->createAnonymousBoxWithSameTypeAs(th
is); | 4636 RenderBox* postBox = boxToSplit->createAnonymousBoxWithSameTypeAs(th
is); |
4638 postBox->setChildrenInline(boxToSplit->childrenInline()); | 4637 postBox->setChildrenInline(boxToSplit->childrenInline()); |
4639 RenderBox* parentBox = toRenderBox(boxToSplit->parent()); | 4638 RenderBox* parentBox = toRenderBox(boxToSplit->parent()); |
4640 // We need to invalidate the |parentBox| before inserting the new no
de | 4639 // We need to invalidate the |parentBox| before inserting the new no
de |
4641 // so that the table repainting logic knows the structure is dirty. | 4640 // so that the table paint invalidation logic knows the structure is
dirty. |
4642 // See for example RenderTableCell:clippedOverflowRectForPaintInvali
dation. | 4641 // See for example RenderTableCell:clippedOverflowRectForPaintInvali
dation. |
4643 markBoxForRelayoutAfterSplit(parentBox); | 4642 markBoxForRelayoutAfterSplit(parentBox); |
4644 parentBox->virtualChildren()->insertChildNode(parentBox, postBox, bo
xToSplit->nextSibling()); | 4643 parentBox->virtualChildren()->insertChildNode(parentBox, postBox, bo
xToSplit->nextSibling()); |
4645 boxToSplit->moveChildrenTo(postBox, beforeChild, 0, true); | 4644 boxToSplit->moveChildrenTo(postBox, beforeChild, 0, true); |
4646 | 4645 |
4647 markBoxForRelayoutAfterSplit(boxToSplit); | 4646 markBoxForRelayoutAfterSplit(boxToSplit); |
4648 markBoxForRelayoutAfterSplit(postBox); | 4647 markBoxForRelayoutAfterSplit(postBox); |
4649 | 4648 |
4650 beforeChild = postBox; | 4649 beforeChild = postBox; |
4651 } else | 4650 } else |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4699 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) | 4698 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) |
4700 { | 4699 { |
4701 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor); | 4700 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor); |
4702 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); | 4701 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); |
4703 ASSERT(hasBackground == style.hasBackground()); | 4702 ASSERT(hasBackground == style.hasBackground()); |
4704 hasBorder = style.hasBorder(); | 4703 hasBorder = style.hasBorder(); |
4705 hasAppearance = style.hasAppearance(); | 4704 hasAppearance = style.hasAppearance(); |
4706 } | 4705 } |
4707 | 4706 |
4708 } // namespace blink | 4707 } // namespace blink |
OLD | NEW |