https://bugs.webkit.org/show_bug.cgi?id=194940
Patch by Rob Buis <rbuis@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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241942
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2019-02-22 Rob Buis <rbuis@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 Simon Fraser <simon.fraser@apple.com>
Hardcode Visual Viewports on everywhere except iOS WK1
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 ]
+2019-02-22 Rob Buis <rbuis@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 Simon Fraser <simon.fraser@apple.com>
Hardcode Visual Viewports on everywhere except iOS WK1
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)
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