Title: [238447] trunk
Revision
238447
Author
[email protected]
Date
2018-11-22 10:11:39 -0800 (Thu, 22 Nov 2018)

Log Message

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.
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.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (238446 => 238447)


--- trunk/LayoutTests/ChangeLog	2018-11-22 17:33:16 UTC (rev 238446)
+++ trunk/LayoutTests/ChangeLog	2018-11-22 18:11:39 UTC (rev 238447)
@@ -1,3 +1,16 @@
+2018-11-22  Simon Fraser  <[email protected]>
+
+        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  <[email protected]>
 
         Tables with vertical-lr writing-mode doesn't apply correctly vertical-align: baseline

Added: trunk/LayoutTests/svg/text/monospace-text-size-in-img-expected.html (0 => 238447)


--- trunk/LayoutTests/svg/text/monospace-text-size-in-img-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/text/monospace-text-size-in-img-expected.html	2018-11-22 18:11:39 UTC (rev 238447)
@@ -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>

Added: trunk/LayoutTests/svg/text/monospace-text-size-in-img.html (0 => 238447)


--- trunk/LayoutTests/svg/text/monospace-text-size-in-img.html	                        (rev 0)
+++ trunk/LayoutTests/svg/text/monospace-text-size-in-img.html	2018-11-22 18:11:39 UTC (rev 238447)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        img {
+            display: block;
+            margin: 10px;
+            border: 1px solid blue;
+        }
+    </style>
+</head>
+<body>
+    <img src="" 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>

Modified: trunk/Source/WebCore/ChangeLog (238446 => 238447)


--- trunk/Source/WebCore/ChangeLog	2018-11-22 17:33:16 UTC (rev 238446)
+++ trunk/Source/WebCore/ChangeLog	2018-11-22 18:11:39 UTC (rev 238447)
@@ -1,3 +1,17 @@
+2018-11-22  Simon Fraser  <[email protected]>
+
+        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  <[email protected]>
 
         Tables with vertical-lr writing-mode doesn't apply correctly vertical-align: baseline

Modified: trunk/Source/WebCore/page/Settings.yaml (238446 => 238447)


--- trunk/Source/WebCore/page/Settings.yaml	2018-11-22 17:33:16 UTC (rev 238446)
+++ trunk/Source/WebCore/page/Settings.yaml	2018-11-22 18:11:39 UTC (rev 238447)
@@ -74,7 +74,7 @@
   onChange: setNeedsRecalcStyleInAllFrames
 defaultFixedFontSize:
   type: int
-  initial: 0
+  initial: 13
   onChange: setNeedsRecalcStyleInAllFrames
 
 editingBehaviorType:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to