Reviewed by Maciej.
authoroliver <oliver@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Oct 2007 12:42:32 +0000 (12:42 +0000)
committeroliver <oliver@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Oct 2007 12:42:32 +0000 (12:42 +0000)
        http://bugs.webkit.org/show_bug.cgi?id=9976
        Fix negative width issue in Hixie's test

        Refuse to render zero or negative width/height.

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

LayoutTests/ChangeLog
LayoutTests/svg/hixie/error/013-expected.checksum [new file with mode: 0644]
LayoutTests/svg/hixie/error/013-expected.png [new file with mode: 0644]
LayoutTests/svg/hixie/error/013-expected.txt [new file with mode: 0644]
LayoutTests/svg/hixie/error/013.xml [moved from LayoutTests/svg/hixie/error/013-broken.xml with 100% similarity]
WebCore/ChangeLog
WebCore/rendering/RenderSVGContainer.cpp
WebCore/rendering/RenderSVGRoot.cpp

index a906561..a8b4865 100644 (file)
@@ -3,6 +3,22 @@
         Reviewed by Maciej.
 
         Testcase for:
+        http://bugs.webkit.org/show_bug.cgi?id=9976
+        Fix negative width issue in Hixie's test
+
+        * svg/hixie/error/013-broken-expected.checksum: Removed.
+        * svg/hixie/error/013-broken-expected.png: Removed.
+        * svg/hixie/error/013-broken-expected.txt: Removed.
+        * svg/hixie/error/013-broken.xml: Removed.
+        * svg/hixie/error/013-expected.checksum: Added.
+        * svg/hixie/error/013-expected.png: Added.
+        * svg/hixie/error/013-expected.txt: Added.
+
+2007-06-26  Rob Buis  <buis@kde.org>
+
+        Reviewed by Maciej.
+
+        Testcase for:
         http://bugs.webkit.org/show_bug.cgi?id=12062
         WebCore does not handle CSS-specified fill fallback correctly
 
diff --git a/LayoutTests/svg/hixie/error/013-expected.checksum b/LayoutTests/svg/hixie/error/013-expected.checksum
new file mode 100644 (file)
index 0000000..862b264
--- /dev/null
@@ -0,0 +1 @@
+5d4145e5756207e345bc55e61e97c212
\ No newline at end of file
diff --git a/LayoutTests/svg/hixie/error/013-expected.png b/LayoutTests/svg/hixie/error/013-expected.png
new file mode 100644 (file)
index 0000000..20cb386
Binary files /dev/null and b/LayoutTests/svg/hixie/error/013-expected.png differ
diff --git a/LayoutTests/svg/hixie/error/013-expected.txt b/LayoutTests/svg/hixie/error/013-expected.txt
new file mode 100644 (file)
index 0000000..db1fc2c
--- /dev/null
@@ -0,0 +1,18 @@
+CONSOLE MESSAGE: line 10: Error: A negative value for svg attribute <width> is not allowed
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x100
+  RenderBlock {html} at (0,0) size 800x100
+    RenderBody {body} at (8,8) size 784x76
+      RenderBlock (anonymous) at (0,0) size 784x24
+        RenderSVGContainer {svg} at (18,28) size 125x13
+          RenderSVGText {text} at (10,30) size 125x13 contains 1 chunk(s)
+            RenderSVGInlineText {#text} at (0,-10) size 125x13
+              chunk 1 text run 1 at (10.00,30.00) startOffset 0 endOffset 30 width 125.00: "FAIL (This should not render.)"
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {p} at (0,40) size 784x36 [color=#008000]
+        RenderText {#text} at (0,0) size 749x36
+          text run at (0,0) width 417: "This line should be green, the word \"FAIL\" should not appear on "
+          text run at (417,0) width 332: "this page, but a highly perceivable indication of error"
+          text run at (0,18) width 65: "should be "
+          text run at (65,18) width 125: "present somewhere."
index 993dae2..dc8f148 100644 (file)
@@ -2,6 +2,20 @@
 
         Reviewed by Maciej.
 
+        http://bugs.webkit.org/show_bug.cgi?id=9976
+        Fix negative width issue in Hixie's test
+
+        Refuse to render zero or negative width/height.
+
+        * rendering/RenderSVGContainer.cpp:
+        (WebCore::RenderSVGContainer::paint):
+        * rendering/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::paint):
+
+2007-06-26  Rob Buis  <buis@kde.org>
+
+        Reviewed by Maciej.
+
         http://bugs.webkit.org/show_bug.cgi?id=12062
         WebCore does not handle CSS-specified fill fallback correctly
 
index be7c521..c171c12 100644 (file)
@@ -152,6 +152,10 @@ void RenderSVGContainer::paint(PaintInfo& paintInfo, int parentX, int parentY)
     if (paintInfo.context->paintingDisabled() || !drawsContents())
         return;
 
+    // A value of zero disables rendering of the element. 
+    if (!viewport().isEmpty() && (viewport().width() <= 0. || viewport().height() <= 0.))
+        return;
+
     if (!firstChild()) {
 #if ENABLE(SVG_EXPERIMENTAL_FEATURES)
         // Spec: groups w/o children still may render filter content.
index 4d197f7..a8f7b6d 100644 (file)
@@ -151,6 +151,10 @@ void RenderSVGRoot::paint(PaintInfo& paintInfo, int parentX, int parentY)
     if (paintInfo.context->paintingDisabled())
         return;
 
+    // A value of zero disables rendering of the element. 
+    if (viewport().width() <= 0. || viewport().height() <= 0.)
+        return;
+
     // This should only exist for <svg> renderers
     if (hasBoxDecorations() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection)) 
         paintBoxDecorations(paintInfo, m_x + parentX, m_y + parentY);