Commit 4d4db5b3 authored by mitz@apple.com's avatar mitz@apple.com

WebCore:

        Reviewed by Simon Fraser.

        - fix https://bugs.webkit.org/show_bug.cgi?id=23606
          <rdar://problem/6537777> CSS gradient not repainted when image load
          completes

        Test: fast/repaint/background-generated.html

        * rendering/RenderObject.cpp:
        (WebCore::mustRepaintFillLayers): Return true if the layer does not
        specify a size and the image uses the container size.

LayoutTests:

        Reviewed by Simon Fraser.

        - test for https://bugs.webkit.org/show_bug.cgi?id=23606
          <rdar://problem/6537777> CSS gradient not repainted when image load
          completes

        * fast/repaint/background-generated.html: Added.
        * platform/mac/fast/repaint/background-generated-expected.checksum: Added.
        * platform/mac/fast/repaint/background-generated-expected.png: Added.
        * platform/mac/fast/repaint/background-generated-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 784b1fe2
2009-06-22 Dan Bernstein <mitz@apple.com>
Reviewed by Simon Fraser.
- test for https://bugs.webkit.org/show_bug.cgi?id=23606
<rdar://problem/6537777> CSS gradient not repainted when image load
completes
* fast/repaint/background-generated.html: Added.
* platform/mac/fast/repaint/background-generated-expected.checksum: Added.
* platform/mac/fast/repaint/background-generated-expected.png: Added.
* platform/mac/fast/repaint/background-generated-expected.txt: Added.
2009-06-22 Darin Adler <darin@apple.com>
* platform/gtk/Skipped: Skip two new tests.
......
<!DOCTYPE HTML>
<head>
<script src="resources/repaint.js" type="text/javascript"></script>
<script type="text/javascript">
function repaintTest()
{
document.getElementById("target").style.height = "200px";
}
</script>
</head>
<body onload="runRepaintTest();">
<div style="width: 100px;
padding-top: 100px;
background-image: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
">
<div id="target" style="height: 100px;"></div>
</div>
</body>
2d086f2e8c50fbb1cc780dc5e3208b23
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x316
RenderBlock {HTML} at (0,0) size 800x316
RenderBody {BODY} at (8,8) size 784x300
RenderBlock {DIV} at (0,0) size 100x300
RenderBlock {DIV} at (0,100) size 100x200
2009-06-22 Dan Bernstein <mitz@apple.com>
Reviewed by Simon Fraser.
- fix https://bugs.webkit.org/show_bug.cgi?id=23606
<rdar://problem/6537777> CSS gradient not repainted when image load
completes
Test: fast/repaint/background-generated.html
* rendering/RenderObject.cpp:
(WebCore::mustRepaintFillLayers): Return true if the layer does not
specify a size and the image uses the container size.
2009-06-22 David Hyatt <hyatt@apple.com>
Reviewed by Sam Weinig.
......
......@@ -643,13 +643,16 @@ static bool mustRepaintFillLayers(const RenderObject* renderer, const FillLayer*
// Make sure we have a valid image.
StyleImage* img = layer->image();
bool shouldPaintBackgroundImage = img && img->canRender(renderer->style()->effectiveZoom());
if (!img || !img->canRender(renderer->style()->effectiveZoom()))
return false;
if (!layer->xPosition().isZero() || !layer->yPosition().isZero())
return true;
// These are always percents or auto.
if (shouldPaintBackgroundImage &&
(!layer->xPosition().isZero() || !layer->yPosition().isZero() ||
layer->size().width().isPercent() || layer->size().height().isPercent()))
// The image will shift unpredictably if the size changes.
if (layer->isSizeSet()) {
if (layer->size().width().isPercent() || layer->size().height().isPercent())
return true;
} else if (img->usesImageContainerSize())
return true;
return false;
......
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