Repaint rect too small on elements with shadows
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2013 20:52:55 +0000 (20:52 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2013 20:52:55 +0000 (20:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=114225

Source/WebCore:

Reviewed by Dain Adler.

We assumed that shadows (box-shadow, text-shadow, svg shadows)
only required inflating the repaint rect by the blur radius of
the shadow. However, this is incorrect; the shadow can extend
further, which resulted in clipped or incorrectly invalidated
shadows.

Fix by disambiguating the blur radius (which is 2x the standard
deviation of the Gaussian distribution used to generate the blur),
from the painting extent, which is how far the shadow visually
projects. Using a 1.4 multiplier of the blur radius is a good
approximation for the painting extent.

Renamed ShadowData::blur() to ShadowData::radius(), and added
ShadowData::paintingExtent(). Use the latter in all places
which relate to invalidation.

Test: fast/box-shadow/shadow-repaint.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::valueForShadow):
* editing/mac/EditorMac.mm:
(WebCore::Editor::fontAttributesForSelectionStart):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::paint):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::applyShadowToGraphicsContext):
(WebCore::InlineTextBox::paintDecoration):
* rendering/RenderBoxModelObject.cpp:
(WebCore::applyBoxShadowForBackground):
(WebCore::areaCastingShadowInHole):
(WebCore::RenderBoxModelObject::paintBoxShadow):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::getShadowExtent):
(WebCore::RenderStyle::getShadowInsetExtent):
(WebCore::RenderStyle::getShadowHorizontalExtent):
(WebCore::RenderStyle::getShadowVerticalExtent):
* rendering/style/ShadowData.cpp:
(WebCore::ShadowData::ShadowData):
(WebCore::ShadowData::operator==):
(WebCore::calculateShadowExtent):
* rendering/style/ShadowData.h:
(WebCore::ShadowData::ShadowData):
(WebCore::ShadowData::radius):
(WebCore::ShadowData::paintingExtent):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):

LayoutTests:

Reviewed by Darin Alder.

New test for invalidation with box-shadow. Update test results affected
by shadow extent.

* compositing/geometry/foreground-layer-expected.txt:
* compositing/iframes/composited-parent-iframe-expected.txt:
* compositing/iframes/connect-compositing-iframe-delayed-expected.txt:
* compositing/iframes/connect-compositing-iframe-expected.txt:
* compositing/iframes/connect-compositing-iframe2-expected.txt:
* compositing/iframes/connect-compositing-iframe3-expected.txt:
* compositing/iframes/enter-compositing-iframe-expected.txt:
* compositing/iframes/iframe-resize-expected.txt:
* compositing/iframes/invisible-nested-iframe-show-expected.txt:
* compositing/iframes/overlapped-iframe-expected.txt:
* compositing/iframes/page-cache-layer-tree-expected.txt:
* compositing/iframes/scrolling-iframe-expected.txt:
* compositing/visible-rect/iframe-and-layers-expected.txt:
* fast/box-shadow/shadow-repaint-expected.txt: Added.
* fast/box-shadow/shadow-repaint.html: Added.
* platform/mac/fast/multicol/shadow-breaking-expected.png:
* platform/mac/fast/multicol/shadow-breaking-expected.txt:
* platform/mac/fast/repaint/moving-shadow-on-container-expected.txt:
* platform/mac/fast/repaint/moving-shadow-on-path-expected.png:
* platform/mac/fast/repaint/moving-shadow-on-path-expected.txt:
* platform/mac/svg/css/arrow-with-shadow-expected.png:
* platform/mac/svg/css/circle-in-mask-with-shadow-expected.png:
* platform/mac/svg/css/clippath-with-shadow-expected.png:
* platform/mac/svg/css/composite-shadow-example-expected.png:
* platform/mac/svg/css/composite-shadow-example-expected.txt:
* platform/mac/svg/css/composite-shadow-text-expected.txt:
* platform/mac/svg/css/composite-shadow-with-opacity-expected.png:
* platform/mac/svg/css/composite-shadow-with-opacity-expected.txt:
* platform/mac/svg/css/group-with-shadow-expected.png:
* platform/mac/svg/css/group-with-shadow-expected.txt:
* platform/mac/svg/css/mask-with-shadow-expected.png:
* platform/mac/svg/css/path-with-shadow-expected.png:
* platform/mac/svg/css/path-with-shadow-expected.txt:
* platform/mac/svg/css/shadow-and-opacity-expected.png:
* platform/mac/svg/css/shadow-and-opacity-expected.txt:
* platform/mac/svg/css/shadow-changes-expected.png:
* platform/mac/svg/css/shadow-changes-expected.txt:
* platform/mac/svg/css/shadow-with-large-radius-expected.png:
* platform/mac/svg/css/shadow-with-negative-offset-expected.png:
* platform/mac/svg/css/stars-with-shadow-expected.png:
* platform/mac/svg/css/stars-with-shadow-expected.txt:
* platform/mac/svg/css/text-gradient-shadow-expected.png:
* platform/mac/svg/css/text-gradient-shadow-expected.txt:
* platform/mac/svg/css/text-shadow-multiple-expected.png:
* platform/mac/svg/custom/repaint-shadow-expected.png:
* platform/mac/svg/custom/transform-with-shadow-and-gradient-expected.txt:
* svg/css/arrow-with-shadow-expected.txt:
* svg/css/circle-in-mask-with-shadow-expected.txt:
* svg/css/clippath-with-shadow-expected.txt:
* svg/css/mask-with-shadow-expected.txt:
* svg/css/shadow-with-large-radius-expected.txt:
* svg/css/shadow-with-negative-offset-expected.txt:
* svg/css/text-shadow-multiple-expected.txt:
* svg/custom/repaint-shadow-expected.txt:
* svg/filters/shadow-on-rect-with-filter-expected.txt:
* svg/repaint/repaint-webkit-svg-shadow-container-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148049 268f45cc-cd09-0410-ab3c-d52691b4dbfc

68 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/geometry/foreground-layer-expected.txt
LayoutTests/compositing/iframes/composited-parent-iframe-expected.txt
LayoutTests/compositing/iframes/connect-compositing-iframe-delayed-expected.txt
LayoutTests/compositing/iframes/connect-compositing-iframe-expected.txt
LayoutTests/compositing/iframes/connect-compositing-iframe2-expected.txt
LayoutTests/compositing/iframes/connect-compositing-iframe3-expected.txt
LayoutTests/compositing/iframes/enter-compositing-iframe-expected.txt
LayoutTests/compositing/iframes/iframe-resize-expected.txt
LayoutTests/compositing/iframes/invisible-nested-iframe-show-expected.txt
LayoutTests/compositing/iframes/overlapped-iframe-expected.txt
LayoutTests/compositing/iframes/page-cache-layer-tree-expected.txt
LayoutTests/compositing/iframes/scrolling-iframe-expected.txt
LayoutTests/compositing/visible-rect/iframe-and-layers-expected.txt
LayoutTests/fast/box-shadow/shadow-repaint-expected.txt [new file with mode: 0644]
LayoutTests/fast/box-shadow/shadow-repaint.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/multicol/shadow-breaking-expected.png
LayoutTests/platform/mac/fast/multicol/shadow-breaking-expected.txt
LayoutTests/platform/mac/fast/repaint/moving-shadow-on-container-expected.txt
LayoutTests/platform/mac/fast/repaint/moving-shadow-on-path-expected.png
LayoutTests/platform/mac/fast/repaint/moving-shadow-on-path-expected.txt
LayoutTests/platform/mac/svg/css/arrow-with-shadow-expected.png
LayoutTests/platform/mac/svg/css/circle-in-mask-with-shadow-expected.png
LayoutTests/platform/mac/svg/css/clippath-with-shadow-expected.png
LayoutTests/platform/mac/svg/css/composite-shadow-example-expected.png
LayoutTests/platform/mac/svg/css/composite-shadow-example-expected.txt
LayoutTests/platform/mac/svg/css/composite-shadow-text-expected.txt
LayoutTests/platform/mac/svg/css/composite-shadow-with-opacity-expected.png
LayoutTests/platform/mac/svg/css/composite-shadow-with-opacity-expected.txt
LayoutTests/platform/mac/svg/css/group-with-shadow-expected.png
LayoutTests/platform/mac/svg/css/group-with-shadow-expected.txt
LayoutTests/platform/mac/svg/css/mask-with-shadow-expected.png
LayoutTests/platform/mac/svg/css/path-with-shadow-expected.png
LayoutTests/platform/mac/svg/css/path-with-shadow-expected.txt
LayoutTests/platform/mac/svg/css/shadow-and-opacity-expected.png
LayoutTests/platform/mac/svg/css/shadow-and-opacity-expected.txt
LayoutTests/platform/mac/svg/css/shadow-changes-expected.png
LayoutTests/platform/mac/svg/css/shadow-changes-expected.txt
LayoutTests/platform/mac/svg/css/shadow-with-large-radius-expected.png
LayoutTests/platform/mac/svg/css/shadow-with-negative-offset-expected.png
LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.png
LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.txt
LayoutTests/platform/mac/svg/css/text-gradient-shadow-expected.png
LayoutTests/platform/mac/svg/css/text-gradient-shadow-expected.txt
LayoutTests/platform/mac/svg/css/text-shadow-multiple-expected.png
LayoutTests/platform/mac/svg/custom/repaint-shadow-expected.png
LayoutTests/platform/mac/svg/custom/transform-with-shadow-and-gradient-expected.txt
LayoutTests/svg/css/arrow-with-shadow-expected.txt
LayoutTests/svg/css/circle-in-mask-with-shadow-expected.txt
LayoutTests/svg/css/clippath-with-shadow-expected.txt
LayoutTests/svg/css/mask-with-shadow-expected.txt
LayoutTests/svg/css/shadow-with-large-radius-expected.txt
LayoutTests/svg/css/shadow-with-negative-offset-expected.txt
LayoutTests/svg/css/text-shadow-multiple-expected.txt
LayoutTests/svg/custom/repaint-shadow-expected.txt
LayoutTests/svg/filters/shadow-on-rect-with-filter-expected.txt
LayoutTests/svg/repaint/repaint-webkit-svg-shadow-container-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/editing/mac/EditorMac.mm
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/rendering/EllipsisBox.cpp
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/ShadowData.cpp
Source/WebCore/rendering/style/ShadowData.h
Source/WebCore/rendering/svg/SVGRenderingContext.cpp

