Bug 201583

Summary: Remove support for attributes deprecated in MathML Core
Product: WebKit Reporter: Rob Buis <rbuis>
Component: MathMLAssignee: Rob Buis <rbuis>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: dbarton, ews-watchlist, fred.wang
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 195797    
Attachments:
Description Flags
Patch none

Description Rob Buis 2019-09-07 09:44:44 PDT
MathML Core does not support some attributes anymore, like fontstyle, fontweight etc.
Comment 1 Rob Buis 2019-09-07 09:46:08 PDT
Created attachment 378294 [details]
Patch
Comment 2 Frédéric Wang (:fredw) 2019-09-07 11:16:43 PDT
Can you please use bug 195797 as a meta bug for MathML Core bugs?

I think this is a duplicate of bug 197492?
Comment 3 Frédéric Wang (:fredw) 2019-09-07 11:20:29 PDT
Comment on attachment 378294 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=378294&action=review

> Source/WebCore/mathml/MathMLElement.cpp:144
> +        if (!document().settings().coreMathMLEnabled())

maybe use a local variable to avoid repeating it?

> Source/WebCore/mathml/MathMLElement.cpp:162
> +        if (document().settings().coreMathMLEnabled() || hasTagName(mathTag) || hasTagName(mrowTag) || hasTagName(mstyleTag) || isMathMLToken())

This is a separate bug: You are making dir allowed on all tags. I'm not sure we actually need to protect this change with the coreMathMLEnabled(), but I guess it's ok.
Comment 4 Frédéric Wang (:fredw) 2019-09-08 03:05:20 PDT
Comment on attachment 378294 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=378294&action=review

Make sure you disable the MathML Core flag when running internal tests assuming MathML3 behavior.

>> Source/WebCore/mathml/MathMLElement.cpp:144
>> +        if (!document().settings().coreMathMLEnabled())
> 
> maybe use a local variable to avoid repeating it?

Actually I would disable all the attributes in one go:

if (!document().settings().coreMathMLEnabled()) {
    // FIXME: The following are deprecated attributes that should lose if there is a conflict with a non-deprecated attribute.
     else if (name == fontsizeAttr)
         addPropertyToPresentationAttributeStyle(style, CSSPropertyFontSize, value);
     else if (name == backgroundAttr)
         addPropertyToPresentationAttributeStyle(style, CSSPropertyBackgroundColor, value);
     else if (name == colorAttr)
         addPropertyToPresentationAttributeStyle(style, CSSPropertyColor, value);
     else if (name == fontstyleAttr)
         addPropertyToPresentationAttributeStyle(style, CSSPropertyFontStyle, value);
     else if (name == fontweightAttr)
         addPropertyToPresentationAttributeStyle(style, CSSPropertyFontWeight, value);
     else if (name == fontfamilyAttr)
         addPropertyToPresentationAttributeStyle(style, CSSPropertyFontFamily, value);
}
Comment 5 Rob Buis 2019-09-09 00:43:14 PDT

*** This bug has been marked as a duplicate of bug 197492 ***