Extremely small monospace text size when SVG is included as an img
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Nov 2018 18:11:39 +0000 (18:11 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Nov 2018 18:11:39 +0000 (18:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191834

Reviewed by Myles C. Maxfield.
Source/WebCore:

Give defaultFixedFontSize a reasonable default value in Settings, so that clients
who omit to set it (like SVGImages) don't get broken rendering.

Test: svg/text/monospace-text-size-in-img.html

* page/Settings.yaml:

LayoutTests:

The test has an x offset in the text transform to work around a different bug
with text position (webkit.org/b/191871).

* svg/text/monospace-text-size-in-img-expected.html: Added.
* svg/text/monospace-text-size-in-img.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/svg/text/monospace-text-size-in-img-expected.html [new file with mode: 0644]
LayoutTests/svg/text/monospace-text-size-in-img.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/Settings.yaml

index d6bd41a..75bdfa8 100644 (file)
@@ -1,3 +1,16 @@
+2018-11-22  Simon Fraser  <simon.fraser@apple.com>
+
+        Extremely small monospace text size when SVG is included as an img
+        https://bugs.webkit.org/show_bug.cgi?id=191834
+
+        Reviewed by Myles C. Maxfield.
+        
+        The test has an x offset in the text transform to work around a different bug
+        with text position (webkit.org/b/191871).
+
+        * svg/text/monospace-text-size-in-img-expected.html: Added.
+        * svg/text/monospace-text-size-in-img.html: Added.
+
 2018-11-22  Javier Fernandez  <jfernandez@igalia.com>
 
         Tables with vertical-lr writing-mode doesn't apply correctly vertical-align: baseline
diff --git a/LayoutTests/svg/text/monospace-text-size-in-img-expected.html b/LayoutTests/svg/text/monospace-text-size-in-img-expected.html
new file mode 100644 (file)
index 0000000..12fd82e
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        svg {
+            display: block;
+            margin: 10px;
+            border: 1px solid blue;
+        }
+    </style>
+</head>
+<body>
+    <svg xmlns:xlink="http://www.w3.org/1999/xlink" width="220" height="60" viewbox="0 0 200 60">
+        <text font-family="monospace" transform="translate(0, 50) scale(5)">ABC</text>
+    </svg>
+</body>
+</html>
diff --git a/LayoutTests/svg/text/monospace-text-size-in-img.html b/LayoutTests/svg/text/monospace-text-size-in-img.html
new file mode 100644 (file)
index 0000000..2d6ebca
--- /dev/null
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        img {
+            display: block;
+            margin: 10px;
+            border: 1px solid blue;
+        }
+    </style>
+</head>
+<body>
+    <img src="data:image/svg+xml;charset=utf-8,%3Csvg xmlns:xlink='http://www.w3.org/1999/xlink' xmlns='http://www.w3.org/2000/svg' width='220' height='60' viewbox='0 0 200 60'%3E%3Ctext font-family='monospace' transform='translate(10, 50) scale(5)'%3EABC%3C/text%3E%3C/svg%3E" />
+</body>
+</html>
index b6d4dff..b038aad 100644 (file)
@@ -1,3 +1,17 @@
+2018-11-22  Simon Fraser  <simon.fraser@apple.com>
+
+        Extremely small monospace text size when SVG is included as an img
+        https://bugs.webkit.org/show_bug.cgi?id=191834
+
+        Reviewed by Myles C. Maxfield.
+
+        Give defaultFixedFontSize a reasonable default value in Settings, so that clients
+        who omit to set it (like SVGImages) don't get broken rendering.
+
+        Test: svg/text/monospace-text-size-in-img.html
+
+        * page/Settings.yaml:
+
 2018-11-22  Javier Fernandez  <jfernandez@igalia.com>
 
         Tables with vertical-lr writing-mode doesn't apply correctly vertical-align: baseline
index 65fb2cb..2b7c9fc 100644 (file)
@@ -74,7 +74,7 @@ defaultFontSize:
   onChange: setNeedsRecalcStyleInAllFrames
 defaultFixedFontSize:
   type: int
-  initial: 0
+  initial: 13
   onChange: setNeedsRecalcStyleInAllFrames
 
 editingBehaviorType: