Reviewed by Darin.
authorrwlbuis@webkit.org <rwlbuis@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Dec 2007 21:25:27 +0000 (21:25 +0000)
committerrwlbuis@webkit.org <rwlbuis@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Dec 2007 21:25:27 +0000 (21:25 +0000)
        http://bugs.webkit.org/show_bug.cgi?id=15767
        Text decorations do not respect "visibility" property

        Only paint decorations if visibility is "visible".

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

LayoutTests/ChangeLog
LayoutTests/svg/custom/text-decoration-visibility-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/text-decoration-visibility-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/text-decoration-visibility-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/text-decoration-visibility.svg [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/SVGInlineTextBox.cpp

index ba0f6a7..cbf3ccf 100644 (file)
@@ -1,3 +1,16 @@
+2007-12-03  Rob Buis  <buis@kde.org>
+
+        Reviewed by Darin.
+
+        Testcase for:
+        http://bugs.webkit.org/show_bug.cgi?id=15767
+        Text decorations do not respect "visibility" property
+
+        * svg/custom/text-decoration-visibility-expected.checksum: Added.
+        * svg/custom/text-decoration-visibility-expected.png: Added.
+        * svg/custom/text-decoration-visibility-expected.txt: Added.
+        * svg/custom/text-decoration-visibility.svg: Added.
+
 2007-12-03  Alice Liu  <alice.liu@apple.com>
 
         Removing passing tests
diff --git a/LayoutTests/svg/custom/text-decoration-visibility-expected.checksum b/LayoutTests/svg/custom/text-decoration-visibility-expected.checksum
new file mode 100644 (file)
index 0000000..28cd31c
--- /dev/null
@@ -0,0 +1 @@
+49a4eb0c6f5eb4ef98abcda0d3a4bb22
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/text-decoration-visibility-expected.png b/LayoutTests/svg/custom/text-decoration-visibility-expected.png
new file mode 100644 (file)
index 0000000..cbd6279
Binary files /dev/null and b/LayoutTests/svg/custom/text-decoration-visibility-expected.png differ
diff --git a/LayoutTests/svg/custom/text-decoration-visibility-expected.txt b/LayoutTests/svg/custom/text-decoration-visibility-expected.txt
new file mode 100644 (file)
index 0000000..f401baa
--- /dev/null
@@ -0,0 +1,10 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (10,16) size 471x88
+    RenderSVGText {text} at (10,30) size 351x18 contains 1 chunk(s)
+      RenderSVGInlineText {#text} at (0,-14) size 351x18
+        chunk 1 text run 1 at (10.00,30.00) startOffset 0 endOffset 55 width 351.00: "There should be no text or lines below this. Bug 15767."
+    RenderSVGText {text} at (100,100) size 381x18 contains 1 chunk(s)
+      RenderSVGInlineText {#text} at (0,-14) size 381x18
+        chunk 1 text run 1 at (100.00,100.00) startOffset 0 endOffset 39 width 381.00: "THIS TEXT AND UNDERLINE SHOULD NOT SHOW"
diff --git a/LayoutTests/svg/custom/text-decoration-visibility.svg b/LayoutTests/svg/custom/text-decoration-visibility.svg
new file mode 100644 (file)
index 0000000..e7b9f46
--- /dev/null
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+  <text x="10" y="30">There should be no text or lines below this. Bug 15767.</text>
+  <text x="100" y="100" visibility="hidden" style="text-decoration:underline;">THIS TEXT AND UNDERLINE SHOULD NOT SHOW</text>
+</svg>
index 6b5e548..03fd8b1 100644 (file)
@@ -1,3 +1,15 @@
+2007-12-03  Rob Buis  <buis@kde.org>
+
+        Reviewed by Darin.
+
+        http://bugs.webkit.org/show_bug.cgi?id=15767
+        Text decorations do not respect "visibility" property
+
+        Only paint decorations if visibility is "visible".
+
+        * rendering/SVGInlineTextBox.cpp:
+        (WebCore::SVGInlineTextBox::paintDecoration):
+
 2007-12-03  Steve Falkenburg  <sfalken@apple.com>
 
         Fix build.
index 96695dc..459c1ea 100644 (file)
@@ -483,6 +483,9 @@ static inline Path pathForDecoration(ETextDecoration decoration, RenderObject* o
 
 void SVGInlineTextBox::paintDecoration(ETextDecoration decoration, GraphicsContext* context, int tx, int ty, int width, const SVGChar& svgChar, const SVGTextDecorationInfo& info)
 {
+    if (object()->style()->visibility() != VISIBLE)
+        return;
+
     // This function does NOT accept combinated text decorations. It's meant to be invoked for just one.
     ASSERT(decoration == TDNONE || decoration == UNDERLINE || decoration == OVERLINE || decoration == LINE_THROUGH || decoration == BLINK);