index d8b9f81..394ad20 100644 (file)
@@ -1,3 +1,70 @@
+2013-04-09  Simon Fraser  <simon.fraser@apple.com>
+
+        Repaint rect too small on elements with shadows
+        https://bugs.webkit.org/show_bug.cgi?id=114225
+
+        Reviewed by Darin Alder.
+        
+        New test for invalidation with box-shadow. Update test results affected
+        by shadow extent.
+
+        * compositing/geometry/foreground-layer-expected.txt:
+        * compositing/iframes/composited-parent-iframe-expected.txt:
+        * compositing/iframes/connect-compositing-iframe-delayed-expected.txt:
+        * compositing/iframes/connect-compositing-iframe-expected.txt:
+        * compositing/iframes/connect-compositing-iframe2-expected.txt:
+        * compositing/iframes/connect-compositing-iframe3-expected.txt:
+        * compositing/iframes/enter-compositing-iframe-expected.txt:
+        * compositing/iframes/iframe-resize-expected.txt:
+        * compositing/iframes/invisible-nested-iframe-show-expected.txt:
+        * compositing/iframes/overlapped-iframe-expected.txt:
+        * compositing/iframes/page-cache-layer-tree-expected.txt:
+        * compositing/iframes/scrolling-iframe-expected.txt:
+        * compositing/visible-rect/iframe-and-layers-expected.txt:
+        * fast/box-shadow/shadow-repaint-expected.txt: Added.
+        * fast/box-shadow/shadow-repaint.html: Added.
+        * platform/mac/fast/multicol/shadow-breaking-expected.png:
+        * platform/mac/fast/multicol/shadow-breaking-expected.txt:
+        * platform/mac/fast/repaint/moving-shadow-on-container-expected.txt:
+        * platform/mac/fast/repaint/moving-shadow-on-path-expected.png:
+        * platform/mac/fast/repaint/moving-shadow-on-path-expected.txt:
+        * platform/mac/svg/css/arrow-with-shadow-expected.png:
+        * platform/mac/svg/css/circle-in-mask-with-shadow-expected.png:
+        * platform/mac/svg/css/clippath-with-shadow-expected.png:
+        * platform/mac/svg/css/composite-shadow-example-expected.png:
+        * platform/mac/svg/css/composite-shadow-example-expected.txt:
+        * platform/mac/svg/css/composite-shadow-text-expected.txt:
+        * platform/mac/svg/css/composite-shadow-with-opacity-expected.png:
+        * platform/mac/svg/css/composite-shadow-with-opacity-expected.txt:
+        * platform/mac/svg/css/group-with-shadow-expected.png:
+        * platform/mac/svg/css/group-with-shadow-expected.txt:
+        * platform/mac/svg/css/mask-with-shadow-expected.png:
+        * platform/mac/svg/css/path-with-shadow-expected.png:
+        * platform/mac/svg/css/path-with-shadow-expected.txt:
+        * platform/mac/svg/css/shadow-and-opacity-expected.png:
+        * platform/mac/svg/css/shadow-and-opacity-expected.txt:
+        * platform/mac/svg/css/shadow-changes-expected.png:
+        * platform/mac/svg/css/shadow-changes-expected.txt:
+        * platform/mac/svg/css/shadow-with-large-radius-expected.png:
+        * platform/mac/svg/css/shadow-with-negative-offset-expected.png:
+        * platform/mac/svg/css/stars-with-shadow-expected.png:
+        * platform/mac/svg/css/stars-with-shadow-expected.txt:
+        * platform/mac/svg/css/text-gradient-shadow-expected.png:
+        * platform/mac/svg/css/text-gradient-shadow-expected.txt:
+        * platform/mac/svg/css/text-shadow-multiple-expected.png:
+        * platform/mac/svg/custom/repaint-shadow-expected.png:
+        * platform/mac/svg/custom/transform-with-shadow-and-gradient-expected.txt:
+        * svg/css/arrow-with-shadow-expected.txt:
+        * svg/css/circle-in-mask-with-shadow-expected.txt:
+        * svg/css/clippath-with-shadow-expected.txt:
+        * svg/css/mask-with-shadow-expected.txt:
+        * svg/css/shadow-with-large-radius-expected.txt:
+        * svg/css/shadow-with-negative-offset-expected.txt:
+        * svg/css/text-shadow-multiple-expected.txt:
+        * svg/custom/repaint-shadow-expected.txt:
+        * svg/filters/shadow-on-rect-with-filter-expected.txt:
+        * svg/repaint/repaint-webkit-svg-shadow-container-expected.txt:
+
 2013-04-09  Benjamin Poulain  <bpoulain@apple.com>
 
         Mark mouse-events-scaled-iframe.html as flaky
