Changeset 159504 in webkit


Ignore:
Timestamp:
Nov 19, 2013 9:36:01 AM (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-19
Reviewed by Darin Adler.

Source/WebCore:

Tests: mathml/presentation/direction-overall.html

mathml/presentation/direction-token.html
mathml/presentation/direction.html

  • mathml/MathMLElement.cpp:

(WebCore::MathMLElement::isPresentationAttribute): add dir
(WebCore::MathMLElement::collectStyleForPresentationAttribute): map dir

  • mathml/mathattrs.in: add the dir attribute
  • mathml/mathtags.in: add the mstyle tag (needed to use mstyleTag)

LayoutTests:

  • mathml/presentation/direction-expected.html: add more tests.
  • mathml/presentation/direction-overall-expected.html: Added.
  • mathml/presentation/direction-overall.html: Added.
  • mathml/presentation/direction-token-expected.html: Added.
  • mathml/presentation/direction-token.html: Added.
  • mathml/presentation/direction.html: add more tests.
Location:
trunk
Files:
4 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r159501 r159504  
     12013-11-19  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-expected.html: add more tests.
     9        * mathml/presentation/direction-overall-expected.html: Added.
     10        * mathml/presentation/direction-overall.html: Added.
     11        * mathml/presentation/direction-token-expected.html: Added.
     12        * mathml/presentation/direction-token.html: Added.
     13        * mathml/presentation/direction.html: add more tests.
     14
    1152013-11-19  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
    216
  • trunk/LayoutTests/mathml/presentation/direction-expected.html

    r159035 r159504  
    99    <p>שורשי משוואה מודגשת זו <math style="direction: ltr;"> <mstyle mathvariant="bold"> <msup> <mi>y</mi> <mn>3</mn> </msup> <mo>+</mo> <mi>p</mi> <mi>y</mi> <mo>+</mo> <mi>q</mi> <mo>=</mo> <mn>0</mn> </mstyle> </math> מודגשים גם הם</p>
    1010
     11    <p>ltr</p>
     12
     13    <p>שורשי משוואה מודגשת זו <math style="direction: ltr;"> <mstyle mathvariant="bold"> <msup> <mi>y</mi> <mn>3</mn> </msup> <mo>+</mo> <mi>p</mi> <mi>y</mi> <mo>+</mo> <mi>q</mi> <mo>=</mo> <mn>0</mn> </mstyle> </math> מודגשים גם הם</p>
     14
     15    <p>ltr</p>
     16
     17    <p>שורשי משוואה מודגשת זו <math style="direction: ltr;"> <mstyle mathvariant="bold"> <msup> <mi>y</mi> <mn>3</mn> </msup> <mo>+</mo> <mi>p</mi> <mi>y</mi> <mo>+</mo> <mi>q</mi> <mo>=</mo> <mn>0</mn> </mstyle> </math> מודגשים גם הם</p>
     18
     19    <p>ltr</p>
     20
     21    <p>שורשי משוואה מודגשת זו <math style="direction: rtl;"> <mstyle mathvariant="bold"> <msup> <mi>y</mi> <mn>3</mn> </msup> <mo>+</mo> <mi>p</mi> <mi>y</mi> <mo>+</mo> <mi>q</mi> <mo>=</mo> <mn>0</mn> </mstyle> </math> מודגשים גם הם</p>
     22
     23    <p>rtl</p>
     24
    1125  </body>
    1226</html>
  • trunk/LayoutTests/mathml/presentation/direction.html

    r159035 r159504  
    44    <title>direction</title>
    55    <meta charset="utf-8"/>
     6    <script type="text/javascript">
     7      function checkDirection()
     8      {
     9        for (var i = 1; i <= 4; i++) {
     10          document.getElementById('y'+i).innerHTML = window.getComputedStyle(document.getElementById('x'+i)).direction;
     11        }
     12      }
     13    </script>
    614  </head>
    7   <body>
     15  <body onload="checkDirection()">
    816
    9     <p>שורשי משוואה מודגשת זו <math> <mstyle mathvariant="bold"> <msup> <mi>y</mi> <mn>3</mn> </msup> <mo>+</mo> <mi>p</mi> <mi>y</mi> <mo>+</mo> <mi>q</mi> <mo>=</mo> <mn>0</mn> </mstyle> </math> מודגשים גם הם</p>
     17    <!-- Test the CSS direction and dir attribute on the <math> element. It
     18         should be "ltr", except if an explicit dir="rtl" is used. -->
     19
     20    <p>שורשי משוואה מודגשת זו <math id="x1"> <mstyle mathvariant="bold"> <msup> <mi>y</mi> <mn>3</mn> </msup> <mo>+</mo> <mi>p</mi> <mi>y</mi> <mo>+</mo> <mi>q</mi> <mo>=</mo> <mn>0</mn> </mstyle> </math> מודגשים גם הם</p>
     21
     22    <p id="y1"></p>
     23
     24    <p>שורשי משוואה מודגשת זו <math id="x2" dir="ltr"> <mstyle mathvariant="bold"> <msup> <mi>y</mi> <mn>3</mn> </msup> <mo>+</mo> <mi>p</mi> <mi>y</mi> <mo>+</mo> <mi>q</mi> <mo>=</mo> <mn>0</mn> </mstyle> </math> מודגשים גם הם</p>
     25
     26    <p id="y2"></p>
     27
     28    <p>שורשי משוואה מודגשת זו <math id="x3" dir="invalid"> <mstyle mathvariant="bold"> <msup> <mi>y</mi> <mn>3</mn> </msup> <mo>+</mo> <mi>p</mi> <mi>y</mi> <mo>+</mo> <mi>q</mi> <mo>=</mo> <mn>0</mn> </mstyle> </math> מודגשים גם הם</p>
     29
     30    <p id="y3"></p>
     31
     32    <p>שורשי משוואה מודגשת זו <math id="x4" dir="rtl"> <mstyle mathvariant="bold"> <msup> <mi>y</mi> <mn>3</mn> </msup> <mo>+</mo> <mi>p</mi> <mi>y</mi> <mo>+</mo> <mi>q</mi> <mo>=</mo> <mn>0</mn> </mstyle> </math> מודגשים גם הם</p>
     33
     34    <p id="y4"></p>
    1035
    1136  </body>
  • trunk/Source/WebCore/ChangeLog

    r159503 r159504  
     12013-11-19  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        Tests: mathml/presentation/direction-overall.html
     9               mathml/presentation/direction-token.html
     10               mathml/presentation/direction.html
     11
     12        * mathml/MathMLElement.cpp:
     13        (WebCore::MathMLElement::isPresentationAttribute): add dir
     14        (WebCore::MathMLElement::collectStyleForPresentationAttribute): map dir
     15        * mathml/mathattrs.in: add the dir attribute
     16        * mathml/mathtags.in: add the mstyle tag (needed to use mstyleTag)
     17
    1182013-11-19  Sergio Correia  <sergio.correia@openbossa.org>
    219
  • trunk/Source/WebCore/mathml/MathMLElement.cpp

    r159036 r159504  
    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)
     81    if (name == mathbackgroundAttr || name == mathsizeAttr || name == mathcolorAttr || name == fontsizeAttr || name == backgroundAttr || name == colorAttr || name == fontstyleAttr || name == fontweightAttr || name == fontfamilyAttr || name == dirAttr)
    8282        return true;
    8383    return StyledElement::isPresentationAttribute(name);
     
    107107    else if (name == fontfamilyAttr)
    108108        addPropertyToPresentationAttributeStyle(style, CSSPropertyFontFamily, value);
    109     else {
     109    else if (name == dirAttr) {
     110        if (hasTagName(mathTag) || hasTagName(mstyleTag) || hasTagName(mrowTag) || hasTagName(mtextTag) || hasTagName(msTag) || hasTagName(moTag) || hasTagName(miTag) || hasTagName(mnTag))
     111            addPropertyToPresentationAttributeStyle(style, CSSPropertyDirection, value);
     112    }  else {
    110113        ASSERT(!isPresentationAttribute(name));
    111114        StyledElement::collectStyleForPresentationAttribute(name, value
  • trunk/Source/WebCore/mathml/mathattrs.in

    r156036 r159504  
    1212denomalign
    1313depth
     14dir
    1415encoding
    1516fontfamily
  • trunk/Source/WebCore/mathml/mathtags.in

    r155818 r159504  
    99msubsup interfaceName=MathMLInlineContainerElement
    1010mrow interfaceName=MathMLInlineContainerElement
     11mstyle interfaceName=MathMLElement
    1112mover interfaceName=MathMLInlineContainerElement
    1213munder interfaceName=MathMLInlineContainerElement
Note: See TracChangeset for help on using the changeset viewer.