Changeset 249645 in webkit


Ignore:
Timestamp:
Sep 9, 2019 8:21:15 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK][WPE] Remove attributes deprecated from MathML3
https://bugs.webkit.org/show_bug.cgi?id=197492

Patch by Rob Buis <rbuis@igalia.com> on 2019-09-09
Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

Import relevant WPT test.

  • web-platform-tests/mathml/relations/css-styling/attribute-mapping-001-expected.txt: Added.
  • web-platform-tests/mathml/relations/css-styling/attribute-mapping-001.html: Added.

Source/WebCore:

Remove some MathML3 deprecated attributes:
https://github.com/mathml-refresh/mathml/issues/5#issuecomment-475506856

This change also maps the dir attribute to direction for MathML Core.

Test: imported/w3c/web-platform-tests/mathml/relations/css-styling/attribute-mapping-001.html

  • mathml/MathMLElement.cpp:

(WebCore::MathMLElement::collectStyleForPresentationAttribute):

LayoutTests:

Disable the MathML Core flag for tests assuming MathML3 behavior.

  • mathml/presentation/attributes-background-color-expected.html:
  • mathml/presentation/attributes-background-color.html:
  • mathml/presentation/attributes-mathvariant.html:
  • mathml/presentation/direction-overall.html:
  • mathml/presentation/mstyle-css-attributes.html:
Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r249630 r249645  
     12019-09-09  Rob Buis  <rbuis@igalia.com>
     2
     3        [GTK][WPE] Remove attributes deprecated from MathML3
     4        https://bugs.webkit.org/show_bug.cgi?id=197492
     5
     6        Reviewed by Frédéric Wang.
     7
     8        Disable the MathML Core flag for tests assuming MathML3 behavior.
     9
     10        * mathml/presentation/attributes-background-color-expected.html:
     11        * mathml/presentation/attributes-background-color.html:
     12        * mathml/presentation/attributes-mathvariant.html:
     13        * mathml/presentation/direction-overall.html:
     14        * mathml/presentation/mstyle-css-attributes.html:
     15
    1162019-09-08  Saam Barati  <sbarati@apple.com>
    217
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r249629 r249645  
     12019-09-09  Rob Buis  <rbuis@igalia.com>
     2
     3        [GTK][WPE] Remove attributes deprecated from MathML3
     4        https://bugs.webkit.org/show_bug.cgi?id=197492
     5
     6        Reviewed by Frédéric Wang.
     7
     8        Import relevant WPT test.
     9
     10        * web-platform-tests/mathml/relations/css-styling/attribute-mapping-001-expected.txt: Added.
     11        * web-platform-tests/mathml/relations/css-styling/attribute-mapping-001.html: Added.
     12
    1132019-09-07  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/LayoutTests/mathml/presentation/attributes-background-color-expected.html

    r202420 r249645  
    1 <!doctype html>
     1<!doctype html><!-- webkit-test-runner [ experimental:CoreMathMLEnabled=false ] -->
    22<html>
    33  <head>
  • trunk/LayoutTests/mathml/presentation/attributes-background-color.html

    r202420 r249645  
    1 <!doctype html>
     1<!doctype html><!-- webkit-test-runner [ experimental:CoreMathMLEnabled=false ] -->
    22<html>
    33  <head>
  • trunk/LayoutTests/mathml/presentation/attributes-mathvariant.html

    r202748 r249645  
    1 <!doctype html>
     1<!doctype html><!-- webkit-test-runner [ experimental:CoreMathMLEnabled=false ] -->
    22<html>
    33  <head>
  • trunk/LayoutTests/mathml/presentation/direction-overall.html

    r159680 r249645  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ experimental:CoreMathMLEnabled=false ] -->
    22<html>
    33  <head><title>Test overall directionality</title></head>
  • trunk/LayoutTests/mathml/presentation/mstyle-css-attributes.html

    r159680 r249645  
    1 <!doctype html>
     1<!doctype html><!-- webkit-test-runner [ experimental:CoreMathMLEnabled=false ] -->
    22<html>
    33  <head>
  • trunk/Source/WebCore/ChangeLog

    r249637 r249645  
     12019-09-09  Rob Buis  <rbuis@igalia.com>
     2
     3        [GTK][WPE] Remove attributes deprecated from MathML3
     4        https://bugs.webkit.org/show_bug.cgi?id=197492
     5
     6        Reviewed by Frédéric Wang.
     7
     8        Remove some MathML3 deprecated attributes:
     9        https://github.com/mathml-refresh/mathml/issues/5#issuecomment-475506856
     10
     11        This change also maps the dir attribute to direction for MathML Core.
     12
     13        Test: imported/w3c/web-platform-tests/mathml/relations/css-styling/attribute-mapping-001.html
     14
     15        * mathml/MathMLElement.cpp:
     16        (WebCore::MathMLElement::collectStyleForPresentationAttribute):
     17
    1182019-09-09  Youenn Fablet  <youenn@apple.com>
    219
  • trunk/Source/WebCore/mathml/MathMLElement.cpp

    r249572 r249645  
    4141#include "MouseEvent.h"
    4242#include "RenderTableCell.h"
     43#include "Settings.h"
    4344#include <wtf/IsoMallocInlines.h>
    4445#include <wtf/text/StringConcatenateNumbers.h>
     
    140141    else if (name == mathcolorAttr)
    141142        addPropertyToPresentationAttributeStyle(style, CSSPropertyColor, value);
    142     // FIXME: The following are deprecated attributes that should lose if there is a conflict with a non-deprecated attribute.
    143     else if (name == fontsizeAttr)
    144         addPropertyToPresentationAttributeStyle(style, CSSPropertyFontSize, value);
    145     else if (name == backgroundAttr)
    146         addPropertyToPresentationAttributeStyle(style, CSSPropertyBackgroundColor, value);
    147     else if (name == colorAttr)
    148         addPropertyToPresentationAttributeStyle(style, CSSPropertyColor, value);
    149     else if (name == fontstyleAttr)
    150         addPropertyToPresentationAttributeStyle(style, CSSPropertyFontStyle, value);
    151     else if (name == fontweightAttr)
    152         addPropertyToPresentationAttributeStyle(style, CSSPropertyFontWeight, value);
    153     else if (name == fontfamilyAttr)
    154         addPropertyToPresentationAttributeStyle(style, CSSPropertyFontFamily, value);
    155143    else if (name == dirAttr) {
    156         if (hasTagName(mathTag) || hasTagName(mrowTag) || hasTagName(mstyleTag) || isMathMLToken())
     144        if (document().settings().coreMathMLEnabled() || hasTagName(mathTag) || hasTagName(mrowTag) || hasTagName(mstyleTag) || isMathMLToken())
    157145            addPropertyToPresentationAttributeStyle(style, CSSPropertyDirection, value);
    158     }  else {
    159         ASSERT(!isPresentationAttribute(name));
    160         StyledElement::collectStyleForPresentationAttribute(name, value, style);
     146    } else {
     147        if (document().settings().coreMathMLEnabled()) {
     148            StyledElement::collectStyleForPresentationAttribute(name, value, style);
     149            return;
     150        }
     151        // FIXME: The following are deprecated attributes that should lose if there is a conflict with a non-deprecated attribute.
     152        if (name == fontsizeAttr)
     153            addPropertyToPresentationAttributeStyle(style, CSSPropertyFontSize, value);
     154        else if (name == backgroundAttr)
     155            addPropertyToPresentationAttributeStyle(style, CSSPropertyBackgroundColor, value);
     156        else if (name == colorAttr)
     157            addPropertyToPresentationAttributeStyle(style, CSSPropertyColor, value);
     158        else if (name == fontstyleAttr)
     159            addPropertyToPresentationAttributeStyle(style, CSSPropertyFontStyle, value);
     160        else if (name == fontweightAttr)
     161            addPropertyToPresentationAttributeStyle(style, CSSPropertyFontWeight, value);
     162        else if (name == fontfamilyAttr)
     163            addPropertyToPresentationAttributeStyle(style, CSSPropertyFontFamily, value);
     164        else {
     165            ASSERT(!isPresentationAttribute(name));
     166            StyledElement::collectStyleForPresentationAttribute(name, value, style);
     167        }
    161168    }
    162169}
Note: See TracChangeset for help on using the changeset viewer.