[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

zimmermann at webkit.org zimmermann at webkit.org
Wed Dec 22 12:19:44 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 0cfc11bbe2950d5b93f146dda8ebbe1e18b036ef
Author: zimmermann at webkit.org <zimmermann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Aug 19 12:41:23 2010 +0000

    2010-08-19  Nikolas Zimmermann  <nzimmermann at rim.com>
    
            Reviewed by Dirk Schulze.
    
            Pattern is rasterized
            https://bugs.webkit.org/show_bug.cgi?id=41396
    
            SVG pattern size changed when resizing browser
            https://bugs.webkit.org/show_bug.cgi?id=38704
    
            Incorrect pattern tilling
            https://bugs.webkit.org/show_bug.cgi?id=41603
    
            Apply same fixes to <pattern> that <mask> recently received. Build the tile image in absolute coordinates,
            to avoid pixelation, when the target element is scaled. Also fixes problems when zooming into patterns.
    
            Clamp ImageBuffer sizes to RenderSVGRoots viewport, now that gradient/pattern and mask buffers are created
            in absolute coordinates -> no more huge image buffer allocations, that could fail.
    
            Drop overflow="visible" support for <pattern>, which complicates the code a lot. Neither Opera nor Firefox
            support this, and SVG 1.1 2nd Edition says that the rendering behaviour is "undefined".
    
            Tests: svg/batik/paints/patternRegions-positioned-objects.svg
                   svg/custom/pattern-incorrect-tiling.svg
                   svg/custom/pattern-no-pixelation.svg
                   svg/transforms/text-with-mask-with-svg-transform.svg
    
            * rendering/PaintInfo.h:
            (WebCore::PaintInfo::applyTransform): Don't alter the repaint rect if it's infinite (only affects SVG).
            (WebCore::PaintInfo::infiniteRect): Moved from RenderLayer into PaintInfo, as applyTransform() needs it.
            * rendering/RenderLayer.cpp:
            (WebCore::RenderLayer::calculateClipRects): s/ClipRects::infiniteRect/PaintInfo::infiniteRect/
            * rendering/RenderLayer.h: Moved infiniteRect() to PaintInfo.
            * rendering/RenderLayerBacking.cpp:
            (WebCore::clipBox): s/ClipRects::infiniteRect/PaintInfo::infiniteRect/
            * rendering/RenderLayerCompositor.cpp:
            (WebCore::RenderLayerCompositor::clippedByAncestor): Ditto.
            * rendering/RenderSVGResourceGradient.cpp:
            (WebCore::createMaskAndSwapContextForTextGradient): Clamp image buffer size, use new SVGImageBufferTools helper methods for that.
            (WebCore::clipToTextMask): Adapt to renames/code changes in SVGImageBufferTools.
            (WebCore::RenderSVGResourceGradient::applyResource): Ditto.
            * rendering/RenderSVGResourceMasker.cpp:
            (WebCore::RenderSVGResourceMasker::applyResource): lamp image buffer size, use new SVGImageBufferTools helper methods for that.
            (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage): Adapt to renames/code changes in SVGImageBufferTools.
            * rendering/RenderSVGResourceMasker.h:
            * rendering/RenderSVGResourcePattern.cpp:
            (WebCore::RenderSVGResourcePattern::applyResource): Rewrite to create tile image buffers in absolute coordinates, avoids pixelation artefacts.
            (WebCore::calculatePatternBoundaries):
            (WebCore::RenderSVGResourcePattern::buildTileImageTransform):
            (WebCore::RenderSVGResourcePattern::createTileImage):
            * rendering/RenderSVGResourcePattern.h:
            * rendering/SVGImageBufferTools.cpp:
            (WebCore::SVGImageBufferTools::transformationToOutermostSVGCoordinateSystem): Helper method, concating all localToParentTransforms() up until RenderSVGRoot is reached.
            (WebCore::SVGImageBufferTools::createImageBuffer): Simplified.
            (WebCore::SVGImageBufferTools::clipToImageBuffer): Rename absoluteTargetRect to clampedAbsoluteTargetRect.
            (WebCore::SVGImageBufferTools::roundedImageBufferSize): New helper method to centralize FloatSize -> IntSize rounding, when creating image buffers.
            (WebCore::SVGImageBufferTools::clampedAbsoluteTargetRectForRenderer): New helper methods to clamp an image buffer rect against the viewport.
            * rendering/SVGImageBufferTools.h:
            * rendering/SVGRenderSupport.cpp:
            (WebCore::SVGRenderSupport::renderSubtreeToImage): Use PaintInfo::infiniteRect() as repaint rect, to avoid any culling.
            (WebCore::SVGRenderSupport::findTreeRootObject): Renamed from svgRootTreeObject, and expose it.
            (WebCore::SVGRenderSupport::layoutChildren): s/svgRootTreeObject/findTreeRootObject/.
            * rendering/SVGRenderSupport.h:
            * svg/SVGSVGElement.cpp:
            (WebCore::SVGSVGElement::setCurrentTranslate): Be sure to relayout on invalidation, otherwhise resources are not updated, and we have to update them, as they depend on the absolute transform.
    
    2010-08-19  Nikolas Zimmermann  <nzimmermann at rim.com>
    
            Reviewed by Dirk Schulze.
    
            Pattern is rasterized
            https://bugs.webkit.org/show_bug.cgi?id=41396
    
            SVG pattern size changed when resizing browser
            https://bugs.webkit.org/show_bug.cgi?id=38704
    
            Incorrect pattern tilling
            https://bugs.webkit.org/show_bug.cgi?id=41603
    
            Update pattern results after fixing the pixelation issues.
    
            * platform/mac-leopard/svg/batik/paints/patternRegions-expected.checksum:
            * platform/mac-leopard/svg/batik/paints/patternRegions-expected.png:
            * platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.checksum:
            * platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.png:
            * platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.checksum: Added.
            * platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.png: Added.
            * platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.txt: Added.
            * platform/mac/svg/batik/text/textEffect3-expected.checksum:
            * platform/mac/svg/batik/text/textEffect3-expected.png:
            * platform/mac/svg/custom/absolute-sized-content-with-resources-expected.checksum:
            * platform/mac/svg/custom/absolute-sized-content-with-resources-expected.png:
            * platform/mac/svg/custom/grayscale-gradient-mask-expected.checksum:
            * platform/mac/svg/custom/grayscale-gradient-mask-expected.png:
            * platform/mac/svg/custom/js-late-gradient-and-object-creation-expected.checksum:
            * platform/mac/svg/custom/js-late-gradient-and-object-creation-expected.png:
            * platform/mac/svg/custom/js-late-gradient-creation-expected.checksum:
            * platform/mac/svg/custom/js-late-gradient-creation-expected.png:
            * platform/mac/svg/custom/js-late-pattern-and-object-creation-expected.checksum:
            * platform/mac/svg/custom/js-late-pattern-and-object-creation-expected.png:
            * platform/mac/svg/custom/js-late-pattern-creation-expected.checksum:
            * platform/mac/svg/custom/js-late-pattern-creation-expected.png:
            * platform/mac/svg/custom/non-scaling-stroke-expected.checksum:
            * platform/mac/svg/custom/non-scaling-stroke-expected.png:
            * platform/mac/svg/custom/pattern-incorrect-tiling-expected.checksum: Added.
            * platform/mac/svg/custom/pattern-incorrect-tiling-expected.png: Added.
            * platform/mac/svg/custom/pattern-incorrect-tiling-expected.txt: Added.
            * platform/mac/svg/custom/pattern-no-pixelation-expected.checksum: Added.
            * platform/mac/svg/custom/pattern-no-pixelation-expected.png: Added.
            * platform/mac/svg/custom/pattern-no-pixelation-expected.txt: Added.
            * platform/mac/svg/custom/pattern-rotate-expected.checksum:
            * platform/mac/svg/custom/pattern-rotate-expected.png:
            * platform/mac/svg/custom/stroked-pattern-expected.checksum:
            * platform/mac/svg/custom/stroked-pattern-expected.png:
            * platform/mac/svg/custom/text-rotated-gradient-expected.checksum:
            * platform/mac/svg/custom/text-rotated-gradient-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.checksum:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.checksum:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.checksum:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.checksum:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.checksum:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.checksum:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.checksum:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.checksum:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.checksum:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.checksum:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.png:
            * platform/mac/svg/dynamic-updates/SVGPatternElement-dom-patternContentUnits-attr-expected.checksum:
            * platform/mac/svg/dynamic-updates/SVGPatternElement-dom-patternContentUnits-attr-expected.png:
            * platform/mac/svg/dynamic-updates/SVGPatternElement-svgdom-patternContentUnits-prop-expected.checksum:
            * platform/mac/svg/dynamic-updates/SVGPatternElement-svgdom-patternContentUnits-prop-expected.png:
            * platform/mac/svg/text/selection-background-color-expected.checksum:
            * platform/mac/svg/text/selection-background-color-expected.png:
            * platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.checksum: Added.
            * platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.png: Added.
            * platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.txt: Added.
            * platform/mac/svg/transforms/text-with-pattern-inside-transformed-html-expected.checksum:
            * platform/mac/svg/transforms/text-with-pattern-inside-transformed-html-expected.png:
            * platform/mac/svg/transforms/text-with-pattern-with-svg-transform-expected.checksum:
            * platform/mac/svg/transforms/text-with-pattern-with-svg-transform-expected.png:
            * platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.checksum:
            * platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.png:
            * svg/batik/paints/patternRegions-positioned-objects.svg: Added.
            * svg/custom/pattern-incorrect-tiling.svg: Added.
            * svg/custom/pattern-no-pixelation.svg: Added.
            * svg/transforms/text-with-mask-with-svg-transform.svg: Added.
            * svg/transforms/text-with-pattern-inside-transformed-html.xhtml:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65665 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 1caddc4..781cb19 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,94 @@
+2010-08-19  Nikolas Zimmermann  <nzimmermann at rim.com>
+
+        Reviewed by Dirk Schulze.
+
+        Pattern is rasterized
+        https://bugs.webkit.org/show_bug.cgi?id=41396
+
+        SVG pattern size changed when resizing browser
+        https://bugs.webkit.org/show_bug.cgi?id=38704
+
+        Incorrect pattern tilling
+        https://bugs.webkit.org/show_bug.cgi?id=41603
+
+        Update pattern results after fixing the pixelation issues.
+
+        * platform/mac-leopard/svg/batik/paints/patternRegions-expected.checksum:
+        * platform/mac-leopard/svg/batik/paints/patternRegions-expected.png:
+        * platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.checksum:
+        * platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.png:
+        * platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.checksum: Added.
+        * platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.png: Added.
+        * platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.txt: Added.
+        * platform/mac/svg/batik/text/textEffect3-expected.checksum:
+        * platform/mac/svg/batik/text/textEffect3-expected.png:
+        * platform/mac/svg/custom/absolute-sized-content-with-resources-expected.checksum:
+        * platform/mac/svg/custom/absolute-sized-content-with-resources-expected.png:
+        * platform/mac/svg/custom/grayscale-gradient-mask-expected.checksum:
+        * platform/mac/svg/custom/grayscale-gradient-mask-expected.png:
+        * platform/mac/svg/custom/js-late-gradient-and-object-creation-expected.checksum:
+        * platform/mac/svg/custom/js-late-gradient-and-object-creation-expected.png:
+        * platform/mac/svg/custom/js-late-gradient-creation-expected.checksum:
+        * platform/mac/svg/custom/js-late-gradient-creation-expected.png:
+        * platform/mac/svg/custom/js-late-pattern-and-object-creation-expected.checksum:
+        * platform/mac/svg/custom/js-late-pattern-and-object-creation-expected.png:
+        * platform/mac/svg/custom/js-late-pattern-creation-expected.checksum:
+        * platform/mac/svg/custom/js-late-pattern-creation-expected.png:
+        * platform/mac/svg/custom/non-scaling-stroke-expected.checksum:
+        * platform/mac/svg/custom/non-scaling-stroke-expected.png:
+        * platform/mac/svg/custom/pattern-incorrect-tiling-expected.checksum: Added.
+        * platform/mac/svg/custom/pattern-incorrect-tiling-expected.png: Added.
+        * platform/mac/svg/custom/pattern-incorrect-tiling-expected.txt: Added.
+        * platform/mac/svg/custom/pattern-no-pixelation-expected.checksum: Added.
+        * platform/mac/svg/custom/pattern-no-pixelation-expected.png: Added.
+        * platform/mac/svg/custom/pattern-no-pixelation-expected.txt: Added.
+        * platform/mac/svg/custom/pattern-rotate-expected.checksum:
+        * platform/mac/svg/custom/pattern-rotate-expected.png:
+        * platform/mac/svg/custom/stroked-pattern-expected.checksum:
+        * platform/mac/svg/custom/stroked-pattern-expected.png:
+        * platform/mac/svg/custom/text-rotated-gradient-expected.checksum:
+        * platform/mac/svg/custom/text-rotated-gradient-expected.png:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.checksum:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.png:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.checksum:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.png:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.checksum:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.png:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.checksum:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.png:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.checksum:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.png:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.checksum:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.png:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.checksum:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.png:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.checksum:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.png:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.checksum:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.png:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.checksum:
+        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.png:
+        * platform/mac/svg/dynamic-updates/SVGPatternElement-dom-patternContentUnits-attr-expected.checksum:
+        * platform/mac/svg/dynamic-updates/SVGPatternElement-dom-patternContentUnits-attr-expected.png:
+        * platform/mac/svg/dynamic-updates/SVGPatternElement-svgdom-patternContentUnits-prop-expected.checksum:
+        * platform/mac/svg/dynamic-updates/SVGPatternElement-svgdom-patternContentUnits-prop-expected.png:
+        * platform/mac/svg/text/selection-background-color-expected.checksum:
+        * platform/mac/svg/text/selection-background-color-expected.png:
+        * platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.checksum: Added.
+        * platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.png: Added.
+        * platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.txt: Added.
+        * platform/mac/svg/transforms/text-with-pattern-inside-transformed-html-expected.checksum:
+        * platform/mac/svg/transforms/text-with-pattern-inside-transformed-html-expected.png:
+        * platform/mac/svg/transforms/text-with-pattern-with-svg-transform-expected.checksum:
+        * platform/mac/svg/transforms/text-with-pattern-with-svg-transform-expected.png:
+        * platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.checksum:
+        * platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.png:
+        * svg/batik/paints/patternRegions-positioned-objects.svg: Added.
+        * svg/custom/pattern-incorrect-tiling.svg: Added.
+        * svg/custom/pattern-no-pixelation.svg: Added.
+        * svg/transforms/text-with-mask-with-svg-transform.svg: Added.
+        * svg/transforms/text-with-pattern-inside-transformed-html.xhtml:
+
 2010-08-19  Csaba Osztrogonác  <ossy at webkit.org>
 
         Unreviewed.
diff --git a/LayoutTests/platform/mac-leopard/svg/batik/paints/patternRegions-expected.checksum b/LayoutTests/platform/mac-leopard/svg/batik/paints/patternRegions-expected.checksum
index 13c6bc2..d56ec6e 100644
--- a/LayoutTests/platform/mac-leopard/svg/batik/paints/patternRegions-expected.checksum
+++ b/LayoutTests/platform/mac-leopard/svg/batik/paints/patternRegions-expected.checksum
@@ -1 +1 @@
-e56e3d2e346373823cee2ff7342f6abe
\ No newline at end of file
+39b53021f79fccd729c30cc6e3d20158
\ No newline at end of file
diff --git a/LayoutTests/platform/mac-leopard/svg/batik/paints/patternRegions-expected.png b/LayoutTests/platform/mac-leopard/svg/batik/paints/patternRegions-expected.png
index eb92d7b..af217a0 100644
Binary files a/LayoutTests/platform/mac-leopard/svg/batik/paints/patternRegions-expected.png and b/LayoutTests/platform/mac-leopard/svg/batik/paints/patternRegions-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.checksum b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.checksum
index 5739cdc..16a443d 100644
--- a/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.checksum
+++ b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.checksum
@@ -1 +1 @@
-6bb6729651be229c2d69393a9d287cf4
\ No newline at end of file
+effebeceed60e2edcd5795281c16f129
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.png b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.png
index aaab494..2ee597c 100644
Binary files a/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.png and b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.checksum b/LayoutTests/platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.checksum
new file mode 100644
index 0000000..2e5eab1
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.checksum
@@ -0,0 +1 @@
+cc37bf2533d0479775663eb1d3039bb6
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.png b/LayoutTests/platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.png
new file mode 100644
index 0000000..5d2ec6e
Binary files /dev/null and b/LayoutTests/platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.txt b/LayoutTests/platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.txt
new file mode 100644
index 0000000..8b8f345
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.txt
@@ -0,0 +1,170 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 450x500
+  RenderSVGRoot {svg} at (14,36) size 410x365
+    RenderSVGText {text} at (105,36) size 240x17 contains 1 chunk(s)
+      RenderSVGInlineText {#text} at (0,0) size 240x17
+        chunk 1 (middle anchor) text run 1 at (105.00,50.00) startOffset 0 endOffset 34 width 240.00: "patternUnits / patternContentUnits"
+    RenderSVGText {text} at (168,61) size 114x17 contains 1 chunk(s)
+      RenderSVGInlineText {#text} at (0,0) size 114x17
+        chunk 1 (middle anchor) text run 1 at (168.00,75.00) startOffset 0 endOffset 15 width 114.00: "pattern viewBox"
+    RenderSVGContainer {g} at (14,108) size 410x293
+      RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+        RenderSVGResourcePattern {pattern} [id="pattern1"] [patternUnits=objectBoundingBox] [patternContentUnits=userSpaceOnUse]
+          RenderPath {circle} at (0,0) size 20x20 [fill={[type=SOLID] [color=#FF0000]}] [data="M20.00,10.00 L19.98,10.63 L19.92,11.25 L19.82,11.87 L19.69,12.49 L19.51,13.09 L19.30,13.68 L19.05,14.26 L18.76,14.82 L18.44,15.36 L18.09,15.88 L17.71,16.37 L17.29,16.85 L16.85,17.29 L16.37,17.71 L15.88,18.09 L15.36,18.44 L14.82,18.76 L14.26,19.05 L13.68,19.30 L13.09,19.51 L12.49,19.69 L11.87,19.82 L11.25,19.92 L10.63,19.98 L10.00,20.00 L9.37,19.98 L8.75,19.92 L8.13,19.82 L7.51,19.69 L6.91,19.51 L6.32,19.30 L5.74,19.05 L5.18,18.76 L4.64,18.44 L4.12,18.09 L3.63,17.71 L3.15,17.29 L2.71,16.85 L2.29,16.37 L1.91,15.88 L1.56,15.36 L1.24,14.82 L0.95,14.26 L0.70,13.68 L0.49,13.09 L0.31,12.49 L0.18,11.87 L0.08,11.25 L0.02,10.63 L0.00,10.00 L0.02,9.37 L0.08,8.75 L0.18,8.13 L0.31,7.51 L0.49,6.91 L0.70,6.32 L0.95,5.74 L1.24,5.18 L1.56,4.64 L1.91,4.12 L2.29,3.63 L2.71,3.15 L3.15,2.71 L3.63,2.29 L4.12,1.91 L4.64,1.56 L5.18,1.24 L5.74,0.95 L6.32,0.70 L6.91,0.49 L7.51,0.31 L8.13,0.18 L8.75,0.08 L9.37,0.02 L10.00,0.00 L10.63,0.02 L11.25,0.08 L11.87,0.18 L12.49,0.31 L13.09,0.49 L13.68,0.70 L14.26,0.95 L14.82,1.24 L15.36,1.56 L15.88,1.91 L16.37,2.29 L16.85,2.71 L17.29,3.15 L17.71,3.63 L18.09,4.12 L18.44,4.64 L18.76,5.18 L19.05,5.74 L19.30,6.32 L19.51,6.91 L19.69,7.51 L19.82,8.13 L19.92,8.75 L19.98,9.37 Z"]
+          RenderPath {rect} at (10,10) size 15x15 [fill={[type=SOLID] [color=#008000]}] [data="M10.00,10.00 L25.00,10.00 L25.00,25.00 L10.00,25.00 Z"]
+        RenderSVGResourcePattern {pattern} [id="pattern2"] [patternUnits=objectBoundingBox] [patternContentUnits=userSpaceOnUse]
+          RenderPath {circle} at (0,0) size 20x20 [fill={[type=SOLID] [color=#FF0000]}] [data="M20.00,10.00 L19.98,10.63 L19.92,11.25 L19.82,11.87 L19.69,12.49 L19.51,13.09 L19.30,13.68 L19.05,14.26 L18.76,14.82 L18.44,15.36 L18.09,15.88 L17.71,16.37 L17.29,16.85 L16.85,17.29 L16.37,17.71 L15.88,18.09 L15.36,18.44 L14.82,18.76 L14.26,19.05 L13.68,19.30 L13.09,19.51 L12.49,19.69 L11.87,19.82 L11.25,19.92 L10.63,19.98 L10.00,20.00 L9.37,19.98 L8.75,19.92 L8.13,19.82 L7.51,19.69 L6.91,19.51 L6.32,19.30 L5.74,19.05 L5.18,18.76 L4.64,18.44 L4.12,18.09 L3.63,17.71 L3.15,17.29 L2.71,16.85 L2.29,16.37 L1.91,15.88 L1.56,15.36 L1.24,14.82 L0.95,14.26 L0.70,13.68 L0.49,13.09 L0.31,12.49 L0.18,11.87 L0.08,11.25 L0.02,10.63 L0.00,10.00 L0.02,9.37 L0.08,8.75 L0.18,8.13 L0.31,7.51 L0.49,6.91 L0.70,6.32 L0.95,5.74 L1.24,5.18 L1.56,4.64 L1.91,4.12 L2.29,3.63 L2.71,3.15 L3.15,2.71 L3.63,2.29 L4.12,1.91 L4.64,1.56 L5.18,1.24 L5.74,0.95 L6.32,0.70 L6.91,0.49 L7.51,0.31 L8.13,0.18 L8.75,0.08 L9.37,0.02 L10.00,0.00 L10.63,0.02 L11.25,0.08 L11.87,0.18 L12.49,0.31 L13.09,0.49 L13.68,0.70 L14.26,0.95 L14.82,1.24 L15.36,1.56 L15.88,1.91 L16.37,2.29 L16.85,2.71 L17.29,3.15 L17.71,3.63 L18.09,4.12 L18.44,4.64 L18.76,5.18 L19.05,5.74 L19.30,6.32 L19.51,6.91 L19.69,7.51 L19.82,8.13 L19.92,8.75 L19.98,9.37 Z"]
+          RenderPath {rect} at (10,10) size 15x15 [fill={[type=SOLID] [color=#008000]}] [data="M10.00,10.00 L25.00,10.00 L25.00,25.00 L10.00,25.00 Z"]
+        RenderSVGResourcePattern {pattern} [id="pattern3"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
+          RenderPath {circle} at (0,0) size 20x20 [fill={[type=SOLID] [color=#FF0000]}] [data="M20.00,10.00 L19.98,10.63 L19.92,11.25 L19.82,11.87 L19.69,12.49 L19.51,13.09 L19.30,13.68 L19.05,14.26 L18.76,14.82 L18.44,15.36 L18.09,15.88 L17.71,16.37 L17.29,16.85 L16.85,17.29 L16.37,17.71 L15.88,18.09 L15.36,18.44 L14.82,18.76 L14.26,19.05 L13.68,19.30 L13.09,19.51 L12.49,19.69 L11.87,19.82 L11.25,19.92 L10.63,19.98 L10.00,20.00 L9.37,19.98 L8.75,19.92 L8.13,19.82 L7.51,19.69 L6.91,19.51 L6.32,19.30 L5.74,19.05 L5.18,18.76 L4.64,18.44 L4.12,18.09 L3.63,17.71 L3.15,17.29 L2.71,16.85 L2.29,16.37 L1.91,15.88 L1.56,15.36 L1.24,14.82 L0.95,14.26 L0.70,13.68 L0.49,13.09 L0.31,12.49 L0.18,11.87 L0.08,11.25 L0.02,10.63 L0.00,10.00 L0.02,9.37 L0.08,8.75 L0.18,8.13 L0.31,7.51 L0.49,6.91 L0.70,6.32 L0.95,5.74 L1.24,5.18 L1.56,4.64 L1.91,4.12 L2.29,3.63 L2.71,3.15 L3.15,2.71 L3.63,2.29 L4.12,1.91 L4.64,1.56 L5.18,1.24 L5.74,0.95 L6.32,0.70 L6.91,0.49 L7.51,0.31 L8.13,0.18 L8.75,0.08 L9.37,0.02 L10.00,0.00 L10.63,0.02 L11.25,0.08 L11.87,0.18 L12.49,0.31 L13.09,0.49 L13.68,0.70 L14.26,0.95 L14.82,1.24 L15.36,1.56 L15.88,1.91 L16.37,2.29 L16.85,2.71 L17.29,3.15 L17.71,3.63 L18.09,4.12 L18.44,4.64 L18.76,5.18 L19.05,5.74 L19.30,6.32 L19.51,6.91 L19.69,7.51 L19.82,8.13 L19.92,8.75 L19.98,9.37 Z"]
+          RenderPath {rect} at (10,10) size 15x15 [fill={[type=SOLID] [color=#008000]}] [data="M10.00,10.00 L25.00,10.00 L25.00,25.00 L10.00,25.00 Z"]
+        RenderSVGResourcePattern {pattern} [id="pattern4"] [patternUnits=objectBoundingBox] [patternContentUnits=objectBoundingBox]
+          RenderPath {circle} at (0,0) size 1x1 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.50,0.33 L0.50,0.35 L0.50,0.36 L0.50,0.38 L0.49,0.40 L0.49,0.41 L0.48,0.43 L0.48,0.44 L0.47,0.45 L0.46,0.47 L0.45,0.48 L0.44,0.49 L0.43,0.50 L0.42,0.52 L0.41,0.53 L0.40,0.54 L0.38,0.54 L0.37,0.55 L0.36,0.56 L0.34,0.57 L0.33,0.57 L0.31,0.58 L0.30,0.58 L0.28,0.58 L0.27,0.58 L0.25,0.58 L0.23,0.58 L0.22,0.58 L0.20,0.58 L0.19,0.58 L0.17,0.57 L0.16,0.57 L0.14,0.56 L0.13,0.55 L0.12,0.54 L0.10,0.54 L0.09,0.53 L0.08,0.52 L0.07,0.50 L0.06,0.49 L0.05,0.48 L0.04,0.47 L0.03,0.45 L0.02,0.44 L0.02,0.43 L0.01,0.41 L0.01,0.40 L0.00,0.38 L0.00,0.36 L0.00,0.35 L0.00,0.33 L0.00,0.32 L0.00,0.30 L0.00,0.29 L0.01,0.27 L0.01,0.26 L0.02,0.24 L0.02,0.23 L0.03,0.21 L0.04,0.20 L0.05,0.19 L0.06,0.17 L0.07,0.16 L0.08,0.15 L0.09,0.14 L0.10,0.13 L0.12,0.12 L0.13,0.11 L0.14,0.11 L0.16,0.10 L0.17,0.10 L0.19,0.09 L0.20,0.09 L0.22,0.09 L0.23,0.08 L0.25,0.08 L0.27,0.08 L0.28,0.09 L0.30,0.09 L0.31,0.09 L0.33,0.10 L0.34,0.10 L0.36,0.11 L0.37,0.11 L0.38,0.12 L0.40,0.13 L0.41,0.14 L0.42,0.15 L0.43,0.16 L0.44,0.17 L0.45,0.19 L0.46,0.20 L0.47,0.21 L0.48,0.23 L0.48,0.24 L0.49,0.26 L0.49,0.27 L0.50,0.29 L0.50,0.30 L0.50,0.32 Z"]
+          RenderPath {rect} at (0,0) size 1x1 [fill={[type=SOLID] [color=#008000]}] [data="M0.25,0.33 L0.62,0.33 L0.62,0.83 L0.25,0.83 Z"]
+        RenderSVGResourcePattern {pattern} [id="pattern5"] [patternUnits=objectBoundingBox] [patternContentUnits=objectBoundingBox]
+          RenderPath {circle} at (0,0) size 1x1 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.50,0.33 L0.50,0.35 L0.50,0.36 L0.50,0.38 L0.49,0.40 L0.49,0.41 L0.48,0.43 L0.48,0.44 L0.47,0.45 L0.46,0.47 L0.45,0.48 L0.44,0.49 L0.43,0.50 L0.42,0.52 L0.41,0.53 L0.40,0.54 L0.38,0.54 L0.37,0.55 L0.36,0.56 L0.34,0.57 L0.33,0.57 L0.31,0.58 L0.30,0.58 L0.28,0.58 L0.27,0.58 L0.25,0.58 L0.23,0.58 L0.22,0.58 L0.20,0.58 L0.19,0.58 L0.17,0.57 L0.16,0.57 L0.14,0.56 L0.13,0.55 L0.12,0.54 L0.10,0.54 L0.09,0.53 L0.08,0.52 L0.07,0.50 L0.06,0.49 L0.05,0.48 L0.04,0.47 L0.03,0.45 L0.02,0.44 L0.02,0.43 L0.01,0.41 L0.01,0.40 L0.00,0.38 L0.00,0.36 L0.00,0.35 L0.00,0.33 L0.00,0.32 L0.00,0.30 L0.00,0.29 L0.01,0.27 L0.01,0.26 L0.02,0.24 L0.02,0.23 L0.03,0.21 L0.04,0.20 L0.05,0.19 L0.06,0.17 L0.07,0.16 L0.08,0.15 L0.09,0.14 L0.10,0.13 L0.12,0.12 L0.13,0.11 L0.14,0.11 L0.16,0.10 L0.17,0.10 L0.19,0.09 L0.20,0.09 L0.22,0.09 L0.23,0.08 L0.25,0.08 L0.27,0.08 L0.28,0.09 L0.30,0.09 L0.31,0.09 L0.33,0.10 L0.34,0.10 L0.36,0.11 L0.37,0.11 L0.38,0.12 L0.40,0.13 L0.41,0.14 L0.42,0.15 L0.43,0.16 L0.44,0.17 L0.45,0.19 L0.46,0.20 L0.47,0.21 L0.48,0.23 L0.48,0.24 L0.49,0.26 L0.49,0.27 L0.50,0.29 L0.50,0.30 L0.50,0.32 Z"]
+          RenderPath {rect} at (0,0) size 1x1 [fill={[type=SOLID] [color=#008000]}] [data="M0.25,0.33 L0.62,0.33 L0.62,0.83 L0.25,0.83 Z"]
+        RenderSVGResourcePattern {pattern} [id="pattern6"] [patternUnits=userSpaceOnUse] [patternContentUnits=objectBoundingBox]
+          RenderPath {circle} at (0,0) size 1x1 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.50,0.33 L0.50,0.35 L0.50,0.36 L0.50,0.38 L0.49,0.40 L0.49,0.41 L0.48,0.43 L0.48,0.44 L0.47,0.45 L0.46,0.47 L0.45,0.48 L0.44,0.49 L0.43,0.50 L0.42,0.52 L0.41,0.53 L0.40,0.54 L0.38,0.54 L0.37,0.55 L0.36,0.56 L0.34,0.57 L0.33,0.57 L0.31,0.58 L0.30,0.58 L0.28,0.58 L0.27,0.58 L0.25,0.58 L0.23,0.58 L0.22,0.58 L0.20,0.58 L0.19,0.58 L0.17,0.57 L0.16,0.57 L0.14,0.56 L0.13,0.55 L0.12,0.54 L0.10,0.54 L0.09,0.53 L0.08,0.52 L0.07,0.50 L0.06,0.49 L0.05,0.48 L0.04,0.47 L0.03,0.45 L0.02,0.44 L0.02,0.43 L0.01,0.41 L0.01,0.40 L0.00,0.38 L0.00,0.36 L0.00,0.35 L0.00,0.33 L0.00,0.32 L0.00,0.30 L0.00,0.29 L0.01,0.27 L0.01,0.26 L0.02,0.24 L0.02,0.23 L0.03,0.21 L0.04,0.20 L0.05,0.19 L0.06,0.17 L0.07,0.16 L0.08,0.15 L0.09,0.14 L0.10,0.13 L0.12,0.12 L0.13,0.11 L0.14,0.11 L0.16,0.10 L0.17,0.10 L0.19,0.09 L0.20,0.09 L0.22,0.09 L0.23,0.08 L0.25,0.08 L0.27,0.08 L0.28,0.09 L0.30,0.09 L0.31,0.09 L0.33,0.10 L0.34,0.10 L0.36,0.11 L0.37,0.11 L0.38,0.12 L0.40,0.13 L0.41,0.14 L0.42,0.15 L0.43,0.16 L0.44,0.17 L0.45,0.19 L0.46,0.20 L0.47,0.21 L0.48,0.23 L0.48,0.24 L0.49,0.26 L0.49,0.27 L0.50,0.29 L0.50,0.30 L0.50,0.32 Z"]
+          RenderPath {rect} at (0,0) size 1x1 [fill={[type=SOLID] [color=#008000]}] [data="M0.25,0.33 L0.62,0.33 L0.62,0.83 L0.25,0.83 Z"]
+        RenderSVGResourcePattern {pattern} [id="pattern7"] [patternUnits=userSpaceOnUse] [patternContentUnits=objectBoundingBox]
+          RenderPath {circle} at (0,0) size 40x40 [fill={[type=SOLID] [color=#FF0000]}] [data="M40.00,20.00 L39.96,21.26 L39.84,22.51 L39.65,23.75 L39.37,24.97 L39.02,26.18 L38.60,27.36 L38.10,28.52 L37.53,29.64 L36.89,30.72 L36.18,31.76 L35.41,32.75 L34.58,33.69 L33.69,34.58 L32.75,35.41 L31.76,36.18 L30.72,36.89 L29.64,37.53 L28.52,38.10 L27.36,38.60 L26.18,39.02 L24.97,39.37 L23.75,39.65 L22.51,39.84 L21.26,39.96 L20.00,40.00 L18.74,39.96 L17.49,39.84 L16.25,39.65 L15.03,39.37 L13.82,39.02 L12.64,38.60 L11.48,38.10 L10.36,37.53 L9.28,36.89 L8.24,36.18 L7.25,35.41 L6.31,34.58 L5.42,33.69 L4.59,32.75 L3.82,31.76 L3.11,30.72 L2.47,29.64 L1.90,28.52 L1.40,27.36 L0.98,26.18 L0.63,24.97 L0.35,23.75 L0.16,22.51 L0.04,21.26 L0.00,20.00 L0.04,18.74 L0.16,17.49 L0.35,16.25 L0.63,15.03 L0.98,13.82 L1.40,12.64 L1.90,11.48 L2.47,10.36 L3.11,9.28 L3.82,8.24 L4.59,7.25 L5.42,6.31 L6.31,5.42 L7.25,4.59 L8.24,3.82 L9.28,3.11 L10.36,2.47 L11.48,1.90 L12.64,1.40 L13.82,0.98 L15.03,0.63 L16.25,0.35 L17.49,0.16 L18.74,0.04 L20.00,0.00 L21.26,0.04 L22.51,0.16 L23.75,0.35 L24.97,0.63 L26.18,0.98 L27.36,1.40 L28.52,1.90 L29.64,2.47 L30.72,3.11 L31.76,3.82 L32.75,4.59 L33.69,5.42 L34.58,6.31 L35.41,7.25 L36.18,8.24 L36.89,9.28 L37.53,10.36 L38.10,11.48 L38.60,12.64 L39.02,13.82 L39.37,15.03 L39.65,16.25 L39.84,17.49 L39.96,18.74 Z"]
+        RenderSVGResourcePattern {pattern} [id="pattern8"] [patternUnits=userSpaceOnUse] [patternContentUnits=objectBoundingBox]
+          RenderPath {circle} at (0,0) size 40x40 [fill={[type=SOLID] [color=#FF0000]}] [data="M40.00,20.00 L39.96,21.26 L39.84,22.51 L39.65,23.75 L39.37,24.97 L39.02,26.18 L38.60,27.36 L38.10,28.52 L37.53,29.64 L36.89,30.72 L36.18,31.76 L35.41,32.75 L34.58,33.69 L33.69,34.58 L32.75,35.41 L31.76,36.18 L30.72,36.89 L29.64,37.53 L28.52,38.10 L27.36,38.60 L26.18,39.02 L24.97,39.37 L23.75,39.65 L22.51,39.84 L21.26,39.96 L20.00,40.00 L18.74,39.96 L17.49,39.84 L16.25,39.65 L15.03,39.37 L13.82,39.02 L12.64,38.60 L11.48,38.10 L10.36,37.53 L9.28,36.89 L8.24,36.18 L7.25,35.41 L6.31,34.58 L5.42,33.69 L4.59,32.75 L3.82,31.76 L3.11,30.72 L2.47,29.64 L1.90,28.52 L1.40,27.36 L0.98,26.18 L0.63,24.97 L0.35,23.75 L0.16,22.51 L0.04,21.26 L0.00,20.00 L0.04,18.74 L0.16,17.49 L0.35,16.25 L0.63,15.03 L0.98,13.82 L1.40,12.64 L1.90,11.48 L2.47,10.36 L3.11,9.28 L3.82,8.24 L4.59,7.25 L5.42,6.31 L6.31,5.42 L7.25,4.59 L8.24,3.82 L9.28,3.11 L10.36,2.47 L11.48,1.90 L12.64,1.40 L13.82,0.98 L15.03,0.63 L16.25,0.35 L17.49,0.16 L18.74,0.04 L20.00,0.00 L21.26,0.04 L22.51,0.16 L23.75,0.35 L24.97,0.63 L26.18,0.98 L27.36,1.40 L28.52,1.90 L29.64,2.47 L30.72,3.11 L31.76,3.82 L32.75,4.59 L33.69,5.42 L34.58,6.31 L35.41,7.25 L36.18,8.24 L36.89,9.28 L37.53,10.36 L38.10,11.48 L38.60,12.64 L39.02,13.82 L39.37,15.03 L39.65,16.25 L39.84,17.49 L39.96,18.74 Z"]
+        RenderSVGResourceRadialGradient {radialGradient} [id="redToYellow"] [gradientUnits=objectBoundingBox] [center=(0.50,0.50)] [focal=(0.50,0.50)] [radius=0.50]
+          RenderSVGGradientStop {stop} [offset=0.00] [color=#FF0000]
+          RenderSVGGradientStop {stop} [offset=1.00] [color=#FFFF00]
+        RenderSVGResourcePattern {pattern} [id="pattern9"] [patternUnits=userSpaceOnUse] [patternContentUnits=objectBoundingBox]
+          RenderPath {circle} at (0,0) size 60x60 [fill={[type=RADIAL-GRADIENT] [id="redToYellow"]}] [data="M60.00,20.00 L59.92,22.51 L59.68,25.01 L59.29,27.50 L58.74,29.95 L58.04,32.36 L57.19,34.72 L56.19,37.03 L55.05,39.27 L53.77,41.43 L52.36,43.51 L50.82,45.50 L49.16,47.38 L47.38,49.16 L45.50,50.82 L43.51,52.36 L41.43,53.77 L39.27,55.05 L37.03,56.19 L34.72,57.19 L32.36,58.04 L29.95,58.74 L27.50,59.29 L25.01,59.68 L22.51,59.92 L20.00,60.00 L17.49,59.92 L14.99,59.68 L12.50,59.29 L10.05,58.74 L7.64,58.04 L5.28,57.19 L2.97,56.19 L0.73,55.05 L-1.43,53.77 L-3.51,52.36 L-5.50,50.82 L-7.38,49.16 L-9.16,47.38 L-10.82,45.50 L-12.36,43.51 L-13.77,41.43 L-15.05,39.27 L-16.19,37.03 L-17.19,34.72 L-18.04,32.36 L-18.74,29.95 L-19.29,27.50 L-19.68,25.01 L-19.92,22.51 L-20.00,20.00 L-19.92,17.49 L-19.68,14.99 L-19.29,12.50 L-18.74,10.05 L-18.04,7.64 L-17.19,5.28 L-16.19,2.97 L-15.05,0.73 L-13.77,-1.43 L-12.36,-3.51 L-10.82,-5.50 L-9.16,-7.38 L-7.38,-9.16 L-5.50,-10.82 L-3.51,-12.36 L-1.43,-13.77 L0.73,-15.05 L2.97,-16.19 L5.28,-17.19 L7.64,-18.04 L10.05,-18.74 L12.50,-19.29 L14.99,-19.68 L17.49,-19.92 L20.00,-20.00 L22.51,-19.92 L25.01,-19.68 L27.50,-19.29 L29.95,-18.74 L32.36,-18.04 L34.72,-17.19 L37.03,-16.19 L39.27,-15.05 L41.43,-13.77 L43.51,-12.36 L45.50,-10.82 L47.38,-9.16 L49.16,-7.38 L50.82,-5.50 L52.36,-3.51 L53.77,-1.43 L55.05,0.73 L56.19,2.97 L57.19,5.28 L58.04,7.64 L58.74,10.05 L59.29,12.50 L59.68,14.99 L59.92,17.49 Z"]
+      RenderSVGContainer {g} at (14,108) size 410x293 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-5.00,100.00)}]
+        RenderSVGContainer {g} at (14,108) size 135x44
+          RenderPath {rect} at (14,119) size 42x32 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=PATTERN] [id="pattern1"]}] [data="M20.00,20.00 L60.00,20.00 L60.00,50.00 L20.00,50.00 Z"]
+          RenderSVGContainer {g} at (15,108) size 134x44 [transform={m=((1.00,0.00)(0.00,1.00)) t=(20.00,20.00)}]
+            RenderSVGText {text} at (0,-12) size 37x13 contains 1 chunk(s)
+              RenderSVGInlineText {#text} at (0,0) size 37x13
+                chunk 1 text run 1 at (0.00,-2.00) startOffset 0 endOffset 9 width 37.00: "#pattern1"
+            RenderSVGContainer {g} at (65,119) size 84x33 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,9.00)}]
+              RenderSVGText {text} at (0,-10) size 82x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 82x13
+                  chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 20 width 82.00: "patternUnits=default"
+              RenderSVGText {text} at (0,0) size 84x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 84x13
+                  chunk 1 text run 1 at (0.00,10.00) startOffset 0 endOffset 20 width 84.00: "contentUnits=default"
+              RenderSVGText {text} at (0,10) size 47x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 47x13
+                  chunk 1 text run 1 at (0.00,20.00) startOffset 0 endOffset 10 width 47.00: "no viewbox"
+        RenderSVGContainer {g} at (14,158) size 187x43
+          RenderPath {rect} at (14,169) size 42x32 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=PATTERN] [id="pattern2"]}] [data="M20.00,70.00 L60.00,70.00 L60.00,100.00 L20.00,100.00 Z"]
+          RenderSVGContainer {g} at (15,158) size 186x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(20.00,70.00)}]
+            RenderSVGText {text} at (0,-12) size 37x13 contains 1 chunk(s)
+              RenderSVGInlineText {#text} at (0,0) size 37x13
+                chunk 1 text run 1 at (0.00,-2.00) startOffset 0 endOffset 9 width 37.00: "#pattern2"
+            RenderSVGContainer {g} at (65,169) size 136x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,9.00)}]
+              RenderSVGText {text} at (0,-10) size 136x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 136x13
+                  chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 30 width 136.00: "patternUnits=objectBoundingBox"
+              RenderSVGText {text} at (0,0) size 84x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 84x13
+                  chunk 1 text run 1 at (0.00,10.00) startOffset 0 endOffset 20 width 84.00: "contentUnits=default"
+        RenderSVGContainer {g} at (14,208) size 172x44
+          RenderPath {rect} at (14,219) size 42x32 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=PATTERN] [id="pattern3"]}] [data="M20.00,120.00 L60.00,120.00 L60.00,150.00 L20.00,150.00 Z"]
+          RenderSVGContainer {g} at (15,208) size 171x44 [transform={m=((1.00,0.00)(0.00,1.00)) t=(20.00,120.00)}]
+            RenderSVGText {text} at (0,-12) size 37x13 contains 1 chunk(s)
+              RenderSVGInlineText {#text} at (0,0) size 37x13
+                chunk 1 text run 1 at (0.00,-2.00) startOffset 0 endOffset 9 width 37.00: "#pattern3"
+            RenderSVGContainer {g} at (65,219) size 121x33 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,9.00)}]
+              RenderSVGText {text} at (0,-10) size 121x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 121x13
+                  chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 27 width 121.00: "patternUnits=userSpaceOnUse"
+              RenderSVGText {text} at (0,0) size 84x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 84x13
+                  chunk 1 text run 1 at (0.00,10.00) startOffset 0 endOffset 20 width 84.00: "contentUnits=default"
+              RenderSVGText {text} at (0,10) size 68x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 68x13
+                  chunk 1 text run 1 at (0.00,20.00) startOffset 0 endOffset 16 width 68.00: "overflow=visible"
+        RenderSVGContainer {g} at (14,258) size 189x44
+          RenderPath {rect} at (14,269) size 42x32 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=PATTERN] [id="pattern4"]}] [data="M20.00,170.00 L60.00,170.00 L60.00,200.00 L20.00,200.00 Z"]
+          RenderSVGContainer {g} at (15,258) size 188x44 [transform={m=((1.00,0.00)(0.00,1.00)) t=(20.00,170.00)}]
+            RenderSVGText {text} at (0,-12) size 37x13 contains 1 chunk(s)
+              RenderSVGInlineText {#text} at (0,0) size 37x13
+                chunk 1 text run 1 at (0.00,-2.00) startOffset 0 endOffset 9 width 37.00: "#pattern4"
+            RenderSVGContainer {g} at (65,269) size 138x33 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,9.00)}]
+              RenderSVGText {text} at (0,-10) size 82x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 82x13
+                  chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 20 width 82.00: "patternUnits=default"
+              RenderSVGText {text} at (0,0) size 138x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 138x13
+                  chunk 1 text run 1 at (0.00,10.00) startOffset 0 endOffset 30 width 138.00: "contentUnits=objectBoundingBox"
+              RenderSVGText {text} at (0,10) size 68x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 68x13
+                  chunk 1 text run 1 at (0.00,20.00) startOffset 0 endOffset 16 width 68.00: "overflow=visible"
+        RenderSVGContainer {g} at (14,308) size 189x43
+          RenderPath {rect} at (14,319) size 42x32 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=PATTERN] [id="pattern5"]}] [data="M20.00,220.00 L60.00,220.00 L60.00,250.00 L20.00,250.00 Z"]
+          RenderSVGContainer {g} at (15,308) size 188x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(20.00,220.00)}]
+            RenderSVGText {text} at (0,-12) size 37x13 contains 1 chunk(s)
+              RenderSVGInlineText {#text} at (0,0) size 37x13
+                chunk 1 text run 1 at (0.00,-2.00) startOffset 0 endOffset 9 width 37.00: "#pattern5"
+            RenderSVGContainer {g} at (65,319) size 138x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,9.00)}]
+              RenderSVGText {text} at (0,-10) size 136x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 136x13
+                  chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 30 width 136.00: "patternUnits=objectBoundingBox"
+              RenderSVGText {text} at (0,0) size 138x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 138x13
+                  chunk 1 text run 1 at (0.00,10.00) startOffset 0 endOffset 30 width 138.00: "contentUnits=objectBoundingBox"
+        RenderSVGContainer {g} at (14,358) size 189x43
+          RenderPath {rect} at (14,369) size 42x32 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=PATTERN] [id="pattern6"]}] [data="M20.00,270.00 L60.00,270.00 L60.00,300.00 L20.00,300.00 Z"]
+          RenderSVGContainer {g} at (15,358) size 188x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(20.00,270.00)}]
+            RenderSVGText {text} at (0,-12) size 37x13 contains 1 chunk(s)
+              RenderSVGInlineText {#text} at (0,0) size 37x13
+                chunk 1 text run 1 at (0.00,-2.00) startOffset 0 endOffset 9 width 37.00: "#pattern6"
+            RenderSVGContainer {g} at (65,369) size 138x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,9.00)}]
+              RenderSVGText {text} at (0,-10) size 121x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 121x13
+                  chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 27 width 121.00: "patternUnits=userSpaceOnUse"
+              RenderSVGText {text} at (0,0) size 138x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 138x13
+                  chunk 1 text run 1 at (0.00,10.00) startOffset 0 endOffset 30 width 138.00: "contentUnits=objectBoundingBox"
+        RenderSVGContainer {g} at (219,108) size 196x44
+          RenderPath {rect} at (219,119) size 42x32 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=PATTERN] [id="pattern7"]}] [data="M225.00,20.00 L265.00,20.00 L265.00,50.00 L225.00,50.00 Z"]
+          RenderSVGContainer {g} at (220,108) size 195x44 [transform={m=((1.00,0.00)(0.00,1.00)) t=(225.00,20.00)}]
+            RenderSVGText {text} at (0,-12) size 37x13 contains 1 chunk(s)
+              RenderSVGInlineText {#text} at (0,0) size 37x13
+                chunk 1 text run 1 at (0.00,-2.00) startOffset 0 endOffset 9 width 37.00: "#pattern7"
+            RenderSVGContainer {g} at (270,119) size 145x33 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,9.00)}]
+              RenderSVGText {text} at (0,-10) size 121x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 121x13
+                  chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 27 width 121.00: "patternUnits=userSpaceOnUse"
+              RenderSVGText {text} at (0,0) size 138x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 138x13
+                  chunk 1 text run 1 at (0.00,10.00) startOffset 0 endOffset 30 width 138.00: "contentUnits=objectBoundingBox"
+              RenderSVGText {text} at (0,10) size 145x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 145x13
+                  chunk 1 text run 1 at (0.00,20.00) startOffset 0 endOffset 32 width 145.00: "viewBox preserveAspectRatio=none"
+        RenderSVGContainer {g} at (219,158) size 205x43
+          RenderPath {rect} at (219,169) size 42x32 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=PATTERN] [id="pattern8"]}] [data="M225.00,70.00 L265.00,70.00 L265.00,100.00 L225.00,100.00 Z"]
+          RenderSVGContainer {g} at (220,158) size 204x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(225.00,70.00)}]
+            RenderSVGText {text} at (0,-12) size 37x13 contains 1 chunk(s)
+              RenderSVGInlineText {#text} at (0,0) size 37x13
+                chunk 1 text run 1 at (0.00,-2.00) startOffset 0 endOffset 9 width 37.00: "#pattern8"
+            RenderSVGContainer {g} at (270,169) size 154x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,9.00)}]
+              RenderSVGText {text} at (0,-10) size 92x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 92x13
+                  chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 22 width 92.00: "same as pattern#7 with"
+              RenderSVGText {text} at (0,0) size 154x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 154x13
+                  chunk 1 text run 1 at (0.00,10.00) startOffset 0 endOffset 33 width 154.00: "preserveAspectRatio=xMinYmin meet"
+        RenderSVGContainer {g} at (219,208) size 204x43
+          RenderPath {rect} at (219,219) size 42x32 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=PATTERN] [id="pattern9"]}] [data="M225.00,120.00 L265.00,120.00 L265.00,150.00 L225.00,150.00 Z"]
+          RenderSVGContainer {g} at (220,208) size 203x34 [transform={m=((1.00,0.00)(0.00,1.00)) t=(225.00,120.00)}]
+            RenderSVGText {text} at (0,-12) size 37x13 contains 1 chunk(s)
+              RenderSVGInlineText {#text} at (0,0) size 37x13
+                chunk 1 text run 1 at (0.00,-2.00) startOffset 0 endOffset 9 width 37.00: "#pattern9"
+            RenderSVGContainer {g} at (270,219) size 153x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,9.00)}]
+              RenderSVGText {text} at (0,-10) size 153x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 153x13
+                  chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 34 width 153.00: "preserveAspectRatio=xMinYmin slice"
+              RenderSVGText {text} at (0,0) size 68x13 contains 1 chunk(s)
+                RenderSVGInlineText {#text} at (0,0) size 68x13
+                  chunk 1 text run 1 at (0.00,10.00) startOffset 0 endOffset 16 width 68.00: "overflow=visible"
+    RenderSVGContainer {use} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/svg/batik/text/textEffect3-expected.checksum b/LayoutTests/platform/mac/svg/batik/text/textEffect3-expected.checksum
index 75c72b0..7586b86 100644
--- a/LayoutTests/platform/mac/svg/batik/text/textEffect3-expected.checksum
+++ b/LayoutTests/platform/mac/svg/batik/text/textEffect3-expected.checksum
@@ -1 +1 @@
-11ee970a315adb062f1c0c3960253ff5
\ No newline at end of file
+b91bfbae656fa5ee0077bff088f5c829
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/batik/text/textEffect3-expected.png b/LayoutTests/platform/mac/svg/batik/text/textEffect3-expected.png
index f25442e..60852aa 100644
Binary files a/LayoutTests/platform/mac/svg/batik/text/textEffect3-expected.png and b/LayoutTests/platform/mac/svg/batik/text/textEffect3-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/absolute-sized-content-with-resources-expected.checksum b/LayoutTests/platform/mac/svg/custom/absolute-sized-content-with-resources-expected.checksum
index b045fb9..b5c5faf 100644
--- a/LayoutTests/platform/mac/svg/custom/absolute-sized-content-with-resources-expected.checksum
+++ b/LayoutTests/platform/mac/svg/custom/absolute-sized-content-with-resources-expected.checksum
@@ -1 +1 @@
-5ec85bc07a87a4d0ca1b5fb065924a60
\ No newline at end of file
+f482ede9c5fc18f3f09a70545af6ba67
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/absolute-sized-content-with-resources-expected.png b/LayoutTests/platform/mac/svg/custom/absolute-sized-content-with-resources-expected.png
index 156fffb..13f6fe3 100644
Binary files a/LayoutTests/platform/mac/svg/custom/absolute-sized-content-with-resources-expected.png and b/LayoutTests/platform/mac/svg/custom/absolute-sized-content-with-resources-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/grayscale-gradient-mask-expected.checksum b/LayoutTests/platform/mac/svg/custom/grayscale-gradient-mask-expected.checksum
index 87aa7fd..7d9698c 100644
--- a/LayoutTests/platform/mac/svg/custom/grayscale-gradient-mask-expected.checksum
+++ b/LayoutTests/platform/mac/svg/custom/grayscale-gradient-mask-expected.checksum
@@ -1 +1 @@
-63c76778f56ccf67c8ad2e82f15dc4e4
\ No newline at end of file
+c9fa987aacc7c5064491999daceb0d4f
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/grayscale-gradient-mask-expected.png b/LayoutTests/platform/mac/svg/custom/grayscale-gradient-mask-expected.png
index 4a16987..f234cad 100644
Binary files a/LayoutTests/platform/mac/svg/custom/grayscale-gradient-mask-expected.png and b/LayoutTests/platform/mac/svg/custom/grayscale-gradient-mask-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/js-late-gradient-and-object-creation-expected.checksum b/LayoutTests/platform/mac/svg/custom/js-late-gradient-and-object-creation-expected.checksum
index 7addd51..3497fbe 100644
--- a/LayoutTests/platform/mac/svg/custom/js-late-gradient-and-object-creation-expected.checksum
+++ b/LayoutTests/platform/mac/svg/custom/js-late-gradient-and-object-creation-expected.checksum
@@ -1 +1 @@
-46e76ae579bcd950ad1d12ef2f47011c
\ No newline at end of file
+79c35c1f034795088b8a008729997baa
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/js-late-gradient-and-object-creation-expected.png b/LayoutTests/platform/mac/svg/custom/js-late-gradient-and-object-creation-expected.png
index d13de57..4ca098e 100644
Binary files a/LayoutTests/platform/mac/svg/custom/js-late-gradient-and-object-creation-expected.png and b/LayoutTests/platform/mac/svg/custom/js-late-gradient-and-object-creation-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/js-late-gradient-creation-expected.checksum b/LayoutTests/platform/mac/svg/custom/js-late-gradient-creation-expected.checksum
index acdb39e..742462b 100644
--- a/LayoutTests/platform/mac/svg/custom/js-late-gradient-creation-expected.checksum
+++ b/LayoutTests/platform/mac/svg/custom/js-late-gradient-creation-expected.checksum
@@ -1 +1 @@
-87e75f0addcc607586091e29d6c04383
\ No newline at end of file
+5c773fdbac0caadf1da7e9884f1c7cc4
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/js-late-gradient-creation-expected.png b/LayoutTests/platform/mac/svg/custom/js-late-gradient-creation-expected.png
index 30fe932..1086121 100644
Binary files a/LayoutTests/platform/mac/svg/custom/js-late-gradient-creation-expected.png and b/LayoutTests/platform/mac/svg/custom/js-late-gradient-creation-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/js-late-pattern-and-object-creation-expected.checksum b/LayoutTests/platform/mac/svg/custom/js-late-pattern-and-object-creation-expected.checksum
index 97669b6..a13d34e 100644
--- a/LayoutTests/platform/mac/svg/custom/js-late-pattern-and-object-creation-expected.checksum
+++ b/LayoutTests/platform/mac/svg/custom/js-late-pattern-and-object-creation-expected.checksum
@@ -1 +1 @@
-8308c9e57b259d3b4a9f124565590c8f
\ No newline at end of file
+c6c30a3bd31a02ebd6b725bb4a0666a2
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/js-late-pattern-and-object-creation-expected.png b/LayoutTests/platform/mac/svg/custom/js-late-pattern-and-object-creation-expected.png
index fcd8583..95c6ba6 100644
Binary files a/LayoutTests/platform/mac/svg/custom/js-late-pattern-and-object-creation-expected.png and b/LayoutTests/platform/mac/svg/custom/js-late-pattern-and-object-creation-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/js-late-pattern-creation-expected.checksum b/LayoutTests/platform/mac/svg/custom/js-late-pattern-creation-expected.checksum
index b4d7ca3..cb98d13 100644
--- a/LayoutTests/platform/mac/svg/custom/js-late-pattern-creation-expected.checksum
+++ b/LayoutTests/platform/mac/svg/custom/js-late-pattern-creation-expected.checksum
@@ -1 +1 @@
-9f0eec78b4540015d88ec6588d565530
\ No newline at end of file
+c3997aecd09346283f14b50130366f02
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/js-late-pattern-creation-expected.png b/LayoutTests/platform/mac/svg/custom/js-late-pattern-creation-expected.png
index 6ae7632..370234c 100644
Binary files a/LayoutTests/platform/mac/svg/custom/js-late-pattern-creation-expected.png and b/LayoutTests/platform/mac/svg/custom/js-late-pattern-creation-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-expected.checksum b/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-expected.checksum
index 6b78008..44577dc 100644
--- a/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-expected.checksum
+++ b/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-expected.checksum
@@ -1 +1 @@
-aed522607fddc44b2982b98b89492f0c
\ No newline at end of file
+1de108766c38d9a6aecbe8820941335d
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-expected.png b/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-expected.png
index 4d71854..8ef553d 100644
Binary files a/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-expected.png and b/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/pattern-incorrect-tiling-expected.checksum b/LayoutTests/platform/mac/svg/custom/pattern-incorrect-tiling-expected.checksum
new file mode 100644
index 0000000..a2a35d0
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/pattern-incorrect-tiling-expected.checksum
@@ -0,0 +1 @@
+360d8a46d1c40813df8bbe34ca86a34a
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/pattern-incorrect-tiling-expected.png b/LayoutTests/platform/mac/svg/custom/pattern-incorrect-tiling-expected.png
new file mode 100644
index 0000000..b3a8d5f
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/pattern-incorrect-tiling-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/pattern-incorrect-tiling-expected.txt b/LayoutTests/platform/mac/svg/custom/pattern-incorrect-tiling-expected.txt
new file mode 100644
index 0000000..5ed8c39
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/pattern-incorrect-tiling-expected.txt
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (27,86) size 346x165
+    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+      RenderSVGResourcePattern {pattern} [id="dot"] [patternUnits=objectBoundingBox] [patternContentUnits=userSpaceOnUse]
+        RenderPath {circle} at (10,40) size 20x20 [fill={[type=SOLID] [color=#000000]}] [data="M30.00,50.00 L29.98,50.63 L29.92,51.25 L29.82,51.87 L29.69,52.49 L29.51,53.09 L29.30,53.68 L29.05,54.26 L28.76,54.82 L28.44,55.36 L28.09,55.88 L27.71,56.37 L27.29,56.85 L26.85,57.29 L26.37,57.71 L25.88,58.09 L25.36,58.44 L24.82,58.76 L24.26,59.05 L23.68,59.30 L23.09,59.51 L22.49,59.69 L21.87,59.82 L21.25,59.92 L20.63,59.98 L20.00,60.00 L19.37,59.98 L18.75,59.92 L18.13,59.82 L17.51,59.69 L16.91,59.51 L16.32,59.30 L15.74,59.05 L15.18,58.76 L14.64,58.44 L14.12,58.09 L13.63,57.71 L13.15,57.29 L12.71,56.85 L12.29,56.37 L11.91,55.88 L11.56,55.36 L11.24,54.82 L10.95,54.26 L10.70,53.68 L10.49,53.09 L10.31,52.49 L10.18,51.87 L10.08,51.25 L10.02,50.63 L10.00,50.00 L10.02,49.37 L10.08,48.75 L10.18,48.13 L10.31,47.51 L10.49,46.91 L10.70,46.32 L10.95,45.74 L11.24,45.18 L11.56,44.64 L11.91,44.12 L12.29,43.63 L12.71,43.15 L13.15,42.71 L13.63,42.29 L14.12,41.91 L14.64,41.56 L15.18,41.24 L15.74,40.95 L16.32,40.70 L16.91,40.49 L17.51,40.31 L18.13,40.18 L18.75,40.08 L19.37,40.02 L20.00,40.00 L20.63,40.02 L21.25,40.08 L21.87,40.18 L22.49,40.31 L23.09,40.49 L23.68,40.70 L24.26,40.95 L24.82,41.24 L25.36,41.56 L25.88,41.91 L26.37,42.29 L26.85,42.71 L27.29,43.15 L27.71,43.63 L28.09,44.12 L28.44,44.64 L28.76,45.18 L29.05,45.74 L29.30,46.32 L29.51,46.91 L29.69,47.51 L29.82,48.13 L29.92,48.75 L29.98,49.37 Z"]
+    RenderSVGText {text} at (27,86) size 346x18 contains 1 chunk(s)
+      RenderSVGInlineText {#text} at (0,0) size 346x18
+        chunk 1 (middle anchor) text run 1 at (27.50,100.00) startOffset 0 endOffset 56 width 345.00: "There should be a black dot in the middle of the ellipse"
+    RenderPath {ellipse} at (179,149) size 42x102 [stroke={[type=SOLID] [color=#808080]}] [fill={[type=PATTERN] [id="dot"]}] [data="M220.00,200.00 L219.96,203.14 L219.84,206.27 L219.65,209.37 L219.37,212.43 L219.02,215.45 L218.60,218.41 L218.10,221.29 L217.53,224.09 L216.89,226.79 L216.18,229.39 L215.41,231.87 L214.58,234.23 L213.69,236.45 L212.75,238.53 L211.76,240.45 L210.72,242.22 L209.64,243.82 L208.52,245.24 L207.36,246.49 L206.18,247.55 L204.97,248.43 L203.75,249.11 L202.51,249.61 L201.26,249.90 L200.00,250.00 L198.74,249.90 L197.49,249.61 L196.25,249.11 L195.03,248.43 L193.82,247.55 L192.64,246.49 L191.48,245.24 L190.36,243.82 L189.28,242.22 L188.24,240.45 L187.25,238.53 L186.31,236.45 L185.42,234.23 L184.59,231.87 L183.82,229.39 L183.11,226.79 L182.47,224.09 L181.90,221.29 L181.40,218.41 L180.98,215.45 L180.63,212.43 L180.35,209.37 L180.16,206.27 L180.04,203.14 L180.00,200.00 L180.04,196.86 L180.16,193.73 L180.35,190.63 L180.63,187.57 L180.98,184.55 L181.40,181.59 L181.90,178.71 L182.47,175.91 L183.11,173.21 L183.82,170.61 L184.59,168.13 L185.42,165.77 L186.31,163.55 L187.25,161.47 L188.24,159.55 L189.28,157.78 L190.36,156.18 L191.48,154.76 L192.64,153.51 L193.82,152.45 L195.03,151.57 L196.25,150.89 L197.49,150.39 L198.74,150.10 L200.00,150.00 L201.26,150.10 L202.51,150.39 L203.75,150.89 L204.97,151.57 L206.18,152.45 L207.36,153.51 L208.52,154.76 L209.64,156.18 L210.72,157.78 L211.76,159.55 L212.75,161.47 L213.69,163.55 L214.58,165.77 L215.41,168.13 L216.18,170.61 L216.89,173.21 L217.53,175.91 L218.10,178.71 L218.60,181.59 L219.02,184.55 L219.37,187.57 L219.65,190.63 L219.84,193.73 L219.96,196.86 Z"]
diff --git a/LayoutTests/platform/mac/svg/custom/pattern-no-pixelation-expected.checksum b/LayoutTests/platform/mac/svg/custom/pattern-no-pixelation-expected.checksum
new file mode 100644
index 0000000..509922a
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/pattern-no-pixelation-expected.checksum
@@ -0,0 +1 @@
+577f6dcfd50b2d07310265b43fd309c9
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/pattern-no-pixelation-expected.png b/LayoutTests/platform/mac/svg/custom/pattern-no-pixelation-expected.png
new file mode 100644
index 0000000..3121f73
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/pattern-no-pixelation-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/pattern-no-pixelation-expected.txt b/LayoutTests/platform/mac/svg/custom/pattern-no-pixelation-expected.txt
new file mode 100644
index 0000000..c6b99aa
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/pattern-no-pixelation-expected.txt
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 400x400
+  RenderSVGRoot {svg} at (40,40) size 320x320
+    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+      RenderSVGResourcePattern {pattern} [id="fail"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
+        RenderPath {circle} at (0,0) size 30x30 [fill={[type=SOLID] [color=#FF0000]}] [data="M30.00,15.00 L29.97,15.94 L29.88,16.88 L29.73,17.81 L29.53,18.73 L29.27,19.64 L28.95,20.52 L28.57,21.39 L28.14,22.23 L27.66,23.04 L27.14,23.82 L26.56,24.56 L25.93,25.27 L25.27,25.93 L24.56,26.56 L23.82,27.14 L23.04,27.66 L22.23,28.14 L21.39,28.57 L20.52,28.95 L19.64,29.27 L18.73,29.53 L17.81,29.73 L16.88,29.88 L15.94,29.97 L15.00,30.00 L14.06,29.97 L13.12,29.88 L12.19,29.73 L11.27,29.53 L10.36,29.27 L9.48,28.95 L8.61,28.57 L7.77,28.14 L6.96,27.66 L6.18,27.14 L5.44,26.56 L4.73,25.93 L4.07,25.27 L3.44,24.56 L2.86,23.82 L2.34,23.04 L1.86,22.23 L1.43,21.39 L1.05,20.52 L0.73,19.64 L0.47,18.73 L0.27,17.81 L0.12,16.88 L0.03,15.94 L0.00,15.00 L0.03,14.06 L0.12,13.12 L0.27,12.19 L0.47,11.27 L0.73,10.36 L1.05,9.48 L1.43,8.61 L1.86,7.77 L2.34,6.96 L2.86,6.18 L3.44,5.44 L4.07,4.73 L4.73,4.07 L5.44,3.44 L6.18,2.86 L6.96,2.34 L7.77,1.86 L8.61,1.43 L9.48,1.05 L10.36,0.73 L11.27,0.47 L12.19,0.27 L13.12,0.12 L14.06,0.03 L15.00,0.00 L15.94,0.03 L16.88,0.12 L17.81,0.27 L18.73,0.47 L19.64,0.73 L20.52,1.05 L21.39,1.43 L22.23,1.86 L23.04,2.34 L23.82,2.86 L24.56,3.44 L25.27,4.07 L25.93,4.73 L26.56,5.44 L27.14,6.18 L27.66,6.96 L28.14,7.77 L28.57,8.61 L28.95,9.48 L29.27,10.36 L29.53,11.27 L29.73,12.19 L29.88,13.12 L29.97,14.06 Z"]
+    RenderPath {rect} at (40,40) size 320x320 [transform={m=((4.00,0.00)(0.00,4.00)) t=(200.00,200.00)}] [fill={[type=PATTERN] [id="fail"]}] [data="M-40.00,-40.00 L40.00,-40.00 L40.00,40.00 L-40.00,40.00 Z"]
diff --git a/LayoutTests/platform/mac/svg/custom/pattern-rotate-expected.checksum b/LayoutTests/platform/mac/svg/custom/pattern-rotate-expected.checksum
index dbe5ec6..3f4d687 100644
--- a/LayoutTests/platform/mac/svg/custom/pattern-rotate-expected.checksum
+++ b/LayoutTests/platform/mac/svg/custom/pattern-rotate-expected.checksum
@@ -1 +1 @@
-b910079c0613137e9ee541ddf1abc4df
\ No newline at end of file
+f0cf06c12fbe9b596610ead6226d1d59
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/pattern-rotate-expected.png b/LayoutTests/platform/mac/svg/custom/pattern-rotate-expected.png
index bdf5427..e74a66d 100644
Binary files a/LayoutTests/platform/mac/svg/custom/pattern-rotate-expected.png and b/LayoutTests/platform/mac/svg/custom/pattern-rotate-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/stroked-pattern-expected.checksum b/LayoutTests/platform/mac/svg/custom/stroked-pattern-expected.checksum
index fde3f90..de499a4 100644
--- a/LayoutTests/platform/mac/svg/custom/stroked-pattern-expected.checksum
+++ b/LayoutTests/platform/mac/svg/custom/stroked-pattern-expected.checksum
@@ -1 +1 @@
-c06a4d53b10f7a547bbb43ce01397453
\ No newline at end of file
+bcf7fba7a20c0338ccfe3a183a22753e
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/stroked-pattern-expected.png b/LayoutTests/platform/mac/svg/custom/stroked-pattern-expected.png
index 4e98492..070a969 100644
Binary files a/LayoutTests/platform/mac/svg/custom/stroked-pattern-expected.png and b/LayoutTests/platform/mac/svg/custom/stroked-pattern-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/text-rotated-gradient-expected.checksum b/LayoutTests/platform/mac/svg/custom/text-rotated-gradient-expected.checksum
index 24683a7..6cf5c52 100644
--- a/LayoutTests/platform/mac/svg/custom/text-rotated-gradient-expected.checksum
+++ b/LayoutTests/platform/mac/svg/custom/text-rotated-gradient-expected.checksum
@@ -1 +1 @@
-4773ecfd9ac32e3a52a3f05044357dde
\ No newline at end of file
+7c0fe736cb4ed2a2a51eb2458251e610
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/text-rotated-gradient-expected.png b/LayoutTests/platform/mac/svg/custom/text-rotated-gradient-expected.png
index 9ccc60b..227be6c 100644
Binary files a/LayoutTests/platform/mac/svg/custom/text-rotated-gradient-expected.png and b/LayoutTests/platform/mac/svg/custom/text-rotated-gradient-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.checksum b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.checksum
index 1e363ea..fbdc83b 100644
--- a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.checksum
+++ b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.checksum
@@ -1 +1 @@
-6669ab446ddc0ff912c784ee18705928
\ No newline at end of file
+5973d03ecc3ab2d4f4edff36b02328e3
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.png b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.png
index 1af8420..d51c509 100644
Binary files a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.png and b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.checksum b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.checksum
index eff0bf4..539a3a5 100644
--- a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.checksum
+++ b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.checksum
@@ -1 +1 @@
-cca7e1243ffc4052ae39c1729fe5676a
\ No newline at end of file
+f9cb7a9bc7c6d5d31caf343fe136103e
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.png b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.png
index 502c26c..5588050 100644
Binary files a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.png and b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.checksum b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.checksum
index 30381d7..dd1482c 100644
--- a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.checksum
+++ b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.checksum
@@ -1 +1 @@
-ca73b7faa6d86098712f37b66bbc1c82
\ No newline at end of file
+6170364f5719b85dfa538ddc5fe48a37
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.png b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.png
index 213ab16..128373a 100644
Binary files a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.png and b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.checksum b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.checksum
index 09953c7..1cbbc7c 100644
--- a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.checksum
+++ b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.checksum
@@ -1 +1 @@
-3019c8444d91d7c726cd6a6d2540fb1e
\ No newline at end of file
+3bc87b9c11d16f3d998b60c45a0ff03b
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.png b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.png
index ebd5806..7280fc3 100644
Binary files a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.png and b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.checksum b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.checksum
index 17243e7..66f06e2 100644
--- a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.checksum
+++ b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.checksum
@@ -1 +1 @@
-70ef44d927c6ad84a702c9771c169905
\ No newline at end of file
+d698c16c6186e5e3602b386edde585fe
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.png b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.png
index 4f9de10..db89074 100644
Binary files a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.png and b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.checksum b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.checksum
index 08476fd..c80cb31 100644
--- a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.checksum
+++ b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.checksum
@@ -1 +1 @@
-414528c414a3ad821d167564502995bb
\ No newline at end of file
+3fb4bd2e7c1921db18b25ea6715b201c
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.png b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.png
index 875a1bc..2e8dfc1 100644
Binary files a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.png and b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.checksum b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.checksum
index 0bf2dfc..16556c5 100644
--- a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.checksum
+++ b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.checksum
@@ -1 +1 @@
-51768de61cfef35e4c8f5d45029ffa8c
\ No newline at end of file
+71253f7a493b1654f9a75093c534976b
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.png b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.png
index 47dc0e6..c79f367 100644
Binary files a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.png and b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.checksum b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.checksum
index 947e381..8719c00 100644
--- a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.checksum
+++ b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.checksum
@@ -1 +1 @@
-d79313dfe1948cb30b740f17f7861030
\ No newline at end of file
+bdf60a2f7813120168c0bcf8093d85b9
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.png b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.png
index c7fd4df..952ff20 100644
Binary files a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.png and b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.checksum b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.checksum
index 8e1dda9..89ced6d 100644
--- a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.checksum
+++ b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.checksum
@@ -1 +1 @@
-bb05754e3fbf1cd483529bc6024a8e0e
\ No newline at end of file
+7c3ac5ccfaf94a6e497e1744d67646d3
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.png b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.png
index 986a69d..bb6aff7 100644
Binary files a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.png and b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.checksum b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.checksum
index 52d2298..a893192 100644
--- a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.checksum
+++ b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.checksum
@@ -1 +1 @@
-a3b34c5887a55c800641ee576b137d06
\ No newline at end of file
+03c6a78228148c49a441d4dfacc173d1
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.png b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.png
index aa8c59e..4314129 100644
Binary files a/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.png and b/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-dom-patternContentUnits-attr-expected.checksum b/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-dom-patternContentUnits-attr-expected.checksum
index 91c26cf..8abcc07 100644
--- a/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-dom-patternContentUnits-attr-expected.checksum
+++ b/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-dom-patternContentUnits-attr-expected.checksum
@@ -1 +1 @@
-0b0f4fb10795a2068e8cb2c01f16f5cf
\ No newline at end of file
+dd9f6ea06a1e5ef3c82260b8e9c90d6b
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-dom-patternContentUnits-attr-expected.png b/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-dom-patternContentUnits-attr-expected.png
index 17b384d..5f8daa2 100644
Binary files a/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-dom-patternContentUnits-attr-expected.png and b/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-dom-patternContentUnits-attr-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-svgdom-patternContentUnits-prop-expected.checksum b/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-svgdom-patternContentUnits-prop-expected.checksum
index 4653242..32773d7 100644
--- a/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-svgdom-patternContentUnits-prop-expected.checksum
+++ b/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-svgdom-patternContentUnits-prop-expected.checksum
@@ -1 +1 @@
-356e3c0c50be66958e884c7bc9a70c52
\ No newline at end of file
+88f5af9e80ed05c6be9936c13a6cd5f5
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-svgdom-patternContentUnits-prop-expected.png b/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-svgdom-patternContentUnits-prop-expected.png
index e097dce..404ff05 100644
Binary files a/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-svgdom-patternContentUnits-prop-expected.png and b/LayoutTests/platform/mac/svg/dynamic-updates/SVGPatternElement-svgdom-patternContentUnits-prop-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/text/selection-background-color-expected.checksum b/LayoutTests/platform/mac/svg/text/selection-background-color-expected.checksum
index 742f6d5..404cfa6 100644
--- a/LayoutTests/platform/mac/svg/text/selection-background-color-expected.checksum
+++ b/LayoutTests/platform/mac/svg/text/selection-background-color-expected.checksum
@@ -1 +1 @@
-b26973a208c70364f2afc2cd4a4e62b6
\ No newline at end of file
+1ad4cec1470600775011aa727d7a5c94
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/text/selection-background-color-expected.png b/LayoutTests/platform/mac/svg/text/selection-background-color-expected.png
index 6e190c1..3bf04ec 100644
Binary files a/LayoutTests/platform/mac/svg/text/selection-background-color-expected.png and b/LayoutTests/platform/mac/svg/text/selection-background-color-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.checksum b/LayoutTests/platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.checksum
new file mode 100644
index 0000000..b5317b4
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.checksum
@@ -0,0 +1 @@
+ab99a5d800d7ea930b1151158e14be69
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.png b/LayoutTests/platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.png
new file mode 100644
index 0000000..7d4cff9
Binary files /dev/null and b/LayoutTests/platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.txt b/LayoutTests/platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.txt
new file mode 100644
index 0000000..624eed4
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.txt
@@ -0,0 +1,55 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (0,83) size 430x461
+    RenderSVGContainer {g} at (0,83) size 430x461 [transform={m=((0.43,0.25)(-0.25,0.43)) t=(50.00,50.00)}]
+      RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+      RenderSVGText {text} at (10,7) size 139x16 contains 1 chunk(s)
+        RenderSVGInlineText {#text} at (0,0) size 139x16
+          chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 21 width 139.00: "Test for mask support"
+      RenderPath {rect} at (0,108) size 152x232 [fill={[type=SOLID] [color=#FF0000]}] [data="M10.00,30.00 L110.00,30.00 L110.00,290.00 L10.00,290.00 Z"]
+      RenderSVGResourceMasker {mask} [id="mask1"] [maskUnits=userSpaceOnUse] [maskContentUnits=userSpaceOnUse]
+        RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+          RenderSVGResourceLinearGradient {linearGradient} [id="Grad1"] [gradientUnits=userSpaceOnUse] [start=(60,50)] [end=(60,120)]
+            RenderSVGGradientStop {stop} [offset=0.00] [color=#FFFFFF]
+            RenderSVGGradientStop {stop} [offset=1.00] [color=#FFFFFF80]
+        RenderPath {rect} at (80,143) size 99x87 [fill={[type=LINEAR-GRADIENT] [id="Grad1"]}] [data="M60.00,50.00 L160.00,50.00 L160.00,110.00 L60.00,110.00 Z"]
+      RenderPath {rect} at (80,143) size 99x87 [fill={[type=SOLID] [color=#00FF00]}] [data="M60.00,50.00 L160.00,50.00 L160.00,110.00 L60.00,110.00 Z"]
+        [masker="mask1"] RenderSVGResourceMasker {mask} at (60,50) size 100x60
+      RenderSVGText {text} at (200,54) size 163x14 contains 1 chunk(s)
+        RenderSVGInlineText {#text} at (0,0) size 163x14
+          chunk 1 text run 1 at (200.00,65.00) startOffset 0 endOffset 30 width 163.00: "Mask with linear gradient from"
+      RenderSVGText {text} at (200,69) size 135x14 contains 1 chunk(s)
+        RenderSVGInlineText {#text} at (0,0) size 135x14
+          chunk 1 text run 1 at (200.00,80.00) startOffset 0 endOffset 25 width 135.00: "opacity=1 to opactity=0.5"
+      RenderSVGResourceMasker {mask} [id="mask2"] [maskUnits=userSpaceOnUse] [maskContentUnits=userSpaceOnUse]
+        RenderPath {rect} at (63,193) size 87x66 [fill={[type=SOLID] [color=#FFFFFF] [opacity=0.50]}] [data="M60.00,120.00 L160.00,120.00 L160.00,150.00 L60.00,150.00 Z"]
+      RenderPath {rect} at (63,193) size 87x66 [fill={[type=SOLID] [color=#00FF00]}] [data="M60.00,120.00 L160.00,120.00 L160.00,150.00 L60.00,150.00 Z"]
+        [masker="mask2"] RenderSVGResourceMasker {mask} at (60,120) size 100x30
+      RenderSVGText {text} at (200,124) size 173x14 contains 1 chunk(s)
+        RenderSVGInlineText {#text} at (0,0) size 173x14
+          chunk 1 text run 1 at (200.00,135.00) startOffset 0 endOffset 32 width 173.00: "Mask with uniform opacity of 0.5"
+      RenderPath {rect} at (46,223) size 88x66 [fill={[type=SOLID] [color=#00FF00] [opacity=0.50]}] [data="M60.00,160.00 L160.00,160.00 L160.00,190.00 L60.00,190.00 Z"]
+      RenderSVGText {text} at (200,164) size 200x14 contains 1 chunk(s)
+        RenderSVGInlineText {#text} at (0,0) size 200x14
+          chunk 1 text run 1 at (200.00,175.00) startOffset 0 endOffset 37 width 200.00: "Rectangle with uniform opacity of 0.5"
+      RenderSVGResourceMasker {mask} [id="mask3"] [maskUnits=userSpaceOnUse] [maskContentUnits=userSpaceOnUse]
+        RenderPath {rect} at (31,251) size 158x104 [fill={[type=SOLID] [color=#FFFFFF] [opacity=0.50]}] [data="M60.00,200.00 L260.00,200.00 L260.00,225.00 L60.00,225.00 Z"]
+        RenderPath {rect} at (21,270) size 158x104 [fill={[type=SOLID] [color=#FFFFFF] [opacity=0.20]}] [data="M60.00,225.00 L260.00,225.00 L260.00,250.00 L60.00,250.00 Z"]
+        RenderPath {rect} at (11,288) size 158x104 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M60.00,250.00 L260.00,250.00 L260.00,275.00 L60.00,275.00 Z"]
+        RenderPath {rect} at (0,306) size 157x103 [fill={[type=SOLID] [color=#FFFFFF] [opacity=0.70]}] [data="M60.00,275.00 L260.00,275.00 L260.00,300.00 L60.00,300.00 Z"]
+      RenderSVGText {text} at (60,198) size 126x110 contains 1 chunk(s)
+        [masker="mask3"] RenderSVGResourceMasker {mask} at (60,200) size 200x100
+        RenderSVGInlineText {#text} at (0,0) size 126x110
+          [masker="mask3"] RenderSVGResourceMasker {mask} at (60,200) size 200x100
+          chunk 1 text run 1 at (60.00,280.00) startOffset 0 endOffset 3 width 121.33: "SVG"
+      RenderSVGText {text} at (200,214) size 200x14 contains 1 chunk(s)
+        RenderSVGInlineText {#text} at (0,0) size 200x14
+          chunk 1 text run 1 at (200.00,225.00) startOffset 0 endOffset 36 width 200.00: "Text with mask containing rectangles"
+      RenderSVGText {text} at (200,229) size 105x14 contains 1 chunk(s)
+        RenderSVGInlineText {#text} at (0,0) size 105x14
+          chunk 1 text run 1 at (200.00,240.00) startOffset 0 endOffset 20 width 105.00: "of various opacities"
+      RenderSVGText {text} at (10,304) size 264x46 contains 1 chunk(s)
+        RenderSVGInlineText {#text} at (0,0) size 264x46
+          chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 16 width 264.00: "$Revision: 1.7 $"
+      RenderPath {rect} at (0,83) size 430x461 [stroke={[type=SOLID] [color=#000000]}] [data="M1.00,1.00 L479.00,1.00 L479.00,359.00 L1.00,359.00 Z"]
diff --git a/LayoutTests/platform/mac/svg/transforms/text-with-pattern-inside-transformed-html-expected.checksum b/LayoutTests/platform/mac/svg/transforms/text-with-pattern-inside-transformed-html-expected.checksum
index d803b85..4c532cc 100644
--- a/LayoutTests/platform/mac/svg/transforms/text-with-pattern-inside-transformed-html-expected.checksum
+++ b/LayoutTests/platform/mac/svg/transforms/text-with-pattern-inside-transformed-html-expected.checksum
@@ -1 +1 @@
-479c1b11297967f0b62acf7a2ff06be7
\ No newline at end of file
+aead2846f1ef5e3af7c41b30ea3000a1
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/transforms/text-with-pattern-inside-transformed-html-expected.png b/LayoutTests/platform/mac/svg/transforms/text-with-pattern-inside-transformed-html-expected.png
index de75cf9..b820b02 100644
Binary files a/LayoutTests/platform/mac/svg/transforms/text-with-pattern-inside-transformed-html-expected.png and b/LayoutTests/platform/mac/svg/transforms/text-with-pattern-inside-transformed-html-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/transforms/text-with-pattern-with-svg-transform-expected.checksum b/LayoutTests/platform/mac/svg/transforms/text-with-pattern-with-svg-transform-expected.checksum
index b68499d..83a24b2 100644
--- a/LayoutTests/platform/mac/svg/transforms/text-with-pattern-with-svg-transform-expected.checksum
+++ b/LayoutTests/platform/mac/svg/transforms/text-with-pattern-with-svg-transform-expected.checksum
@@ -1 +1 @@
-6361e10a1d892eb97697011cc6a177ad
\ No newline at end of file
+f699207d8dfd9dca70e6cd6e27b0a435
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/transforms/text-with-pattern-with-svg-transform-expected.png b/LayoutTests/platform/mac/svg/transforms/text-with-pattern-with-svg-transform-expected.png
index 82d3f4a..80e5012 100644
Binary files a/LayoutTests/platform/mac/svg/transforms/text-with-pattern-with-svg-transform-expected.png and b/LayoutTests/platform/mac/svg/transforms/text-with-pattern-with-svg-transform-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.checksum b/LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.checksum
index e45b650..6695306 100644
--- a/LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.checksum
+++ b/LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.checksum
@@ -1 +1 @@
-70602e10a8d6679cda64322a785907e7
\ No newline at end of file
+28befae5e6709c12c60fd2e448dff271
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.png b/LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.png
index 701cda2..90935bd 100644
Binary files a/LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.png and b/LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.png differ
diff --git a/LayoutTests/svg/batik/paints/patternRegions-positioned-objects.svg b/LayoutTests/svg/batik/paints/patternRegions-positioned-objects.svg
new file mode 100644
index 0000000..9a3ea1d
--- /dev/null
+++ b/LayoutTests/svg/batik/paints/patternRegions-positioned-objects.svg
@@ -0,0 +1,280 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+
+<!--
+
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+-->
+<!-- ========================================================================= -->
+<!-- This test file checks that the various combinations of units and viewbox  -->
+<!-- work in Batik for patternRegions                                          -->
+<!--                                                                           -->
+<!-- @author vhardy at eng.sun.com                                                -->
+<!-- @version $Id: patternRegions.svg 475477 2006-11-15 22:44:28Z cam $ -->
+<!-- ========================================================================= -->
+
+<?xml-stylesheet type="text/css" href="../resources/test.css" ?>
+
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="body" width="450" height="500" viewBox="0 0 450 500">
+<title>Pattern Tests</title>
+
+    <text x="225" y="50" class="title">
+        patternUnits / patternContentUnits 
+    </text>
+    <text x="225" y="75" class="title">
+        pattern viewBox
+    </text>
+
+    <!-- ============================================================= -->
+    <!-- Test content                                                  -->
+    <!-- ============================================================= -->
+    <g id="testContent" style="font-size:10">
+        <defs>
+        <!-- ============================================== -->
+        <!-- patternUnits : default (objectBoundingBox)     -->
+        <!-- patternContentUnits : default (userSpaceOnUse) -->
+        <!-- viewBox : default (none)                       -->
+        <!-- ============================================== -->
+        <pattern id="pattern1" x="0" y="0" width=".75" height="50%">
+            <circle cx="10" cy="10" r="10" style="fill:red" />
+            <rect x="10" y="10" width="15" height="15" style="fill:green"/>
+        </pattern>
+
+        <!-- ============================================== -->
+        <!-- patternUnits : objectBoundingBox               -->
+        <!-- patternContentUnits : default (userSpaceOnUse) -->
+        <!-- viewBox : default (none)                       -->
+        <!-- ============================================== -->
+        <pattern id="pattern2" patternUnits="objectBoundingBox" x="0" y="0" width=".75" height="50%">
+            <circle cx="10" cy="10" r="10" style="fill:red" />
+            <rect x="10" y="10" width="15" height="15" style="fill:green"/>
+        </pattern>
+
+        <!-- ============================================== -->
+        <!-- patternUnits : userSpaceOnUse                  -->
+        <!-- patternContentUnits : default (userSpaceOnUse) -->
+        <!-- viewBox : default (none)                       -->
+        <!-- ============================================== -->
+        <pattern id="pattern3" 
+                 patternUnits="userSpaceOnUse" 
+                 x="0" y="0" width="30" height="15" overflow="visible">
+            <circle cx="10" cy="10" r="10" style="fill:red" />
+            <rect x="10" y="10" width="15" height="15" style="fill:green"/>
+        </pattern>
+
+        <!-- ============================================== -->
+        <!-- patternUnits : default (objectBoundingBox)     -->
+        <!-- patternContentUnits : objectBoundingBox        -->
+        <!-- viewBox : default (none)                       -->
+        <!-- ============================================== -->
+        <pattern id="pattern4" 
+                 patternContentUnits="objectBoundingBox"
+                 x="0" y="0" width=".75" height=".5" overflow="visible">
+            <circle cx="0.0556%" cy=".33333333" r=".25" style="fill:red" />
+            <rect x=".25" y=".33333333" width="0.375" height=".5" style="fill:green"/>
+        </pattern>
+
+        <!-- ============================================== -->
+        <!-- patternUnits : objectBoundingBox               -->
+        <!-- patternContentUnits : objectBoundingBox        -->
+        <!-- viewBox : default (none)                       -->
+        <!-- ============================================== -->
+        <pattern id="pattern5" 
+                 patternUnits="objectBoundingBox"
+                 patternContentUnits="objectBoundingBox"
+                 x="0" y="0" width=".75" height=".5">
+            <circle cx=".25" cy=".33333333" r=".25" style="fill:red" />
+            <rect x=".25" y=".33333333" width="0.375" height=".5" style="fill:green"/>
+        </pattern>
+
+        <!-- ============================================== -->
+        <!-- patternUnits : userSpaceOnUse                  -->
+        <!-- patternContentUnits : objectBoundingBox        -->
+        <!-- viewBox : default (none)                       -->
+        <!-- ============================================== -->
+        <pattern id="pattern6" 
+                 patternUnits="userSpaceOnUse" 
+                 patternContentUnits="objectBoundingBox"
+                 x="0" y="0" width="30" height="15">
+            <circle cx=".25" cy=".33333333" r=".25" style="fill:red" />
+            <rect x=".25" y=".33333333" width="0.375" height=".5" style="fill:green"/>
+        </pattern>
+
+        <!-- ============================================== -->
+        <!-- patternUnits : userSpaceOnUse                  -->
+        <!-- patternContentUnits : objectBoundingBox        -->
+        <!-- viewBox : set                                  -->
+        <!-- Note patternContentUnits is ignored if viewBox -->
+        <!-- is set.                                        -->
+        <!-- ============================================== -->
+        <pattern id="pattern7" 
+                 patternUnits="userSpaceOnUse" 
+                 patternContentUnits="objectBoundingBox"
+                 x="0" y="0" width="30" height="15" 
+                 viewBox="10 10 40 30" preserveAspectRatio="none">
+            <circle cx="20" cy="20" r="20" style="fill:red" />
+        </pattern>
+
+        <!-- ============================================== -->
+        <!-- patternUnits : userSpaceOnUse                  -->
+        <!-- patternContentUnits : objectBoundingBox        -->
+        <!-- viewBox : set                                  -->
+        <!-- Note patternContentUnits is ignored if viewBox -->
+        <!-- is set.                                        -->
+        <!-- ============================================== -->
+        <pattern id="pattern8" 
+                 patternUnits="userSpaceOnUse" 
+                 patternContentUnits="objectBoundingBox"
+                 x="0" y="0" width="30" height="15" 
+                 viewBox="10 10 40 30" preserveAspectRatio="xMinYMin meet">
+            <circle cx="20" cy="20" r="20" style="fill:red" />
+        </pattern>
+
+        <radialGradient id="redToYellow" >
+            <stop offset="0" stop-color="red" />
+            <stop offset="1" stop-color="yellow" />
+        </radialGradient>
+
+        <!-- ============================================== -->
+        <!-- patternUnits : userSpaceOnUse                  -->
+        <!-- patternContentUnits : userSpaceOnUse           -->
+        <!-- viewBox : set                                  -->
+        <!-- Note patternContentUnits is ignored if viewBox -->
+        <!-- is set.                                        -->
+        <!-- ============================================== -->
+        <pattern id="pattern9" 
+                 patternUnits="userSpaceOnUse" 
+                 patternContentUnits="objectBoundingBox" overflow="visible"
+                 x="0" y="0" width="30" height="15" viewBox="10 10 40 40" preserveAspectRatio="xMinYMin slice">
+            <circle cx="20" cy="20" r="40" style="fill:url(#redToYellow)" />
+        </pattern>
+
+    </defs>
+
+    <g transform="translate(-5, 100)">
+
+    <g id="p1">
+        <rect x="20" y="20" width="40" height="30" style="fill:url(#pattern1); stroke:black;"/>
+        <g transform="translate(20, 20)">
+        <text y="-2">#pattern1</text>
+        <g transform="translate(50, 9)">
+            <text x="0" y="0">patternUnits=default</text>
+            <text x="0" y="10">contentUnits=default</text>
+            <text x="0" y="20">no viewbox</text>
+        </g>
+        </g>
+    </g>
+
+    <g id="p2">
+        <rect x="20" y="70" width="40" height="30" style="fill:url(#pattern2); stroke:black;"/>
+        <g transform="translate(20, 70)">
+        <text y="-2">#pattern2</text>
+        <g transform="translate(50, 9)">
+            <text x="0" y="0">patternUnits=objectBoundingBox</text>
+            <text x="0" y="10">contentUnits=default</text>
+        </g>
+        </g>
+    </g>
+
+    <g id="p3">
+        <rect x="20" y="120" width="40" height="30" style="fill:url(#pattern3); stroke:black;"/>
+        <g transform="translate(20, 120)">
+        <text y="-2">#pattern3</text>
+        <g transform="translate(50, 9)">
+            <text>patternUnits=userSpaceOnUse</text>
+            <text y="10">contentUnits=default</text>
+            <text y="20">overflow=visible</text>
+        </g>
+        </g>
+    </g>
+
+    <g id="p4">
+        <rect x="20" y="170" width="40" height="30" style="fill:url(#pattern4); stroke:black;"/>
+        <g transform="translate(20, 170)">
+        <text y="-2">#pattern4</text>
+        <g transform="translate(50, 9)">
+            <text>patternUnits=default</text>
+            <text y="10">contentUnits=objectBoundingBox</text>
+            <text y="20">overflow=visible</text>
+        </g>
+        </g>
+    </g>
+
+    <g id="p5">
+        <rect x="20" y="220" width="40" height="30" style="fill:url(#pattern5); stroke:black;"/>
+        <g transform="translate(20, 220)">
+        <text y="-2">#pattern5</text>
+        <g transform="translate(50, 9)">
+            <text>patternUnits=objectBoundingBox</text>
+            <text y="10">contentUnits=objectBoundingBox</text>
+        </g>
+        </g>
+    </g>
+
+    <g id="p6">
+        <rect x="20" y="270" width="40" height="30" style="fill:url(#pattern6); stroke:black;"/>
+        <g transform="translate(20, 270)">
+        <text y="-2">#pattern6</text>
+        <g transform="translate(50, 9)">
+            <text>patternUnits=userSpaceOnUse</text>
+            <text y="10">contentUnits=objectBoundingBox</text>
+        </g>
+        </g>
+    </g>
+
+    <g id="p7">
+        <rect x="225" y="20" width="40" height="30" style="fill:url(#pattern7); stroke:black;"/>
+        <g transform="translate(225, 20)">
+        <text y="-2">#pattern7</text>
+        <g transform="translate(50, 9)">
+            <text>patternUnits=userSpaceOnUse</text>
+            <text y="10">contentUnits=objectBoundingBox</text>
+            <text y="20">viewBox preserveAspectRatio=none</text>
+        </g>
+        </g>
+    </g>
+
+    <g id="p8">
+        <rect x="225" y="70" width="40" height="30" style="fill:url(#pattern8); stroke:black;"/>
+        <g transform="translate(225, 70)">
+        <text y="-2" >#pattern8</text>
+        <g transform="translate(50, 9)">
+            <text>same as pattern#7 with</text>
+            <text y="10">preserveAspectRatio=xMinYmin meet</text>
+        </g>
+        </g>
+    </g>
+
+    <g id="p9">
+        <rect x="225" y="120" width="40" height="30" style="fill:url(#pattern9); stroke:black;"/>
+        <g transform="translate(225, 120)">
+        <text y="-2" >#pattern9</text>
+        <g transform="translate(50, 9)">
+            <text y="0">preserveAspectRatio=xMinYmin slice</text>
+            <text y="10">overflow=visible</text>
+        </g>
+        </g>
+    </g>
+    </g>
+</g>
+    <!-- ============================================================= -->
+    <!-- Batik sample mark                                             -->
+    <!-- ============================================================= -->
+    <use xlink:href="../resources/batikLogo.svg#Batik_Tag_Box" />
+    
+</svg>
diff --git a/LayoutTests/svg/custom/pattern-incorrect-tiling.svg b/LayoutTests/svg/custom/pattern-incorrect-tiling.svg
new file mode 100644
index 0000000..19016a4
--- /dev/null
+++ b/LayoutTests/svg/custom/pattern-incorrect-tiling.svg
@@ -0,0 +1,12 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+     xmlns:xlink="http://www.w3.org/1999/xlink">
+
+<defs>
+ <pattern id="dot" width="1" height="1">
+  <circle cx="20" cy="50" r="10" fill="black" />
+ </pattern>
+</defs>
+
+<text text-anchor="middle" x="200" y="100">There should be a black dot in the middle of the ellipse</text>
+<ellipse cx="200" cy="200" rx="20" ry="50" fill="url(#dot)" stroke="gray" />
+</svg>
diff --git a/LayoutTests/svg/custom/pattern-no-pixelation.svg b/LayoutTests/svg/custom/pattern-no-pixelation.svg
new file mode 100644
index 0000000..9ae4424
--- /dev/null
+++ b/LayoutTests/svg/custom/pattern-no-pixelation.svg
@@ -0,0 +1,16 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+    width="400px" height="400px">
+    
+    <defs>
+        <pattern id="fail"
+            x="0" y="0"
+            width="30" height="30" 
+            patternUnits="userSpaceOnUse">
+
+            <circle cx="15" cy="15" r="15" fill="#f00" />
+        </pattern>
+    </defs>
+
+    <rect x="-40" y="-40" width="80" height="80" fill="url(#fail)"
+        transform="translate(200,200) scale(4)" />
+</svg>
diff --git a/LayoutTests/svg/transforms/text-with-mask-with-svg-transform.svg b/LayoutTests/svg/transforms/text-with-mask-with-svg-transform.svg
new file mode 100644
index 0000000..dc6fc4f
--- /dev/null
+++ b/LayoutTests/svg/transforms/text-with-mask-with-svg-transform.svg
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" baseProfile="basic" width="100%" height="100%" viewBox="0 0 480 360">
+	<g id="test-body-content" transform="translate(50 50) scale(.5) rotate(30)">
+		<defs>
+			<font horiz-adv-x="313">
+				<!-- Converted from Larabie Anglepoise by Batik ttf2svg -->
+				<font-face font-family="larabie-anglepoise" units-per-em="1000" panose-1="0 0 4 0 0 0 0 0 0 0" ascent="703" descent="-300" alphabetic="0"/>
+				<missing-glyph horiz-adv-x="500" d="M63 0V700H438V0H63ZM125 63H375V638H125V63Z"/>
+				<glyph unicode="S" glyph-name="S" horiz-adv-x="385" d="M371 1H29V144H264Q264 151 264 166Q265 180 265 188Q265 212 249 212H132Q83 212 55 247Q29 279 29 329V566H335V422H136V375Q136 360 144 356Q148 355 168 355H279Q327 355 352 309Q371 273 371 221V1Z"/>
+				<glyph unicode="V" glyph-name="V" horiz-adv-x="351" d="M365 563L183 -33L0 563H101L183 296L270 563H365Z"/>
+				<glyph unicode="G" glyph-name="G" horiz-adv-x="367" d="M355 1H18V564H355V420H125V144H248V211H156V355H355V1Z"/>
+				<hkern g1="V" g2="G" k="-40"/>
+			</font>
+		</defs>
+		<text font-family="Arial" font-size="14" x="10" y="20">Test for mask support</text>
+		<!-- Draw a red rectangle in the background -->
+		<rect x="10" y="30" width="100" height="260" fill="red"/>
+		<!-- Apply a gradient ramp based opacity -->
+		<mask id="mask1" maskUnits="userSpaceOnUse" x="60" y="50" width="100" height="60">
+			<defs>
+				<linearGradient gradientUnits="userSpaceOnUse" id="Grad1" x1="60" y1="50" x2="60" y2="120">
+					<stop stop-color="white" stop-opacity="1" offset="0"/>
+					<stop stop-color="white" stop-opacity="0.5" offset="1"/>
+				</linearGradient>
+			</defs>
+			<rect x="60" y="50" width="100" height="60" fill="url(#Grad1)"/>
+		</mask>
+		<rect x="60" y="50" width="100" height="60" fill="lime" mask="url(#mask1)"/>
+		<text font-family="Arial" font-size="12" x="200" y="65">Mask with linear gradient from</text>
+		<text font-family="Arial" font-size="12" x="200" y="80">opacity=1 to opactity=0.5</text>
+		<!-- Simulate a uniform opacity using a mask -->
+		<mask id="mask2" maskUnits="userSpaceOnUse" x="60" y="120" width="100" height="30">
+			<rect x="60" y="120" width="100" height="30" fill-opacity="0.5" fill="white"/>
+		</mask>
+		<rect x="60" y="120" width="100" height="30" fill="lime" mask="url(#mask2)"/>
+		<text font-family="Arial" font-size="12" x="200" y="135">Mask with uniform opacity of 0.5</text>
+		<!-- Apply a uniform opacity -->
+		<rect x="60" y="160" width="100" height="30" fill="lime" fill-opacity="0.5"/>
+		<text font-family="Arial" font-size="12" x="200" y="175">Rectangle with uniform opacity of 0.5</text>
+		<!-- Apply a mask to text -->
+		<mask id="mask3" maskUnits="userSpaceOnUse" x="60" y="200" width="200" height="100">
+			<rect x="60" y="200" width="200" height="25" fill="white" fill-opacity="0.5"/>
+			<rect x="60" y="225" width="200" height="25" fill="white" fill-opacity="0.2"/>
+			<rect x="60" y="250" width="200" height="25" fill="white" fill-opacity="1"/>
+			<rect x="60" y="275" width="200" height="25" fill="white" fill-opacity="0.7"/>
+		</mask>
+		<text x="60" y="280" font-family="larabie-anglepoise" font-size="110" fill="lime" mask="url(#mask3)">SVG</text>
+		<text font-family="Arial" font-size="12" x="200" y="225">Text with mask containing rectangles</text>
+		<text font-family="Arial" font-size="12" x="200" y="240">of various opacities</text>
+	<text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.7 $</text>
+	<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+	</g>
+</svg>
diff --git a/LayoutTests/svg/transforms/text-with-pattern-inside-transformed-html.xhtml b/LayoutTests/svg/transforms/text-with-pattern-inside-transformed-html.xhtml
index cd42626..a45483e 100644
--- a/LayoutTests/svg/transforms/text-with-pattern-inside-transformed-html.xhtml
+++ b/LayoutTests/svg/transforms/text-with-pattern-inside-transformed-html.xhtml
@@ -10,6 +10,7 @@
       width: 400px;
       margin: 50px;
       border: 1px solid black;
+      -o-transform: translate(30px, 30px) rotate(20deg);
       -webkit-transform: translate(30px, 30px) rotate(20deg);
     }
   </style>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 58c680c..b5cf24f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,69 @@
+2010-08-19  Nikolas Zimmermann  <nzimmermann at rim.com>
+
+        Reviewed by Dirk Schulze.
+
+        Pattern is rasterized
+        https://bugs.webkit.org/show_bug.cgi?id=41396
+
+        SVG pattern size changed when resizing browser
+        https://bugs.webkit.org/show_bug.cgi?id=38704
+
+        Incorrect pattern tilling
+        https://bugs.webkit.org/show_bug.cgi?id=41603
+
+        Apply same fixes to <pattern> that <mask> recently received. Build the tile image in absolute coordinates,
+        to avoid pixelation, when the target element is scaled. Also fixes problems when zooming into patterns.
+
+        Clamp ImageBuffer sizes to RenderSVGRoots viewport, now that gradient/pattern and mask buffers are created
+        in absolute coordinates -> no more huge image buffer allocations, that could fail.
+
+        Drop overflow="visible" support for <pattern>, which complicates the code a lot. Neither Opera nor Firefox
+        support this, and SVG 1.1 2nd Edition says that the rendering behaviour is "undefined".
+
+        Tests: svg/batik/paints/patternRegions-positioned-objects.svg
+               svg/custom/pattern-incorrect-tiling.svg
+               svg/custom/pattern-no-pixelation.svg
+               svg/transforms/text-with-mask-with-svg-transform.svg
+
+        * rendering/PaintInfo.h:
+        (WebCore::PaintInfo::applyTransform): Don't alter the repaint rect if it's infinite (only affects SVG).
+        (WebCore::PaintInfo::infiniteRect): Moved from RenderLayer into PaintInfo, as applyTransform() needs it.
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateClipRects): s/ClipRects::infiniteRect/PaintInfo::infiniteRect/
+        * rendering/RenderLayer.h: Moved infiniteRect() to PaintInfo.
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::clipBox): s/ClipRects::infiniteRect/PaintInfo::infiniteRect/
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::clippedByAncestor): Ditto.
+        * rendering/RenderSVGResourceGradient.cpp:
+        (WebCore::createMaskAndSwapContextForTextGradient): Clamp image buffer size, use new SVGImageBufferTools helper methods for that.
+        (WebCore::clipToTextMask): Adapt to renames/code changes in SVGImageBufferTools. 
+        (WebCore::RenderSVGResourceGradient::applyResource): Ditto.
+        * rendering/RenderSVGResourceMasker.cpp:
+        (WebCore::RenderSVGResourceMasker::applyResource): lamp image buffer size, use new SVGImageBufferTools helper methods for that.
+        (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage): Adapt to renames/code changes in SVGImageBufferTools.
+        * rendering/RenderSVGResourceMasker.h:
+        * rendering/RenderSVGResourcePattern.cpp:
+        (WebCore::RenderSVGResourcePattern::applyResource): Rewrite to create tile image buffers in absolute coordinates, avoids pixelation artefacts.
+        (WebCore::calculatePatternBoundaries):
+        (WebCore::RenderSVGResourcePattern::buildTileImageTransform):
+        (WebCore::RenderSVGResourcePattern::createTileImage):
+        * rendering/RenderSVGResourcePattern.h:
+        * rendering/SVGImageBufferTools.cpp:
+        (WebCore::SVGImageBufferTools::transformationToOutermostSVGCoordinateSystem): Helper method, concating all localToParentTransforms() up until RenderSVGRoot is reached.
+        (WebCore::SVGImageBufferTools::createImageBuffer): Simplified.
+        (WebCore::SVGImageBufferTools::clipToImageBuffer): Rename absoluteTargetRect to clampedAbsoluteTargetRect.
+        (WebCore::SVGImageBufferTools::roundedImageBufferSize): New helper method to centralize FloatSize -> IntSize rounding, when creating image buffers.
+        (WebCore::SVGImageBufferTools::clampedAbsoluteTargetRectForRenderer): New helper methods to clamp an image buffer rect against the viewport.
+        * rendering/SVGImageBufferTools.h:
+        * rendering/SVGRenderSupport.cpp:
+        (WebCore::SVGRenderSupport::renderSubtreeToImage): Use PaintInfo::infiniteRect() as repaint rect, to avoid any culling. 
+        (WebCore::SVGRenderSupport::findTreeRootObject): Renamed from svgRootTreeObject, and expose it.
+        (WebCore::SVGRenderSupport::layoutChildren): s/svgRootTreeObject/findTreeRootObject/.
+        * rendering/SVGRenderSupport.h:
+        * svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::setCurrentTranslate): Be sure to relayout on invalidation, otherwhise resources are not updated, and we have to update them, as they depend on the absolute transform.
+
 2010-08-19  Alejandro G. Castro  <alex at igalia.com>
 
         Reviewed by Dirk Schulze.
diff --git a/WebCore/rendering/PaintInfo.h b/WebCore/rendering/PaintInfo.h
index 213eb30..3598807 100644
--- a/WebCore/rendering/PaintInfo.h
+++ b/WebCore/rendering/PaintInfo.h
@@ -86,10 +86,16 @@ struct PaintInfo {
             return;
 
         context->concatCTM(localToAncestorTransform);
+
+        if (rect == infiniteRect())
+            return;
+
         rect = localToAncestorTransform.inverse().mapRect(rect);
     }
 #endif
 
+    static IntRect infiniteRect() { return IntRect(INT_MIN / 2, INT_MIN / 2, INT_MAX, INT_MAX); }
+
     // FIXME: Introduce setters/getters at some point. Requires a lot of changes throughout rendering/.
     GraphicsContext* context;
     IntRect rect;
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index 668b1ca..0e17eab 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -3095,7 +3095,7 @@ void RenderLayer::calculateClipRects(const RenderLayer* rootLayer, ClipRects& cl
 {
     if (!parent()) {
         // The root layer's clip rect is always infinite.
-        clipRects.reset(ClipRects::infiniteRect());
+        clipRects.reset(PaintInfo::infiniteRect());
         return;
     }
 
@@ -3111,7 +3111,7 @@ void RenderLayer::calculateClipRects(const RenderLayer* rootLayer, ClipRects& cl
             parentLayer->calculateClipRects(rootLayer, clipRects);
     }
     else
-        clipRects.reset(ClipRects::infiniteRect());
+        clipRects.reset(PaintInfo::infiniteRect());
 
     // A fixed object is essentially the root of its containing block hierarchy, so when
     // we encounter such an object, we reset our clip rects to the fixedClipRect.
diff --git a/WebCore/rendering/RenderLayer.h b/WebCore/rendering/RenderLayer.h
index 9587650..fd4a2b5 100644
--- a/WebCore/rendering/RenderLayer.h
+++ b/WebCore/rendering/RenderLayer.h
@@ -145,8 +145,6 @@ public:
         m_fixed = other.fixed();
         return *this;
     }
-    
-    static IntRect infiniteRect() { return IntRect(INT_MIN/2, INT_MIN/2, INT_MAX, INT_MAX); }
 
 private:
     // The normal operator new is disallowed on all render objects.
diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp
index 95ec3f3..96d6d1a 100644
--- a/WebCore/rendering/RenderLayerBacking.cpp
+++ b/WebCore/rendering/RenderLayerBacking.cpp
@@ -272,7 +272,7 @@ bool RenderLayerBacking::updateGraphicsLayerConfiguration()
 
 static IntRect clipBox(RenderBox* renderer)
 {
-    IntRect result = ClipRects::infiniteRect();
+    IntRect result = PaintInfo::infiniteRect();
     if (renderer->hasOverflowClip())
         result = renderer->overflowClipRect(0, 0);
 
diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp
index a8cf4e9..b112daf 100644
--- a/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/WebCore/rendering/RenderLayerCompositor.cpp
@@ -1138,7 +1138,7 @@ bool RenderLayerCompositor::clippedByAncestor(RenderLayer* layer) const
         return false;
 
     IntRect backgroundRect = layer->backgroundClipRect(computeClipRoot, true);
-    return backgroundRect != ClipRects::infiniteRect();
+    return backgroundRect != PaintInfo::infiniteRect();
 }
 
 // Return true if the given layer is a stacking context and has compositing child
diff --git a/WebCore/rendering/RenderSVGResourceGradient.cpp b/WebCore/rendering/RenderSVGResourceGradient.cpp
index d29192a..b8c4e77 100644
--- a/WebCore/rendering/RenderSVGResourceGradient.cpp
+++ b/WebCore/rendering/RenderSVGResourceGradient.cpp
@@ -80,35 +80,43 @@ static inline bool createMaskAndSwapContextForTextGradient(GraphicsContext*& con
     const RenderObject* textRootBlock = SVGRenderSupport::findTextRootObject(object);
     ASSERT(textRootBlock);
 
-    AffineTransform absoluteTransform(SVGImageBufferTools::absoluteTransformFromContext(context));
-    FloatRect absoluteTargetRect = absoluteTransform.mapRect(textRootBlock->repaintRectInLocalCoordinates());
+    AffineTransform absoluteTransform(SVGImageBufferTools::transformationToOutermostSVGCoordinateSystem(textRootBlock));
+    FloatRect clampedAbsoluteTargetRect = SVGImageBufferTools::clampedAbsoluteTargetRectForRenderer(textRootBlock, absoluteTransform, textRootBlock->repaintRectInLocalCoordinates());
+    if (clampedAbsoluteTargetRect.isEmpty())
+        return false;
 
     OwnPtr<ImageBuffer> maskImage;
-    if (!SVGImageBufferTools::createImageBuffer(absoluteTransform, absoluteTargetRect, maskImage, DeviceRGB))
+    if (!SVGImageBufferTools::createImageBuffer(clampedAbsoluteTargetRect, maskImage, DeviceRGB))
         return false;
 
+    GraphicsContext* maskImageContext = maskImage->context();
+    ASSERT(maskImageContext);
+
+    maskImageContext->translate(-clampedAbsoluteTargetRect.x(), -clampedAbsoluteTargetRect.y());
+    maskImageContext->concatCTM(absoluteTransform);
+
     ASSERT(maskImage);
     savedContext = context;
-    context = maskImage->context();
+    context = maskImageContext;
     imageBuffer = maskImage.release();
     return true;
 }
 
 static inline AffineTransform clipToTextMask(GraphicsContext* context,
                                              OwnPtr<ImageBuffer>& imageBuffer,
-                                             FloatRect& repaintRect,
+                                             FloatRect& targetRect,
                                              const RenderObject* object,
                                              GradientData* gradientData)
 {
     const RenderObject* textRootBlock = SVGRenderSupport::findTextRootObject(object);
     ASSERT(textRootBlock);
 
-    repaintRect = textRootBlock->repaintRectInLocalCoordinates();
+    targetRect = textRootBlock->repaintRectInLocalCoordinates();
 
-    AffineTransform absoluteTransform(SVGImageBufferTools::absoluteTransformFromContext(context));
-    FloatRect absoluteTargetRect = absoluteTransform.mapRect(repaintRect);
+    AffineTransform absoluteTransform(SVGImageBufferTools::transformationToOutermostSVGCoordinateSystem(textRootBlock));
+    FloatRect clampedAbsoluteTargetRect = SVGImageBufferTools::clampedAbsoluteTargetRectForRenderer(textRootBlock, absoluteTransform, targetRect);
 
-    SVGImageBufferTools::clipToImageBuffer(context, absoluteTransform, absoluteTargetRect, imageBuffer.get());
+    SVGImageBufferTools::clipToImageBuffer(context, absoluteTransform, clampedAbsoluteTargetRect, imageBuffer.get());
 
     AffineTransform matrix;
     if (gradientData->boundingBoxMode) {
@@ -216,11 +224,11 @@ void RenderSVGResourceGradient::postApplyResource(RenderObject* object, Graphics
             context = m_savedContext;
             m_savedContext = 0;
 
-            FloatRect repaintRect;
-            gradientData->gradient->setGradientSpaceTransform(clipToTextMask(context, m_imageBuffer, repaintRect, object, gradientData));
+            FloatRect targetRect;
+            gradientData->gradient->setGradientSpaceTransform(clipToTextMask(context, m_imageBuffer, targetRect, object, gradientData));
             context->setFillGradient(gradientData->gradient);
 
-            context->fillRect(repaintRect);
+            context->fillRect(targetRect);
             m_imageBuffer.clear();
         }
 #else
diff --git a/WebCore/rendering/RenderSVGResourceMasker.cpp b/WebCore/rendering/RenderSVGResourceMasker.cpp
index 9713dd6..39ad951 100644
--- a/WebCore/rendering/RenderSVGResourceMasker.cpp
+++ b/WebCore/rendering/RenderSVGResourceMasker.cpp
@@ -96,43 +96,43 @@ bool RenderSVGResourceMasker::applyResource(RenderObject* object, RenderStyle*,
 
     MaskerData* maskerData = m_masker.get(object);
 
-    AffineTransform absoluteTransform(SVGImageBufferTools::absoluteTransformFromContext(context));
-    FloatRect maskRect = absoluteTransform.mapRect(object->repaintRectInLocalCoordinates());
+    AffineTransform absoluteTransform(SVGImageBufferTools::transformationToOutermostSVGCoordinateSystem(object));
+    FloatRect clampedAbsoluteTargetRect = SVGImageBufferTools::clampedAbsoluteTargetRectForRenderer(object, absoluteTransform, object->repaintRectInLocalCoordinates());
 
-    if (!maskerData->maskImage && !maskRect.isEmpty()) {
+    if (!maskerData->maskImage && !clampedAbsoluteTargetRect.isEmpty()) {
         SVGMaskElement* maskElement = static_cast<SVGMaskElement*>(node());
         if (!maskElement)
             return false;
 
-        if (!SVGImageBufferTools::createImageBuffer(absoluteTransform, maskRect, maskerData->maskImage, LinearRGB))
+        if (!SVGImageBufferTools::createImageBuffer(clampedAbsoluteTargetRect, maskerData->maskImage, LinearRGB))
             return false;
 
-        ASSERT(maskerData->maskImage);
-        drawContentIntoMaskImage(maskRect, maskerData, maskElement, object);
+        GraphicsContext* maskImageContext = maskerData->maskImage->context();
+        ASSERT(maskImageContext);
+
+        maskImageContext->translate(-clampedAbsoluteTargetRect.x(), -clampedAbsoluteTargetRect.y());
+        maskImageContext->concatCTM(absoluteTransform);
+
+        drawContentIntoMaskImage(maskerData, maskElement, object);
     }
 
     if (!maskerData->maskImage)
         return false;
 
-    SVGImageBufferTools::clipToImageBuffer(context, absoluteTransform, maskRect, maskerData->maskImage.get());
+    SVGImageBufferTools::clipToImageBuffer(context, absoluteTransform, clampedAbsoluteTargetRect, maskerData->maskImage.get());
     return true;
 }
 
-void RenderSVGResourceMasker::drawContentIntoMaskImage(const FloatRect& maskRect, MaskerData* maskerData, const SVGMaskElement* maskElement, RenderObject* object)
+void RenderSVGResourceMasker::drawContentIntoMaskImage(MaskerData* maskerData, const SVGMaskElement* maskElement, RenderObject* object)
 {
-    IntRect maskImageRect = enclosingIntRect(maskRect);
-    maskImageRect.setLocation(IntPoint());
-
     // Eventually adjust the mask image context according to the target objectBoundingBox.
     if (maskElement->maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
         GraphicsContext* maskImageContext = maskerData->maskImage->context();
         ASSERT(maskImageContext);
 
         FloatRect objectBoundingBox = object->objectBoundingBox();
-        AffineTransform contextTransform;
-        contextTransform.translate(objectBoundingBox.x(), objectBoundingBox.y());
-        contextTransform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
-        maskImageContext->concatCTM(contextTransform);
+        maskImageContext->translate(objectBoundingBox.x(), objectBoundingBox.y());
+        maskImageContext->scale(FloatSize(objectBoundingBox.width(), objectBoundingBox.height()));
     }
 
     // Draw the content into the ImageBuffer.
@@ -150,7 +150,8 @@ void RenderSVGResourceMasker::drawContentIntoMaskImage(const FloatRect& maskRect
     maskerData->maskImage->transformColorSpace(DeviceRGB, LinearRGB);
 #endif
 
-    // create the luminance mask
+    // Create the luminance mask.
+    IntRect maskImageRect(IntPoint(), maskerData->maskImage->size());
     RefPtr<ImageData> imageData(maskerData->maskImage->getUnmultipliedImageData(maskImageRect));
     CanvasPixelArray* srcPixelArray(imageData->data());
 
diff --git a/WebCore/rendering/RenderSVGResourceMasker.h b/WebCore/rendering/RenderSVGResourceMasker.h
index f2d8cb2..fddecd0 100644
--- a/WebCore/rendering/RenderSVGResourceMasker.h
+++ b/WebCore/rendering/RenderSVGResourceMasker.h
@@ -58,7 +58,7 @@ public:
     static RenderSVGResourceType s_resourceType;
 
 private:
-    void drawContentIntoMaskImage(const FloatRect& maskRect, MaskerData*, const SVGMaskElement*, RenderObject*);
+    void drawContentIntoMaskImage(MaskerData*, const SVGMaskElement*, RenderObject*);
     void calculateMaskContentRepaintRect();
 
     FloatRect m_maskContentBoundaries;
diff --git a/WebCore/rendering/RenderSVGResourcePattern.cpp b/WebCore/rendering/RenderSVGResourcePattern.cpp
index f4f5cf4..f87fcb7 100644
--- a/WebCore/rendering/RenderSVGResourcePattern.cpp
+++ b/WebCore/rendering/RenderSVGResourcePattern.cpp
@@ -27,6 +27,8 @@
 #include "FrameView.h"
 #include "GraphicsContext.h"
 #include "PatternAttributes.h"
+#include "RenderSVGRoot.h"
+#include "SVGImageBufferTools.h"
 #include "SVGRenderSupport.h"
 
 namespace WebCore {
@@ -75,7 +77,7 @@ bool RenderSVGResourcePattern::applyResource(RenderObject* object, RenderStyle*
     ASSERT(resourceMode != ApplyToDefaultMode);
 
     // Be sure to synchronize all SVG properties on the patternElement _before_ processing any further.
-    // Otherwhise the call to collectPatternAttributes() in createTileImage(), may cause the SVG DOM property
+    // Otherwhise the call to collectPatternAttributes() below, may cause the SVG DOM property
     // synchronization to kick in, which causes removeAllClientsFromCache() to be called, which in turn deletes our
     // PatternData object! Leaving out the line below will cause svg/dynamic-updates/SVGPatternElement-svgdom* to crash.
     SVGPatternElement* patternElement = static_cast<SVGPatternElement*>(node());
@@ -89,17 +91,41 @@ bool RenderSVGResourcePattern::applyResource(RenderObject* object, RenderStyle*
 
     PatternData* patternData = m_pattern.get(object);
     if (!patternData->pattern) {
-        // Create tile image
-        OwnPtr<ImageBuffer> tileImage = createTileImage(patternData, patternElement, object);
+        PatternAttributes attributes = patternElement->collectPatternProperties();
+
+        // If we couldn't determine the pattern content element root, stop here.
+        if (!attributes.patternContentElement())
+            return false;
+
+        // Compute all necessary transformations to build the tile image & the pattern.
+        FloatRect tileBoundaries;
+        AffineTransform tileImageTransform = buildTileImageTransform(object, attributes, patternElement, tileBoundaries);
+
+        AffineTransform absoluteTransform(SVGImageBufferTools::transformationToOutermostSVGCoordinateSystem(object));
+        FloatRect absoluteTileBoundaries = absoluteTransform.mapRect(tileBoundaries);
+
+        // Build tile image.
+        OwnPtr<ImageBuffer> tileImage = createTileImage(object, attributes, tileBoundaries, absoluteTileBoundaries, tileImageTransform);
         if (!tileImage)
             return false;
 
-        // Create pattern object
-        buildPattern(patternData, tileImage.release());
+        RefPtr<Image> copiedImage = tileImage->copyImage();
+        if (!copiedImage)
+            return false;
 
+        // Build pattern.
+        patternData->pattern = Pattern::create(copiedImage, true, true);
         if (!patternData->pattern)
             return false;
 
+        // Compute pattern space transformation.
+        patternData->transform.translate(tileBoundaries.x(), tileBoundaries.y());
+        patternData->transform.scale(tileBoundaries.width() / absoluteTileBoundaries.width(), tileBoundaries.height() / absoluteTileBoundaries.height());
+
+        AffineTransform patternTransform = attributes.patternTransform();
+        if (!patternTransform.isIdentity())
+            patternData->transform.multiply(patternTransform);
+
         patternData->pattern->setPatternSpaceTransform(patternData->transform);
     }
 
@@ -155,13 +181,15 @@ void RenderSVGResourcePattern::postApplyResource(RenderObject*, GraphicsContext*
     context->restore();
 }
 
-static inline FloatRect calculatePatternBoundaries(PatternAttributes& attributes,
+static inline FloatRect calculatePatternBoundaries(const PatternAttributes& attributes,
                                                    const FloatRect& objectBoundingBox,
                                                    const SVGPatternElement* patternElement)
 {
+    ASSERT(patternElement);
+
     if (attributes.boundingBoxMode())
-        return FloatRect(attributes.x().valueAsPercentage() * objectBoundingBox.width(),
-                         attributes.y().valueAsPercentage() * objectBoundingBox.height(),
+        return FloatRect(attributes.x().valueAsPercentage() * objectBoundingBox.width() + objectBoundingBox.x(),
+                         attributes.y().valueAsPercentage() * objectBoundingBox.height() + objectBoundingBox.y(),
                          attributes.width().valueAsPercentage() * objectBoundingBox.width(),
                          attributes.height().valueAsPercentage() * objectBoundingBox.height());
 
@@ -171,175 +199,80 @@ static inline FloatRect calculatePatternBoundaries(PatternAttributes& attributes
                      attributes.height().value(patternElement));
 }
 
-FloatRect RenderSVGResourcePattern::calculatePatternBoundariesIncludingOverflow(PatternAttributes& attributes,
-                                                                                const FloatRect& objectBoundingBox,
-                                                                                const AffineTransform& viewBoxCTM,
-                                                                                const FloatRect& patternBoundaries) const
+AffineTransform RenderSVGResourcePattern::buildTileImageTransform(RenderObject* renderer,
+                                                                  const PatternAttributes& attributes,
+                                                                  const SVGPatternElement* patternElement,
+                                                                  FloatRect& patternBoundaries) const
 {
-    // Eventually calculate the pattern content boundaries (only needed with overflow="visible").
-    FloatRect patternContentBoundaries;
-
-    const RenderStyle* style = this->style();
-    if (style->overflowX() == OVISIBLE && style->overflowY() == OVISIBLE) {
-        for (Node* node = attributes.patternContentElement()->firstChild(); node; node = node->nextSibling()) {
-            if (!node->isSVGElement() || !static_cast<SVGElement*>(node)->isStyledTransformable() || !node->renderer())
-                continue;
-            patternContentBoundaries.unite(node->renderer()->repaintRectInLocalCoordinates());
-        }
-    }
+    ASSERT(renderer);
+    ASSERT(patternElement);
 
-    if (patternContentBoundaries.isEmpty())
-        return patternBoundaries;
+    FloatRect objectBoundingBox = renderer->objectBoundingBox();    
+    patternBoundaries = calculatePatternBoundaries(attributes, objectBoundingBox, patternElement); 
 
-    FloatRect patternBoundariesIncludingOverflow = patternBoundaries;
+    AffineTransform viewBoxCTM = patternElement->viewBoxToViewTransform(patternElement->viewBox(), patternElement->preserveAspectRatio(), patternBoundaries.width(), patternBoundaries.height());
+    AffineTransform tileImageTransform;
 
-    // Respect objectBoundingBoxMode for patternContentUnits, if viewBox is not set.
+    // Apply viewBox/objectBoundingBox transformations.
     if (!viewBoxCTM.isIdentity())
-        patternContentBoundaries = viewBoxCTM.mapRect(patternContentBoundaries);
-    else if (attributes.boundingBoxModeContent())
-        patternContentBoundaries = FloatRect(patternContentBoundaries.x() * objectBoundingBox.width(),
-                                             patternContentBoundaries.y() * objectBoundingBox.height(),
-                                             patternContentBoundaries.width() * objectBoundingBox.width(),
-                                             patternContentBoundaries.height() * objectBoundingBox.height());
-
-    patternBoundariesIncludingOverflow.unite(patternContentBoundaries);
-    return patternBoundariesIncludingOverflow;
-}
-
-// FIXME: This method should be removed. RenderSVGResourcePatterns usage of it is just wrong.
-static inline void clampImageBufferSizeToViewport(FrameView* frameView, IntSize& size)
-{
-    if (!frameView)
-        return;
-
-    int viewWidth = frameView->visibleWidth();
-    int viewHeight = frameView->visibleHeight();
-
-    if (size.width() > viewWidth)
-        size.setWidth(viewWidth);
+        tileImageTransform = viewBoxCTM;
+    else if (attributes.boundingBoxModeContent()) {
+        tileImageTransform.translate(objectBoundingBox.x(), objectBoundingBox.y());
+        tileImageTransform.scale(objectBoundingBox.width(), objectBoundingBox.height());
+    }
 
-    if (size.height() > viewHeight)
-        size.setHeight(viewHeight);
+    return tileImageTransform;
 }
 
-PassOwnPtr<ImageBuffer> RenderSVGResourcePattern::createTileImage(PatternData* patternData,
-                                                                  const SVGPatternElement* patternElement,
-                                                                  RenderObject* object) const
+PassOwnPtr<ImageBuffer> RenderSVGResourcePattern::createTileImage(RenderObject* object,
+                                                                  const PatternAttributes& attributes,
+                                                                  const FloatRect& tileBoundaries,
+                                                                  const FloatRect& absoluteTileBoundaries,
+                                                                  const AffineTransform& tileImageTransform) const
 {
-    PatternAttributes attributes = patternElement->collectPatternProperties();
-
-    // If we couldn't determine the pattern content element root, stop here.
-    if (!attributes.patternContentElement())
-        return 0;
-
-    FloatRect objectBoundingBox = object->objectBoundingBox();    
-    FloatRect patternBoundaries = calculatePatternBoundaries(attributes, objectBoundingBox, patternElement); 
-    AffineTransform patternTransform = attributes.patternTransform();
-
-    AffineTransform viewBoxCTM = patternElement->viewBoxToViewTransform(patternElement->viewBox(),
-                                                                        patternElement->preserveAspectRatio(),
-                                                                        patternBoundaries.width(),
-                                                                        patternBoundaries.height());
-
-    FloatRect patternBoundariesIncludingOverflow = calculatePatternBoundariesIncludingOverflow(attributes,
-                                                                                               objectBoundingBox,
-                                                                                               viewBoxCTM,
-                                                                                               patternBoundaries);
+    ASSERT(object);
 
-    IntSize imageSize(lroundf(patternBoundariesIncludingOverflow.width()), lroundf(patternBoundariesIncludingOverflow.height()));
+    // Clamp tile image size against SVG viewport size, as last resort, to avoid allocating huge image buffers.
+    FloatRect contentBoxRect = SVGRenderSupport::findTreeRootObject(object)->contentBoxRect();
 
-    // FIXME: We should be able to clip this more, needs investigation
-    clampImageBufferSizeToViewport(object->document()->view(), imageSize);
+    FloatRect clampedAbsoluteTileBoundaries = absoluteTileBoundaries;
+    if (clampedAbsoluteTileBoundaries.width() > contentBoxRect.width())
+        clampedAbsoluteTileBoundaries.setWidth(contentBoxRect.width());
 
-    // Don't create ImageBuffers with image size of 0
-    if (imageSize.isEmpty())
-        return 0;
+    if (clampedAbsoluteTileBoundaries.height() > contentBoxRect.height())
+        clampedAbsoluteTileBoundaries.setHeight(contentBoxRect.height());
 
-    OwnPtr<ImageBuffer> tileImage = ImageBuffer::create(imageSize);
+    OwnPtr<ImageBuffer> tileImage;
 
-    GraphicsContext* context = tileImage->context();
-    ASSERT(context);
+    if (!SVGImageBufferTools::createImageBuffer(clampedAbsoluteTileBoundaries, tileImage, DeviceRGB))
+        return PassOwnPtr<ImageBuffer>();
 
-    context->save();
+    GraphicsContext* tileImageContext = tileImage->context();
+    ASSERT(tileImageContext);
 
-    // Translate to pattern start origin
-    if (patternBoundariesIncludingOverflow.location() != patternBoundaries.location()) {
-        context->translate(patternBoundaries.x() - patternBoundariesIncludingOverflow.x(),
-                           patternBoundaries.y() - patternBoundariesIncludingOverflow.y());
+    // Compensate rounding effects, as the absolute target rect is using floating-point numbers and the image buffer size is integer.
+    IntSize unclampedImageSize(SVGImageBufferTools::roundedImageBufferSize(absoluteTileBoundaries.size()));
+    tileImageContext->scale(FloatSize(unclampedImageSize.width() / absoluteTileBoundaries.width(),
+                                      unclampedImageSize.height() / absoluteTileBoundaries.height()));
 
-        patternBoundaries.setLocation(patternBoundariesIncludingOverflow.location());
-    }
+    // The image buffer represents the final rendered size, so the content has to be scaled (to avoid pixelation).
+    tileImageContext->scale(FloatSize(absoluteTileBoundaries.width() / tileBoundaries.width(),
+                                      absoluteTileBoundaries.height() / tileBoundaries.height()));
 
-    // Process viewBox or boundingBoxModeContent correction
-    if (!viewBoxCTM.isIdentity())
-        context->concatCTM(viewBoxCTM);
-    else if (attributes.boundingBoxModeContent()) {
-        context->translate(objectBoundingBox.x(), objectBoundingBox.y());
-        context->scale(FloatSize(objectBoundingBox.width(), objectBoundingBox.height()));
-    }
+    // Apply tile image transformations.
+    if (!tileImageTransform.isIdentity())
+        tileImageContext->concatCTM(tileImageTransform);
 
-    // Render subtree into ImageBuffer
+    // Draw the content into the ImageBuffer.
     for (Node* node = attributes.patternContentElement()->firstChild(); node; node = node->nextSibling()) {
         if (!node->isSVGElement() || !static_cast<SVGElement*>(node)->isStyled() || !node->renderer())
             continue;
         SVGRenderSupport::renderSubtreeToImage(tileImage.get(), node->renderer());
     }
 
-    patternData->boundaries = patternBoundaries;
-
-    // Compute pattern transformation
-    patternData->transform.translate(patternBoundaries.x(), patternBoundaries.y());
-    patternData->transform.multiply(patternTransform);
-
-    context->restore();
     return tileImage.release();
 }
 
-void RenderSVGResourcePattern::buildPattern(PatternData* patternData, PassOwnPtr<ImageBuffer> tileImage) const
-{
-    RefPtr<Image> copiedImage = tileImage->copyImage();
-    if (!copiedImage) {
-        patternData->pattern = 0;
-        return;
-    }
-    
-    IntRect tileRect = copiedImage->rect();
-    if (tileRect.width() <= patternData->boundaries.width() && tileRect.height() <= patternData->boundaries.height()) {
-        patternData->pattern = Pattern::create(copiedImage, true, true);
-        return;
-    }
-
-    // Draw the first cell of the pattern manually to support overflow="visible" on all platforms.
-    int tileWidth = static_cast<int>(patternData->boundaries.width() + 0.5f);
-    int tileHeight = static_cast<int>(patternData->boundaries.height() + 0.5f);
-
-    // Don't create ImageBuffers with image size of 0
-    if (!tileWidth || !tileHeight) {
-        patternData->pattern = 0;
-        return;
-    }
-
-    OwnPtr<ImageBuffer> newTileImage = ImageBuffer::create(IntSize(tileWidth, tileHeight));
-    GraphicsContext* newTileImageContext = newTileImage->context();
-
-    int numY = static_cast<int>(ceilf(tileRect.height() / tileHeight)) + 1;
-    int numX = static_cast<int>(ceilf(tileRect.width() / tileWidth)) + 1;
-
-    newTileImageContext->save();
-    newTileImageContext->translate(-patternData->boundaries.width() * numX, -patternData->boundaries.height() * numY);
-    for (int i = numY; i > 0; --i) {
-        newTileImageContext->translate(0, patternData->boundaries.height());
-        for (int j = numX; j > 0; --j) {
-            newTileImageContext->translate(patternData->boundaries.width(), 0);
-            newTileImageContext->drawImage(copiedImage.get(), style()->colorSpace(), tileRect, tileRect);
-        }
-        newTileImageContext->translate(-patternData->boundaries.width() * numX, 0);
-    }
-    newTileImageContext->restore();
-
-    patternData->pattern = Pattern::create(newTileImage->copyImage(), true, true);
-}
-
 }
 
 #endif
diff --git a/WebCore/rendering/RenderSVGResourcePattern.h b/WebCore/rendering/RenderSVGResourcePattern.h
index 52bf09d..9a067c2 100644
--- a/WebCore/rendering/RenderSVGResourcePattern.h
+++ b/WebCore/rendering/RenderSVGResourcePattern.h
@@ -38,7 +38,6 @@ namespace WebCore {
 
 struct PatternData {
     RefPtr<Pattern> pattern;
-    FloatRect boundaries;
     AffineTransform transform;
 };
 
@@ -62,10 +61,10 @@ public:
     static RenderSVGResourceType s_resourceType;
 
 private:
-    PassOwnPtr<ImageBuffer> createTileImage(PatternData*, const SVGPatternElement*, RenderObject*) const;
-    void buildPattern(PatternData*, PassOwnPtr<ImageBuffer> tileImage) const;
-    FloatRect calculatePatternBoundariesIncludingOverflow(PatternAttributes&, const FloatRect& objectBoundingBox,
-                                                          const AffineTransform& viewBoxCTM, const FloatRect& patternBoundaries) const;
+    AffineTransform buildTileImageTransform(RenderObject*, const PatternAttributes&, const SVGPatternElement*, FloatRect& patternBoundaries) const;
+
+    PassOwnPtr<ImageBuffer> createTileImage(RenderObject*, const PatternAttributes&, const FloatRect& tileBoundaries,
+                                            const FloatRect& absoluteTileBoundaries, const AffineTransform& tileImageTransform) const;
 
     HashMap<RenderObject*, PatternData*> m_pattern;
 };
diff --git a/WebCore/rendering/SVGImageBufferTools.cpp b/WebCore/rendering/SVGImageBufferTools.cpp
index 5b45ccc..fd522a5 100644
--- a/WebCore/rendering/SVGImageBufferTools.cpp
+++ b/WebCore/rendering/SVGImageBufferTools.cpp
@@ -22,41 +22,49 @@
 #if ENABLE(SVG)
 #include "SVGImageBufferTools.h"
 
+#include "FrameView.h"
 #include "GraphicsContext.h"
 #include "RenderObject.h"
+#include "RenderSVGRoot.h"
 
 namespace WebCore {
 
-AffineTransform SVGImageBufferTools::absoluteTransformFromContext(GraphicsContext* context)
+AffineTransform SVGImageBufferTools::transformationToOutermostSVGCoordinateSystem(const RenderObject* renderer)
 {
-    // Extract current transformation matrix used in the original context. Note that this coordinate
-    // system is flipped compared to SVGs internal coordinate system, done in WebKit level. Fix
-    // this transformation by flipping the y component.
-    return context->getCTM() * AffineTransform().flipY();
+    ASSERT(renderer);
+
+    const RenderObject* current = renderer;
+    ASSERT(current);
+
+    AffineTransform ctm;
+    while (current) {
+        ctm.multiply(current->localToParentTransform());
+        if (current->isSVGRoot())
+            break;
+
+        current = current->parent();
+    }
+
+    return ctm;
 }
 
-bool SVGImageBufferTools::createImageBuffer(const AffineTransform& absoluteTransform, const FloatRect& absoluteTargetRect, OwnPtr<ImageBuffer>& imageBuffer, ImageColorSpace colorSpace)
+bool SVGImageBufferTools::createImageBuffer(const FloatRect& clampedAbsoluteTargetRect, OwnPtr<ImageBuffer>& imageBuffer, ImageColorSpace colorSpace)
 {
-    IntRect imageRect = enclosingIntRect(absoluteTargetRect);
-    if (imageRect.isEmpty())
+    IntSize imageSize(roundedImageBufferSize(clampedAbsoluteTargetRect.size()));
+
+    // Don't create empty ImageBuffers.
+    if (imageSize.isEmpty())
         return false;
 
-    // Allocate an image buffer as big as the absolute unclipped size of the object
-    OwnPtr<ImageBuffer> image = ImageBuffer::create(imageRect.size(), colorSpace);
+    OwnPtr<ImageBuffer> image = ImageBuffer::create(imageSize, colorSpace);
     if (!image)
         return false;
 
-    GraphicsContext* imageContext = image->context();
-
-    // Transform the mask image coordinate system to absolute screen coordinates
-    imageContext->translate(-absoluteTargetRect.x(), -absoluteTargetRect.y());
-    imageContext->concatCTM(absoluteTransform);
-
     imageBuffer = image.release();
     return true;
 }
 
-void SVGImageBufferTools::clipToImageBuffer(GraphicsContext* context, const AffineTransform& absoluteTransform, const FloatRect& absoluteTargetRect, ImageBuffer* imageBuffer)
+void SVGImageBufferTools::clipToImageBuffer(GraphicsContext* context, const AffineTransform& absoluteTransform, const FloatRect& clampedAbsoluteTargetRect, ImageBuffer* imageBuffer)
 {
     ASSERT(context);
     ASSERT(imageBuffer);
@@ -64,10 +72,25 @@ void SVGImageBufferTools::clipToImageBuffer(GraphicsContext* context, const Affi
     // The mask image has been created in the device coordinate space, as the image should not be scaled.
     // So the actual masking process has to be done in the device coordinate space as well.
     context->concatCTM(absoluteTransform.inverse());
-    context->clipToImageBuffer(imageBuffer, absoluteTargetRect);
+    context->clipToImageBuffer(imageBuffer, clampedAbsoluteTargetRect);
     context->concatCTM(absoluteTransform);
 }
 
+IntSize SVGImageBufferTools::roundedImageBufferSize(const FloatSize& size)
+{
+    return IntSize(static_cast<int>(lroundf(size.width())), static_cast<int>(lroundf(size.height())));
+}
+
+FloatRect SVGImageBufferTools::clampedAbsoluteTargetRectForRenderer(const RenderObject* renderer, const AffineTransform& absoluteTransform, const FloatRect& targetRect)
+{
+    ASSERT(renderer);
+
+    const RenderSVGRoot* svgRoot = SVGRenderSupport::findTreeRootObject(renderer);
+    FloatRect clampedAbsoluteTargetRect = absoluteTransform.mapRect(targetRect);
+    clampedAbsoluteTargetRect.intersect(svgRoot->contentBoxRect());
+    return clampedAbsoluteTargetRect;
+}
+
 }
 
 #endif // ENABLE(SVG)
diff --git a/WebCore/rendering/SVGImageBufferTools.h b/WebCore/rendering/SVGImageBufferTools.h
index bdbcb1c..7535042 100644
--- a/WebCore/rendering/SVGImageBufferTools.h
+++ b/WebCore/rendering/SVGImageBufferTools.h
@@ -28,15 +28,18 @@ namespace WebCore {
 
 class AffineTransform;
 class FloatRect;
+class FloatSize;
 class GraphicsContext;
 class RenderObject;
 
 class SVGImageBufferTools : public Noncopyable {
 public:
-    static bool createImageBuffer(const AffineTransform& absoluteTransform, const FloatRect& absoluteTargetRect, OwnPtr<ImageBuffer>&, ImageColorSpace);
-    static void clipToImageBuffer(GraphicsContext*, const AffineTransform& absoluteTransform, const FloatRect& absoluteTargetRect, ImageBuffer*);
+    static bool createImageBuffer(const FloatRect& clampedAbsoluteTargetRect, OwnPtr<ImageBuffer>&, ImageColorSpace);
+    static void clipToImageBuffer(GraphicsContext*, const AffineTransform& absoluteTransform, const FloatRect& clampedAbsoluteTargetRect, ImageBuffer*);
 
-    static AffineTransform absoluteTransformFromContext(GraphicsContext*);
+    static AffineTransform transformationToOutermostSVGCoordinateSystem(const RenderObject*);
+    static FloatRect clampedAbsoluteTargetRectForRenderer(const RenderObject*, const AffineTransform& absouteTransform, const FloatRect& targetRect);
+    static IntSize roundedImageBufferSize(const FloatSize&);
 
 private:
     SVGImageBufferTools() { }
diff --git a/WebCore/rendering/SVGRenderSupport.cpp b/WebCore/rendering/SVGRenderSupport.cpp
index e265b2b..90fed6a 100644
--- a/WebCore/rendering/SVGRenderSupport.cpp
+++ b/WebCore/rendering/SVGRenderSupport.cpp
@@ -169,13 +169,7 @@ void SVGRenderSupport::renderSubtreeToImage(ImageBuffer* image, RenderObject* it
     ASSERT(image);
     ASSERT(image->context());
 
-    // FIXME: This sets the rect to the viewable area of the current frame. This
-    // is used to support text drawings to the ImageBuffer. See bug 30399.
-    IntRect rect;
-    FrameView* frameView = item->document()->view();
-    if (frameView)
-        rect = IntRect(0, 0, frameView->visibleWidth(), frameView->visibleHeight());
-    PaintInfo info(image->context(), rect, PaintPhaseForeground, 0, 0, 0);
+    PaintInfo info(image->context(), PaintInfo::infiniteRect(), PaintPhaseForeground, 0, 0, 0);
 
     // FIXME: isSVGContainer returns true for RenderSVGViewportContainer, so if this is ever
     // called with one of those, we will read from the wrong offset in an object due to a bad cast.
@@ -219,7 +213,7 @@ FloatRect SVGRenderSupport::computeContainerBoundingBox(const RenderObject* cont
     return boundingBox;
 }
 
-static inline RenderSVGRoot* svgRootTreeObject(RenderObject* start)
+const RenderSVGRoot* SVGRenderSupport::findTreeRootObject(const RenderObject* start)
 {
     while (start && !start->isSVGRoot())
         start = start->parent();
@@ -241,7 +235,7 @@ static inline void invalidateResourcesOfChildren(RenderObject* start)
 
 void SVGRenderSupport::layoutChildren(RenderObject* start, bool selfNeedsLayout)
 {
-    bool layoutSizeChanged = svgRootTreeObject(start)->isLayoutSizeChanged();
+    bool layoutSizeChanged = findTreeRootObject(start)->isLayoutSizeChanged();
     HashSet<RenderObject*> notlayoutedObjects;
 
     for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) {
diff --git a/WebCore/rendering/SVGRenderSupport.h b/WebCore/rendering/SVGRenderSupport.h
index 576475b..715fb55 100644
--- a/WebCore/rendering/SVGRenderSupport.h
+++ b/WebCore/rendering/SVGRenderSupport.h
@@ -36,6 +36,7 @@ class ImageBuffer;
 class RenderBoxModelObject;
 class RenderObject;
 class RenderStyle;
+class RenderSVGRoot;
 class TransformState;
 
 // SVGRendererSupport is a helper class sharing code between all SVG renderers.
@@ -80,6 +81,7 @@ public:
 
     // FIXME: These methods do not belong here.
     static const RenderObject* findTextRootObject(const RenderObject* start);
+    static const RenderSVGRoot* findTreeRootObject(const RenderObject* start);
 
 private:
     // This class is not constructable.
diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp
index 5193e2a..b7f9717 100644
--- a/WebCore/svg/SVGSVGElement.cpp
+++ b/WebCore/svg/SVGSVGElement.cpp
@@ -217,6 +217,9 @@ FloatPoint SVGSVGElement::currentTranslate() const
 void SVGSVGElement::setCurrentTranslate(const FloatPoint &translation)
 {
     m_translation = translation;
+    if (RenderObject* object = renderer())
+        object->setNeedsLayout(true);
+
     if (parentNode() == document() && document()->renderer())
         document()->renderer()->repaint();
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list