WebKit Bugzilla
Attachment 362708 Details for
Bug 194940
: Fix unitless usage of mathsize
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194940-20190222104030.patch (text/plain), 3.97 KB, created by
Rob Buis
on 2019-02-22 01:40:31 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2019-02-22 01:40:31 PST
Size:
3.97 KB
patch
obsolete
>Subversion Revision: 241938 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 78d8fb8094a829323f75ad6e061a944260ef372c..89f17a3cad2d8dfd9268b997d6be9f0a6242dc7e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2019-02-22 Rob Buis <rbuis@igalia.com> >+ >+ Fix unitless usage of mathsize >+ https://bugs.webkit.org/show_bug.cgi?id=194940 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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 >diff --git a/Source/WebCore/mathml/MathMLElement.cpp b/Source/WebCore/mathml/MathMLElement.cpp >index 5ffa23f241e00ad403fec6781d17638103628d7d..d8cb1c4dab3d578acdd5514dcf4203039892eda8 100644 >--- a/Source/WebCore/mathml/MathMLElement.cpp >+++ b/Source/WebCore/mathml/MathMLElement.cpp >@@ -97,6 +97,15 @@ bool MathMLElement::isPresentationAttribute(const QualifiedName& name) const > 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 @@ void MathMLElement::collectStyleForPresentationAttribute(const QualifiedName& na > 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 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 82b3882d85d936a626b6deda4d71f64d5c55c796..bb53afcbdbb857f2fb25bfc8fa79793f6b44204a 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2019-02-22 Rob Buis <rbuis@igalia.com> >+ >+ Fix unitless usage of mathsize >+ https://bugs.webkit.org/show_bug.cgi?id=194940 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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 >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index 878faaeb4f35c3ae4a945b440200888e92426ad9..29817deb360d9236e2deaa323320dd1eb60ed353 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -719,9 +719,7 @@ imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/f > 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 ]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194940
:
362708
|
362888
|
362890