Changeset 131402 in webkit
- Timestamp:
- Oct 15, 2012, 8:26:49 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r131400 r131402 1 2012-10-15 Vlad Grecescu <igrecesc@adobe.com>, Douglas Stockwell <dstockwell@chromium.org> 2 3 Support for background-clip:content-box and padding-box with border-radius 4 https://bugs.webkit.org/show_bug.cgi?id=23166 5 6 Reviewed by Simon Fraser. 7 8 * fast/css/background-clip-radius-values-expected.png: Added. 9 * fast/css/background-clip-radius-values-expected.txt: Added. 10 * fast/css/background-clip-radius-values.html: Added. 11 * platform/chromium-linux/fast/css/background-clip-radius-values-expected.png: Added. 12 * platform/chromium-linux/ietestcenter/css3/bordersbackgrounds/border-radius-clip-002-expected.png: 13 * platform/chromium/TestExpectations: 14 * platform/mac/ietestcenter/css3/bordersbackgrounds/border-radius-clip-002-expected.png: Added. 15 * platform/qt/TestExpectations: 16 * platform/efl/TestExpectations: 17 1 18 2012-10-15 Kent Tamura <tkent@chromium.org> 2 19 -
trunk/LayoutTests/platform/chromium/TestExpectations
r131396 r131402 4037 4037 webkit.org/b/98686 editing/pasteboard/data-transfer-items.html [ Failure ] 4038 4038 4039 webkit.org/b/23166 [ Android Mac Win ] fast/css/background-clip-radius-values.html [ Pass ImageOnlyFailure ] 4040 webkit.org/b/23166 [ Android Mac Win ] ietestcenter/css3/bordersbackgrounds/border-radius-clip-002.htm [ Pass ImageOnlyFailure ] 4041 4039 4042 webkit.org/b/98699 [ Lion ] fast/writing-mode/vertical-subst-font-vert-no-dflt.html [ Crash ] 4040 4043 webkit.org/b/98811 [ Mac ] fast/transforms/transformed-focused-text-input.html [ Pass ImageOnlyFailure ] -
trunk/LayoutTests/platform/efl/TestExpectations
r131378 r131402 1529 1529 webkit.org/b/10890 fast/selectors/unqualified-hover-strict.html [ Failure Pass ] 1530 1530 1531 # May need rebaseline 1532 webkit.org/b/23166 fast/css/background-clip-radius-values.html [ Pass ImageOnlyFailure ] 1533 webkit.org/b/23166 ietestcenter/css3/bordersbackgrounds/border-radius-clip-002.htm [ Pass ImageOnlyFailure ] 1534 1531 1535 # Regressions after r130699 1532 1536 webkit.org/b/98729 fast/css/import-style-update.html [ Failure ] -
trunk/LayoutTests/platform/qt/TestExpectations
r131378 r131402 2419 2419 webkit.org/b/94004 css2.1/20110323/c541-word-sp-000.htm [ ImageOnlyFailure ] 2420 2420 2421 # May need rebaseline 2422 webkit.org/b/23166 fast/css/background-clip-radius-values.html [ Pass ImageOnlyFailure ] 2423 webkit.org/b/23166 ietestcenter/css3/bordersbackgrounds/border-radius-clip-002.htm [ Pass ImageOnlyFailure ] 2424 2421 2425 # Added by bug 89826 2422 2426 webkit.org/b/94005 css2.1/20110323/word-spacing-remove-space-003.htm [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r131397 r131402 1 2012-10-15 Vlad Grecescu <igrecesc@adobe.com>, Douglas Stockwell <dstockwell@chromium.org> 2 3 Support for background-clip:content-box and padding-box with border-radius 4 https://bugs.webkit.org/show_bug.cgi?id=23166 5 6 Reviewed by Simon Fraser. 7 8 Test: fast/css/background-clip-radius-values.html 9 10 * rendering/RenderBoxModelObject.cpp: 11 (WebCore::RenderBoxModelObject::clipRoundedInnerRect): 12 (WebCore): 13 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 14 * rendering/RenderBoxModelObject.h: 15 1 16 2012-10-15 Byungwoo Lee <bw80.lee@samsung.com> 2 17 -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r131111 r131402 660 660 } 661 661 662 void RenderBoxModelObject::clipRoundedInnerRect(GraphicsContext * context, const LayoutRect& rect, const RoundedRect& clipRect) 663 { 664 if (clipRect.isRenderable()) 665 context->addRoundedRectClip(clipRect); 666 else { 667 // We create a rounded rect for each of the corners and clip it, while making sure we clip opposing corners together. 668 if (!clipRect.radii().topLeft().isEmpty() || !clipRect.radii().bottomRight().isEmpty()) { 669 IntRect topCorner(clipRect.rect().x(), clipRect.rect().y(), rect.maxX() - clipRect.rect().x(), rect.maxY() - clipRect.rect().y()); 670 RoundedRect::Radii topCornerRadii; 671 topCornerRadii.setTopLeft(clipRect.radii().topLeft()); 672 context->addRoundedRectClip(RoundedRect(topCorner, topCornerRadii)); 673 674 IntRect bottomCorner(rect.x(), rect.y(), clipRect.rect().maxX() - rect.x(), clipRect.rect().maxY() - rect.y()); 675 RoundedRect::Radii bottomCornerRadii; 676 bottomCornerRadii.setBottomRight(clipRect.radii().bottomRight()); 677 context->addRoundedRectClip(RoundedRect(bottomCorner, bottomCornerRadii)); 678 } 679 680 if (!clipRect.radii().topRight().isEmpty() || !clipRect.radii().bottomLeft().isEmpty()) { 681 IntRect topCorner(rect.x(), clipRect.rect().y(), clipRect.rect().maxX() - rect.x(), rect.maxY() - clipRect.rect().y()); 682 RoundedRect::Radii topCornerRadii; 683 topCornerRadii.setTopRight(clipRect.radii().topRight()); 684 context->addRoundedRectClip(RoundedRect(topCorner, topCornerRadii)); 685 686 IntRect bottomCorner(clipRect.rect().x(), rect.y(), rect.maxX() - clipRect.rect().x(), clipRect.rect().maxY() - rect.y()); 687 RoundedRect::Radii bottomCornerRadii; 688 bottomCornerRadii.setBottomLeft(clipRect.radii().bottomLeft()); 689 context->addRoundedRectClip(RoundedRect(bottomCorner, bottomCornerRadii)); 690 } 691 } 692 } 693 662 694 static LayoutRect backgroundRectAdjustedForBleedAvoidance(GraphicsContext* context, const LayoutRect& borderRect, BackgroundBleedAvoidance bleedAvoidance) 663 695 { … … 750 782 } 751 783 752 bool clipToBorderRadius = hasRoundedBorder && bleedAvoidance != BackgroundBleedUseTransparencyLayer; 784 // BorderFillBox radius clipping is taken care of by BackgroundBleedUseTransparencyLayer 785 bool clipToBorderRadius = hasRoundedBorder && !(isBorderFill && bleedAvoidance == BackgroundBleedUseTransparencyLayer); 753 786 GraphicsContextStateSaver clipToBorderStateSaver(*context, clipToBorderRadius); 754 787 if (clipToBorderRadius) { 755 RoundedRect border = getBackgroundRoundedRect(backgroundRectAdjustedForBleedAvoidance(context, rect, bleedAvoidance), box, boxSize.width(), boxSize.height(), includeLeftEdge, includeRightEdge); 756 context->addRoundedRectClip(border); 788 LayoutRect adjustedRect = isBorderFill ? backgroundRectAdjustedForBleedAvoidance(context, rect, bleedAvoidance) : rect; 789 RoundedRect border = getBackgroundRoundedRect(adjustedRect, box, boxSize.width(), boxSize.height(), includeLeftEdge, includeRightEdge); 790 791 // Clip to the padding or content boxes as necessary. 792 if (bgLayer->clip() == ContentFillBox) { 793 border = style()->getRoundedInnerBorderFor(border.rect(), 794 paddingTop() + borderTop(), paddingBottom() + borderBottom(), paddingLeft() + borderLeft(), paddingRight() + borderRight(), includeLeftEdge, includeRightEdge); 795 } else if (bgLayer->clip() == PaddingFillBox) 796 border = style()->getRoundedInnerBorderFor(border.rect(), includeLeftEdge, includeRightEdge); 797 798 clipRoundedInnerRect(context, rect, border); 757 799 } 758 800 … … 782 824 if (bgLayer->clip() == PaddingFillBox || bgLayer->clip() == ContentFillBox) { 783 825 // Clip to the padding or content boxes as necessary. 784 bool includePadding = bgLayer->clip() == ContentFillBox; 785 LayoutRect clipRect = LayoutRect(scrolledPaintRect.x() + bLeft + (includePadding ? pLeft : ZERO_LAYOUT_UNIT), 786 scrolledPaintRect.y() + borderTop() + (includePadding ? paddingTop() : ZERO_LAYOUT_UNIT), 787 scrolledPaintRect.width() - bLeft - bRight - (includePadding ? pLeft + pRight : ZERO_LAYOUT_UNIT), 788 scrolledPaintRect.height() - borderTop() - borderBottom() - (includePadding ? paddingTop() + paddingBottom() : ZERO_LAYOUT_UNIT)); 789 backgroundClipStateSaver.save(); 790 if (clipToBorderRadius && includePadding) { 791 RoundedRect rounded = getBackgroundRoundedRect(clipRect, box, boxSize.width(), boxSize.height(), includeLeftEdge, includeRightEdge); 792 context->addRoundedRectClip(rounded); 793 } else 826 if (!clipToBorderRadius) { 827 bool includePadding = bgLayer->clip() == ContentFillBox; 828 LayoutRect clipRect = LayoutRect(scrolledPaintRect.x() + bLeft + (includePadding ? pLeft : ZERO_LAYOUT_UNIT), 829 scrolledPaintRect.y() + borderTop() + (includePadding ? paddingTop() : ZERO_LAYOUT_UNIT), 830 scrolledPaintRect.width() - bLeft - bRight - (includePadding ? pLeft + pRight : ZERO_LAYOUT_UNIT), 831 scrolledPaintRect.height() - borderTop() - borderBottom() - (includePadding ? paddingTop() + paddingBottom() : ZERO_LAYOUT_UNIT)); 832 backgroundClipStateSaver.save(); 794 833 context->clip(clipRect); 834 } 795 835 } else if (bgLayer->clip() == TextFillBox) { 796 836 // We have to draw our text into a mask that can then be used to clip background drawing. -
trunk/Source/WebCore/rendering/RenderBoxModelObject.h
r131231 r131402 286 286 bool includeLogicalLeftEdge, bool includeLogicalRightEdge); 287 287 288 void clipRoundedInnerRect(GraphicsContext*, const LayoutRect&, const RoundedRect& clipRect); 289 288 290 void clipBorderSidePolygon(GraphicsContext*, const RoundedRect& outerBorder, const RoundedRect& innerBorder, 289 291 BoxSide, bool firstEdgeMatches, bool secondEdgeMatches);
Note:
See TracChangeset
for help on using the changeset viewer.