Changeset 64982 in webkit


Ignore:
Timestamp:
Aug 9, 2010 8:40:40 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-08-09 François Sausset <François Sausset>

Reviewed by Kenneth Rohde Christiansen.

Add test for some deprecated MathML style attributes
https://bugs.webkit.org/show_bug.cgi?id=43503

  • mathml/presentation/attributes.xhtml:
  • platform/mac/mathml/presentation/attributes-expected.checksum:
  • platform/mac/mathml/presentation/attributes-expected.png:
  • platform/mac/mathml/presentation/attributes-expected.txt:

2010-08-09 François Sausset <François Sausset>

Reviewed by Kenneth Rohde Christiansen.

Implement MathML deprecated style attributes
https://bugs.webkit.org/show_bug.cgi?id=43503

Test: mathml/presentation/attributes.xhtml

  • mathml/MathMLElement.cpp: (WebCore::MathMLElement::mapToEntry): (WebCore::MathMLElement::parseMappedAttribute):
  • mathml/mathattrs.in:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r64979 r64982  
     12010-08-09  François Sausset  <sausset@gmail.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        Add test for some deprecated MathML style attributes
     6        https://bugs.webkit.org/show_bug.cgi?id=43503
     7
     8        * mathml/presentation/attributes.xhtml:
     9        * platform/mac/mathml/presentation/attributes-expected.checksum:
     10        * platform/mac/mathml/presentation/attributes-expected.png:
     11        * platform/mac/mathml/presentation/attributes-expected.txt:
     12
    1132010-08-09  Pavel Feldman  <pfeldman@chromium.org>
    214
  • trunk/LayoutTests/mathml/presentation/attributes.xhtml

    r64753 r64982  
    1212<mn mathcolor="#00F">1</mn>
    1313<msqrt mathcolor="#0000FF"><mn>2</mn></msqrt>
     14</math>
     15<math xmlns='http://www.w3.org/1998/Math/MathML' background="orange">
     16<mfrac color="blue"><mi>x</mi><mi>y</mi></mfrac>
    1417</math>
    1518</p>
     
    3033</math>
    3134</p>
     35<p id='t4'>test font style attributes:
     36<math xmlns='http://www.w3.org/1998/Math/MathML'>
     37<mtext fontsize="2em">A</mtext>
     38<mtext fontfamily="sans-serif">A</mtext>
     39<mtext fontstyle="italic">A</mtext>
     40<mtext fontweight="bold">A</mtext>
     41</math>
     42</p>
    3243</body>
    3344</html>
  • trunk/LayoutTests/platform/mac/mathml/presentation/attributes-expected.checksum

    r64753 r64982  
    1 573c0ea5a0013b193f34b258498e0a6e
     1684bc130d96bc4b74df32b4b69116b31
  • trunk/LayoutTests/platform/mac/mathml/presentation/attributes-expected.txt

    r64753 r64982  
    11layer at (0,0) size 800x600
    22  RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x163
    4   RenderBlock {html} at (0,0) size 800x163
    5     RenderBody {body} at (8,16) size 784x131
     3layer at (0,0) size 800x216
     4  RenderBlock {html} at (0,0) size 800x216
     5    RenderBody {body} at (8,16) size 784x184
    66      RenderBlock {p} at (0,0) size 784x43
    77        RenderText {#text} at (0,13) size 432x18
     
    2828              RenderText {#text} at (12,3) size 8x16
    2929                text run at (12,3) width 8: "2"
     30        RenderText {#text} at (486,13) size 4x18
     31          text run at (486,13) width 4: " "
     32        RenderBlock {math} at (490,3) size 15x40 [bgcolor=#FFA500]
     33          RenderBlock {mfrac} at (1,0) size 13x40 [color=#0000FF]
     34            RenderBlock {mfrac} at (0,0) size 13x19
     35              RenderInline {mi} at (0,0) size 7x16
     36                RenderText {#text} at (3,3) size 7x16
     37                  text run at (3,3) width 7: "x"
     38            RenderBlock {mfrac} at (0,19) size 13x21
     39              RenderInline {mi} at (0,0) size 7x16
     40                RenderText {#text} at (3,5) size 7x16
     41                  text run at (3,5) width 7: "y"
    3042        RenderText {#text} at (0,0) size 0x0
    3143      RenderBlock {p} at (0,59) size 784x37
     
    6375              text run at (35,3) width 11: "A"
    6476        RenderText {#text} at (0,0) size 0x0
     77      RenderBlock {p} at (0,147) size 784x37
     78        RenderText {#text} at (0,13) size 152x18
     79          text run at (0,13) width 152: "test font style attributes: "
     80        RenderBlock {math} at (152,0) size 58x37
     81          RenderInline {mtext} at (0,0) size 23x32
     82            RenderText {#text} at (1,5) size 23x32
     83              text run at (1,5) width 23: "A"
     84          RenderInline {mtext} at (0,0) size 11x18
     85            RenderText {#text} at (24,13) size 11x18
     86              text run at (24,13) width 11: "A"
     87          RenderInline {mtext} at (0,0) size 10x16
     88            RenderText {#text} at (35,16) size 10x16
     89              text run at (35,16) width 10: "A"
     90          RenderInline {mtext} at (0,0) size 12x16
     91            RenderText {#text} at (45,16) size 12x16
     92              text run at (45,16) width 12: "A"
     93        RenderText {#text} at (0,0) size 0x0
  • trunk/WebCore/ChangeLog

    r64981 r64982  
     12010-08-09  François Sausset  <sausset@gmail.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        Implement MathML deprecated style attributes
     6        https://bugs.webkit.org/show_bug.cgi?id=43503
     7
     8        Test: mathml/presentation/attributes.xhtml
     9
     10        * mathml/MathMLElement.cpp:
     11        (WebCore::MathMLElement::mapToEntry):
     12        (WebCore::MathMLElement::parseMappedAttribute):
     13        * mathml/mathattrs.in:
     14
    1152010-08-09  Ilya Tikhonovsky  <loislo@chromium.org>
    216
  • trunk/WebCore/mathml/MathMLElement.cpp

    r63079 r64982  
    5151bool MathMLElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
    5252{
    53     if (attrName == MathMLNames::mathcolorAttr || attrName == MathMLNames::mathbackgroundAttr) {
     53    if (attrName == mathcolorAttr || attrName == mathbackgroundAttr
     54        || attrName == colorAttr || attrName == backgroundAttr
     55        || attrName == fontsizeAttr || attrName == fontstyleAttr
     56        || attrName == fontweightAttr || attrName == fontfamilyAttr) {
    5457        result = eMathML;
    5558        return false;
     
    6063void MathMLElement::parseMappedAttribute(Attribute* attr)
    6164{
    62     if (attr->name() == MathMLNames::mathbackgroundAttr)
     65    if (attr->name() == mathbackgroundAttr)
    6366        addCSSProperty(attr, CSSPropertyBackgroundColor, attr->value());
    64     else if (attr->name() == MathMLNames::mathcolorAttr)
    65         addCSSProperty(attr, CSSPropertyColor, attr->value());
    66     else if (attr->name() == MathMLNames::mathsizeAttr) {
     67    else if (attr->name() == mathsizeAttr) {
    6768        // The following three values of mathsize are handled in WebCore/css/mathml.css
    6869        if (attr->value() != "normal" && attr->value() != "small" && attr->value() != "big")
    6970            addCSSProperty(attr, CSSPropertyFontSize, attr->value());
    70     }
     71    } else if (attr->name() == mathcolorAttr)
     72        addCSSProperty(attr, CSSPropertyColor, attr->value());
     73    // FIXME: deprecated attributes that should loose in a conflict with a non deprecated attribute
     74    else if (attr->name() == fontsizeAttr)
     75        addCSSProperty(attr, CSSPropertyFontSize, attr->value());
     76    else if (attr->name() == backgroundAttr)
     77        addCSSProperty(attr, CSSPropertyBackgroundColor, attr->value());
     78    else if (attr->name() == colorAttr)
     79        addCSSProperty(attr, CSSPropertyColor, attr->value());
     80    else if (attr->name() == fontstyleAttr)
     81        addCSSProperty(attr, CSSPropertyFontStyle, attr->value());
     82    else if (attr->name() == fontweightAttr)
     83        addCSSProperty(attr, CSSPropertyFontWeight, attr->value());
     84    else if (attr->name() == fontfamilyAttr)
     85        addCSSProperty(attr, CSSPropertyFontFamily, attr->value());
    7186    else
    7287        StyledElement::parseMappedAttribute(attr);
  • trunk/WebCore/mathml/mathattrs.in

    r64753 r64982  
    44attrsNullNamespace
    55
     6background
    67close
     8color
    79definitionURL
    810denomalign
     11fontfamily
     12fontsize
     13fontstyle
     14fontweight
    915linethickness
    1016mathbackground
Note: See TracChangeset for help on using the changeset viewer.