| 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 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. 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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 { | 513 { |
| 514 const ShadowData* boxShadow = renderer->style()->boxShadow(); | 514 const ShadowData* boxShadow = renderer->style()->boxShadow(); |
| 515 while (boxShadow->style() != Normal) | 515 while (boxShadow->style() != Normal) |
| 516 boxShadow = boxShadow->next(); | 516 boxShadow = boxShadow->next(); |
| 517 | 517 |
| 518 FloatSize shadowOffset(boxShadow->x(), boxShadow->y()); | 518 FloatSize shadowOffset(boxShadow->x(), boxShadow->y()); |
| 519 context->setShadow(shadowOffset, boxShadow->blur(), renderer->resolveColor(b
oxShadow->color()), | 519 context->setShadow(shadowOffset, boxShadow->blur(), renderer->resolveColor(b
oxShadow->color()), |
| 520 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresAlpha); | 520 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresAlpha); |
| 521 } | 521 } |
| 522 | 522 |
| 523 void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
nst Color& color, const FillLayer* bgLayer, const LayoutRect& rect, | 523 void RenderBoxModelObject::paintFillLayerExtended(PaintInfo& paintInfo, const Co
lor& color, const FillLayer* bgLayer, const LayoutRect& rect, |
| 524 BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox* box, const LayoutSiz
e& boxSize, CompositeOperator op, RenderObject* backgroundObject) | 524 BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox* box, const LayoutSiz
e& boxSize, CompositeOperator op, RenderObject* backgroundObject) |
| 525 { | 525 { |
| 526 GraphicsContext* context = paintInfo.context; | 526 GraphicsContext* context = paintInfo.getContext(); |
| 527 if (context->paintingDisabled() || rect.isEmpty()) | 527 if (context->paintingDisabled() || rect.isEmpty()) |
| 528 return; | 528 return; |
| 529 | 529 |
| 530 bool includeLeftEdge = box ? box->includeLogicalLeftEdge() : true; | 530 bool includeLeftEdge = box ? box->includeLogicalLeftEdge() : true; |
| 531 bool includeRightEdge = box ? box->includeLogicalRightEdge() : true; | 531 bool includeRightEdge = box ? box->includeLogicalRightEdge() : true; |
| 532 | 532 |
| 533 bool hasRoundedBorder = style()->hasBorderRadius() && (includeLeftEdge || in
cludeRightEdge); | 533 bool hasRoundedBorder = style()->hasBorderRadius() && (includeLeftEdge || in
cludeRightEdge); |
| 534 bool clippedWithLocalScrolling = hasOverflowClip() && bgLayer->attachment()
== LocalBackgroundAttachment; | 534 bool clippedWithLocalScrolling = hasOverflowClip() && bgLayer->attachment()
== LocalBackgroundAttachment; |
| 535 bool isBorderFill = bgLayer->clip() == BorderFillBox; | 535 bool isBorderFill = bgLayer->clip() == BorderFillBox; |
| 536 bool isRoot = this->isRoot(); | 536 bool isRoot = this->isRoot(); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 int bLeft = includeLeftEdge ? borderLeft() : 0; | 611 int bLeft = includeLeftEdge ? borderLeft() : 0; |
| 612 int bRight = includeRightEdge ? borderRight() : 0; | 612 int bRight = includeRightEdge ? borderRight() : 0; |
| 613 LayoutUnit pLeft = includeLeftEdge ? paddingLeft() : LayoutUnit(); | 613 LayoutUnit pLeft = includeLeftEdge ? paddingLeft() : LayoutUnit(); |
| 614 LayoutUnit pRight = includeRightEdge ? paddingRight() : LayoutUnit(); | 614 LayoutUnit pRight = includeRightEdge ? paddingRight() : LayoutUnit(); |
| 615 | 615 |
| 616 GraphicsContextStateSaver clipWithScrollingStateSaver(*context, clippedWithL
ocalScrolling); | 616 GraphicsContextStateSaver clipWithScrollingStateSaver(*context, clippedWithL
ocalScrolling); |
| 617 LayoutRect scrolledPaintRect = rect; | 617 LayoutRect scrolledPaintRect = rect; |
| 618 if (clippedWithLocalScrolling) { | 618 if (clippedWithLocalScrolling) { |
| 619 // Clip to the overflow area. | 619 // Clip to the overflow area. |
| 620 RenderBox* thisBox = toRenderBox(this); | 620 RenderBox* thisBox = toRenderBox(this); |
| 621 context->clip(thisBox->overflowClipRect(rect.location(), paintInfo.rende
rRegion)); | 621 context->clip(thisBox->overflowClipRect(rect.location(), paintInfo.getRe
nderRegion())); |
| 622 | 622 |
| 623 // Adjust the paint rect to reflect a scrolled content box with borders
at the ends. | 623 // Adjust the paint rect to reflect a scrolled content box with borders
at the ends. |
| 624 IntSize offset = thisBox->scrolledContentOffset(); | 624 IntSize offset = thisBox->scrolledContentOffset(); |
| 625 scrolledPaintRect.move(-offset); | 625 scrolledPaintRect.move(-offset); |
| 626 scrolledPaintRect.setWidth(bLeft + layer()->scrollWidth() + bRight); | 626 scrolledPaintRect.setWidth(bLeft + layer()->scrollWidth() + bRight); |
| 627 scrolledPaintRect.setHeight(borderTop() + layer()->scrollHeight() + bord
erBottom()); | 627 scrolledPaintRect.setHeight(borderTop() + layer()->scrollHeight() + bord
erBottom()); |
| 628 } | 628 } |
| 629 | 629 |
| 630 GraphicsContextStateSaver backgroundClipStateSaver(*context, false); | 630 GraphicsContextStateSaver backgroundClipStateSaver(*context, false); |
| 631 IntRect maskRect; | 631 IntRect maskRect; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 644 scrolledPaintRect.height() - borderTop() - borderBottom() - (include
Padding ? paddingTop() + paddingBottom() : LayoutUnit())); | 644 scrolledPaintRect.height() - borderTop() - borderBottom() - (include
Padding ? paddingTop() + paddingBottom() : LayoutUnit())); |
| 645 backgroundClipStateSaver.save(); | 645 backgroundClipStateSaver.save(); |
| 646 context->clip(clipRect); | 646 context->clip(clipRect); |
| 647 | 647 |
| 648 break; | 648 break; |
| 649 } | 649 } |
| 650 case TextFillBox: { | 650 case TextFillBox: { |
| 651 // First figure out how big the mask has to be. It should be no bigger
than what we need | 651 // First figure out how big the mask has to be. It should be no bigger
than what we need |
| 652 // to actually render, so we should intersect the dirty rect with the bo
rder box of the background. | 652 // to actually render, so we should intersect the dirty rect with the bo
rder box of the background. |
| 653 maskRect = pixelSnappedIntRect(rect); | 653 maskRect = pixelSnappedIntRect(rect); |
| 654 maskRect.intersect(paintInfo.rect); | 654 maskRect.intersect(paintInfo.getRect()); |
| 655 | 655 |
| 656 // We draw the background into a separate layer, to be later masked with
yet another layer | 656 // We draw the background into a separate layer, to be later masked with
yet another layer |
| 657 // holding the text content. | 657 // holding the text content. |
| 658 backgroundClipStateSaver.save(); | 658 backgroundClipStateSaver.save(); |
| 659 context->clip(maskRect); | 659 context->clip(maskRect); |
| 660 context->beginTransparencyLayer(1); | 660 context->beginTransparencyLayer(1); |
| 661 | 661 |
| 662 break; | 662 break; |
| 663 } | 663 } |
| 664 case BorderFillBox: | 664 case BorderFillBox: |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 } | 697 } |
| 698 | 698 |
| 699 // Paint the color first underneath all images, culled if background image o
ccludes it. | 699 // Paint the color first underneath all images, culled if background image o
ccludes it. |
| 700 // FIXME: In the bgLayer->hasFiniteBounds() case, we could improve the culli
ng test | 700 // FIXME: In the bgLayer->hasFiniteBounds() case, we could improve the culli
ng test |
| 701 // by verifying whether the background image covers the entire layout rect. | 701 // by verifying whether the background image covers the entire layout rect. |
| 702 if (!bgLayer->next()) { | 702 if (!bgLayer->next()) { |
| 703 IntRect backgroundRect(pixelSnappedIntRect(scrolledPaintRect)); | 703 IntRect backgroundRect(pixelSnappedIntRect(scrolledPaintRect)); |
| 704 bool boxShadowShouldBeAppliedToBackground = this->boxShadowShouldBeAppli
edToBackground(bleedAvoidance, box); | 704 bool boxShadowShouldBeAppliedToBackground = this->boxShadowShouldBeAppli
edToBackground(bleedAvoidance, box); |
| 705 if (boxShadowShouldBeAppliedToBackground || !shouldPaintBackgroundImage
|| !bgLayer->hasOpaqueImage(this) || !bgLayer->hasRepeatXY()) { | 705 if (boxShadowShouldBeAppliedToBackground || !shouldPaintBackgroundImage
|| !bgLayer->hasOpaqueImage(this) || !bgLayer->hasRepeatXY()) { |
| 706 if (!boxShadowShouldBeAppliedToBackground) | 706 if (!boxShadowShouldBeAppliedToBackground) |
| 707 backgroundRect.intersect(paintInfo.rect); | 707 backgroundRect.intersect(paintInfo.getRect()); |
| 708 | 708 |
| 709 // If we have an alpha and we are painting the root element, go ahea
d and blend with the base background color. | 709 // If we have an alpha and we are painting the root element, go ahea
d and blend with the base background color. |
| 710 Color baseColor; | 710 Color baseColor; |
| 711 bool shouldClearBackground = false; | 711 bool shouldClearBackground = false; |
| 712 if (isOpaqueRoot) { | 712 if (isOpaqueRoot) { |
| 713 baseColor = view()->frameView()->baseBackgroundColor(); | 713 baseColor = view()->frameView()->baseBackgroundColor(); |
| 714 if (!baseColor.alpha()) | 714 if (!baseColor.alpha()) |
| 715 shouldClearBackground = true; | 715 shouldClearBackground = true; |
| 716 } | 716 } |
| 717 | 717 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 729 context->fillRect(backgroundRect, bgColor, operation); | 729 context->fillRect(backgroundRect, bgColor, operation); |
| 730 } else if (shouldClearBackground) | 730 } else if (shouldClearBackground) |
| 731 context->clearRect(backgroundRect); | 731 context->clearRect(backgroundRect); |
| 732 } | 732 } |
| 733 } | 733 } |
| 734 | 734 |
| 735 // no progressive loading of the background image | 735 // no progressive loading of the background image |
| 736 if (shouldPaintBackgroundImage) { | 736 if (shouldPaintBackgroundImage) { |
| 737 BackgroundImageGeometry geometry; | 737 BackgroundImageGeometry geometry; |
| 738 calculateBackgroundImageGeometry(bgLayer, scrolledPaintRect, geometry, b
ackgroundObject); | 738 calculateBackgroundImageGeometry(bgLayer, scrolledPaintRect, geometry, b
ackgroundObject); |
| 739 geometry.clip(paintInfo.rect); | 739 geometry.clip(paintInfo.getRect()); |
| 740 if (!geometry.destRect().isEmpty()) { | 740 if (!geometry.destRect().isEmpty()) { |
| 741 CompositeOperator compositeOp = op == CompositeSourceOver ? bgLayer-
>composite() : op; | 741 CompositeOperator compositeOp = op == CompositeSourceOver ? bgLayer-
>composite() : op; |
| 742 RenderObject* clientForBackgroundImage = backgroundObject ? backgrou
ndObject : this; | 742 RenderObject* clientForBackgroundImage = backgroundObject ? backgrou
ndObject : this; |
| 743 RefPtr<Image> image = bgImage->image(clientForBackgroundImage, geome
try.tileSize()); | 743 RefPtr<Image> image = bgImage->image(clientForBackgroundImage, geome
try.tileSize()); |
| 744 bool useLowQualityScaling = shouldPaintAtLowQuality(context, image.g
et(), bgLayer, geometry.tileSize()); | 744 bool useLowQualityScaling = shouldPaintAtLowQuality(context, image.g
et(), bgLayer, geometry.tileSize()); |
| 745 context->drawTiledImage(image.get(), geometry.destRect(), geometry.r
elativePhase(), geometry.tileSize(), | 745 context->drawTiledImage(image.get(), geometry.destRect(), geometry.r
elativePhase(), geometry.tileSize(), |
| 746 compositeOp, useLowQualityScaling, bgLayer->blendMode()); | 746 compositeOp, useLowQualityScaling, bgLayer->blendMode()); |
| 747 } | 747 } |
| 748 } | 748 } |
| 749 | 749 |
| 750 if (bgLayer->clip() == TextFillBox) { | 750 if (bgLayer->clip() == TextFillBox) { |
| 751 // Create the text mask layer. | 751 // Create the text mask layer. |
| 752 context->setCompositeOperation(CompositeDestinationIn); | 752 context->setCompositeOperation(CompositeDestinationIn); |
| 753 context->beginTransparencyLayer(1); | 753 context->beginTransparencyLayer(1); |
| 754 | 754 |
| 755 // FIXME: Workaround for https://code.google.com/p/skia/issues/detail?id
=1291. | 755 // FIXME: Workaround for https://code.google.com/p/skia/issues/detail?id
=1291. |
| 756 context->clearRect(maskRect); | 756 context->clearRect(maskRect); |
| 757 | 757 |
| 758 // Now draw the text into the mask. We do this by painting using a speci
al paint phase that signals to | 758 // Now draw the text into the mask. We do this by painting using a speci
al paint phase that signals to |
| 759 // InlineTextBoxes that they should just add their contents to the clip. | 759 // InlineTextBoxes that they should just add their contents to the clip. |
| 760 PaintInfo info(context, maskRect, PaintPhaseTextClip, PaintBehaviorForce
BlackText, 0, paintInfo.renderRegion); | 760 PaintInfo info(context, maskRect, PaintPhaseTextClip, PaintBehaviorForce
BlackText, 0, paintInfo.getRenderRegion()); |
| 761 context->setCompositeOperation(CompositeSourceOver); | 761 context->setCompositeOperation(CompositeSourceOver); |
| 762 if (box) { | 762 if (box) { |
| 763 RootInlineBox* root = box->root(); | 763 RootInlineBox* root = box->root(); |
| 764 box->paint(info, LayoutPoint(scrolledPaintRect.x() - box->x(), scrol
ledPaintRect.y() - box->y()), root->lineTop(), root->lineBottom()); | 764 box->paint(info, LayoutPoint(scrolledPaintRect.x() - box->x(), scrol
ledPaintRect.y() - box->y()), root->lineTop(), root->lineBottom()); |
| 765 } else { | 765 } else { |
| 766 LayoutSize localOffset = isBox() ? toRenderBox(this)->locationOffset
() : LayoutSize(); | 766 LayoutSize localOffset = isBox() ? toRenderBox(this)->locationOffset
() : LayoutSize(); |
| 767 paint(info, scrolledPaintRect.location() - localOffset); | 767 paint(info, scrolledPaintRect.location() - localOffset); |
| 768 } | 768 } |
| 769 | 769 |
| 770 context->endTransparencyLayer(); | 770 context->endTransparencyLayer(); |
| (...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1661 | 1661 |
| 1662 paintBorderSides(graphicsContext, style, outerBorder, innerBorder, inner
BorderAdjustment, edges, commonColorEdgeSet, bleedAvoidance, includeLogicalLeftE
dge, includeLogicalRightEdge, antialias, &commonColor); | 1662 paintBorderSides(graphicsContext, style, outerBorder, innerBorder, inner
BorderAdjustment, edges, commonColorEdgeSet, bleedAvoidance, includeLogicalLeftE
dge, includeLogicalRightEdge, antialias, &commonColor); |
| 1663 | 1663 |
| 1664 if (useTransparencyLayer) | 1664 if (useTransparencyLayer) |
| 1665 graphicsContext->endTransparencyLayer(); | 1665 graphicsContext->endTransparencyLayer(); |
| 1666 | 1666 |
| 1667 edgesToDraw &= ~commonColorEdgeSet; | 1667 edgesToDraw &= ~commonColorEdgeSet; |
| 1668 } | 1668 } |
| 1669 } | 1669 } |
| 1670 | 1670 |
| 1671 void RenderBoxModelObject::paintBorder(const PaintInfo& info, const LayoutRect&
rect, const RenderStyle* style, | 1671 void RenderBoxModelObject::paintBorder(PaintInfo& info, const LayoutRect& rect,
const RenderStyle* style, |
| 1672 BackgroundBleedAvoidance bleedAvoidance,
bool includeLogicalLeftEdge, bool includeLogicalRightEdge) | 1672 BackgroundBleedAvoidance bleedAvoidance,
bool includeLogicalLeftEdge, bool includeLogicalRightEdge) |
| 1673 { | 1673 { |
| 1674 GraphicsContext* graphicsContext = info.context; | 1674 GraphicsContext* graphicsContext = info.getContext(); |
| 1675 // border-image is not affected by border-radius. | 1675 // border-image is not affected by border-radius. |
| 1676 if (paintNinePieceImage(graphicsContext, rect, style, style->borderImage())) | 1676 if (paintNinePieceImage(graphicsContext, rect, style, style->borderImage())) |
| 1677 return; | 1677 return; |
| 1678 | 1678 |
| 1679 if (graphicsContext->paintingDisabled()) | 1679 if (graphicsContext->paintingDisabled()) |
| 1680 return; | 1680 return; |
| 1681 | 1681 |
| 1682 BorderEdge edges[4]; | 1682 BorderEdge edges[4]; |
| 1683 getBorderEdgeInfo(edges, style, includeLogicalLeftEdge, includeLogicalRightE
dge); | 1683 getBorderEdgeInfo(edges, style, includeLogicalLeftEdge, includeLogicalRightE
dge); |
| 1684 RoundedRect outerBorder = style->getRoundedBorderFor(rect, view(), includeLo
gicalLeftEdge, includeLogicalRightEdge); | 1684 RoundedRect outerBorder = style->getRoundedBorderFor(rect, view(), includeLo
gicalLeftEdge, includeLogicalRightEdge); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1719 | 1719 |
| 1720 if (currEdge.style != SOLID) | 1720 if (currEdge.style != SOLID) |
| 1721 haveAllSolidEdges = false; | 1721 haveAllSolidEdges = false; |
| 1722 | 1722 |
| 1723 if (currEdge.style != DOUBLE) | 1723 if (currEdge.style != DOUBLE) |
| 1724 haveAllDoubleEdges = false; | 1724 haveAllDoubleEdges = false; |
| 1725 } | 1725 } |
| 1726 | 1726 |
| 1727 // If no corner intersects the clip region, we can pretend outerBorder is | 1727 // If no corner intersects the clip region, we can pretend outerBorder is |
| 1728 // rectangular to improve performance. | 1728 // rectangular to improve performance. |
| 1729 if (haveAllSolidEdges && outerBorder.isRounded() && allCornersClippedOut(out
erBorder, info.rect)) | 1729 if (haveAllSolidEdges && outerBorder.isRounded() && allCornersClippedOut(out
erBorder, info.getRect())) |
| 1730 outerBorder.setRadii(RoundedRect::Radii()); | 1730 outerBorder.setRadii(RoundedRect::Radii()); |
| 1731 | 1731 |
| 1732 // isRenderable() check avoids issue described in https://bugs.webkit.org/sh
ow_bug.cgi?id=38787 | 1732 // isRenderable() check avoids issue described in https://bugs.webkit.org/sh
ow_bug.cgi?id=38787 |
| 1733 if ((haveAllSolidEdges || haveAllDoubleEdges) && allEdgesShareColor && inner
Border.isRenderable()) { | 1733 if ((haveAllSolidEdges || haveAllDoubleEdges) && allEdgesShareColor && inner
Border.isRenderable()) { |
| 1734 // Fast path for drawing all solid edges and all unrounded double edges | 1734 // Fast path for drawing all solid edges and all unrounded double edges |
| 1735 if (numEdgesVisible == 4 && (outerBorder.isRounded() || haveAlphaColor) | 1735 if (numEdgesVisible == 4 && (outerBorder.isRounded() || haveAlphaColor) |
| 1736 && (haveAllSolidEdges || (!outerBorder.isRounded() && !innerBorder.i
sRounded()))) { | 1736 && (haveAllSolidEdges || (!outerBorder.isRounded() && !innerBorder.i
sRounded()))) { |
| 1737 Path path; | 1737 Path path; |
| 1738 | 1738 |
| 1739 if (outerBorder.isRounded() && bleedAvoidance != BackgroundBleedUseT
ransparencyLayer) | 1739 if (outerBorder.isRounded() && bleedAvoidance != BackgroundBleedUseT
ransparencyLayer) |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2404 bounds.inflate(shadowBlur); | 2404 bounds.inflate(shadowBlur); |
| 2405 | 2405 |
| 2406 if (shadowSpread < 0) | 2406 if (shadowSpread < 0) |
| 2407 bounds.inflate(-shadowSpread); | 2407 bounds.inflate(-shadowSpread); |
| 2408 | 2408 |
| 2409 IntRect offsetBounds = bounds; | 2409 IntRect offsetBounds = bounds; |
| 2410 offsetBounds.move(-shadowOffset); | 2410 offsetBounds.move(-shadowOffset); |
| 2411 return unionRect(bounds, offsetBounds); | 2411 return unionRect(bounds, offsetBounds); |
| 2412 } | 2412 } |
| 2413 | 2413 |
| 2414 void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
t& paintRect, const RenderStyle* s, ShadowStyle shadowStyle, bool includeLogical
LeftEdge, bool includeLogicalRightEdge) | 2414 void RenderBoxModelObject::paintBoxShadow(PaintInfo& info, const LayoutRect& pai
ntRect, const RenderStyle* s, ShadowStyle shadowStyle, bool includeLogicalLeftEd
ge, bool includeLogicalRightEdge) |
| 2415 { | 2415 { |
| 2416 // FIXME: Deal with border-image. Would be great to use border-image as a m
ask. | 2416 // FIXME: Deal with border-image. Would be great to use border-image as a m
ask. |
| 2417 GraphicsContext* context = info.context; | 2417 GraphicsContext* context = info.getContext(); |
| 2418 if (context->paintingDisabled() || !s->boxShadow()) | 2418 if (context->paintingDisabled() || !s->boxShadow()) |
| 2419 return; | 2419 return; |
| 2420 | 2420 |
| 2421 RoundedRect border = (shadowStyle == Inset) ? s->getRoundedInnerBorderFor(pa
intRect, includeLogicalLeftEdge, includeLogicalRightEdge) | 2421 RoundedRect border = (shadowStyle == Inset) ? s->getRoundedInnerBorderFor(pa
intRect, includeLogicalLeftEdge, includeLogicalRightEdge) |
| 2422 : s->getRoundedBorderFor(pain
tRect, view(), includeLogicalLeftEdge, includeLogicalRightEdge); | 2422 : s->getRoundedBorderFor(pain
tRect, view(), includeLogicalLeftEdge, includeLogicalRightEdge); |
| 2423 | 2423 |
| 2424 bool hasBorderRadius = s->hasBorderRadius(); | 2424 bool hasBorderRadius = s->hasBorderRadius(); |
| 2425 bool isHorizontal = s->isHorizontalWritingMode(); | 2425 bool isHorizontal = s->isHorizontalWritingMode(); |
| 2426 | 2426 |
| 2427 bool hasOpaqueBackground = s->visitedDependentColor(CSSPropertyBackgroundCol
or).isValid() && s->visitedDependentColor(CSSPropertyBackgroundColor).alpha() ==
255; | 2427 bool hasOpaqueBackground = s->visitedDependentColor(CSSPropertyBackgroundCol
or).isValid() && s->visitedDependentColor(CSSPropertyBackgroundColor).alpha() ==
255; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2463 // corners. Those are avoided by insetting the clipping path by
one pixel. | 2463 // corners. Those are avoided by insetting the clipping path by
one pixel. |
| 2464 if (hasOpaqueBackground) | 2464 if (hasOpaqueBackground) |
| 2465 rectToClipOut.inflateWithRadii(-1); | 2465 rectToClipOut.inflateWithRadii(-1); |
| 2466 | 2466 |
| 2467 if (!rectToClipOut.isEmpty()) { | 2467 if (!rectToClipOut.isEmpty()) { |
| 2468 context->clipOutRoundedRect(rectToClipOut); | 2468 context->clipOutRoundedRect(rectToClipOut); |
| 2469 } | 2469 } |
| 2470 | 2470 |
| 2471 RoundedRect influenceRect(shadowRect, border.radii()); | 2471 RoundedRect influenceRect(shadowRect, border.radii()); |
| 2472 influenceRect.expandRadii(2 * shadowBlur + shadowSpread); | 2472 influenceRect.expandRadii(2 * shadowBlur + shadowSpread); |
| 2473 if (allCornersClippedOut(influenceRect, info.rect)) | 2473 if (allCornersClippedOut(influenceRect, info.getRect())) |
| 2474 context->fillRect(fillRect.rect(), Color::black); | 2474 context->fillRect(fillRect.rect(), Color::black); |
| 2475 else { | 2475 else { |
| 2476 fillRect.expandRadii(shadowSpread); | 2476 fillRect.expandRadii(shadowSpread); |
| 2477 if (!fillRect.isRenderable()) | 2477 if (!fillRect.isRenderable()) |
| 2478 fillRect.adjustRadii(); | 2478 fillRect.adjustRadii(); |
| 2479 context->fillRoundedRect(fillRect, Color::black); | 2479 context->fillRoundedRect(fillRect, Color::black); |
| 2480 } | 2480 } |
| 2481 } else { | 2481 } else { |
| 2482 IntRect rectToClipOut = border.rect(); | 2482 IntRect rectToClipOut = border.rect(); |
| 2483 | 2483 |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2754 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 2754 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
| 2755 for (RenderObject* child = startChild; child && child != endChild; ) { | 2755 for (RenderObject* child = startChild; child && child != endChild; ) { |
| 2756 // Save our next sibling as moveChildTo will clear it. | 2756 // Save our next sibling as moveChildTo will clear it. |
| 2757 RenderObject* nextSibling = child->nextSibling(); | 2757 RenderObject* nextSibling = child->nextSibling(); |
| 2758 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); | 2758 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); |
| 2759 child = nextSibling; | 2759 child = nextSibling; |
| 2760 } | 2760 } |
| 2761 } | 2761 } |
| 2762 | 2762 |
| 2763 } // namespace WebCore | 2763 } // namespace WebCore |
| OLD | NEW |