Bug #: 5326
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Oct 2005 08:29:21 +0000 (08:29 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Oct 2005 08:29:21 +0000 (08:29 +0000)
Submitted by: Rob Buis  <rwlbuis@xs4all.nl>
Reviewed by: eseidel
        Test cases updated:
        * svg-tests/W3C-SVG-1.1/filters-color-01-b-expected.checksum:
        * svg-tests/W3C-SVG-1.1/filters-color-01-b-expected.png:
        * svg-tests/W3C-SVG-1.1/filters-color-01-b-expected.txt:
        * svg-tests/W3C-SVG-1.1/struct-symbol-01-b-expected.checksum:
        * svg-tests/W3C-SVG-1.1/struct-symbol-01-b-expected.png:
        * svg-tests/W3C-SVG-1.1/struct-symbol-01-b-expected.txt:

        Fixed <svg> to base %lengths off of the nearest viewbox.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=5326

        * ksvg2/svg/SVGPreserveAspectRatioImpl.cpp:
        (SVGPreserveAspectRatioImpl::SVGPreserveAspectRatioImpl):
        * ksvg2/svg/SVGSVGElementImpl.cpp:
        (SVGSVGElementImpl::x):
        (SVGSVGElementImpl::y):
        (SVGSVGElementImpl::width):
        (SVGSVGElementImpl::height):

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

LayoutTests/svg/W3C-SVG-1.1/filters-color-01-b-expected.checksum
LayoutTests/svg/W3C-SVG-1.1/filters-color-01-b-expected.png
LayoutTests/svg/W3C-SVG-1.1/filters-color-01-b-expected.txt
LayoutTests/svg/W3C-SVG-1.1/struct-symbol-01-b-expected.checksum
LayoutTests/svg/W3C-SVG-1.1/struct-symbol-01-b-expected.png
LayoutTests/svg/W3C-SVG-1.1/struct-symbol-01-b-expected.txt
WebCore/ChangeLog-2005-12-19
WebCore/ksvg2/svg/SVGPreserveAspectRatioImpl.cpp
WebCore/ksvg2/svg/SVGSVGElementImpl.cpp

index 73e4187dd5d10923569278d0e2d11890c0432dd4..ea824ae74f1daedf97c3170f4ad450f3d487ea7a 100644 (file)
@@ -1 +1 @@
-0fed2ac026fbcd5e0da6d34b0857c3e6
\ No newline at end of file
+42f1c3af5e2a656e86e3de8c1cf7ad6b
\ No newline at end of file
index 7d46c9456007dc54ad487231922dae2aad810046..362b8f12009200b5f4574e212e586d2c7a883502 100644 (file)
Binary files a/LayoutTests/svg/W3C-SVG-1.1/filters-color-01-b-expected.png and b/LayoutTests/svg/W3C-SVG-1.1/filters-color-01-b-expected.png differ
index 2355c638b61dd06d7bc148718e4200bf264fc1c0..f06a8cbb013a3a126e14af2b79e3625a0cbf8162 100644 (file)
@@ -4,14 +4,14 @@ KCanvasRegistry:
   KCanvasResource {id="Saturate40" [type=FILTER]  [bounding box=at (-5,-5) size 110x110] [effect bounding box mode=0] [effects=[[type=COLOR-MATRIX] [in="SourceGraphic"] [color matrix type=CMT_SATURATE] [values=[0.25]]]]}
   KCanvasResource {id="LuminanceToAlpha" [type=FILTER]  [bounding box=at (-5,-5) size 110x110] [effect bounding box mode=0] [effects=[[type=COLOR-MATRIX] [in="SourceGraphic"] [result="a"] [color matrix type=LUMINANCE-TO-ALPHA] [values=[]], [type=COMPOSITE] [in="SourceGraphic"] [in2="a"] [k1=0.00 k2=0.00 k3=0.00 k4=0.00]]]}
   KRenderingPaintServer {id="MyGradient" [type=LINEAR-GRADIENT] [stops=[(0.00,#DD00DD), (0.33,#22CC22), (0.67,#400000), (1.00,#A0A0FF)]] [start=(0,0)] [end=(0,0)]}
-KCanvasContainer at (-9,0) size 488x359
-  KCanvasContainer at (-9,5) size 463x289 [fill={[type=SOLID] [color=#000000]}]
-    KCanvasContainer at (-9,5) size 463x289 [transform={m=((0.58,0.00)(0.00,0.58)) t=(-10.00,5.00)}]
-      KCanvasContainer at (-9,5) size 463x289 [fill={[type=SOLID] [color=#000000]}]
-        KCanvasItem {rect} at (-9,5) size 463x289 [stroke={[type=SOLID] [color=#0000FF]}] [data="M1.00,1.00L799.00,1.00L799.00,499.00L1.00,499.00"]
-        KCanvasItem {rect} at (1,16) size 440x23 [fill={[id="MyGradient"]}] [data="M20.00,20.00L780.00,20.00L780.00,60.00L20.00,60.00"]
-        KCanvasItem {rect} at (1,74) size 440x23 [fill={[id="MyGradient"]}] [filter="Matrix"] [data="M20.00,120.00L780.00,120.00L780.00,160.00L20.00,160.00"]
-        KCanvasItem {rect} at (1,132) size 440x23 [fill={[id="MyGradient"]}] [filter="Saturate40"] [data="M20.00,220.00L780.00,220.00L780.00,260.00L20.00,260.00"]
-        KCanvasItem {rect} at (1,190) size 440x23 [fill={[id="MyGradient"]}] [filter="HueRotate90"] [data="M20.00,320.00L780.00,320.00L780.00,360.00L20.00,360.00"]
-        KCanvasItem {rect} at (1,248) size 440x23 [fill={[id="MyGradient"]}] [filter="LuminanceToAlpha"] [data="M20.00,420.00L780.00,420.00L780.00,460.00L20.00,460.00"]
+KCanvasContainer at (0,0) size 479x359
+  KCanvasContainer at (8,5) size 463x289 [fill={[type=SOLID] [color=#000000]}]
+    KCanvasContainer at (8,5) size 463x289 [transform={m=((0.58,0.00)(0.00,0.58)) t=(8.00,5.00)}]
+      KCanvasContainer at (8,5) size 463x289 [fill={[type=SOLID] [color=#000000]}]
+        KCanvasItem {rect} at (8,5) size 463x289 [stroke={[type=SOLID] [color=#0000FF]}] [data="M1.00,1.00L799.00,1.00L799.00,499.00L1.00,499.00"]
+        KCanvasItem {rect} at (19,16) size 440x23 [fill={[id="MyGradient"]}] [data="M20.00,20.00L780.00,20.00L780.00,60.00L20.00,60.00"]
+        KCanvasItem {rect} at (19,74) size 440x23 [fill={[id="MyGradient"]}] [filter="Matrix"] [data="M20.00,120.00L780.00,120.00L780.00,160.00L20.00,160.00"]
+        KCanvasItem {rect} at (19,132) size 440x23 [fill={[id="MyGradient"]}] [filter="Saturate40"] [data="M20.00,220.00L780.00,220.00L780.00,260.00L20.00,260.00"]
+        KCanvasItem {rect} at (19,190) size 440x23 [fill={[id="MyGradient"]}] [filter="HueRotate90"] [data="M20.00,320.00L780.00,320.00L780.00,360.00L20.00,360.00"]
+        KCanvasItem {rect} at (19,248) size 440x23 [fill={[id="MyGradient"]}] [filter="LuminanceToAlpha"] [data="M20.00,420.00L780.00,420.00L780.00,460.00L20.00,460.00"]
   KCanvasItem {rect} at (0,0) size 479x359 [stroke={[type=SOLID] [color=#000000]}] [data="M1.00,1.00L479.00,1.00L479.00,359.00L1.00,359.00"]
index d05e9ace676ba7560d649a520fff8032bafdbeb2..2b3519603c63a65d1045822d15dcbcc78e3cdc1d 100644 (file)
@@ -1 +1 @@
-30436c8a6010788fde414e1211cd933b
\ No newline at end of file
+a4ce5c507449ccbed31fc0bf3497bc53
\ No newline at end of file
index 491b0d215ee85563c941053861f00a2ef22fb0e3..f6115cfa8549a7a269761910b7306a28bcae8a0e 100644 (file)
Binary files a/LayoutTests/svg/W3C-SVG-1.1/struct-symbol-01-b-expected.png and b/LayoutTests/svg/W3C-SVG-1.1/struct-symbol-01-b-expected.png differ
index 7ad742191132eba3b338f15f4b4b023a8b03a7e4..a22035866e27a803c9d88864fa6c4efbfc5015c6 100644 (file)
@@ -1,16 +1,16 @@
 KCanvasRegistry: empty
 KCanvasContainer at (0,0) size 479x359
-  KCanvasContainer at (0,0) size 390x300 [fill={[type=SOLID] [color=#000000]}]
-    KCanvasContainer at (0,0) size 390x300 [fill={[type=SOLID] [color=#000000]}]
-      KCanvasContainer at (0,0) size 150x150 [fill={[type=SOLID] [color=#000000]}]
-        KCanvasContainer at (0,0) size 150x150 [fill={[type=SOLID] [color=#000000]}]
-          KCanvasContainer at (0,0) size 150x150 [transform={m=((0.15,0.00)(0.00,0.15)) t=(0.00,0.00)}]
-            KCanvasItem at (0,0) size 150x150 [fill={[type=IMAGE]}] [data="M0.00,0.00L1000.00,0.00L1000.00,1000.00L0.00,1000.00"]
-      KCanvasContainer at (240,150) size 150x150 [fill={[type=SOLID] [color=#000000]}]
-        KCanvasContainer at (240,150) size 150x150 [transform={m=((1.00,0.00)(0.00,1.00)) t=(240.00,150.00)}] [fill={[type=SOLID] [color=#000000]}]
-          KCanvasContainer at (240,150) size 150x150 [transform={m=((0.15,0.00)(0.00,0.15)) t=(240.00,150.00)}]
-            KCanvasItem {rect} at (240,150) size 75x75 [fill={[type=SOLID] [color=#FFFF00]}] [data="M0.00,0.00L500.00,0.00L500.00,500.00L0.00,500.00"]
-            KCanvasItem {rect} at (315,150) size 75x75 [fill={[type=SOLID] [color=#FF0000]}] [data="M500.00,0.00L1000.00,0.00L1000.00,500.00L500.00,500.00"]
-            KCanvasItem {rect} at (240,225) size 75x75 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,500.00L500.00,500.00L500.00,1000.00L0.00,1000.00"]
-            KCanvasItem {rect} at (315,225) size 75x75 [fill={[type=SOLID] [color=#FFFF00]}] [data="M500.00,500.00L1000.00,500.00L1000.00,1000.00L500.00,1000.00"]
+  KCanvasContainer at (45,0) size 390x300 [fill={[type=SOLID] [color=#000000]}]
+    KCanvasContainer at (45,0) size 390x300 [fill={[type=SOLID] [color=#000000]}]
+      KCanvasContainer at (45,0) size 150x150 [fill={[type=SOLID] [color=#000000]}]
+        KCanvasContainer at (45,0) size 150x150 [fill={[type=SOLID] [color=#000000]}]
+          KCanvasContainer at (45,0) size 150x150 [transform={m=((0.15,0.00)(0.00,0.15)) t=(45.00,0.00)}]
+            KCanvasItem at (45,0) size 150x150 [fill={[type=IMAGE]}] [data="M0.00,0.00L1000.00,0.00L1000.00,1000.00L0.00,1000.00"]
+      KCanvasContainer at (285,150) size 150x150 [fill={[type=SOLID] [color=#000000]}]
+        KCanvasContainer at (285,150) size 150x150 [transform={m=((1.00,0.00)(0.00,1.00)) t=(240.00,150.00)}] [fill={[type=SOLID] [color=#000000]}]
+          KCanvasContainer at (285,150) size 150x150 [transform={m=((0.15,0.00)(0.00,0.15)) t=(285.00,150.00)}]
+            KCanvasItem {rect} at (285,150) size 75x75 [fill={[type=SOLID] [color=#FFFF00]}] [data="M0.00,0.00L500.00,0.00L500.00,500.00L0.00,500.00"]
+            KCanvasItem {rect} at (360,150) size 75x75 [fill={[type=SOLID] [color=#FF0000]}] [data="M500.00,0.00L1000.00,0.00L1000.00,500.00L500.00,500.00"]
+            KCanvasItem {rect} at (285,225) size 75x75 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,500.00L500.00,500.00L500.00,1000.00L0.00,1000.00"]
+            KCanvasItem {rect} at (360,225) size 75x75 [fill={[type=SOLID] [color=#FFFF00]}] [data="M500.00,500.00L1000.00,500.00L1000.00,1000.00L500.00,1000.00"]
   KCanvasItem {rect} at (0,0) size 479x359 [stroke={[type=SOLID] [color=#000000]}] [data="M1.00,1.00L479.00,1.00L479.00,359.00L1.00,359.00"]
index 6c4915c5799da2da45dff09bc4e8abee67f2caeb..1ed48cb9bb6718ffc092a737ae6de7bfd36c6991 100644 (file)
@@ -1,3 +1,26 @@
+2005-10-13  Rob Buis  <rwlbuis@xs4all.nl>
+
+        Reviewed by eseidel.
+
+        Test cases updated:
+        * svg-tests/W3C-SVG-1.1/filters-color-01-b-expected.checksum:
+        * svg-tests/W3C-SVG-1.1/filters-color-01-b-expected.png:
+        * svg-tests/W3C-SVG-1.1/filters-color-01-b-expected.txt:
+        * svg-tests/W3C-SVG-1.1/struct-symbol-01-b-expected.checksum:
+        * svg-tests/W3C-SVG-1.1/struct-symbol-01-b-expected.png:
+        * svg-tests/W3C-SVG-1.1/struct-symbol-01-b-expected.txt:
+
+        Fixed <svg> to base %lengths off of the nearest viewbox.
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=5326
+
+        * ksvg2/svg/SVGPreserveAspectRatioImpl.cpp:
+        (SVGPreserveAspectRatioImpl::SVGPreserveAspectRatioImpl):
+        * ksvg2/svg/SVGSVGElementImpl.cpp:
+        (SVGSVGElementImpl::x):
+        (SVGSVGElementImpl::y):
+        (SVGSVGElementImpl::width):
+        (SVGSVGElementImpl::height):
+
 2005-10-12  Vicki Murley  <vicki@apple.com>
 
         Reviewed by Hyatt.
index 8858b45d585fd0169f13ebd6c1cbcc600772b133..a469bf39227ec53bfd2aa7f66b59725775dfa997 100644 (file)
@@ -37,7 +37,7 @@ SVGPreserveAspectRatioImpl::SVGPreserveAspectRatioImpl(const SVGStyledElementImp
 {
     m_context = context;
     m_meetOrSlice = SVG_MEETORSLICE_MEET;
-    m_align = SVG_PRESERVEASPECTRATIO_XMINYMID;
+    m_align = SVG_PRESERVEASPECTRATIO_XMIDYMID;
 }
 
 SVGPreserveAspectRatioImpl::~SVGPreserveAspectRatioImpl()
index ada5764bc731d56026f044883d49da0941a64a8f..980db6018d48a58cef13d89127172558fbf06980 100644 (file)
@@ -87,12 +87,12 @@ SVGSVGElementImpl::~SVGSVGElementImpl()
 
 SVGAnimatedLengthImpl *SVGSVGElementImpl::x() const
 {
-    return lazy_create<SVGAnimatedLengthImpl>(m_x, static_cast<const SVGStyledElementImpl *>(0), LM_WIDTH, this);
+    return lazy_create<SVGAnimatedLengthImpl>(m_x, static_cast<const SVGStyledElementImpl *>(0), LM_WIDTH, ownerDocument()->documentElement() == static_cast<const KDOM::ElementImpl *>(this) ? this : viewportElement());
 }
 
 SVGAnimatedLengthImpl *SVGSVGElementImpl::y() const
 {
-    return lazy_create<SVGAnimatedLengthImpl>(m_y, static_cast<const SVGStyledElementImpl *>(0), LM_HEIGHT, this);
+    return lazy_create<SVGAnimatedLengthImpl>(m_y, static_cast<const SVGStyledElementImpl *>(0), LM_HEIGHT, ownerDocument()->documentElement() == static_cast<const KDOM::ElementImpl *>(this) ? this : viewportElement());
 }
 
 SVGAnimatedLengthImpl *SVGSVGElementImpl::width() const
@@ -100,7 +100,7 @@ SVGAnimatedLengthImpl *SVGSVGElementImpl::width() const
     if(!m_width)
     {
         KDOM::DOMString temp("100%");
-        lazy_create<SVGAnimatedLengthImpl>(m_width, static_cast<const SVGStyledElementImpl *>(0), LM_WIDTH, this);
+        lazy_create<SVGAnimatedLengthImpl>(m_width, static_cast<const SVGStyledElementImpl *>(0), LM_WIDTH, ownerDocument()->documentElement() == static_cast<const KDOM::ElementImpl *>(this) ? this : viewportElement());
         m_width->baseVal()->setValueAsString(temp.handle());
     }
 
@@ -112,7 +112,7 @@ SVGAnimatedLengthImpl *SVGSVGElementImpl::height() const
     if(!m_height)
     {
         KDOM::DOMString temp("100%");
-        lazy_create<SVGAnimatedLengthImpl>(m_height, static_cast<const SVGStyledElementImpl *>(0), LM_HEIGHT, this);
+        lazy_create<SVGAnimatedLengthImpl>(m_height, static_cast<const SVGStyledElementImpl *>(0), LM_HEIGHT, ownerDocument()->documentElement() == static_cast<const KDOM::ElementImpl *>(this) ? this : viewportElement());
         m_height->baseVal()->setValueAsString(temp.handle());
     }