Title: [242439] releases/WebKitGTK/webkit-2.24
Revision
242439
Author
carlo...@webkit.org
Date
2019-03-05 04:40:28 -0800 (Tue, 05 Mar 2019)

Log Message

Merge r241942 - Fix unitless usage of mathsize
https://bugs.webkit.org/show_bug.cgi?id=194940

Patch by Rob Buis <rb...@igalia.com> on 2019-02-22
Reviewed by Frédéric Wang.

Source/WebCore:

Convert unitless lengths to percentage values to correct the computed
font size.

* mathml/MathMLElement.cpp:
(WebCore::convertToPercentageIfNeeded):
(WebCore::MathMLElement::collectStyleForPresentationAttribute):

LayoutTests:

Tests lengths-1.html and length-3.html now pass.

* TestExpectations:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.24/LayoutTests/ChangeLog (242438 => 242439)


--- releases/WebKitGTK/webkit-2.24/LayoutTests/ChangeLog	2019-03-05 12:40:23 UTC (rev 242438)
+++ releases/WebKitGTK/webkit-2.24/LayoutTests/ChangeLog	2019-03-05 12:40:28 UTC (rev 242439)
@@ -1,3 +1,14 @@
+2019-02-22  Rob Buis  <rb...@igalia.com>
+
+        Fix unitless usage of mathsize
+        https://bugs.webkit.org/show_bug.cgi?id=194940
+
+        Reviewed by Frédéric Wang.
+
+        Tests lengths-1.html and length-3.html now pass.
+
+        * TestExpectations:
+
 2019-02-21  Darin Adler  <da...@apple.com>
 
         Some refinements for Node and Document

Modified: releases/WebKitGTK/webkit-2.24/LayoutTests/TestExpectations (242438 => 242439)


--- releases/WebKitGTK/webkit-2.24/LayoutTests/TestExpectations	2019-03-05 12:40:23 UTC (rev 242438)
+++ releases/WebKitGTK/webkit-2.24/LayoutTests/TestExpectations	2019-03-05 12:40:28 UTC (rev 242439)
@@ -727,9 +727,7 @@
 imported/w3c/web-platform-tests/html/browsers/windows/targeting-cross-origin-nested-browsing-contexts.sub.html [ Pass Failure ]
 
 # These MathML WPT tests fail.
-webkit.org/b/180013 imported/w3c/web-platform-tests/mathml/relations/css-styling/lengths-1.html [ ImageOnlyFailure ]
 webkit.org/b/180013 imported/w3c/web-platform-tests/mathml/relations/css-styling/lengths-2.html [ ImageOnlyFailure ]
-webkit.org/b/180013 imported/w3c/web-platform-tests/mathml/relations/css-styling/lengths-3.html [ Failure ]
 
 # These webmessaging WPT tests time out.
 webkit.org/b/187034 imported/w3c/web-platform-tests/webmessaging/MessageEvent_onmessage_postMessage_infinite_loop.html [ Skip ]

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog (242438 => 242439)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-03-05 12:40:23 UTC (rev 242438)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-03-05 12:40:28 UTC (rev 242439)
@@ -1,3 +1,17 @@
+2019-02-22  Rob Buis  <rb...@igalia.com>
+
+        Fix unitless usage of mathsize
+        https://bugs.webkit.org/show_bug.cgi?id=194940
+
+        Reviewed by Frédéric Wang.
+
+        Convert unitless lengths to percentage values to correct the computed
+        font size.
+
+        * mathml/MathMLElement.cpp:
+        (WebCore::convertToPercentageIfNeeded):
+        (WebCore::MathMLElement::collectStyleForPresentationAttribute):
+
 2019-02-21  Darin Adler  <da...@apple.com>
 
         Some refinements for Node and Document

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/mathml/MathMLElement.cpp (242438 => 242439)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/mathml/MathMLElement.cpp	2019-03-05 12:40:23 UTC (rev 242438)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/mathml/MathMLElement.cpp	2019-03-05 12:40:28 UTC (rev 242439)
@@ -97,6 +97,15 @@
     return StyledElement::isPresentationAttribute(name);
 }
 
+static String convertToPercentageIfNeeded(const AtomicString& value)
+{
+    bool ok = false;
+    float unitlessValue = value.toFloat(&ok);
+    if (ok)
+        return String::format("%.3f%%", unitlessValue * 100.0);
+    return value;
+}
+
 void MathMLElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStyleProperties& style)
 {
     if (name == mathbackgroundAttr)
@@ -104,7 +113,7 @@
     else if (name == mathsizeAttr) {
         // The following three values of mathsize are handled in WebCore/css/mathml.css
         if (value != "normal" && value != "small" && value != "big")
-            addPropertyToPresentationAttributeStyle(style, CSSPropertyFontSize, value);
+            addPropertyToPresentationAttributeStyle(style, CSSPropertyFontSize, convertToPercentageIfNeeded(value));
     } else if (name == mathcolorAttr)
         addPropertyToPresentationAttributeStyle(style, CSSPropertyColor, value);
     // FIXME: deprecated attributes that should loose in a conflict with a non deprecated attribute
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to