Commit 2d33a85b authored by morrita@google.com's avatar morrita@google.com

2011-01-23 MORITA Hajime <morrita@google.com>

        Reviewed by Eric Seidel.

        REGRESSION: Inset shadow with too large border radius misses rounded corner.
        https://bugs.webkit.org/show_bug.cgi?id=52800

        * fast/box-shadow/inset-with-extraordinary-radii-and-border.html: Added.
        * platform/mac/fast/box-shadow/inset-with-extraordinary-radii-and-border-expected.checksum: Added.
        * platform/mac/fast/box-shadow/inset-with-extraordinary-radii-and-border-expected.png: Added.
        * platform/mac/fast/box-shadow/inset-with-extraordinary-radii-and-border-expected.txt: Added.
2011-01-23  MORITA Hajime  <morrita@google.com>

        Reviewed by Eric Seidel.

        REGRESSION: Inset shadow with too large border radius misses rounded corner.
        https://bugs.webkit.org/show_bug.cgi?id=52800

        The refactoring on r76083 broke the invariant between border
        IntRect and its radii because RoundedIntRect::setRect() is called
        after getRoundedInnerBorderWithBorderWidths(), which enforces the
        invariant. Th rounded-rect clipping code verifies the invariant,
        and discard the invalid radii, that results broken paintings.

        This change moved setRect() before
        getRoundedInnerBorderWithBorderWidths() not to modify the valid
        RoundedIntRect value.

        Test: fast/box-shadow/inset-with-extraordinary-radii-and-border.html

        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::paintBoxShadow):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3d2ff16f
2011-01-23 MORITA Hajime <morrita@google.com>
Reviewed by Eric Seidel.
REGRESSION: Inset shadow with too large border radius misses rounded corner.
https://bugs.webkit.org/show_bug.cgi?id=52800
* fast/box-shadow/inset-with-extraordinary-radii-and-border.html: Added.
* platform/mac/fast/box-shadow/inset-with-extraordinary-radii-and-border-expected.checksum: Added.
* platform/mac/fast/box-shadow/inset-with-extraordinary-radii-and-border-expected.png: Added.
* platform/mac/fast/box-shadow/inset-with-extraordinary-radii-and-border-expected.txt: Added.
2011-01-30 Simon Fraser <simon.fraser@apple.com>
Reviewed by Dan Bernstein.
<html>
<head>
<style>
body { background-color: black; }
.test {
border-radius: 40px;
-webkit-box-shadow: inset white 0 0 0 15px;
border: 4px solid green;
background-color: blue;
margin: 20px;
}
#test0 {
height: 70px;
width: 70px;
float: left;
}
#test1 {
height: 100px;
width: 70px;
float: left;
}
#test2 {
height: 70px;
width: 100px;
float: right;
}
#test3 {
height: 100px;
width: 100px;
float: right;
}
</style>
</head>
<body>
<div>
<div class="test" id="test0"></div>
<div class="test" id="test1"></div>
<div class="test" id="test2"></div>
<div class="test" id="test3"></div>
</div>
</body>
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584 [bgcolor=#000000]
RenderBlock {DIV} at (0,0) size 784x0
RenderBlock (floating) {DIV} at (20,20) size 78x78 [bgcolor=#0000FF] [border: (4px solid #008000)]
RenderBlock (floating) {DIV} at (138,20) size 78x108 [bgcolor=#0000FF] [border: (4px solid #008000)]
RenderBlock (floating) {DIV} at (656,20) size 108x78 [bgcolor=#0000FF] [border: (4px solid #008000)]
RenderBlock (floating) {DIV} at (508,20) size 108x108 [bgcolor=#0000FF] [border: (4px solid #008000)]
2011-01-23 MORITA Hajime <morrita@google.com>
Reviewed by Eric Seidel.
REGRESSION: Inset shadow with too large border radius misses rounded corner.
https://bugs.webkit.org/show_bug.cgi?id=52800
The refactoring on r76083 broke the invariant between border
IntRect and its radii because RoundedIntRect::setRect() is called
after getRoundedInnerBorderWithBorderWidths(), which enforces the
invariant. Th rounded-rect clipping code verifies the invariant,
and discard the invalid radii, that results broken paintings.
This change moved setRect() before
getRoundedInnerBorderWithBorderWidths() not to modify the valid
RoundedIntRect value.
Test: fast/box-shadow/inset-with-extraordinary-radii-and-border.html
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintBoxShadow):
2011-01-30 Simon Fraser <simon.fraser@apple.com>
Attempt to fix Windows build by adding ShadowBlur.cpp/h to the
......@@ -1585,17 +1585,18 @@ void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int
RoundedIntRect border(tx, ty, w, h);
bool hasBorderRadius = s->hasBorderRadius();
bool isHorizontal = s->isHorizontalWritingMode();
if (hasBorderRadius && (includeLogicalLeftEdge || includeLogicalRightEdge)) {
RoundedIntRect::Radii radii = ((shadowStyle == Inset) ? s->getRoundedInnerBorderWithBorderWidths(border.rect(), borderTop(), borderBottom(), borderLeft(), borderRight()) : s->getRoundedBorderFor(border.rect())).radii();
border.includeLogicalEdges(radii, isHorizontal, includeLogicalLeftEdge, includeLogicalRightEdge);
}
if (shadowStyle == Inset)
border.setRect(IntRect(border.rect().x() + (includeLogicalLeftEdge || !isHorizontal ? borderLeft() : 0),
border.rect().y() + (includeLogicalLeftEdge || isHorizontal ? borderTop() : 0),
border.rect().width() - ((includeLogicalLeftEdge || !isHorizontal) ? borderLeft() : 0) - ((includeLogicalRightEdge || !isHorizontal) ? borderRight() : 0),
border.rect().height() - ((includeLogicalLeftEdge || isHorizontal) ? borderTop() : 0) - ((includeLogicalRightEdge || isHorizontal) ? borderBottom() : 0)));
if (hasBorderRadius && (includeLogicalLeftEdge || includeLogicalRightEdge)) {
RoundedIntRect::Radii radii = ((shadowStyle == Inset) ? s->getRoundedInnerBorderWithBorderWidths(border.rect(), borderTop(), borderBottom(), borderLeft(), borderRight()) : s->getRoundedBorderFor(border.rect())).radii();
border.includeLogicalEdges(radii, isHorizontal, includeLogicalLeftEdge, includeLogicalRightEdge);
}
bool hasOpaqueBackground = s->visitedDependentColor(CSSPropertyBackgroundColor).isValid() && s->visitedDependentColor(CSSPropertyBackgroundColor).alpha() == 255;
for (const ShadowData* shadow = s->boxShadow(); shadow; shadow = shadow->next()) {
if (shadow->style() != shadowStyle)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment