Changeset 159680 in webkit


Ignore:
Timestamp:
Nov 21, 2013 9:03:26 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Map the dir attribute to the CSS direction property.
https://bugs.webkit.org/show_bug.cgi?id=124572.

Patch by Frédéric Wang <fred.wang@free.fr> on 2013-11-21
Reviewed by Darin Adler.

Source/WebCore:

Test: mathml/presentation/mstyle-css-attributes.html

  • mathml/MathMLElement.cpp:

(WebCore::MathMLElement::isPresentationAttribute): reorder attributes
(WebCore::MathMLElement::collectStyleForPresentationAttribute): reorder tags that accept dir
(WebCore::MathMLElement::isMathMLToken): add an inline function to test that a tag corresponds to a MathML Token Element.

  • mathml/MathMLElement.h:

Follow-up work to address Darin's comments.

LayoutTests:

  • mathml/presentation/direction-overall-expected.html: test that dir does not apply to msqrt
  • mathml/presentation/direction-overall.html:
  • mathml/presentation/mstyle-css-attributes-expected.html: Added.
  • mathml/presentation/mstyle-css-attributes.html: Added.

Add more tests for presentation attributes on mstyle.

Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r159671 r159680  
     12013-11-21  Frédéric Wang  <fred.wang@free.fr>
     2
     3        Map the dir attribute to the CSS direction property.
     4        https://bugs.webkit.org/show_bug.cgi?id=124572.
     5
     6        Reviewed by Darin Adler.
     7
     8        * mathml/presentation/direction-overall-expected.html: test that dir does not apply to msqrt
     9        * mathml/presentation/direction-overall.html:
     10        * mathml/presentation/mstyle-css-attributes-expected.html: Added.
     11        * mathml/presentation/mstyle-css-attributes.html: Added.
     12
     13        Add more tests for presentation attributes on mstyle.
     14
    1152013-11-21  Bear Travis  <betravis@adobe.com>
    216
  • trunk/LayoutTests/mathml/presentation/direction-overall-expected.html

    r159504 r159680  
    3434    </p>
    3535
     36    <p>
     37      msqrt:
     38      <math>
     39        <msqrt>
     40          <mspace width="25px" height="25px" mathbackground="red"/>
     41          <mspace width="25px" height="25px" mathbackground="green"/>
     42          <mspace width="25px" height="25px" mathbackground="blue"/>
     43        </msqrt>
     44      </math>
     45    </p>
     46
    3647  </body>
    3748</html>
  • trunk/LayoutTests/mathml/presentation/direction-overall.html

    r159504 r159680  
    3838    </p>
    3939
     40    <!-- dir="rtl" on <msqrt> should be ignored. The rectangle
     41         inside this element should be displayed left-to-right. -->
     42
     43    <p>
     44      msqrt:
     45      <math>
     46        <msqrt dir="rtl">
     47          <mspace width="25px" height="25px" mathbackground="red"/>
     48          <mspace width="25px" height="25px" mathbackground="green"/>
     49          <mspace width="25px" height="25px" mathbackground="blue"/>
     50        </msqrt>
     51      </math>
     52    </p>
     53
    4054  </body>
    4155</html>
  • trunk/Source/WebCore/ChangeLog

    r159679 r159680  
     12013-11-21  Frédéric Wang  <fred.wang@free.fr>
     2
     3        Map the dir attribute to the CSS direction property.
     4        https://bugs.webkit.org/show_bug.cgi?id=124572.
     5
     6        Reviewed by Darin Adler.
     7
     8        Test: mathml/presentation/mstyle-css-attributes.html
     9
     10        * mathml/MathMLElement.cpp:
     11        (WebCore::MathMLElement::isPresentationAttribute): reorder attributes
     12        (WebCore::MathMLElement::collectStyleForPresentationAttribute): reorder tags that accept dir
     13        (WebCore::MathMLElement::isMathMLToken): add an inline function to test that a tag corresponds to a MathML Token Element.
     14        * mathml/MathMLElement.h:
     15
     16        Follow-up work to address Darin's comments.
     17
    1182013-11-21  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
    219
  • trunk/Source/WebCore/mathml/MathMLElement.cpp

    r159504 r159680  
    7979bool MathMLElement::isPresentationAttribute(const QualifiedName& name) const
    8080{
    81     if (name == mathbackgroundAttr || name == mathsizeAttr || name == mathcolorAttr || name == fontsizeAttr || name == backgroundAttr || name == colorAttr || name == fontstyleAttr || name == fontweightAttr || name == fontfamilyAttr || name == dirAttr)
     81    if (name == backgroundAttr || name == colorAttr || name == dirAttr || name == fontfamilyAttr || name == fontsizeAttr || name == fontstyleAttr || name == fontweightAttr || name == mathbackgroundAttr || name == mathcolorAttr || name == mathsizeAttr)
    8282        return true;
    8383    return StyledElement::isPresentationAttribute(name);
     
    108108        addPropertyToPresentationAttributeStyle(style, CSSPropertyFontFamily, value);
    109109    else if (name == dirAttr) {
    110         if (hasTagName(mathTag) || hasTagName(mstyleTag) || hasTagName(mrowTag) || hasTagName(mtextTag) || hasTagName(msTag) || hasTagName(moTag) || hasTagName(miTag) || hasTagName(mnTag))
     110        if (hasTagName(mathTag) || hasTagName(mrowTag) || hasTagName(mstyleTag) || isMathMLToken())
    111111            addPropertyToPresentationAttributeStyle(style, CSSPropertyDirection, value);
    112112    }  else {
     
    123123}
    124124
     125bool MathMLElement::isMathMLToken() const
     126{
     127    return hasTagName(miTag) || hasTagName(mnTag) || hasTagName(moTag) || hasTagName(msTag) || hasTagName(mtextTag);
     128}
     129
    125130}
    126131
  • trunk/Source/WebCore/mathml/MathMLElement.h

    r159036 r159680  
    5252
    5353    virtual bool childShouldCreateRenderer(const Node&) const OVERRIDE;
     54
     55    inline bool isMathMLToken() const;
    5456};
    5557
Note: See TracChangeset for help on using the changeset viewer.