index fa038c9..00d8eb0 100644 (file)
@@ -7,28 +7,28 @@
       (contentsOpaque 1)
       (children 2
         (GraphicsLayer
-          (position 18.00 18.00)
-          (bounds 320.00 320.00)
+          (position 10.00 10.00)
+          (bounds 336.00 336.00)
           (drawsContent 1)
           (children 2
             (GraphicsLayer
-              (position 60.00 60.00)
+              (position 68.00 68.00)
               (bounds 50.00 50.00)
               (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
             )
             (GraphicsLayer
-              (bounds 320.00 320.00)
+              (bounds 336.00 336.00)
               (drawsContent 1)
             )
           )
         )
         (GraphicsLayer
-          (position 362.00 18.00)
-          (bounds 320.00 320.00)
+          (position 354.00 10.00)
+          (bounds 336.00 336.00)
           (drawsContent 1)
           (children 1
             (GraphicsLayer
-              (position 60.00 60.00)
+              (position 68.00 68.00)
               (bounds 200.00 200.00)
               (children 2
                 (GraphicsLayer
index b336eaa..a080a97 100644 (file)
@@ -7,12 +7,12 @@
       (contentsOpaque 1)
       (children 1
         (GraphicsLayer
-          (position -12.00 -12.00)
-          (bounds 370.00 220.00)
+          (position -20.00 -20.00)
+          (bounds 386.00 236.00)
           (drawsContent 1)
           (children 1
             (GraphicsLayer
-              (position 35.00 35.00)
+              (position 43.00 43.00)
               (children 1
                 (GraphicsLayer
                   (bounds 285.00 150.00)
index 8bc77d2..9e17e22 100644 (file)
@@ -9,12 +9,12 @@ When the parent document becomes composited, the layer trees should get connecte
       (contentsOpaque 1)
       (children 2
         (GraphicsLayer
-          (position 8.00 108.00)
-          (bounds 370.00 220.00)
+          (position 0.00 100.00)
+          (bounds 386.00 236.00)
           (drawsContent 1)
           (children 1
             (GraphicsLayer
-              (position 35.00 35.00)
+              (position 43.00 43.00)
               (children 1
                 (GraphicsLayer
                   (bounds 285.00 150.00)
index bb689bf..a635805 100644 (file)
@@ -7,12 +7,11 @@
       (contentsOpaque 1)
       (children 2
         (GraphicsLayer
-          (position 8.00 8.00)
-          (bounds 370.00 220.00)
+          (bounds 386.00 236.00)
           (drawsContent 1)
           (children 1
             (GraphicsLayer
-              (position 35.00 35.00)
+              (position 43.00 43.00)
               (children 1
                 (GraphicsLayer
                   (bounds 285.00 150.00)
index bb689bf..a635805 100644 (file)
@@ -7,12 +7,11 @@
       (contentsOpaque 1)
       (children 2
         (GraphicsLayer
-          (position 8.00 8.00)
-          (bounds 370.00 220.00)
+          (bounds 386.00 236.00)
           (drawsContent 1)
           (children 1
             (GraphicsLayer
-              (position 35.00 35.00)
+              (position 43.00 43.00)
               (children 1
                 (GraphicsLayer
                   (bounds 285.00 150.00)
index bd90e41..dfbe73e 100644 (file)
@@ -7,12 +7,11 @@
       (contentsOpaque 1)
       (children 1
         (GraphicsLayer
-          (position 8.00 8.00)
-          (bounds 370.00 220.00)
+          (bounds 386.00 236.00)
           (drawsContent 1)
           (children 1
             (GraphicsLayer
-              (position 35.00 35.00)
+              (position 43.00 43.00)
               (children 1
                 (GraphicsLayer
                   (bounds 285.00 150.00)
index bb689bf..a635805 100644 (file)
@@ -7,12 +7,11 @@
       (contentsOpaque 1)
       (children 2
         (GraphicsLayer
-          (position 8.00 8.00)
-          (bounds 370.00 220.00)
+          (bounds 386.00 236.00)
           (drawsContent 1)
           (children 1
             (GraphicsLayer
-              (position 35.00 35.00)
+              (position 43.00 43.00)
               (children 1
                 (GraphicsLayer
                   (bounds 285.00 150.00)
index 7440c8f..5b7cfaa 100644 (file)
@@ -7,12 +7,11 @@
       (contentsOpaque 1)
       (children 2
         (GraphicsLayer
-          (position 8.00 8.00)
-          (bounds 470.00 190.00)
+          (bounds 486.00 206.00)
           (drawsContent 1)
           (children 1
             (GraphicsLayer
-              (position 35.00 35.00)
+              (position 43.00 43.00)
               (children 1
                 (GraphicsLayer
                   (bounds 385.00 120.00)
index b18b1b6..be8bb74 100644 (file)
@@ -7,7 +7,7 @@
       (contentsOpaque 1)
       (children 2
         (GraphicsLayer
-          (bounds 358.00 208.00)
+          (bounds 366.00 216.00)
           (drawsContent 1)
           (children 1
             (GraphicsLayer
index bb689bf..a635805 100644 (file)
@@ -7,12 +7,11 @@
       (contentsOpaque 1)
       (children 2
         (GraphicsLayer
-          (position 8.00 8.00)
-          (bounds 370.00 220.00)
+          (bounds 386.00 236.00)
           (drawsContent 1)
           (children 1
             (GraphicsLayer
-              (position 35.00 35.00)
+              (position 43.00 43.00)
               (children 1
                 (GraphicsLayer
                   (bounds 285.00 150.00)
index 9070fbe..8c2cce4 100644 (file)
@@ -13,12 +13,12 @@ This tests that layers are rebuilt properly after the page is restored from the
       (contentsOpaque 1)
       (children 4
         (GraphicsLayer
-          (position 8.00 50.00)
-          (bounds 370.00 220.00)
+          (position 0.00 42.00)
+          (bounds 386.00 236.00)
           (drawsContent 1)
           (children 1
             (GraphicsLayer
-              (position 35.00 35.00)
+              (position 43.00 43.00)
               (children 1
                 (GraphicsLayer
                   (bounds 285.00 135.00)
@@ -57,28 +57,35 @@ This tests that layers are rebuilt properly after the page is restored from the
         )
         (GraphicsLayer
           (position 8.00 274.00)
-          (bounds 370.00 220.00)
+          (bounds 784.00 224.00)
           (drawsContent 1)
           (children 1
             (GraphicsLayer
-              (position 35.00 35.00)
+              (position -8.00 -8.00)
+              (bounds 386.00 236.00)
+              (drawsContent 1)
               (children 1
                 (GraphicsLayer
-                  (bounds 285.00 135.00)
+                  (position 43.00 43.00)
                   (children 1
                     (GraphicsLayer
+                      (bounds 285.00 135.00)
                       (children 1
                         (GraphicsLayer
-                          (bounds 508.00 608.00)
                           (children 1
                             (GraphicsLayer
                               (bounds 508.00 608.00)
-                              (drawsContent 1)
                               (children 1
                                 (GraphicsLayer
-                                  (position 108.00 100.00)
-                                  (bounds 200.00 200.00)
-                                  (contentsOpaque 1)
+                                  (bounds 508.00 608.00)
+                                  (drawsContent 1)
+                                  (children 1
+                                    (GraphicsLayer
+                                      (position 108.00 100.00)
+                                      (bounds 200.00 200.00)
+                                      (contentsOpaque 1)
+                                    )
+                                  )
                                 )
                               )
                             )
index baa1d29..73c83a5 100644 (file)
@@ -7,12 +7,11 @@
       (contentsOpaque 1)
       (children 2
         (GraphicsLayer
-          (position 8.00 8.00)
-          (bounds 370.00 220.00)
+          (bounds 386.00 236.00)
           (drawsContent 1)
           (children 1
             (GraphicsLayer
-              (position 35.00 35.00)
+              (position 43.00 43.00)
               (children 1
                 (GraphicsLayer
                   (bounds 285.00 135.00)
index b7c1f83..f02eb8e 100644 (file)
@@ -9,13 +9,13 @@
       (visible rect 0.00, 0.00 785.00 x 585.00)
       (children 2
         (GraphicsLayer
-          (position 18.00 18.00)
-          (bounds 344.00 194.00)
+          (position 10.00 10.00)
+          (bounds 360.00 210.00)
           (drawsContent 1)
-          (visible rect 0.00, 0.00 344.00 x 194.00)
+          (visible rect 0.00, 0.00 360.00 x 210.00)
           (children 1
             (GraphicsLayer
-              (position 22.00 22.00)
+              (position 30.00 30.00)
               (visible rect 0.00, 0.00 0.00 x 0.00)
               (children 1
                 (GraphicsLayer
diff --git a/LayoutTests/fast/box-shadow/shadow-repaint-expected.txt b/LayoutTests/fast/box-shadow/shadow-repaint-expected.txt
new file mode 100644 (file)
index 0000000..4523893
--- /dev/null
@@ -0,0 +1,8 @@
+Repaint rects:
+
+(repaint rects
+  (rect 38 30 100 100)
+  (rect 20 12 156 156)
+  (rect 8 12 784 18)
+)
+
diff --git a/LayoutTests/fast/box-shadow/shadow-repaint.html b/LayoutTests/fast/box-shadow/shadow-repaint.html
new file mode 100644 (file)
index 0000000..9b16818
--- /dev/null
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        .box {
+            height: 100px;
+            width: 100px;
+            margin: 30px;
+            background-color: blue;
+        }
+        
+        .shadowed {
+            box-shadow: 10px 10px 20px black;
+        }
+    </style>
+
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsText();
+
+        function doTest() 
+        {
+            if (!window.testRunner || !window.internals)
+                return;
+
+            window.internals.startTrackingRepaints(document);
+            document.getElementById('box').classList.add('shadowed');
+            document.getElementById('repaints').textContent = window.internals.repaintRectsAsText(document);
+            window.internals.stopTrackingRepaints(document);
+        }
+        
+        window.addEventListener('load', doTest, false);
+    </script>
+</head>
+<body>
+    
+    <div id="box" class="box">
+    </div>
+
+<h2>Repaint rects:</h2>
+<pre id="repaints"></pre>
+</body>
+</html>
index ea7a566..06c48a2 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/multicol/shadow-breaking-expected.png and b/LayoutTests/platform/mac/fast/multicol/shadow-breaking-expected.png differ
index a3ec324..6a397ca 100644 (file)
@@ -4,12 +4,12 @@ layer at (0,0) size 800x8
   RenderBlock {HTML} at (0,0) size 800x8
     RenderBody {BODY} at (8,8) size 784x0
       RenderBlock {DIV} at (0,0) size 784x0
-layer at (20,36) size 424x270
-  RenderBlock (positioned) {P} at (20,36) size 424x270 [border: (2px solid #000000)]
+layer at (20,36) size 424x272
+  RenderBlock (positioned) {P} at (20,36) size 424x272 [border: (2px solid #000000)]
     RenderBlock (floating) at (2,2) size 24x41
       RenderText {#text} at (0,0) size 24x41
         text run at (0,0) width 24: "L"
-    RenderText {#text} at (30,2) size 200x491
+    RenderText {#text} at (30,2) size 200x497
       text run at (30,2) width 172: "orem ipsum dolor sit"
       text run at (30,20) width 172: "amet, consectetur"
       text run at (2,38) width 200: "adipiscing elit. Cras pharetra"
@@ -24,15 +24,15 @@ layer at (20,36) size 424x270
       text run at (2,200) width 200: "a nunc scelerisque blandit."
       text run at (2,218) width 200: "Nam non ligula massa, sed"
       text run at (2,236) width 200: "suscipit turpis. Etiam eget"
-      text run at (2,277) width 200: "ligula sit amet turpis"
-      text run at (2,295) width 200: "venenatis dictum in eleifend"
-      text run at (2,313) width 200: "augue. Duis tellus lectus,"
-      text run at (2,331) width 200: "volutpat et adipiscing a,"
-      text run at (2,349) width 200: "pellentesque eu metus."
-      text run at (2,367) width 200: "Aenean suscipit congue"
-      text run at (2,385) width 200: "mauris at gravida. Integer"
-      text run at (2,403) width 200: "lectus ligula, consectetur sit"
-      text run at (2,421) width 200: "amet venenatis id, scelerisque"
-      text run at (2,439) width 200: "eget nisl. Nunc dapibus"
-      text run at (2,457) width 200: "posuere risus, vitae tempor"
-      text run at (2,475) width 97: "nibh iaculis et."
+      text run at (2,283) width 200: "ligula sit amet turpis"
+      text run at (2,301) width 200: "venenatis dictum in eleifend"
+      text run at (2,319) width 200: "augue. Duis tellus lectus,"
+      text run at (2,337) width 200: "volutpat et adipiscing a,"
+      text run at (2,355) width 200: "pellentesque eu metus."
+      text run at (2,373) width 200: "Aenean suscipit congue"
+      text run at (2,391) width 200: "mauris at gravida. Integer"
+      text run at (2,409) width 200: "lectus ligula, consectetur sit"
+      text run at (2,427) width 200: "amet venenatis id, scelerisque"
+      text run at (2,445) width 200: "eget nisl. Nunc dapibus"
+      text run at (2,463) width 200: "posuere risus, vitae tempor"
+      text run at (2,481) width 97: "nibh iaculis et."
index 3fae8ef..d730508 100644 (file)
@@ -3,7 +3,7 @@ layer at (0,0) size 785x616
 layer at (0,0) size 785x616
   RenderBlock {HTML} at (0,0) size 785x616
     RenderBody {BODY} at (8,8) size 769x600
-      RenderSVGRoot {svg} at (8,8) size 488x193
-        RenderSVGPath {path} at (8,8) size 78x68 [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
-        RenderSVGPath {path} at (200,46) size 128x125 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
-        RenderSVGPath {path} at (349,46) size 117x122 [transform={m=((1.00,0.00)(0.00,1.00)) t=(400.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.53081e-15 25 L -29.3893 40.4509 L -23.7764 7.72542 L -47.5528 -15.4508 L -14.6946 -20.2254 L -9.18485e-15 -50 L 14.6946 -20.2254 L 47.5528 -15.4508 L 23.7764 7.72542 L 29.3893 40.4509 Z"]
+      RenderSVGRoot {svg} at (8,8) size 496x201
+        RenderSVGPath {path} at (8,8) size 80x70 [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
+        RenderSVGPath {path} at (198,44) size 132x129 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
+        RenderSVGPath {path} at (347,44) size 121x126 [transform={m=((1.00,0.00)(0.00,1.00)) t=(400.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.53081e-15 25 L -29.3893 40.4509 L -23.7764 7.72542 L -47.5528 -15.4508 L -14.6946 -20.2254 L -9.18485e-15 -50 L 14.6946 -20.2254 L 47.5528 -15.4508 L 23.7764 7.72542 L 29.3893 40.4509 Z"]
index 7aed856..3096ea2 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/repaint/moving-shadow-on-path-expected.png and b/LayoutTests/platform/mac/fast/repaint/moving-shadow-on-path-expected.png differ
index 3dcbb48..150c8f6 100644 (file)
@@ -3,7 +3,7 @@ layer at (0,0) size 785x616
 layer at (0,0) size 785x616
   RenderBlock {HTML} at (0,0) size 785x616
     RenderBody {BODY} at (8,8) size 769x600
-      RenderSVGRoot {svg} at (8,8) size 458x163
-        RenderSVGPath {path} at (8,8) size 88x78 [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
-        RenderSVGPath {path} at (200,46) size 138x135 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
-        RenderSVGPath {path} at (349,46) size 127x132 [transform={m=((1.00,0.00)(0.00,1.00)) t=(400.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.53081e-15 25 L -29.3893 40.4509 L -23.7764 7.72542 L -47.5528 -15.4508 L -14.6946 -20.2254 L -9.18485e-15 -50 L 14.6946 -20.2254 L 47.5528 -15.4508 L 23.7764 7.72542 L 29.3893 40.4509 Z"]
+      RenderSVGRoot {svg} at (8,8) size 460x165
+        RenderSVGPath {path} at (8,8) size 92x82 [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
+        RenderSVGPath {path} at (196,42) size 146x143 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
+        RenderSVGPath {path} at (345,42) size 135x140 [transform={m=((1.00,0.00)(0.00,1.00)) t=(400.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.53081e-15 25 L -29.3893 40.4509 L -23.7764 7.72542 L -47.5528 -15.4508 L -14.6946 -20.2254 L -9.18485e-15 -50 L 14.6946 -20.2254 L 47.5528 -15.4508 L 23.7764 7.72542 L 29.3893 40.4509 Z"]
index ce8b473..ca87c7e 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/css/arrow-with-shadow-expected.png and b/LayoutTests/platform/mac/svg/css/arrow-with-shadow-expected.png differ
index 67f58a1..6197f74 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/css/circle-in-mask-with-shadow-expected.png and b/LayoutTests/platform/mac/svg/css/circle-in-mask-with-shadow-expected.png differ
index 3f8d210..124828d 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/css/clippath-with-shadow-expected.png and b/LayoutTests/platform/mac/svg/css/clippath-with-shadow-expected.png differ
index bc85648..5cfd80d 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/css/composite-shadow-example-expected.png and b/LayoutTests/platform/mac/svg/css/composite-shadow-example-expected.png differ
index 5281f1f..342021f 100644 (file)
@@ -3,10 +3,10 @@ layer at (0,0) size 785x616
 layer at (0,0) size 785x616
   RenderBlock {HTML} at (0,0) size 785x616
     RenderBody {BODY} at (8,8) size 769x600
-      RenderSVGRoot {svg} at (40,36) size 456x170
-        RenderSVGContainer {g} at (40,36) size 156x150
-          RenderSVGPath {path} at (40,36) size 146x140 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
-        RenderSVGContainer {g} at (200,46) size 138x135
-          RenderSVGPath {path} at (200,46) size 128x125 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
-        RenderSVGContainer {g} at (349,46) size 127x132
-          RenderSVGPath {path} at (349,46) size 117x122 [transform={m=((1.00,0.00)(0.00,1.00)) t=(400.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.53081e-15 25 L -29.3893 40.4509 L -23.7764 7.72542 L -47.5528 -15.4508 L -14.6946 -20.2254 L -9.18485e-15 -50 L 14.6946 -20.2254 L 47.5528 -15.4508 L 23.7764 7.72542 L 29.3893 40.4509 Z"]
+      RenderSVGRoot {svg} at (32,28) size 472x186
+        RenderSVGContainer {g} at (36,32) size 164x158
+          RenderSVGPath {path} at (38,34) size 150x144 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
+        RenderSVGContainer {g} at (196,42) size 146x143
+          RenderSVGPath {path} at (198,44) size 132x129 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
+        RenderSVGContainer {g} at (345,42) size 135x140
+          RenderSVGPath {path} at (347,44) size 121x126 [transform={m=((1.00,0.00)(0.00,1.00)) t=(400.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.53081e-15 25 L -29.3893 40.4509 L -23.7764 7.72542 L -47.5528 -15.4508 L -14.6946 -20.2254 L -9.18485e-15 -50 L 14.6946 -20.2254 L 47.5528 -15.4508 L 23.7764 7.72542 L 29.3893 40.4509 Z"]
index dd2f424..0528d61 100644 (file)
@@ -9,7 +9,7 @@ layer at (0,0) size 800x600
       RenderSVGResourcePattern {pattern} [id="pattern"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
         RenderSVGRect {rect} at (0,0) size 10x10 [fill={[type=SOLID] [color=#0000FF]}] [x=0.00] [y=0.00] [width=10.00] [height=10.00]
         RenderSVGRect {rect} at (0,10) size 10x10 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=10.00] [width=10.00] [height=10.00]
-    RenderSVGContainer {g} at (9,9) size 245x427
+    RenderSVGContainer {g} at (9,9) size 249x431
       RenderSVGText {text} at (10,10) size 183x115 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,0) size 183x115
           chunk 1 text run 1 at (10.00,100.00) startOffset 0 endOffset 4 width 183.00: "Test"
index 2312928..e1a7deb 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/css/composite-shadow-with-opacity-expected.png and b/LayoutTests/platform/mac/svg/css/composite-shadow-with-opacity-expected.png differ
index 6bacd32..1ab885b 100644 (file)
@@ -4,10 +4,10 @@ layer at (0,0) size 785x616
   RenderBlock {HTML} at (0,0) size 785x616
     RenderBody {BODY} at (8,8) size 769x600
 layer at (8,8) size 769x600
-  RenderSVGRoot {svg} at (40,36) size 456x170 [opacity=0.50]
-    RenderSVGContainer {g} at (40,36) size 156x150
-      RenderSVGPath {path} at (40,36) size 146x140 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
-    RenderSVGContainer {g} at (200,46) size 138x135
-      RenderSVGPath {path} at (200,46) size 128x125 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
-    RenderSVGContainer {g} at (349,46) size 127x132
-      RenderSVGPath {path} at (349,46) size 117x122 [transform={m=((1.00,0.00)(0.00,1.00)) t=(400.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.53081e-15 25 L -29.3893 40.4509 L -23.7764 7.72542 L -47.5528 -15.4508 L -14.6946 -20.2254 L -9.18485e-15 -50 L 14.6946 -20.2254 L 47.5528 -15.4508 L 23.7764 7.72542 L 29.3893 40.4509 Z"]
+  RenderSVGRoot {svg} at (32,28) size 472x186 [opacity=0.50]
+    RenderSVGContainer {g} at (36,32) size 164x158
+      RenderSVGPath {path} at (38,34) size 150x144 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
+    RenderSVGContainer {g} at (196,42) size 146x143
+      RenderSVGPath {path} at (198,44) size 132x129 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
+    RenderSVGContainer {g} at (345,42) size 135x140
+      RenderSVGPath {path} at (347,44) size 121x126 [transform={m=((1.00,0.00)(0.00,1.00)) t=(400.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.53081e-15 25 L -29.3893 40.4509 L -23.7764 7.72542 L -47.5528 -15.4508 L -14.6946 -20.2254 L -9.18485e-15 -50 L 14.6946 -20.2254 L 47.5528 -15.4508 L 23.7764 7.72542 L 29.3893 40.4509 Z"]
index 745d84f..e27ddc2 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/css/group-with-shadow-expected.png and b/LayoutTests/platform/mac/svg/css/group-with-shadow-expected.png differ
index 2572d74..56e7674 100644 (file)
@@ -1,10 +1,10 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (30,31) size 289x286
-    RenderSVGContainer {g} at (30,31) size 355x353 [transform={m=((2.00,0.00)(0.00,2.00)) t=(0.00,0.00)}]
-      RenderSVGPath {line} at (33,31) size 284x38 [stroke={[type=SOLID] [color=#800080]}] [fill={[type=SOLID] [color=#000000]}] [x1=10.00] [y1=10.00] [x2=85.00] [y2=10.00]
-      RenderSVGRect {rect} at (31,65) size 288x204 [stroke={[type=SOLID] [color=#800080]}] [fill={[type=SOLID] [color=#800080]}] [x=10.00] [y=20.00] [width=75.00] [height=50.00]
+  RenderSVGRoot {svg} at (25,25) size 300x292
+    RenderSVGContainer {g} at (11,11) size 394x386 [transform={m=((2.00,0.00)(0.00,2.00)) t=(0.00,0.00)}]
+      RenderSVGPath {line} at (26,25) size 298x50 [stroke={[type=SOLID] [color=#800080]}] [fill={[type=SOLID] [color=#000000]}] [x1=10.00] [y1=10.00] [x2=85.00] [y2=10.00]
+      RenderSVGRect {rect} at (25,58) size 300x217 [stroke={[type=SOLID] [color=#800080]}] [fill={[type=SOLID] [color=#800080]}] [x=10.00] [y=20.00] [width=75.00] [height=50.00]
       RenderSVGText {text} at (10,75) size 78x19 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,0) size 78x19
           chunk 1 text run 1 at (10.00,90.00) startOffset 0 endOffset 12 width 77.40: "Hello there!"
index bb95a27..e58e788 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/css/mask-with-shadow-expected.png and b/LayoutTests/platform/mac/svg/css/mask-with-shadow-expected.png differ
index fe39616..2066959 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/css/path-with-shadow-expected.png and b/LayoutTests/platform/mac/svg/css/path-with-shadow-expected.png differ
index 2358dc5..a9270de 100644 (file)
@@ -1,5 +1,5 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (200,200) size 110x210
-    RenderSVGPath {path} at (200,200) size 120x220 [fill={[type=SOLID] [color=#0000FF]}] [data="M 200 200 L 300 200 L 300 400 L 200 400 Z"]
+  RenderSVGRoot {svg} at (198,198) size 114x214
+    RenderSVGPath {path} at (196,196) size 128x228 [fill={[type=SOLID] [color=#0000FF]}] [data="M 200 200 L 300 200 L 300 400 L 200 400 Z"]
index d545b79..943f5c5 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/css/shadow-and-opacity-expected.png and b/LayoutTests/platform/mac/svg/css/shadow-and-opacity-expected.png differ
index 06e8972..7de62ea 100644 (file)
@@ -1,5 +1,5 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (87,87) size 213x213
-    RenderSVGRect {rect} at (74,74) size 226x226 [opacity=0.50] [fill={[type=SOLID] [color=#008000]}] [x=100.00] [y=100.00] [width=200.00] [height=200.00]
+  RenderSVGRoot {svg} at (85,85) size 215x215
+    RenderSVGRect {rect} at (70,70) size 230x230 [opacity=0.50] [fill={[type=SOLID] [color=#008000]}] [x=100.00] [y=100.00] [width=200.00] [height=200.00]
index 34ca207..9e720a5 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/css/shadow-changes-expected.png and b/LayoutTests/platform/mac/svg/css/shadow-changes-expected.png differ
index 9c91a05..86c8e7f 100644 (file)
@@ -1,10 +1,10 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (135,5) size 326x285
-    RenderSVGContainer {g} at (105,0) size 356x290
-      RenderSVGRect {rect} at (135,5) size 215x215 [fill={[type=SOLID] [color=#FF0000]}] [x=150.00] [y=20.00] [width=200.00] [height=200.00]
-      RenderSVGEllipse {circle} at (205,75) size 215x215 [fill={[type=SOLID] [color=#0000FF]}] [cx=320.00] [cy=190.00] [r=100.00]
+  RenderSVGRoot {svg} at (132,2) size 329x288
+    RenderSVGContainer {g} at (96,0) size 365x290
+      RenderSVGRect {rect} at (132,2) size 218x218 [fill={[type=SOLID] [color=#FF0000]}] [x=150.00] [y=20.00] [width=200.00] [height=200.00]
+      RenderSVGEllipse {circle} at (202,72) size 218x218 [fill={[type=SOLID] [color=#0000FF]}] [cx=320.00] [cy=190.00] [r=100.00]
       RenderSVGText {text} at (270,36) size 191x108 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,0) size 191x107
           chunk 1 text run 1 at (270.00,120.00) startOffset 0 endOffset 3 width 191.00: "SVG"
index 1492db9..005994a 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/css/shadow-with-large-radius-expected.png and b/LayoutTests/platform/mac/svg/css/shadow-with-large-radius-expected.png differ
index c3f0c6f..fbe996c 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/css/shadow-with-negative-offset-expected.png and b/LayoutTests/platform/mac/svg/css/shadow-with-negative-offset-expected.png differ
index ae6d5c6..70fa899 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.png and b/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.png differ
index 6e5d64b..64f319d 100644 (file)
@@ -3,7 +3,7 @@ layer at (0,0) size 785x616
 layer at (0,0) size 785x616
   RenderBlock {HTML} at (0,0) size 785x616
     RenderBody {BODY} at (8,8) size 769x600
-      RenderSVGRoot {svg} at (40,36) size 437x140
-        RenderSVGPath {path} at (40,36) size 156x150 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,100.00)}] [stroke={[type=SOLID] [color=#800080] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
-        RenderSVGPath {path} at (190,36) size 156x150 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,100.00)}] [stroke={[type=SOLID] [color=#800080] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
-        RenderSVGPath {path} at (349,46) size 138x132 [transform={m=((1.00,0.00)(0.00,1.00)) t=(400.00,100.00)}] [stroke={[type=SOLID] [color=#800080] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.53081e-15 25 L -29.3893 40.4509 L -23.7764 7.72542 L -47.5528 -15.4508 L -14.6946 -20.2254 L -9.18485e-15 -50 L 14.6946 -20.2254 L 47.5528 -15.4508 L 23.7764 7.72542 L 29.3893 40.4509 Z"]
+      RenderSVGRoot {svg} at (38,34) size 441x144
+        RenderSVGPath {path} at (36,32) size 164x158 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,100.00)}] [stroke={[type=SOLID] [color=#800080] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
+        RenderSVGPath {path} at (186,32) size 164x158 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,100.00)}] [stroke={[type=SOLID] [color=#800080] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
+        RenderSVGPath {path} at (345,42) size 146x140 [transform={m=((1.00,0.00)(0.00,1.00)) t=(400.00,100.00)}] [stroke={[type=SOLID] [color=#800080] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.53081e-15 25 L -29.3893 40.4509 L -23.7764 7.72542 L -47.5528 -15.4508 L -14.6946 -20.2254 L -9.18485e-15 -50 L 14.6946 -20.2254 L 47.5528 -15.4508 L 23.7764 7.72542 L 29.3893 40.4509 Z"]
index 0e0513f..0d6a436 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/css/text-gradient-shadow-expected.png and b/LayoutTests/platform/mac/svg/css/text-gradient-shadow-expected.png differ
index d8687b8..f96d373 100644 (file)
@@ -1,7 +1,7 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (200,20) size 439x270
+  RenderSVGRoot {svg} at (192,12) size 455x286
     RenderSVGHiddenContainer {defs} at (0,0) size 0x0
       RenderSVGResourceLinearGradient {linearGradient} [id="gradient"] [gradientUnits=objectBoundingBox] [start=(0,0)] [end=(1,0)]
         RenderSVGGradientStop {stop} [offset=0.00] [color=#FF0000]
index cd3925a..2e03216 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/css/text-shadow-multiple-expected.png and b/LayoutTests/platform/mac/svg/css/text-shadow-multiple-expected.png differ
index 71899e0..9166c04 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/custom/repaint-shadow-expected.png and b/LayoutTests/platform/mac/svg/custom/repaint-shadow-expected.png differ
index 31be8a4..47f17ed 100644 (file)
@@ -1,12 +1,12 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (18,16) size 542x544
+  RenderSVGRoot {svg} at (14,0) size 578x592
     RenderSVGHiddenContainer {defs} at (0,0) size 0x0
       RenderSVGResourceLinearGradient {linearGradient} [id="gradient"] [gradientUnits=objectBoundingBox] [start=(0,0)] [end=(1,0)]
         RenderSVGGradientStop {stop} [offset=0.00] [color=#0000FF]
         RenderSVGGradientStop {stop} [offset=1.00] [color=#008000]
-    RenderSVGEllipse {circle} at (20,20) size 176x176 [transform={m=((4.00,0.00)(0.00,4.00)) t=(0.00,0.00)}] [fill={[type=LINEAR-GRADIENT] [id="gradient"]}] [cx=25.00] [cy=25.00] [r=20.00]
-    RenderSVGRect {rect} at (320,16) size 288x288 [transform={m=((32.00,0.00)(0.00,32.00)) t=(0.00,0.00)}] [fill={[type=LINEAR-GRADIENT] [id="gradient"]}] [x=10.00] [y=0.50] [width=5.00] [height=5.00]
-    RenderSVGEllipse {circle} at (18,318) size 180x180 [transform={m=((4.00,0.00)(0.00,4.00)) t=(0.00,0.00)}] [stroke={[type=LINEAR-GRADIENT] [id="gradient"]}] [fill={[type=SOLID] [color=#00000000]}] [cx=25.00] [cy=100.00] [r=20.00]
-    RenderSVGRect {rect} at (304,304) size 320x296 [transform={m=((32.00,0.00)(0.00,32.00)) t=(0.00,0.00)}] [stroke={[type=LINEAR-GRADIENT] [id="gradient"]}] [fill={[type=SOLID] [color=#00000000]}] [x=10.00] [y=10.00] [width=5.00] [height=5.00]
+    RenderSVGEllipse {circle} at (12,12) size 192x192 [transform={m=((4.00,0.00)(0.00,4.00)) t=(0.00,0.00)}] [fill={[type=LINEAR-GRADIENT] [id="gradient"]}] [cx=25.00] [cy=25.00] [r=20.00]
+    RenderSVGRect {rect} at (256,0) size 416x368 [transform={m=((32.00,0.00)(0.00,32.00)) t=(0.00,0.00)}] [fill={[type=LINEAR-GRADIENT] [id="gradient"]}] [x=10.00] [y=0.50] [width=5.00] [height=5.00]
+    RenderSVGEllipse {circle} at (10,310) size 196x196 [transform={m=((4.00,0.00)(0.00,4.00)) t=(0.00,0.00)}] [stroke={[type=LINEAR-GRADIENT] [id="gradient"]}] [fill={[type=SOLID] [color=#00000000]}] [cx=25.00] [cy=100.00] [r=20.00]
+    RenderSVGRect {rect} at (240,240) size 448x360 [transform={m=((32.00,0.00)(0.00,32.00)) t=(0.00,0.00)}] [stroke={[type=LINEAR-GRADIENT] [id="gradient"]}] [fill={[type=SOLID] [color=#00000000]}] [x=10.00] [y=10.00] [width=5.00] [height=5.00]
index d7018cd..4eef0d6 100644 (file)
@@ -1,7 +1,7 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (79,23) size 605x414
-    RenderSVGContainer {g} at (79,23) size 671x480 [transform={m=((2.00,0.00)(0.00,2.00)) t=(0.00,0.00)}]
-      RenderSVGContainer {a} at (79,23) size 638x447
-        RenderSVGPath {path} at (79,23) size 605x414 [stroke={[type=SOLID] [color=#0000FF] [stroke width=20.00]}] [data="M 185 40 L 85 40 L 85 28 L 40 64 L 85 100 L 85 88 L 185 88 Z"]
+  RenderSVGRoot {svg} at (73,17) size 617x426
+    RenderSVGContainer {g} at (59,3) size 711x520 [transform={m=((2.00,0.00)(0.00,2.00)) t=(0.00,0.00)}]
+      RenderSVGContainer {a} at (66,10) size 664x473
+        RenderSVGPath {path} at (73,17) size 617x426 [stroke={[type=SOLID] [color=#0000FF] [stroke width=20.00]}] [data="M 185 40 L 85 40 L 85 28 L 40 64 L 85 100 L 85 88 L 185 88 Z"]
index ad342de..159e9fc 100644 (file)
@@ -1,19 +1,19 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 450x500
-  RenderSVGRoot {svg} at (5,5) size 220x220
-    RenderSVGContainer {g} at (5,5) size 220x220
+  RenderSVGRoot {svg} at (3,3) size 224x224
+    RenderSVGContainer {g} at (3,3) size 224x224
       RenderSVGHiddenContainer {defs} at (0,0) size 0x0
         RenderSVGResourceLinearGradient {linearGradient} [id="maskedGradient"] [gradientUnits=objectBoundingBox] [start=(0,0)] [end=(1,1)]
           RenderSVGGradientStop {stop} [offset=0.00] [color=#0000FF]
           RenderSVGGradientStop {stop} [offset=1.00] [color=#FF0000]
         RenderSVGRect {rect} at (0,0) size 300x300 [fill={[type=LINEAR-GRADIENT] [id="maskedGradient"]}] [x=0.00] [y=0.00] [width=300.00] [height=300.00]
         RenderSVGResourceMasker {mask} [id="mask_1"] [maskUnits=objectBoundingBox] [maskContentUnits=userSpaceOnUse]
-          RenderSVGEllipse {circle} at (5,5) size 120x120 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=55.00] [cy=55.00] [r=50.00]
-          RenderSVGEllipse {circle} at (5,115) size 120x120 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=55.00] [cy=165.00] [r=50.00]
-          RenderSVGEllipse {circle} at (115,5) size 120x120 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=165.00] [cy=55.00] [r=50.00]
-          RenderSVGEllipse {circle} at (115,115) size 120x120 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=165.00] [cy=165.00] [r=50.00]
-      RenderSVGContainer {g} at (5,5) size 220x220
-        RenderSVGContainer {use} at (5,5) size 220x220
-          [masker="mask_1"] RenderSVGResourceMasker {mask} at (5,5) size 220x220
+          RenderSVGEllipse {circle} at (1,1) size 128x128 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=55.00] [cy=55.00] [r=50.00]
+          RenderSVGEllipse {circle} at (1,111) size 128x128 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=55.00] [cy=165.00] [r=50.00]
+          RenderSVGEllipse {circle} at (111,1) size 128x128 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=165.00] [cy=55.00] [r=50.00]
+          RenderSVGEllipse {circle} at (111,111) size 128x128 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=165.00] [cy=165.00] [r=50.00]
+      RenderSVGContainer {g} at (3,3) size 224x224
+        RenderSVGContainer {use} at (3,3) size 224x224
+          [masker="mask_1"] RenderSVGResourceMasker {mask} at (3,3) size 224x224
           RenderSVGRect {rect} at (0,0) size 300x300 [fill={[type=LINEAR-GRADIENT] [id="maskedGradient"]}] [x=0.00] [y=0.00] [width=300.00] [height=300.00]
index 129e6c2..2d0ef39 100644 (file)
@@ -1,11 +1,11 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (0,0) size 210x200
+  RenderSVGRoot {svg} at (0,0) size 212x200
     RenderSVGRect {rect} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=200.00] [height=200.00]
     RenderSVGRect {rect} at (0,0) size 200x200 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-200.00,0.00)}] [x=200.00] [y=0.00] [width=200.00] [height=200.00]
     RenderSVGResourceClipper {clipPath} [id="clip"] [clipPathUnits=userSpaceOnUse]
-      RenderSVGContainer {use} at (0,0) size 220x220
-        RenderSVGRect {rect} at (0,0) size 210x210 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-200.00,0.00)}] [x=200.00] [y=0.00] [width=200.00] [height=200.00]
-    RenderSVGRect {rect} at (0,0) size 210x200 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=400.00] [height=200.00]
-      [clipPath="clip"] RenderSVGResourceClipper {clipPath} at (0,0) size 210x210
+      RenderSVGContainer {use} at (0,0) size 224x224
+        RenderSVGRect {rect} at (0,0) size 212x212 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-200.00,0.00)}] [x=200.00] [y=0.00] [width=200.00] [height=200.00]
+    RenderSVGRect {rect} at (0,0) size 212x200 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=400.00] [height=200.00]
+      [clipPath="clip"] RenderSVGResourceClipper {clipPath} at (-2,-2) size 214x214
index db1d836..95f1561 100644 (file)
@@ -1,19 +1,19 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 450x500
-  RenderSVGRoot {svg} at (5,5) size 220x220
-    RenderSVGContainer {g} at (5,5) size 220x220
+  RenderSVGRoot {svg} at (3,3) size 224x224
+    RenderSVGContainer {g} at (3,3) size 224x224
       RenderSVGHiddenContainer {defs} at (0,0) size 0x0
         RenderSVGResourceLinearGradient {linearGradient} [id="maskedGradient"] [gradientUnits=objectBoundingBox] [start=(0,0)] [end=(1,1)]
           RenderSVGGradientStop {stop} [offset=0.00] [color=#0000FF]
           RenderSVGGradientStop {stop} [offset=1.00] [color=#FF0000]
         RenderSVGRect {rect} at (0,0) size 300x300 [fill={[type=LINEAR-GRADIENT] [id="maskedGradient"]}] [x=0.00] [y=0.00] [width=300.00] [height=300.00]
         RenderSVGResourceMasker {mask} [id="mask_1"] [maskUnits=objectBoundingBox] [maskContentUnits=userSpaceOnUse]
-          RenderSVGEllipse {circle} at (5,5) size 110x110 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=55.00] [cy=55.00] [r=50.00]
-          RenderSVGEllipse {circle} at (5,115) size 110x110 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=55.00] [cy=165.00] [r=50.00]
-          RenderSVGEllipse {circle} at (115,5) size 110x110 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=165.00] [cy=55.00] [r=50.00]
-          RenderSVGEllipse {circle} at (115,115) size 110x110 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=165.00] [cy=165.00] [r=50.00]
-      RenderSVGContainer {g} at (5,5) size 220x220
-        RenderSVGContainer {use} at (5,5) size 220x220
-          [masker="mask_1"] RenderSVGResourceMasker {mask} at (5,5) size 220x220
+          RenderSVGEllipse {circle} at (3,3) size 114x114 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=55.00] [cy=55.00] [r=50.00]
+          RenderSVGEllipse {circle} at (3,113) size 114x114 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=55.00] [cy=165.00] [r=50.00]
+          RenderSVGEllipse {circle} at (113,3) size 114x114 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=165.00] [cy=55.00] [r=50.00]
+          RenderSVGEllipse {circle} at (113,113) size 114x114 [fill={[type=SOLID] [color=#FFFFFF]}] [cx=165.00] [cy=165.00] [r=50.00]
+      RenderSVGContainer {g} at (3,3) size 224x224
+        RenderSVGContainer {use} at (3,3) size 224x224
+          [masker="mask_1"] RenderSVGResourceMasker {mask} at (3,3) size 224x224
           RenderSVGRect {rect} at (0,0) size 300x300 [fill={[type=LINEAR-GRADIENT] [id="maskedGradient"]}] [x=0.00] [y=0.00] [width=300.00] [height=300.00]
index ba7275a..ec52c9e 100644 (file)
@@ -1,5 +1,5 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (50,50) size 210x210
-    RenderSVGPath {path} at (5,5) size 310x310 [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 100 100 L 200 100 L 200 200 L 100 200 Z"]
+  RenderSVGRoot {svg} at (30,30) size 250x250
+    RenderSVGPath {path} at (0,0) size 355x355 [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 100 100 L 200 100 L 200 200 L 100 200 Z"]
index 2ed6dfb..38d0a5e 100644 (file)
@@ -1,5 +1,5 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (40,40) size 210x210
-    RenderSVGPath {path} at (0,0) size 295x295 [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 100 100 L 200 100 L 200 200 L 100 200 Z"]
+  RenderSVGRoot {svg} at (20,20) size 250x250
+    RenderSVGPath {path} at (0,0) size 335x335 [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 100 100 L 200 100 L 200 200 L 100 200 Z"]
index 2d8fde5..49bd823 100644 (file)
@@ -30,7 +30,7 @@ layer at (0,0) size 800x408
         RenderText {#text} at (0,0) size 556x18
           text run at (0,0) width 556: "The next two texts have subtle differences, as the stroke/fill is painted seperated in SVG."
       RenderBlock (anonymous) at (0,238) size 800x154
-        RenderSVGRoot {svg} at (0,307) size 747x90
+        RenderSVGRoot {svg} at (0,305) size 747x93
           RenderSVGText {text} at (20,20) size 720x57 contains 1 chunk(s)
             RenderSVGTSpan {tspan} at (0,0) size 95x56
               RenderSVGInlineText {#text} at (0,0) size 95x56
index 6f96eeb..ae4ce98 100644 (file)
@@ -1,7 +1,7 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (20,20) size 406x255
+  RenderSVGRoot {svg} at (20,20) size 408x257
     RenderSVGText {text} at (20,20) size 50x50 contains 1 chunk(s)
       RenderSVGInlineText {#text} at (0,0) size 50x50
         chunk 1 text run 1 at (20.00,60.00) startOffset 0 endOffset 1 width 50.00: "X"
index ef5fd95..4462b30 100644 (file)
@@ -1,12 +1,12 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (37,37) size 493x493
+  RenderSVGRoot {svg} at (35,35) size 495x495
     RenderSVGHiddenContainer {defs} at (0,0) size 0x0
       RenderSVGResourceFilter {filter} [id="filter"] [filterUnits=objectBoundingBox] [primitiveUnits=objectBoundingBox]
         [feGaussianBlur stdDeviation="0.01, 0.01"]
           [feComposite operation="OVER"]
             [feFlood flood-color="#FF0000" flood-opacity="1.00"]
             [feFlood flood-color="#008000" flood-opacity="1.00"]
-    RenderSVGRect {rect} at (24,24) size 506x506 [fill={[type=SOLID] [color=#008000]}] [x=200.00] [y=200.00] [width=300.00] [height=300.00]
+    RenderSVGRect {rect} at (20,20) size 510x510 [fill={[type=SOLID] [color=#008000]}] [x=200.00] [y=200.00] [width=300.00] [height=300.00]
       [filter="filter"] RenderSVGResourceFilter {filter} at (50,50) size 480x480
index 680612c..3dadeb6 100644 (file)
@@ -1,6 +1,6 @@
  (repaint rects
-  (rect 8 8 300 300)
-  (rect 8 8 510 510)
-  (rect 8 8 600 600)
+  (rect 8 8 340 340)
+  (rect 8 8 594 594)
+  (rect 8 8 720 600)
 )
 
index 01e7ceb..ac40cb4 100644 (file)
@@ -1,5 +1,61 @@
 2013-04-08  Simon Fraser  <simon.fraser@apple.com>
 
+        Repaint rect too small on elements with shadows
+        https://bugs.webkit.org/show_bug.cgi?id=114225
+
+        Reviewed by Dain Adler.
+        
+        We assumed that shadows (box-shadow, text-shadow, svg shadows)
+        only required inflating the repaint rect by the blur radius of
+        the shadow. However, this is incorrect; the shadow can extend
+        further, which resulted in clipped or incorrectly invalidated
+        shadows.
+        
+        Fix by disambiguating the blur radius (which is 2x the standard
+        deviation of the Gaussian distribution used to generate the blur),
+        from the painting extent, which is how far the shadow visually
+        projects. Using a 1.4 multiplier of the blur radius is a good
+        approximation for the painting extent.
+        
+        Renamed ShadowData::blur() to ShadowData::radius(), and added
+        ShadowData::paintingExtent(). Use the latter in all places
+        which relate to invalidation.
+
+        Test: fast/box-shadow/shadow-repaint.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::valueForShadow):
+        * editing/mac/EditorMac.mm:
+        (WebCore::Editor::fontAttributesForSelectionStart):
+        * page/animation/CSSPropertyAnimation.cpp:
+        (WebCore::blendFunc):
+        * rendering/EllipsisBox.cpp:
+        (WebCore::EllipsisBox::paint):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::applyShadowToGraphicsContext):
+        (WebCore::InlineTextBox::paintDecoration):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::applyBoxShadowForBackground):
+        (WebCore::areaCastingShadowInHole):
+        (WebCore::RenderBoxModelObject::paintBoxShadow):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::getShadowExtent):
+        (WebCore::RenderStyle::getShadowInsetExtent):
+        (WebCore::RenderStyle::getShadowHorizontalExtent):
+        (WebCore::RenderStyle::getShadowVerticalExtent):
+        * rendering/style/ShadowData.cpp:
+        (WebCore::ShadowData::ShadowData):
+        (WebCore::ShadowData::operator==):
+        (WebCore::calculateShadowExtent):
+        * rendering/style/ShadowData.h:
+        (WebCore::ShadowData::ShadowData):
+        (WebCore::ShadowData::radius):
+        (WebCore::ShadowData::paintingExtent):
+        * rendering/svg/SVGRenderingContext.cpp:
+        (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
+
+2013-04-08  Simon Fraser  <simon.fraser@apple.com>
+
         window.internals.repaintRectsAsText() is hard to use because it doesn't force layout
         https://bugs.webkit.org/show_bug.cgi?id=114219
 
index 3f101e4..77be659 100644 (file)
@@ -1272,7 +1272,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadow(const ShadowDat
     for (const ShadowData* s = shadow; s; s = s->next()) {
         RefPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(s->x(), style);
         RefPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(s->y(), style);
-        RefPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(s->blur(), style);
+        RefPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(s->radius(), style);
         RefPtr<CSSPrimitiveValue> spread = propertyID == CSSPropertyTextShadow ? PassRefPtr<CSSPrimitiveValue>() : zoomAdjustedPixelValue(s->spread(), style);
         RefPtr<CSSPrimitiveValue> style = propertyID == CSSPropertyTextShadow || s->style() == Normal ? PassRefPtr<CSSPrimitiveValue>() : cssValuePool().createIdentifierValue(CSSValueInset);
         RefPtr<CSSPrimitiveValue> color = cssValuePool().createColorValue(s->color().rgb());
index fe4f40a..1d650b9 100644 (file)
@@ -207,7 +207,7 @@ NSDictionary* Editor::fontAttributesForSelectionStart() const
     if (shadow) {
         RetainPtr<NSShadow> s(AdoptNS, [[NSShadow alloc] init]);
         [s.get() setShadowOffset:NSMakeSize(shadow->x(), shadow->y())];
-        [s.get() setShadowBlurRadius:shadow->blur()];
+        [s.get() setShadowBlurRadius:shadow->radius()];
         [s.get() setShadowColor:nsColor(shadow->color())];
         [result setObject:s.get() forKey:NSShadowAttributeName];
     }
index 7ed880d..2fc2f26 100644 (file)
@@ -114,7 +114,7 @@ static inline PassOwnPtr<ShadowData> blendFunc(const AnimationBase* anim, const
         return adoptPtr(new ShadowData(*to));
 
     return adoptPtr(new ShadowData(blend(from->location(), to->location(), progress),
-                                   blend(from->blur(), to->blur(), progress),
+                                   blend(from->radius(), to->radius(), progress),
                                    blend(from->spread(), to->spread(), progress),
                                    blendFunc(anim, from->style(), to->style(), progress),
                                    from->isWebkitBoxShadow(),
index 79c1402..6d90e38 100644 (file)
@@ -42,7 +42,7 @@ void EllipsisBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, La
     bool setShadow = false;
     if (style->textShadow()) {
         context->setShadow(LayoutSize(style->textShadow()->x(), style->textShadow()->y()),
-                           style->textShadow()->blur(), style->textShadow()->color(), style->colorSpace());
+                           style->textShadow()->radius(), style->textShadow()->color(), style->colorSpace());
         setShadow = true;
     }
 
index 1e9f6a5..f1450da 100644 (file)
@@ -389,21 +389,21 @@ FloatSize InlineTextBox::applyShadowToGraphicsContext(GraphicsContext* context,
     int shadowX = horizontal ? shadow->x() : shadow->y();
     int shadowY = horizontal ? shadow->y() : -shadow->x();
     FloatSize shadowOffset(shadowX, shadowY);
-    int shadowBlur = shadow->blur();
+    int shadowRadius = shadow->radius();
     const Color& shadowColor = shadow->color();
 
     if (shadow->next() || stroked || !opaque) {
         FloatRect shadowRect(textRect);
-        shadowRect.inflate(shadowBlur);
+        shadowRect.inflate(shadow->paintingExtent());
         shadowRect.move(shadowOffset);
         context->save();
         context->clip(shadowRect);
 
-        extraOffset = FloatSize(0, 2 * textRect.height() + max(0.0f, shadowOffset.height()) + shadowBlur);
+        extraOffset = FloatSize(0, 2 * textRect.height() + max(0.0f, shadowOffset.height()) + shadowRadius);
         shadowOffset -= extraOffset;
     }
 
-    context->setShadow(shadowOffset, shadowBlur, shadowColor, context->fillColorSpace());
+    context->setShadow(shadowOffset, shadowRadius, shadowColor, context->fillColorSpace());
     return extraOffset;
 }
 
@@ -1150,13 +1150,14 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, const FloatPoint&
     if (!linesAreOpaque && shadow && shadow->next()) {
         FloatRect clipRect(localOrigin, FloatSize(width, baseline + 2));
         for (const ShadowData* s = shadow; s; s = s->next()) {
+            int shadowExtent = s->paintingExtent();
             FloatRect shadowRect(localOrigin, FloatSize(width, baseline + 2));
-            shadowRect.inflate(s->blur());
+            shadowRect.inflate(shadowExtent);
             int shadowX = isHorizontal() ? s->x() : s->y();
             int shadowY = isHorizontal() ? s->y() : -s->x();
             shadowRect.move(shadowX, shadowY);
             clipRect.unite(shadowRect);
-            extraOffset = max(extraOffset, max(0, shadowY) + s->blur());
+            extraOffset = max(extraOffset, max(0, shadowY) + shadowExtent);
         }
         context->save();
         context->clip(clipRect);
@@ -1177,7 +1178,7 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, const FloatPoint&
             }
             int shadowX = isHorizontal() ? shadow->x() : shadow->y();
             int shadowY = isHorizontal() ? shadow->y() : -shadow->x();
-            context->setShadow(FloatSize(shadowX, shadowY - extraOffset), shadow->blur(), shadow->color(), colorSpace);
+            context->setShadow(FloatSize(shadowX, shadowY - extraOffset), shadow->radius(), shadow->color(), colorSpace);
             setShadow = true;
             shadow = shadow->next();
         }
index 2385c40..3e01bf2 100644 (file)
@@ -717,9 +717,9 @@ static void applyBoxShadowForBackground(GraphicsContext* context, RenderStyle* s
 
     FloatSize shadowOffset(boxShadow->x(), boxShadow->y());
     if (!boxShadow->isWebkitBoxShadow())
-        context->setShadow(shadowOffset, boxShadow->blur(), boxShadow->color(), style->colorSpace());
+        context->setShadow(shadowOffset, boxShadow->radius(), boxShadow->color(), style->colorSpace());
     else
-        context->setLegacyShadow(shadowOffset, boxShadow->blur(), boxShadow->color(), style->colorSpace());
+        context->setLegacyShadow(shadowOffset, boxShadow->radius(), boxShadow->color(), style->colorSpace());
 }
 
 void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, const Color& color, const FillLayer* bgLayer, const LayoutRect& rect,
@@ -2526,11 +2526,11 @@ bool RenderBoxModelObject::boxShadowShouldBeAppliedToBackground(BackgroundBleedA
     return true;
 }
 
-static inline IntRect areaCastingShadowInHole(const IntRect& holeRect, int shadowBlur, int shadowSpread, const IntSize& shadowOffset)
+static inline IntRect areaCastingShadowInHole(const IntRect& holeRect, int shadowExtent, int shadowSpread, const IntSize& shadowOffset)
 {
     IntRect bounds(holeRect);
     
-    bounds.inflate(shadowBlur);
+    bounds.inflate(shadowExtent);
 
     if (shadowSpread < 0)
         bounds.inflate(-shadowSpread);
@@ -2559,10 +2559,11 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
             continue;
 
         IntSize shadowOffset(shadow->x(), shadow->y());
-        int shadowBlur = shadow->blur();
+        int shadowRadius = shadow->radius();
+        int shadowPaintingExtent = shadow->paintingExtent();
         int shadowSpread = shadow->spread();
         
-        if (shadowOffset.isZero() && !shadowBlur && !shadowSpread)
+        if (shadowOffset.isZero() && !shadowRadius && !shadowSpread)
             continue;
         
         const Color& shadowColor = shadow->color();
@@ -2574,7 +2575,7 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
                 continue;
 
             IntRect shadowRect(border.rect());
-            shadowRect.inflate(shadowBlur + shadowSpread);
+            shadowRect.inflate(shadowPaintingExtent + shadowSpread);
             shadowRect.move(shadowOffset);
 
             GraphicsContextStateSaver stateSaver(*context);
@@ -2582,14 +2583,14 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
 
             // Move the fill just outside the clip, adding 1 pixel separation so that the fill does not
             // bleed in (due to antialiasing) if the context is transformed.
-            IntSize extraOffset(paintRect.pixelSnappedWidth() + max(0, shadowOffset.width()) + shadowBlur + 2 * shadowSpread + 1, 0);
+            IntSize extraOffset(paintRect.pixelSnappedWidth() + max(0, shadowOffset.width()) + shadowPaintingExtent + 2 * shadowSpread + 1, 0);
             shadowOffset -= extraOffset;
             fillRect.move(extraOffset);
 
             if (shadow->isWebkitBoxShadow())
-                context->setLegacyShadow(shadowOffset, shadowBlur, shadowColor, s->colorSpace());
+                context->setLegacyShadow(shadowOffset, shadowRadius, shadowColor, s->colorSpace());
             else
-                context->setShadow(shadowOffset, shadowBlur, shadowColor, s->colorSpace());
+                context->setShadow(shadowOffset, shadowRadius, shadowColor, s->colorSpace());
 
             if (hasBorderRadius) {
                 RoundedRect rectToClipOut = border;
@@ -2605,7 +2606,7 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
                     context->clipOutRoundedRect(rectToClipOut);
 
                 RoundedRect influenceRect(shadowRect, border.radii());
-                influenceRect.expandRadii(2 * shadowBlur + shadowSpread);
+                influenceRect.expandRadii(2 * shadowPaintingExtent + shadowSpread);
                 if (allCornersClippedOut(influenceRect, info.rect))
                     context->fillRect(fillRect.rect(), Color::black, s->colorSpace());
                 else {
@@ -2648,23 +2649,23 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
 
             if (!includeLogicalLeftEdge) {
                 if (isHorizontal) {
-                    holeRect.move(-max(shadowOffset.width(), 0) - shadowBlur, 0);
-                    holeRect.setWidth(holeRect.width() + max(shadowOffset.width(), 0) + shadowBlur);
+                    holeRect.move(-max(shadowOffset.width(), 0) - shadowPaintingExtent, 0);
+                    holeRect.setWidth(holeRect.width() + max(shadowOffset.width(), 0) + shadowPaintingExtent);
                 } else {
-                    holeRect.move(0, -max(shadowOffset.height(), 0) - shadowBlur);
-                    holeRect.setHeight(holeRect.height() + max(shadowOffset.height(), 0) + shadowBlur);
+                    holeRect.move(0, -max(shadowOffset.height(), 0) - shadowPaintingExtent);
+                    holeRect.setHeight(holeRect.height() + max(shadowOffset.height(), 0) + shadowPaintingExtent);
                 }
             }
             if (!includeLogicalRightEdge) {
                 if (isHorizontal)
-                    holeRect.setWidth(holeRect.width() - min(shadowOffset.width(), 0) + shadowBlur);
+                    holeRect.setWidth(holeRect.width() - min(shadowOffset.width(), 0) + shadowPaintingExtent);
                 else
-                    holeRect.setHeight(holeRect.height() - min(shadowOffset.height(), 0) + shadowBlur);
+                    holeRect.setHeight(holeRect.height() - min(shadowOffset.height(), 0) + shadowPaintingExtent);
             }
 
             Color fillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), 255);
 
-            IntRect outerRect = areaCastingShadowInHole(border.rect(), shadowBlur, shadowSpread, shadowOffset);
+            IntRect outerRect = areaCastingShadowInHole(border.rect(), shadowPaintingExtent, shadowSpread, shadowOffset);
             RoundedRect roundedHole(holeRect, border.radii());
 
             GraphicsContextStateSaver stateSaver(*context);
@@ -2676,14 +2677,14 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
             } else
                 context->clip(border.rect());
 
-            IntSize extraOffset(2 * paintRect.pixelSnappedWidth() + max(0, shadowOffset.width()) + shadowBlur - 2 * shadowSpread + 1, 0);
+            IntSize extraOffset(2 * paintRect.pixelSnappedWidth() + max(0, shadowOffset.width()) + shadowPaintingExtent - 2 * shadowSpread + 1, 0);
             context->translate(extraOffset.width(), extraOffset.height());
             shadowOffset -= extraOffset;
 
             if (shadow->isWebkitBoxShadow())
-                context->setLegacyShadow(shadowOffset, shadowBlur, shadowColor, s->colorSpace());
+                context->setLegacyShadow(shadowOffset, shadowRadius, shadowColor, s->colorSpace());
             else
-                context->setShadow(shadowOffset, shadowBlur, shadowColor, s->colorSpace());
+                context->setShadow(shadowOffset, shadowRadius, shadowColor, s->colorSpace());
 
             context->fillRectWithRoundedHole(outerRect, roundedHole, fillColor, s->colorSpace());
         }
index d8d657e..163f478 100644 (file)
@@ -1345,12 +1345,12 @@ void RenderStyle::getShadowExtent(const ShadowData* shadow, LayoutUnit &top, Lay
     for ( ; shadow; shadow = shadow->next()) {
         if (shadow->style() == Inset)
             continue;
-        int blurAndSpread = shadow->blur() + shadow->spread();
 
-        top = min<LayoutUnit>(top, shadow->y() - blurAndSpread);
-        right = max<LayoutUnit>(right, shadow->x() + blurAndSpread);
-        bottom = max<LayoutUnit>(bottom, shadow->y() + blurAndSpread);
-        left = min<LayoutUnit>(left, shadow->x() - blurAndSpread);
+        int extentAndSpread = shadow->paintingExtent() + shadow->spread();
+        top = min<LayoutUnit>(top, shadow->y() - extentAndSpread);
+        right = max<LayoutUnit>(right, shadow->x() + extentAndSpread);
+        bottom = max<LayoutUnit>(bottom, shadow->y() + extentAndSpread);
+        left = min<LayoutUnit>(left, shadow->x() - extentAndSpread);
     }
 }
 
@@ -1364,11 +1364,12 @@ LayoutBoxExtent RenderStyle::getShadowInsetExtent(const ShadowData* shadow) cons
     for ( ; shadow; shadow = shadow->next()) {
         if (shadow->style() == Normal)
             continue;
-        int blurAndSpread = shadow->blur() + shadow->spread();
-        top = max<LayoutUnit>(top, shadow->y() + blurAndSpread);
-        right = min<LayoutUnit>(right, shadow->x() - blurAndSpread);
-        bottom = min<LayoutUnit>(bottom, shadow->y() - blurAndSpread);
-        left = max<LayoutUnit>(left, shadow->x() + blurAndSpread);
+
+        int extentAndSpread = shadow->paintingExtent() + shadow->spread();
+        top = max<LayoutUnit>(top, shadow->y() + extentAndSpread);
+        right = min<LayoutUnit>(right, shadow->x() - extentAndSpread);
+        bottom = min<LayoutUnit>(bottom, shadow->y() - extentAndSpread);
+        left = max<LayoutUnit>(left, shadow->x() + extentAndSpread);
     }
 
     return LayoutBoxExtent(top, right, bottom, left);
@@ -1382,10 +1383,10 @@ void RenderStyle::getShadowHorizontalExtent(const ShadowData* shadow, LayoutUnit
     for ( ; shadow; shadow = shadow->next()) {
         if (shadow->style() == Inset)
             continue;
-        int blurAndSpread = shadow->blur() + shadow->spread();
 
-        left = min<LayoutUnit>(left, shadow->x() - blurAndSpread);
-        right = max<LayoutUnit>(right, shadow->x() + blurAndSpread);
+        int extentAndSpread = shadow->paintingExtent() + shadow->spread();
+        left = min<LayoutUnit>(left, shadow->x() - extentAndSpread);
+        right = max<LayoutUnit>(right, shadow->x() + extentAndSpread);
     }
 }
 
@@ -1397,10 +1398,10 @@ void RenderStyle::getShadowVerticalExtent(const ShadowData* shadow, LayoutUnit &
     for ( ; shadow; shadow = shadow->next()) {
         if (shadow->style() == Inset)
             continue;
-        int blurAndSpread = shadow->blur() + shadow->spread();
 
-        top = min<LayoutUnit>(top, shadow->y() - blurAndSpread);
-        bottom = max<LayoutUnit>(bottom, shadow->y() + blurAndSpread);
+        int extentAndSpread = shadow->paintingExtent() + shadow->spread();
+        top = min<LayoutUnit>(top, shadow->y() - extentAndSpread);
+        bottom = max<LayoutUnit>(bottom, shadow->y() + extentAndSpread);
     }
 }
 
index 381b590..edd5b37 100644 (file)
@@ -30,7 +30,7 @@ namespace WebCore {
 
 ShadowData::ShadowData(const ShadowData& o)
     : m_location(o.m_location)
-    , m_blur(o.m_blur)
+    , m_radius(o.m_radius)
     , m_spread(o.m_spread)
     , m_color(o.m_color)
     , m_style(o.m_style)
@@ -46,7 +46,7 @@ bool ShadowData::operator==(const ShadowData& o) const
         return false;
     
     return m_location == o.m_location
-        && m_blur == o.m_blur
+        && m_radius == o.m_radius
         && m_spread == o.m_spread
         && m_style == o.m_style
         && m_color == o.m_color
@@ -56,12 +56,12 @@ bool ShadowData::operator==(const ShadowData& o) const
 static inline void calculateShadowExtent(const ShadowData* shadow, int additionalOutlineSize, int& shadowLeft, int& shadowRight, int& shadowTop, int& shadowBottom)
 {
     do {
-        int blurAndSpread = shadow->blur() + shadow->spread() + additionalOutlineSize;
+        int extentAndSpread = shadow->paintingExtent() + shadow->spread() + additionalOutlineSize;
         if (shadow->style() == Normal) {
-            shadowLeft = min(shadow->x() - blurAndSpread, shadowLeft);
-            shadowRight = max(shadow->x() + blurAndSpread, shadowRight);
-            shadowTop = min(shadow->y() - blurAndSpread, shadowTop);
-            shadowBottom = max(shadow->y() + blurAndSpread, shadowBottom);
+            shadowLeft = min(shadow->x() - extentAndSpread, shadowLeft);
+            shadowRight = max(shadow->x() + extentAndSpread, shadowRight);
+            shadowTop = min(shadow->y() - extentAndSpread, shadowTop);
+            shadowBottom = max(shadow->y() + extentAndSpread, shadowBottom);
         }
 
         shadow = shadow->next();
index 77d71e9..19be48d 100644 (file)
@@ -41,16 +41,16 @@ class ShadowData {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     ShadowData()
-        : m_blur(0)
+        : m_radius(0)
         , m_spread(0)
         , m_style(Normal)
         , m_isWebkitBoxShadow(false)
     {
     }
 
-    ShadowData(const IntPoint& location, int blur, int spread, ShadowStyle style, bool isWebkitBoxShadow, const Color& color)
+    ShadowData(const IntPoint& location, int radius, int spread, ShadowStyle style, bool isWebkitBoxShadow, const Color& color)
         : m_location(location)
-        , m_blur(blur)
+        , m_radius(radius)
         , m_spread(spread)
         , m_color(color)
         , m_style(style)
@@ -69,7 +69,15 @@ public:
     int x() const { return m_location.x(); }
     int y() const { return m_location.y(); }
     IntPoint location() const { return m_location; }
-    int blur() const { return m_blur; }
+    int radius() const { return m_radius; }
+    int paintingExtent() const
+    {
+        // Blurring uses a Gaussian function whose std. deviation is m_radius/2, and which in theory
+        // extends to infinity. In 8-bit contexts, however, rounding causes the effect to become
+        // undetectable at around 1.4x the radius.
+        const float radiusExtentMultiplier = 1.4;
+        return ceilf(m_radius * radiusExtentMultiplier);
+    }
     int spread() const { return m_spread; }
     ShadowStyle style() const { return m_style; }
     const Color& color() const { return m_color; }
@@ -83,7 +91,7 @@ public:
 
 private:
     IntPoint m_location;
-    int m_blur;
+    int m_radius; // This is the "blur radius", or twice the standard deviation of the Gaussian blur.
     int m_spread;
     Color m_color;
     ShadowStyle m_style;
index fe06edf..a65d39f 100644 (file)
@@ -120,7 +120,7 @@ void SVGRenderingContext::prepareToRenderSVGContent(RenderObject* object, PaintI
 
         if (shadow) {
             m_paintInfo->context->clip(repaintRect);
-            m_paintInfo->context->setShadow(IntSize(roundToInt(shadow->x()), roundToInt(shadow->y())), shadow->blur(), shadow->color(), style->colorSpace());
+            m_paintInfo->context->setShadow(IntSize(roundToInt(shadow->x()), roundToInt(shadow->y())), shadow->radius(), shadow->color(), style->colorSpace());
             m_paintInfo->context->beginTransparencyLayer(1);
             m_renderingFlags |= EndShadowLayer;
         }