| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 setNeedsLayoutAndPrefWidthsRecalc(); | 142 setNeedsLayoutAndPrefWidthsRecalc(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 if (layer()) { | 145 if (layer()) { |
| 146 // FIXME: Ideally we shouldn't need this setter but we can't easily infe
r an overflow-only layer | 146 // FIXME: Ideally we shouldn't need this setter but we can't easily infe
r an overflow-only layer |
| 147 // from the style. | 147 // from the style. |
| 148 layer()->setLayerType(type); | 148 layer()->setLayerType(type); |
| 149 layer()->styleChanged(diff, oldStyle); | 149 layer()->styleChanged(diff, oldStyle); |
| 150 } | 150 } |
| 151 | 151 |
| 152 updateTransform(oldStyle); |
| 153 |
| 152 if (needsLayout() && oldStyle) | 154 if (needsLayout() && oldStyle) |
| 153 RenderBlock::removePercentHeightDescendantIfNeeded(this); | 155 RenderBlock::removePercentHeightDescendantIfNeeded(this); |
| 154 } | 156 } |
| 155 | 157 |
| 158 void RenderBox::updateTransformationMatrix() |
| 159 { |
| 160 if (m_transform) { |
| 161 m_transform->makeIdentity(); |
| 162 style()->applyTransform(*m_transform, pixelSnappedBorderBoxRect().size()
, RenderStyle::IncludeTransformOrigin); |
| 163 // FIXME(sky): We shouldn't need to do this once Skia has 4x4 matrix sup
port. |
| 164 // Until then, 3d transforms don't work right. |
| 165 m_transform->makeAffine(); |
| 166 } |
| 167 } |
| 168 |
| 169 void RenderBox::updateTransform(const RenderStyle* oldStyle) |
| 170 { |
| 171 if (oldStyle && style()->transformDataEquivalent(*oldStyle)) |
| 172 return; |
| 173 |
| 174 // hasTransform() on the renderer is also true when there is transform-style
: preserve-3d or perspective set, |
| 175 // so check style too. |
| 176 bool localHasTransform = hasTransform() && style()->hasTransform(); |
| 177 bool had3DTransform = has3DTransform(); |
| 178 |
| 179 bool hadTransform = m_transform; |
| 180 if (localHasTransform != hadTransform) { |
| 181 if (localHasTransform) |
| 182 m_transform = adoptPtr(new TransformationMatrix); |
| 183 else |
| 184 m_transform.clear(); |
| 185 |
| 186 // Layers with transforms act as clip rects roots, so clear the cached c
lip rects here. |
| 187 layer()->clipper().clearClipRectsIncludingDescendants(); |
| 188 } else if (localHasTransform) { |
| 189 layer()->clipper().clearClipRectsIncludingDescendants(AbsoluteClipRects)
; |
| 190 } |
| 191 |
| 192 updateTransformationMatrix(); |
| 193 |
| 194 if (had3DTransform != has3DTransform()) |
| 195 layer()->dirty3DTransformedDescendantStatus(); |
| 196 } |
| 197 |
| 156 // TODO(ojan): Inline this into styleDidChange, | 198 // TODO(ojan): Inline this into styleDidChange, |
| 157 void RenderBox::updateFromStyle() | 199 void RenderBox::updateFromStyle() |
| 158 { | 200 { |
| 159 RenderStyle* styleToUse = style(); | 201 RenderStyle* styleToUse = style(); |
| 160 | 202 |
| 161 setHasBoxDecorationBackground(hasBackground() || styleToUse->hasBorder() ||
styleToUse->boxShadow()); | 203 setHasBoxDecorationBackground(hasBackground() || styleToUse->hasBorder() ||
styleToUse->boxShadow()); |
| 162 setInline(styleToUse->isDisplayInlineType()); | 204 setInline(styleToUse->isDisplayInlineType()); |
| 163 setPositionState(styleToUse->position()); | 205 setPositionState(styleToUse->position()); |
| 164 | 206 |
| 165 if (isRenderView()) { | 207 if (isRenderView()) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 return snapSizeToPixel(offsetHeight(), y() + clientTop()); | 281 return snapSizeToPixel(offsetHeight(), y() + clientTop()); |
| 240 } | 282 } |
| 241 | 283 |
| 242 void RenderBox::absoluteQuads(Vector<FloatQuad>& quads) const | 284 void RenderBox::absoluteQuads(Vector<FloatQuad>& quads) const |
| 243 { | 285 { |
| 244 quads.append(localToAbsoluteQuad(FloatRect(0, 0, width().toFloat(), height()
.toFloat()), 0 /* mode */)); | 286 quads.append(localToAbsoluteQuad(FloatRect(0, 0, width().toFloat(), height()
.toFloat()), 0 /* mode */)); |
| 245 } | 287 } |
| 246 | 288 |
| 247 void RenderBox::updateLayerTransformAfterLayout() | 289 void RenderBox::updateLayerTransformAfterLayout() |
| 248 { | 290 { |
| 249 // Transform-origin depends on box size, so we need to update the layer tran
sform after layout. | 291 // Transform-origin depends on box size, so we need to update the transform
after layout. |
| 250 if (hasLayer()) | 292 updateTransformationMatrix(); |
| 251 layer()->updateTransformationMatrix(); | |
| 252 } | 293 } |
| 253 | 294 |
| 254 LayoutUnit RenderBox::constrainLogicalWidthByMinMax(LayoutUnit logicalWidth, Lay
outUnit availableWidth, RenderBlock* cb) const | 295 LayoutUnit RenderBox::constrainLogicalWidthByMinMax(LayoutUnit logicalWidth, Lay
outUnit availableWidth, RenderBlock* cb) const |
| 255 { | 296 { |
| 256 RenderStyle* styleToUse = style(); | 297 RenderStyle* styleToUse = style(); |
| 257 if (!styleToUse->logicalMaxWidth().isMaxSizeNone()) | 298 if (!styleToUse->logicalMaxWidth().isMaxSizeNone()) |
| 258 logicalWidth = std::min(logicalWidth, computeLogicalWidthUsing(MaxSize,
styleToUse->logicalMaxWidth(), availableWidth, cb)); | 299 logicalWidth = std::min(logicalWidth, computeLogicalWidthUsing(MaxSize,
styleToUse->logicalMaxWidth(), availableWidth, cb)); |
| 259 return std::max(logicalWidth, computeLogicalWidthUsing(MinSize, styleToUse->
logicalMinWidth(), availableWidth, cb)); | 300 return std::max(logicalWidth, computeLogicalWidthUsing(MinSize, styleToUse->
logicalMinWidth(), availableWidth, cb)); |
| 260 } | 301 } |
| 261 | 302 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 { | 582 { |
| 542 ASSERT(layer()->isSelfPaintingLayer()); | 583 ASSERT(layer()->isSelfPaintingLayer()); |
| 543 | 584 |
| 544 // The natural thing would be to keep HitTestingTransformState on the stack,
but it's big, so we heap-allocate. | 585 // The natural thing would be to keep HitTestingTransformState on the stack,
but it's big, so we heap-allocate. |
| 545 RefPtr<HitTestingTransformState> localTransformState; | 586 RefPtr<HitTestingTransformState> localTransformState; |
| 546 | 587 |
| 547 LayoutRect localHitTestRect = hitTestRect; | 588 LayoutRect localHitTestRect = hitTestRect; |
| 548 HitTestLocation localHitTestLocation = hitTestLocation; | 589 HitTestLocation localHitTestLocation = hitTestLocation; |
| 549 | 590 |
| 550 // We need transform state for the first time, or to offset the container st
ate, or to accumulate the new transform. | 591 // We need transform state for the first time, or to offset the container st
ate, or to accumulate the new transform. |
| 551 if (layer()->transform() || transformState || layer()->has3DTransformedDesce
ndant() || layer()->preserves3D()) | 592 if (transform() || transformState || layer()->has3DTransformedDescendant() |
| style()->preserves3D()) |
| 552 localTransformState = createLocalTransformState(rootLayer, containerLaye
r, localHitTestRect, localHitTestLocation, transformState); | 593 localTransformState = createLocalTransformState(rootLayer, containerLaye
r, localHitTestRect, localHitTestLocation, transformState); |
| 553 | 594 |
| 554 // Apply a transform if we have one. | 595 // Apply a transform if we have one. |
| 555 if (layer()->transform()) { | 596 if (transform()) { |
| 556 // The RenderView cannot have transforms. | 597 // The RenderView cannot have transforms. |
| 557 ASSERT(parent()); | 598 ASSERT(parent()); |
| 558 // Make sure the parent's clip rects have been calculated. | 599 // Make sure the parent's clip rects have been calculated. |
| 559 ClipRect clipRect = layer()->clipper().backgroundClipRect(ClipRectsConte
xt(rootLayer, RootRelativeClipRects)); | 600 ClipRect clipRect = layer()->clipper().backgroundClipRect(ClipRectsConte
xt(rootLayer, RootRelativeClipRects)); |
| 560 // Go ahead and test the enclosing clip now. | 601 // Go ahead and test the enclosing clip now. |
| 561 if (!clipRect.intersects(localHitTestLocation)) | 602 if (!clipRect.intersects(localHitTestLocation)) |
| 562 return 0; | 603 return 0; |
| 563 | 604 |
| 564 // If the transform can't be inverted, then don't hit test this layer at
all. | 605 // If the transform can't be inverted, then don't hit test this layer at
all. |
| 565 if (!localTransformState->m_accumulatedTransform.isInvertible()) | 606 if (!localTransformState->m_accumulatedTransform.isInvertible()) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 589 | 630 |
| 590 // Check for hit test on backface if backface-visibility is 'hidden' | 631 // Check for hit test on backface if backface-visibility is 'hidden' |
| 591 if (localTransformState && style()->backfaceVisibility() == BackfaceVisibili
tyHidden) { | 632 if (localTransformState && style()->backfaceVisibility() == BackfaceVisibili
tyHidden) { |
| 592 TransformationMatrix invertedMatrix = localTransformState->m_accumulated
Transform.inverse(); | 633 TransformationMatrix invertedMatrix = localTransformState->m_accumulated
Transform.inverse(); |
| 593 // If the z-vector of the matrix is negative, the back is facing towards
the viewer. | 634 // If the z-vector of the matrix is negative, the back is facing towards
the viewer. |
| 594 if (invertedMatrix.m33() < 0) | 635 if (invertedMatrix.m33() < 0) |
| 595 return 0; | 636 return 0; |
| 596 } | 637 } |
| 597 | 638 |
| 598 RefPtr<HitTestingTransformState> unflattenedTransformState = localTransformS
tate; | 639 RefPtr<HitTestingTransformState> unflattenedTransformState = localTransformS
tate; |
| 599 if (localTransformState && !layer()->preserves3D()) { | 640 if (localTransformState && !style()->preserves3D()) { |
| 600 // Keep a copy of the pre-flattening state, for computing z-offsets for
the container | 641 // Keep a copy of the pre-flattening state, for computing z-offsets for
the container |
| 601 unflattenedTransformState = HitTestingTransformState::create(*localTrans
formState); | 642 unflattenedTransformState = HitTestingTransformState::create(*localTrans
formState); |
| 602 // This layer is flattening, so flatten the state passed to descendants. | 643 // This layer is flattening, so flatten the state passed to descendants. |
| 603 localTransformState->flatten(); | 644 localTransformState->flatten(); |
| 604 } | 645 } |
| 605 | 646 |
| 606 // The following are used for keeping track of the z-depth of the hit point
of 3d-transformed | 647 // The following are used for keeping track of the z-depth of the hit point
of 3d-transformed |
| 607 // descendants. | 648 // descendants. |
| 608 double localZOffset = -std::numeric_limits<double>::infinity(); | 649 double localZOffset = -std::numeric_limits<double>::infinity(); |
| 609 double* zOffsetForDescendantsPtr = 0; | 650 double* zOffsetForDescendantsPtr = 0; |
| 610 double* zOffsetForContentsPtr = 0; | 651 double* zOffsetForContentsPtr = 0; |
| 611 | 652 |
| 612 bool depthSortDescendants = false; | 653 bool depthSortDescendants = false; |
| 613 if (layer()->preserves3D()) { | 654 if (style()->preserves3D()) { |
| 614 depthSortDescendants = true; | 655 depthSortDescendants = true; |
| 615 // Our layers can depth-test with our container, so share the z depth po
inter with the container, if it passed one down. | 656 // Our layers can depth-test with our container, so share the z depth po
inter with the container, if it passed one down. |
| 616 zOffsetForDescendantsPtr = zOffset ? zOffset : &localZOffset; | 657 zOffsetForDescendantsPtr = zOffset ? zOffset : &localZOffset; |
| 617 zOffsetForContentsPtr = zOffset ? zOffset : &localZOffset; | 658 zOffsetForContentsPtr = zOffset ? zOffset : &localZOffset; |
| 618 } else if (zOffset) { | 659 } else if (zOffset) { |
| 619 zOffsetForDescendantsPtr = 0; | 660 zOffsetForDescendantsPtr = 0; |
| 620 // Container needs us to give back a z offset for the hit layer. | 661 // Container needs us to give back a z offset for the hit layer. |
| 621 zOffsetForContentsPtr = zOffset; | 662 zOffsetForContentsPtr = zOffset; |
| 622 } | 663 } |
| 623 | 664 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 return first->style()->zIndex() < second->style()->zIndex(); | 754 return first->style()->zIndex() < second->style()->zIndex(); |
| 714 } | 755 } |
| 715 | 756 |
| 716 void RenderBox::paintLayer(GraphicsContext* context, const LayerPaintingInfo& pa
intingInfo) | 757 void RenderBox::paintLayer(GraphicsContext* context, const LayerPaintingInfo& pa
intingInfo) |
| 717 { | 758 { |
| 718 // If this layer is totally invisible then there is nothing to paint. | 759 // If this layer is totally invisible then there is nothing to paint. |
| 719 // TODO(ojan): Return false from isSelfPainting and then ASSERT(!opacity())
here. | 760 // TODO(ojan): Return false from isSelfPainting and then ASSERT(!opacity())
here. |
| 720 if (!opacity()) | 761 if (!opacity()) |
| 721 return; | 762 return; |
| 722 | 763 |
| 723 TransformationMatrix* layerTransform = layer()->transform(); | 764 if (!transform()) { |
| 724 | |
| 725 if (!layerTransform) { | |
| 726 paintLayerContents(context, paintingInfo); | 765 paintLayerContents(context, paintingInfo); |
| 727 return; | 766 return; |
| 728 } | 767 } |
| 729 | 768 |
| 730 // The RenderView can't be transformed in Sky. | 769 // The RenderView can't be transformed in Sky. |
| 731 ASSERT(layer()->parent()); | 770 ASSERT(layer()->parent()); |
| 732 | 771 |
| 733 // If the transform can't be inverted, then don't paint anything. | 772 // If the transform can't be inverted, then don't paint anything. |
| 734 if (!layerTransform->isInvertible()) | 773 if (!transform()->isInvertible()) |
| 735 return; | 774 return; |
| 736 | 775 |
| 737 // Make sure the parent's clip rects have been calculated. | 776 // Make sure the parent's clip rects have been calculated. |
| 738 ClipRectsContext clipRectsContext(paintingInfo.rootLayer, PaintingClipRects)
; | 777 ClipRectsContext clipRectsContext(paintingInfo.rootLayer, PaintingClipRects)
; |
| 739 ClipRect clipRect = layer()->clipper().backgroundClipRect(clipRectsContext); | 778 ClipRect clipRect = layer()->clipper().backgroundClipRect(clipRectsContext); |
| 740 clipRect.intersect(paintingInfo.paintDirtyRect); | 779 clipRect.intersect(paintingInfo.paintDirtyRect); |
| 741 | 780 |
| 742 // Push the parent coordinate space's clip. | 781 // Push the parent coordinate space's clip. |
| 743 layer()->parent()->clipToRect(paintingInfo, context, clipRect); | 782 layer()->parent()->clipToRect(paintingInfo, context, clipRect); |
| 744 | 783 |
| 745 // This involves subtracting out the position of the layer in our current co
ordinate space, but preserving | 784 // This involves subtracting out the position of the layer in our current co
ordinate space, but preserving |
| 746 // the accumulated error for sub-pixel layout. | 785 // the accumulated error for sub-pixel layout. |
| 747 LayoutPoint delta; | 786 LayoutPoint delta; |
| 748 layer()->convertToLayerCoords(paintingInfo.rootLayer, delta); | 787 layer()->convertToLayerCoords(paintingInfo.rootLayer, delta); |
| 749 TransformationMatrix transform(*layerTransform); | 788 TransformationMatrix localTransform(*transform()); |
| 750 IntPoint roundedDelta = roundedIntPoint(delta); | 789 IntPoint roundedDelta = roundedIntPoint(delta); |
| 751 transform.translateRight(roundedDelta.x(), roundedDelta.y()); | 790 localTransform.translateRight(roundedDelta.x(), roundedDelta.y()); |
| 752 LayoutSize adjustedSubPixelAccumulation = paintingInfo.subPixelAccumulation
+ (delta - roundedDelta); | 791 LayoutSize adjustedSubPixelAccumulation = paintingInfo.subPixelAccumulation
+ (delta - roundedDelta); |
| 753 | 792 |
| 754 // Apply the transform. | 793 // Apply the transform. |
| 755 GraphicsContextStateSaver stateSaver(*context, false); | 794 GraphicsContextStateSaver stateSaver(*context, false); |
| 756 if (!transform.isIdentity()) { | 795 if (!localTransform.isIdentity()) { |
| 757 stateSaver.save(); | 796 stateSaver.save(); |
| 758 context->concatCTM(transform.toAffineTransform()); | 797 context->concatCTM(localTransform.toAffineTransform()); |
| 759 } | 798 } |
| 760 | 799 |
| 761 // Now do a paint with the root layer shifted to be us. | 800 // Now do a paint with the root layer shifted to be us. |
| 762 LayerPaintingInfo transformedPaintingInfo(layer(), enclosingIntRect(transfor
m.inverse().mapRect(paintingInfo.paintDirtyRect)), | 801 LayerPaintingInfo transformedPaintingInfo(layer(), enclosingIntRect(localTra
nsform.inverse().mapRect(paintingInfo.paintDirtyRect)), |
| 763 adjustedSubPixelAccumulation); | 802 adjustedSubPixelAccumulation); |
| 764 paintLayerContents(context, transformedPaintingInfo); | 803 paintLayerContents(context, transformedPaintingInfo); |
| 765 | 804 |
| 766 // Restore the clip. | 805 // Restore the clip. |
| 767 layer()->parent()->restoreClip(context, paintingInfo.paintDirtyRect, clipRec
t); | 806 layer()->parent()->restoreClip(context, paintingInfo.paintDirtyRect, clipRec
t); |
| 768 } | 807 } |
| 769 | 808 |
| 770 static LayoutRect transparencyClipBox(const RenderLayer*, const RenderLayer* roo
tLayer, const LayoutSize& subPixelAccumulation); | 809 static LayoutRect transparencyClipBox(const RenderLayer*, const RenderLayer* roo
tLayer, const LayoutSize& subPixelAccumulation); |
| 771 | 810 |
| 772 static void expandClipRectForDescendantsAndReflection(LayoutRect& clipRect, cons
t RenderLayer* layer, const RenderLayer* rootLayer, | 811 static void expandClipRectForDescendantsAndReflection(LayoutRect& clipRect, cons
t RenderLayer* layer, const RenderLayer* rootLayer, |
| 773 const LayoutSize& subPixelAccumulation) | 812 const LayoutSize& subPixelAccumulation) |
| 774 { | 813 { |
| 775 // Note: we don't have to walk z-order lists since transparent elements alwa
ys establish | 814 // Note: we don't have to walk z-order lists since transparent elements alwa
ys establish |
| 776 // a stacking container. This means we can just walk the layer tree directly
. | 815 // a stacking container. This means we can just walk the layer tree directly
. |
| 777 for (RenderLayer* curr = layer->firstChild(); curr; curr = curr->nextSibling
()) | 816 for (RenderLayer* curr = layer->firstChild(); curr; curr = curr->nextSibling
()) |
| 778 clipRect.unite(transparencyClipBox(curr, rootLayer, subPixelAccumulation
)); | 817 clipRect.unite(transparencyClipBox(curr, rootLayer, subPixelAccumulation
)); |
| 779 } | 818 } |
| 780 | 819 |
| 781 static LayoutRect transparencyClipBox(const RenderLayer* layer, const RenderLaye
r* rootLayer, | 820 static LayoutRect transparencyClipBox(const RenderLayer* layer, const RenderLaye
r* rootLayer, |
| 782 const LayoutSize& subPixelAccumulation) | 821 const LayoutSize& subPixelAccumulation) |
| 783 { | 822 { |
| 784 // FIXME: Although this function completely ignores CSS-imposed clipping, we
did already intersect with the | 823 // FIXME: Although this function completely ignores CSS-imposed clipping, we
did already intersect with the |
| 785 // paintDirtyRect, and that should cut down on the amount we have to paint.
Still it | 824 // paintDirtyRect, and that should cut down on the amount we have to paint.
Still it |
| 786 // would be better to respect clips. | 825 // would be better to respect clips. |
| 787 | 826 |
| 788 if (rootLayer != layer && layer->transform()) { | 827 if (rootLayer != layer && layer->renderer()->transform()) { |
| 789 // The best we can do here is to use enclosed bounding boxes to establis
h a "fuzzy" enough clip to encompass | 828 // The best we can do here is to use enclosed bounding boxes to establis
h a "fuzzy" enough clip to encompass |
| 790 // the transformed layer and all of its children. | 829 // the transformed layer and all of its children. |
| 791 const RenderLayer* rootLayerForTransform = rootLayer; | 830 const RenderLayer* rootLayerForTransform = rootLayer; |
| 792 LayoutPoint delta; | 831 LayoutPoint delta; |
| 793 layer->convertToLayerCoords(rootLayerForTransform, delta); | 832 layer->convertToLayerCoords(rootLayerForTransform, delta); |
| 794 | 833 |
| 795 delta.move(subPixelAccumulation); | 834 delta.move(subPixelAccumulation); |
| 796 IntPoint pixelSnappedDelta = roundedIntPoint(delta); | 835 IntPoint pixelSnappedDelta = roundedIntPoint(delta); |
| 797 TransformationMatrix transform; | 836 TransformationMatrix transform; |
| 798 transform.translate(pixelSnappedDelta.x(), pixelSnappedDelta.y()); | 837 transform.translate(pixelSnappedDelta.x(), pixelSnappedDelta.y()); |
| 799 transform = transform * *layer->transform(); | 838 transform = transform * *layer->renderer()->transform(); |
| 800 | 839 |
| 801 // We don't use fragment boxes when collecting a transformed layer's bou
nding box, since it always | 840 // We don't use fragment boxes when collecting a transformed layer's bou
nding box, since it always |
| 802 // paints unfragmented.y | 841 // paints unfragmented.y |
| 803 LayoutRect clipRect = layer->physicalBoundingBox(layer); | 842 LayoutRect clipRect = layer->physicalBoundingBox(layer); |
| 804 expandClipRectForDescendantsAndReflection(clipRect, layer, layer, subPix
elAccumulation); | 843 expandClipRectForDescendantsAndReflection(clipRect, layer, layer, subPix
elAccumulation); |
| 805 layer->renderer()->style()->filterOutsets().expandRect(clipRect); | 844 layer->renderer()->style()->filterOutsets().expandRect(clipRect); |
| 806 LayoutRect result = transform.mapRect(clipRect); | 845 LayoutRect result = transform.mapRect(clipRect); |
| 807 return result; | 846 return result; |
| 808 } | 847 } |
| 809 | 848 |
| (...skipping 2196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3006 | 3045 |
| 3007 LayoutRect RenderBox::layoutOverflowRectForPropagation() const | 3046 LayoutRect RenderBox::layoutOverflowRectForPropagation() const |
| 3008 { | 3047 { |
| 3009 // Only propagate interior layout overflow if we don't clip it. | 3048 // Only propagate interior layout overflow if we don't clip it. |
| 3010 LayoutRect rect = borderBoxRect(); | 3049 LayoutRect rect = borderBoxRect(); |
| 3011 rect.expand(LayoutSize(LayoutUnit(), marginAfter())); | 3050 rect.expand(LayoutSize(LayoutUnit(), marginAfter())); |
| 3012 | 3051 |
| 3013 if (!hasOverflowClip()) | 3052 if (!hasOverflowClip()) |
| 3014 rect.unite(layoutOverflowRect()); | 3053 rect.unite(layoutOverflowRect()); |
| 3015 | 3054 |
| 3016 if (hasLayer() && layer()->transform()) | 3055 if (transform()) |
| 3017 rect = layer()->transform()->mapRect(rect); | 3056 rect = transform()->mapRect(rect); |
| 3018 | 3057 |
| 3019 return rect; | 3058 return rect; |
| 3020 } | 3059 } |
| 3021 | 3060 |
| 3022 LayoutUnit RenderBox::offsetLeft() const | 3061 LayoutUnit RenderBox::offsetLeft() const |
| 3023 { | 3062 { |
| 3024 return adjustedPositionRelativeToOffsetParent(location()).x(); | 3063 return adjustedPositionRelativeToOffsetParent(location()).x(); |
| 3025 } | 3064 } |
| 3026 | 3065 |
| 3027 LayoutUnit RenderBox::offsetTop() const | 3066 LayoutUnit RenderBox::offsetTop() const |
| (...skipping 10 matching lines...) Expand all Loading... |
| 3038 | 3077 |
| 3039 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) | 3078 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) |
| 3040 { | 3079 { |
| 3041 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); | 3080 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); |
| 3042 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); | 3081 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); |
| 3043 ASSERT(hasBackground == style.hasBackground()); | 3082 ASSERT(hasBackground == style.hasBackground()); |
| 3044 hasBorder = style.hasBorder(); | 3083 hasBorder = style.hasBorder(); |
| 3045 } | 3084 } |
| 3046 | 3085 |
| 3047 } // namespace blink | 3086 } // namespace blink |
| OLD | NEW |