Changeset 165461 in webkit


Ignore:
Timestamp:
Mar 11, 2014 11:46:52 PM (10 years ago)
Author:
fred.wang@free.fr
Message:

Implement MathML spacing around operators .
https://bugs.webkit.org/show_bug.cgi?id=115787

Reviewed by Chris Fleizach.

Source/WebCore:

This makes the <mo> operators use the lspace/rspace properties to
determine their spacing. The spacing is now consistent with the one
of <mfenced> and as a consequence bug 118843 is fixed. This also ensures
that the rendering of <mo> elements is updated when the form or
attributes are changed.

Tests: mathml/presentation/dir-mo.html

mathml/presentation/mo-form-dynamic.html
mathml/presentation/mo-form-minus-plus.html
mathml/presentation/mo-form.html
mathml/presentation/mo-lspace-rspace-dynamic.html
mathml/presentation/mo-lspace-rspace.html
mathml/presentation/mo-whitespaces.html

  • css/mathml.css:
  • mathml/MathMLInlineContainerElement.cpp:

(WebCore::MathMLInlineContainerElement::childrenChanged):

  • mathml/MathMLInlineContainerElement.h:
  • rendering/mathml/RenderMathMLOperator.cpp:

(WebCore::RenderMathMLOperator::setOperatorPropertiesFromOpDictEntry):
(WebCore::RenderMathMLOperator::SetOperatorProperties):
(WebCore::RenderMathMLOperator::updateFromElement):
(WebCore::RenderMathMLOperator::updateOperatorProperties):
(WebCore::RenderMathMLOperator::updateStyle):

  • rendering/mathml/RenderMathMLOperator.h:
  • rendering/mathml/RenderMathMLRow.cpp:

(WebCore::RenderMathMLRow::updateOperatorProperties):

  • rendering/mathml/RenderMathMLRow.h:
  • rendering/mathml/RenderMathMLToken.h:

LayoutTests:

Add many new tests to verify the form/lspace/rspace properties of the
<mo> element and that the whitespace of the text content is collapsed.
Update fenced-mi now that bug 118843 is fixed.

  • mathml/presentation/dir-mo-expected.html: Added.
  • mathml/presentation/dir-mo.html: Added.
  • mathml/presentation/fenced-expected.html:
  • mathml/presentation/fenced-mi-expected.html:
  • mathml/presentation/mo-form-dynamic-expected.html: Added.
  • mathml/presentation/mo-form-dynamic.html: Added.
  • mathml/presentation/mo-form-expected.html: Added.
  • mathml/presentation/mo-form-minus-plus-expected.html: Added.
  • mathml/presentation/mo-form-minus-plus.html: Added.
  • mathml/presentation/mo-form.html: Added.
  • mathml/presentation/mo-lspace-rspace-dynamic-expected.html: Added.
  • mathml/presentation/mo-lspace-rspace-dynamic.html: Added.
  • mathml/presentation/mo-lspace-rspace-expected.html: Added.
  • mathml/presentation/mo-lspace-rspace.html: Added.
  • mathml/presentation/mo-whitespaces-expected.html: Added.
  • mathml/presentation/mo-whitespaces.html: Added.
  • platform/mac/mathml/presentation/mo-stretch-expected.txt: update reference.
Location:
trunk
Files:
14 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r165449 r165461  
     12014-03-11  Frédéric Wang  <fred.wang@free.fr>
     2
     3        Implement MathML spacing around operators .
     4        https://bugs.webkit.org/show_bug.cgi?id=115787
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Add many new tests to verify the form/lspace/rspace properties of the
     9        <mo> element and that the whitespace of the text content is collapsed.
     10        Update fenced-mi now that bug 118843 is fixed.
     11
     12        * mathml/presentation/dir-mo-expected.html: Added.
     13        * mathml/presentation/dir-mo.html: Added.
     14        * mathml/presentation/fenced-expected.html:
     15        * mathml/presentation/fenced-mi-expected.html:
     16        * mathml/presentation/mo-form-dynamic-expected.html: Added.
     17        * mathml/presentation/mo-form-dynamic.html: Added.
     18        * mathml/presentation/mo-form-expected.html: Added.
     19        * mathml/presentation/mo-form-minus-plus-expected.html: Added.
     20        * mathml/presentation/mo-form-minus-plus.html: Added.
     21        * mathml/presentation/mo-form.html: Added.
     22        * mathml/presentation/mo-lspace-rspace-dynamic-expected.html: Added.
     23        * mathml/presentation/mo-lspace-rspace-dynamic.html: Added.
     24        * mathml/presentation/mo-lspace-rspace-expected.html: Added.
     25        * mathml/presentation/mo-lspace-rspace.html: Added.
     26        * mathml/presentation/mo-whitespaces-expected.html: Added.
     27        * mathml/presentation/mo-whitespaces.html: Added.
     28        * platform/mac/mathml/presentation/mo-stretch-expected.txt: update reference.
     29
    1302014-03-11  Manuel Rego Casasnovas  <rego@igalia.com>
    231
  • trunk/LayoutTests/mathml/presentation/fenced-expected.html

    r152923 r165461  
    1111         Note that the MathML operator dictionary defines "(" and ")" as fences,
    1212         so we don't need an explicit "fence" attribute on the <mo> elements.-->
    13     <!-- FIXME: <mfenced> and its expanded form do not use the same spacing,
    14          so -webkit-margin-start and -webkit-margin-end are currently set
    15          explicitly below. See bug 118843. -->
    1613    <math>
    1714      <mrow>
     
    1916        <mrow>
    2017          <mspace width="48px" height="24px" depth="24px" mathbackground="#0f0"/>
    21           <mo separator="true" style="-webkit-margin-start: 0; -webkit-margin-end: .25em;">,</mo>
     18          <mo separator="true">,</mo>
    2219          <mspace width="48px" height="24px" depth="24px" mathbackground="#0f0"/>
    23           <mo separator="true" style="-webkit-margin-start: 0; -webkit-margin-end: .25em;">,</mo>
     20          <mo separator="true">,</mo>
    2421          <mspace width="48px" height="24px" depth="24px" mathbackground="#0f0"/>
    2522        </mrow>
  • trunk/LayoutTests/mathml/presentation/fenced-mi-expected.html

    r165436 r165461  
    1111         The MathML operator dictionary defines '(', ')', '{', '}' as fences,
    1212         so we don't need an explicit "fence" attribute on the <mo> elements.-->
    13     <!-- FIXME: <mfenced> and its expanded form do not use the same spacing,
    14          so -webkit-margin-start and -webkit-margin-end are currently set
    15          explicitly below. See bug 118843. -->
    1613
    1714    <p>
     
    2118          <mrow>
    2219            <mi>x</mi>
    23             <mo separator="true" style="-webkit-margin-start: 0; -webkit-margin-end: .25em;">,</mo>
     20            <mo separator="true">,</mo>
    2421            <mi>y</mi>
    25             <mo separator="true" style="-webkit-margin-start: 0; -webkit-margin-end: .25em;">,</mo>
     22            <mo separator="true">,</mo>
    2623            <mi>z</mi>
    2724          </mrow>
     
    3734          <mrow>
    3835            <mi>x</mi>
    39             <mo separator="true" style="-webkit-margin-start: 0; -webkit-margin-end: .25em;">1</mo>
     36            <mo separator="true">1</mo>
    4037            <mi>y</mi>
    41             <mo separator="true" style="-webkit-margin-start: 0; -webkit-margin-end: .25em;">2</mo>
     38            <mo separator="true">2</mo>
    4239            <mi>z</mi>
    4340          </mrow>
     
    5350          <mrow>
    5451            <mi>x</mi>
    55             <mo separator="true" style="-webkit-margin-start: 0; -webkit-margin-end: .25em;">1</mo>
     52            <mo separator="true">1</mo>
    5653            <mi>y</mi>
    57             <mo separator="true" style="-webkit-margin-start: 0; -webkit-margin-end: .25em;">2</mo>
     54            <mo separator="true">2</mo>
    5855            <mi>z</mi>
    59             <mo separator="true" style="-webkit-margin-start: 0; -webkit-margin-end: .25em;">3</mo>
     56            <mo separator="true">3</mo>
    6057            <mi>u</mi>
    61             <mo separator="true" style="-webkit-margin-start: 0; -webkit-margin-end: .25em;">3</mo>
     58            <mo separator="true">3</mo>
    6259            <mi>v</mi>
    63             <mo separator="true" style="-webkit-margin-start: 0; -webkit-margin-end: .25em;">3</mo>
     60            <mo separator="true">3</mo>
    6461            <mi>w</mi>
    6562          </mrow>
  • trunk/LayoutTests/platform/mac/mathml/presentation/mo-stretch-expected.txt

    r165436 r165461  
    44  RenderBlock {HTML} at (0,0) size 800x260
    55    RenderBody {BODY} at (8,8) size 784x244
    6       RenderMathMLMath {math} at (0,0) size 195x25 [padding: 0 1 0 1]
    7         RenderMathMLRow {mrow} at (1,0) size 193x25
    8           RenderMathMLOperator {mo} at (1,5) size 8x14
     6      RenderMathMLMath {math} at (0,0) size 126x25 [padding: 0 1 0 1]
     7        RenderMathMLRow {mrow} at (1,0) size 124x25
     8          RenderMathMLOperator {mo} at (0,5) size 7x14
    99            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    1010              RenderBlock (anonymous) at (0,0) size 5x14
    1111                RenderText at (0,-6) size 5x24
    1212                  text run at (0,-6) width 5: "("
    13           RenderMathMLOperator {mo} at (13,5) size 8x14
     13          RenderMathMLOperator {mo} at (7,5) size 7x14
    1414            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    1515              RenderBlock (anonymous) at (0,0) size 5x14
    1616                RenderText at (0,-6) size 5x24
    1717                  text run at (0,-6) width 5: ")"
    18           RenderMathMLOperator {mo} at (26,5) size 11x14
     18          RenderMathMLOperator {mo} at (14,5) size 10x14
    1919            RenderMathMLBlock (anonymous, flex) at (0,0) size 10x14
    2020              RenderBlock (anonymous) at (0,0) size 8x14
    2121                RenderText at (0,-6) size 8x24
    2222                  text run at (0,-6) width 8: "{"
    23           RenderMathMLOperator {mo} at (43,5) size 11x14
     23          RenderMathMLOperator {mo} at (24,5) size 10x14
    2424            RenderMathMLBlock (anonymous, flex) at (0,0) size 10x14
    2525              RenderBlock (anonymous) at (0,0) size 8x14
    2626                RenderText at (0,-6) size 8x24
    2727                  text run at (0,-6) width 8: "}"
    28           RenderMathMLOperator {mo} at (59,5) size 8x14
     28          RenderMathMLOperator {mo} at (34,5) size 7x14
    2929            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    3030              RenderBlock (anonymous) at (0,0) size 5x14
    3131                RenderText at (0,-6) size 5x24
    3232                  text run at (0,-6) width 5: "["
    33           RenderMathMLOperator {mo} at (72,5) size 8x14
     33          RenderMathMLOperator {mo} at (41,5) size 7x14
    3434            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    3535              RenderBlock (anonymous) at (0,0) size 5x14
    3636                RenderText at (0,-6) size 5x24
    3737                  text run at (0,-6) width 5: "]"
    38           RenderMathMLOperator {mo} at (86,4) size 9x16
     38          RenderMathMLOperator {mo} at (48,4) size 8x16
    3939            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    4040              RenderBlock (anonymous) at (0,0) size 8x16
    4141                RenderText at (0,-5) size 8x24
    4242                  text run at (0,-5) width 8: "\x{2308}"
    43           RenderMathMLOperator {mo} at (100,4) size 9x16
     43          RenderMathMLOperator {mo} at (56,4) size 8x16
    4444            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    4545              RenderBlock (anonymous) at (0,0) size 8x16
    4646                RenderText at (0,-5) size 8x24
    4747                  text run at (0,-5) width 8: "\x{2309}"
    48           RenderMathMLOperator {mo} at (115,4) size 8x16
     48          RenderMathMLOperator {mo} at (64,4) size 8x16
    4949            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    5050              RenderBlock (anonymous) at (0,0) size 8x16
    5151                RenderText at (0,-5) size 8x24
    5252                  text run at (0,-5) width 8: "\x{230A}"
    53           RenderMathMLOperator {mo} at (129,4) size 9x16
     53          RenderMathMLOperator {mo} at (72,4) size 8x16
    5454            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    5555              RenderBlock (anonymous) at (0,0) size 8x16
    5656                RenderText at (0,-5) size 8x24
    5757                  text run at (0,-5) width 8: "\x{230B}"
    58           RenderMathMLOperator {mo} at (143,2) size 12x20
     58          RenderMathMLOperator {mo} at (80,2) size 12x20
    5959            RenderMathMLBlock (anonymous, flex) at (0,0) size 11x20
    6060              RenderBlock (anonymous) at (0,0) size 7x20
    6161                RenderText at (0,-3) size 7x24
    6262                  text run at (0,-3) width 7: "\x{222B}"
    63           RenderMathMLOperator {mo} at (161,0) size 4x25
    64             RenderMathMLBlock (anonymous, flex) at (0,0) size 3x12
     63          RenderMathMLOperator {mo} at (91,0) size 8x25
     64            RenderMathMLBlock (anonymous, flex) at (1,0) size 4x12
    6565              RenderBlock (anonymous) at (0,0) size 3x12
    6666                RenderText at (0,-6) size 3x24
    6767                  text run at (0,-6) width 3: "|"
    68           RenderMathMLOperator {mo} at (170,4) size 9x16
     68          RenderMathMLOperator {mo} at (98,4) size 9x16
    6969            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    7070              RenderBlock (anonymous) at (0,0) size 8x16
    7171                RenderText at (0,-5) size 8x24
    7272                  text run at (0,-5) width 8: "\x{2016}"
    73           RenderMathMLOperator {mo} at (183,4) size 9x16
    74             RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
     73          RenderMathMLOperator {mo} at (106,4) size 18x16
     74            RenderMathMLBlock (anonymous, flex) at (4,0) size 9x16
    7575              RenderBlock (anonymous) at (0,0) size 8x16
    7676                RenderText at (0,-5) size 8x24
    7777                  text run at (0,-5) width 8: "\x{2225}"
    78       RenderText {#text} at (194,2) size 5x18
    79         text run at (194,2) width 5: " "
     78      RenderText {#text} at (125,2) size 5x18
     79        text run at (125,2) width 5: " "
    8080      RenderBR {BR} at (0,0) size 0x0
    81       RenderMathMLMath {math} at (0,24) size 199x143 [padding: 0 1 0 1]
    82         RenderMathMLRow {mrow} at (1,0) size 197x143
    83           RenderMathMLOperator {mo} at (1,0) size 8x143
     81      RenderMathMLMath {math} at (0,24) size 126x143 [padding: 0 1 0 1]
     82        RenderMathMLRow {mrow} at (1,0) size 124x143
     83          RenderMathMLOperator {mo} at (0,0) size 7x143
    8484            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    8585              RenderBlock (anonymous) at (0,0) size 5x14
    8686                RenderText at (0,-6) size 5x24
    8787                  text run at (0,-6) width 5: "("
    88           RenderMathMLOperator {mo} at (13,0) size 8x143
     88          RenderMathMLOperator {mo} at (7,0) size 7x143
    8989            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    9090              RenderBlock (anonymous) at (0,0) size 5x14
    9191                RenderText at (0,-6) size 5x24
    9292                  text run at (0,-6) width 5: ")"
    93           RenderMathMLOperator {mo} at (26,0) size 11x143
     93          RenderMathMLOperator {mo} at (14,0) size 10x143
    9494            RenderMathMLBlock (anonymous, flex) at (0,0) size 10x14
    9595              RenderBlock (anonymous) at (0,0) size 8x14
    9696                RenderText at (0,-6) size 8x24
    9797                  text run at (0,-6) width 8: "{"
    98           RenderMathMLOperator {mo} at (43,0) size 11x143
     98          RenderMathMLOperator {mo} at (24,0) size 10x143
    9999            RenderMathMLBlock (anonymous, flex) at (0,0) size 10x14
    100100              RenderBlock (anonymous) at (0,0) size 8x14
    101101                RenderText at (0,-6) size 8x24
    102102                  text run at (0,-6) width 8: "}"
    103           RenderMathMLOperator {mo} at (59,0) size 8x143
     103          RenderMathMLOperator {mo} at (34,0) size 7x143
    104104            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    105105              RenderBlock (anonymous) at (0,0) size 5x14
    106106                RenderText at (0,-6) size 5x24
    107107                  text run at (0,-6) width 5: "["
     108          RenderMathMLOperator {mo} at (41,0) size 7x143
     109            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
     110              RenderBlock (anonymous) at (0,0) size 5x14
     111                RenderText at (0,-6) size 5x24
     112                  text run at (0,-6) width 5: "]"
     113          RenderMathMLOperator {mo} at (48,0) size 8x143
     114            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
     115              RenderBlock (anonymous) at (0,0) size 8x16
     116                RenderText at (0,-5) size 8x24
     117                  text run at (0,-5) width 8: "\x{2308}"
     118          RenderMathMLOperator {mo} at (56,0) size 8x143
     119            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
     120              RenderBlock (anonymous) at (0,0) size 8x16
     121                RenderText at (0,-5) size 8x24
     122                  text run at (0,-5) width 8: "\x{2309}"
     123          RenderMathMLOperator {mo} at (64,0) size 8x143
     124            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
     125              RenderBlock (anonymous) at (0,0) size 8x16
     126                RenderText at (0,-5) size 8x24
     127                  text run at (0,-5) width 8: "\x{230A}"
    108128          RenderMathMLOperator {mo} at (72,0) size 8x143
    109             RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    110               RenderBlock (anonymous) at (0,0) size 5x14
    111                 RenderText at (0,-6) size 5x24
    112                   text run at (0,-6) width 5: "]"
    113           RenderMathMLOperator {mo} at (86,0) size 9x143
    114             RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    115               RenderBlock (anonymous) at (0,0) size 8x16
    116                 RenderText at (0,-5) size 8x24
    117                   text run at (0,-5) width 8: "\x{2308}"
    118           RenderMathMLOperator {mo} at (100,0) size 9x143
    119             RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    120               RenderBlock (anonymous) at (0,0) size 8x16
    121                 RenderText at (0,-5) size 8x24
    122                   text run at (0,-5) width 8: "\x{2309}"
    123           RenderMathMLOperator {mo} at (115,0) size 8x143
    124             RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    125               RenderBlock (anonymous) at (0,0) size 8x16
    126                 RenderText at (0,-5) size 8x24
    127                   text run at (0,-5) width 8: "\x{230A}"
    128           RenderMathMLOperator {mo} at (129,0) size 9x143
    129129            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    130130              RenderBlock (anonymous) at (0,0) size 8x16
    131131                RenderText at (0,-5) size 8x24
    132132                  text run at (0,-5) width 8: "\x{230B}"
    133           RenderMathMLOperator {mo} at (143,0) size 12x143
     133          RenderMathMLOperator {mo} at (80,0) size 12x143
    134134            RenderMathMLBlock (anonymous, flex) at (0,0) size 11x20
    135135              RenderBlock (anonymous) at (0,0) size 7x20
    136136                RenderText at (0,-3) size 7x24
    137137                  text run at (0,-3) width 7: "\x{222B}"
    138           RenderMathMLOperator {mo} at (161,0) size 4x143
    139             RenderMathMLBlock (anonymous, flex) at (0,0) size 3x12
     138          RenderMathMLOperator {mo} at (91,0) size 8x143
     139            RenderMathMLBlock (anonymous, flex) at (1,0) size 4x12
    140140              RenderBlock (anonymous) at (0,0) size 3x12
    141141                RenderText at (0,-6) size 3x24
    142142                  text run at (0,-6) width 3: "|"
    143           RenderMathMLOperator {mo} at (170,0) size 9x76
     143          RenderMathMLOperator {mo} at (98,0) size 9x76
    144144            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    145145              RenderBlock (anonymous) at (0,0) size 8x16
    146146                RenderText at (0,-5) size 8x24
    147147                  text run at (0,-5) width 8: "\x{2016}"
    148           RenderMathMLOperator {mo} at (184,0) size 9x76
    149             RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
     148          RenderMathMLOperator {mo} at (106,0) size 18x76
     149            RenderMathMLBlock (anonymous, flex) at (4,0) size 9x16
    150150              RenderBlock (anonymous) at (0,0) size 8x16
    151151                RenderText at (0,-5) size 8x24
    152152                  text run at (0,-5) width 8: "\x{2225}"
    153           RenderMathMLSpace {mspace} at (196,0) size 1x76
    154       RenderText {#text} at (198,85) size 5x18
    155         text run at (198,85) width 5: " "
    156       RenderMathMLMath {math} at (202,49) size 199x93 [padding: 0 1 0 1]
    157         RenderMathMLRow {mrow} at (1,0) size 197x93
    158           RenderMathMLOperator {mo} at (1,0) size 8x93
     153          RenderMathMLSpace {mspace} at (123,0) size 1x76
     154      RenderText {#text} at (125,85) size 5x18
     155        text run at (125,85) width 5: " "
     156      RenderMathMLMath {math} at (129,49) size 126x93 [padding: 0 1 0 1]
     157        RenderMathMLRow {mrow} at (1,0) size 124x93
     158          RenderMathMLOperator {mo} at (0,0) size 7x93
    159159            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    160160              RenderBlock (anonymous) at (0,0) size 5x14
    161161                RenderText at (0,-6) size 5x24
    162162                  text run at (0,-6) width 5: "("
    163           RenderMathMLOperator {mo} at (13,0) size 8x93
     163          RenderMathMLOperator {mo} at (7,0) size 7x93
    164164            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    165165              RenderBlock (anonymous) at (0,0) size 5x14
    166166                RenderText at (0,-6) size 5x24
    167167                  text run at (0,-6) width 5: ")"
    168           RenderMathMLOperator {mo} at (26,0) size 11x93
     168          RenderMathMLOperator {mo} at (14,0) size 10x93
    169169            RenderMathMLBlock (anonymous, flex) at (0,0) size 10x14
    170170              RenderBlock (anonymous) at (0,0) size 8x14
    171171                RenderText at (0,-6) size 8x24
    172172                  text run at (0,-6) width 8: "{"
    173           RenderMathMLOperator {mo} at (43,0) size 11x93
     173          RenderMathMLOperator {mo} at (24,0) size 10x93
    174174            RenderMathMLBlock (anonymous, flex) at (0,0) size 10x14
    175175              RenderBlock (anonymous) at (0,0) size 8x14
    176176                RenderText at (0,-6) size 8x24
    177177                  text run at (0,-6) width 8: "}"
    178           RenderMathMLOperator {mo} at (59,0) size 8x93
     178          RenderMathMLOperator {mo} at (34,0) size 7x93
    179179            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    180180              RenderBlock (anonymous) at (0,0) size 5x14
    181181                RenderText at (0,-6) size 5x24
    182182                  text run at (0,-6) width 5: "["
     183          RenderMathMLOperator {mo} at (41,0) size 7x93
     184            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
     185              RenderBlock (anonymous) at (0,0) size 5x14
     186                RenderText at (0,-6) size 5x24
     187                  text run at (0,-6) width 5: "]"
     188          RenderMathMLOperator {mo} at (48,0) size 8x93
     189            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
     190              RenderBlock (anonymous) at (0,0) size 8x16
     191                RenderText at (0,-5) size 8x24
     192                  text run at (0,-5) width 8: "\x{2308}"
     193          RenderMathMLOperator {mo} at (56,0) size 8x93
     194            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
     195              RenderBlock (anonymous) at (0,0) size 8x16
     196                RenderText at (0,-5) size 8x24
     197                  text run at (0,-5) width 8: "\x{2309}"
     198          RenderMathMLOperator {mo} at (64,0) size 8x93
     199            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
     200              RenderBlock (anonymous) at (0,0) size 8x16
     201                RenderText at (0,-5) size 8x24
     202                  text run at (0,-5) width 8: "\x{230A}"
    183203          RenderMathMLOperator {mo} at (72,0) size 8x93
    184             RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    185               RenderBlock (anonymous) at (0,0) size 5x14
    186                 RenderText at (0,-6) size 5x24
    187                   text run at (0,-6) width 5: "]"
    188           RenderMathMLOperator {mo} at (86,0) size 9x93
    189             RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    190               RenderBlock (anonymous) at (0,0) size 8x16
    191                 RenderText at (0,-5) size 8x24
    192                   text run at (0,-5) width 8: "\x{2308}"
    193           RenderMathMLOperator {mo} at (100,0) size 9x93
    194             RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    195               RenderBlock (anonymous) at (0,0) size 8x16
    196                 RenderText at (0,-5) size 8x24
    197                   text run at (0,-5) width 8: "\x{2309}"
    198           RenderMathMLOperator {mo} at (115,0) size 8x93
    199             RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    200               RenderBlock (anonymous) at (0,0) size 8x16
    201                 RenderText at (0,-5) size 8x24
    202                   text run at (0,-5) width 8: "\x{230A}"
    203           RenderMathMLOperator {mo} at (129,0) size 9x93
    204204            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    205205              RenderBlock (anonymous) at (0,0) size 8x16
    206206                RenderText at (0,-5) size 8x24
    207207                  text run at (0,-5) width 8: "\x{230B}"
    208           RenderMathMLOperator {mo} at (143,0) size 12x93
     208          RenderMathMLOperator {mo} at (80,0) size 12x93
    209209            RenderMathMLBlock (anonymous, flex) at (0,0) size 11x20
    210210              RenderBlock (anonymous) at (0,0) size 7x20
    211211                RenderText at (0,-3) size 7x24
    212212                  text run at (0,-3) width 7: "\x{222B}"
    213           RenderMathMLOperator {mo} at (161,0) size 4x93
    214             RenderMathMLBlock (anonymous, flex) at (0,0) size 3x12
     213          RenderMathMLOperator {mo} at (91,0) size 8x93
     214            RenderMathMLBlock (anonymous, flex) at (1,0) size 4x12
    215215              RenderBlock (anonymous) at (0,0) size 3x12
    216216                RenderText at (0,-6) size 3x24
    217217                  text run at (0,-6) width 3: "|"
    218           RenderMathMLOperator {mo} at (170,0) size 9x51
     218          RenderMathMLOperator {mo} at (98,0) size 9x51
    219219            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    220220              RenderBlock (anonymous) at (0,0) size 8x16
    221221                RenderText at (0,-5) size 8x24
    222222                  text run at (0,-5) width 8: "\x{2016}"
    223           RenderMathMLOperator {mo} at (184,0) size 9x51
    224             RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
     223          RenderMathMLOperator {mo} at (106,0) size 18x51
     224            RenderMathMLBlock (anonymous, flex) at (4,0) size 9x16
    225225              RenderBlock (anonymous) at (0,0) size 8x16
    226226                RenderText at (0,-5) size 8x24
    227227                  text run at (0,-5) width 8: "\x{2225}"
    228           RenderMathMLSpace {mspace} at (196,0) size 1x51
    229       RenderText {#text} at (400,85) size 5x18
    230         text run at (400,85) width 5: " "
    231       RenderMathMLMath {math} at (404,79) size 199x33 [padding: 0 1 0 1]
    232         RenderMathMLRow {mrow} at (1,0) size 197x33
    233           RenderMathMLOperator {mo} at (1,0) size 8x33
     228          RenderMathMLSpace {mspace} at (123,0) size 1x51
     229      RenderText {#text} at (254,85) size 5x18
     230        text run at (254,85) width 5: " "
     231      RenderMathMLMath {math} at (258,79) size 126x33 [padding: 0 1 0 1]
     232        RenderMathMLRow {mrow} at (1,0) size 124x33
     233          RenderMathMLOperator {mo} at (0,0) size 7x33
    234234            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    235235              RenderBlock (anonymous) at (0,0) size 5x14
    236236                RenderText at (0,-6) size 5x24
    237237                  text run at (0,-6) width 5: "("
    238           RenderMathMLOperator {mo} at (13,0) size 8x33
     238          RenderMathMLOperator {mo} at (7,0) size 7x33
    239239            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    240240              RenderBlock (anonymous) at (0,0) size 5x14
    241241                RenderText at (0,-6) size 5x24
    242242                  text run at (0,-6) width 5: ")"
    243           RenderMathMLOperator {mo} at (26,9) size 11x14
     243          RenderMathMLOperator {mo} at (14,9) size 10x14
    244244            RenderMathMLBlock (anonymous, flex) at (0,0) size 10x14
    245245              RenderBlock (anonymous) at (0,0) size 8x14
    246246                RenderText at (0,-6) size 8x24
    247247                  text run at (0,-6) width 8: "{"
    248           RenderMathMLOperator {mo} at (43,9) size 11x14
     248          RenderMathMLOperator {mo} at (24,9) size 10x14
    249249            RenderMathMLBlock (anonymous, flex) at (0,0) size 10x14
    250250              RenderBlock (anonymous) at (0,0) size 8x14
    251251                RenderText at (0,-6) size 8x24
    252252                  text run at (0,-6) width 8: "}"
    253           RenderMathMLOperator {mo} at (59,0) size 8x33
     253          RenderMathMLOperator {mo} at (34,0) size 7x33
    254254            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    255255              RenderBlock (anonymous) at (0,0) size 5x14
    256256                RenderText at (0,-6) size 5x24
    257257                  text run at (0,-6) width 5: "["
     258          RenderMathMLOperator {mo} at (41,0) size 7x33
     259            RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
     260              RenderBlock (anonymous) at (0,0) size 5x14
     261                RenderText at (0,-6) size 5x24
     262                  text run at (0,-6) width 5: "]"
     263          RenderMathMLOperator {mo} at (48,0) size 8x33
     264            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
     265              RenderBlock (anonymous) at (0,0) size 8x16
     266                RenderText at (0,-5) size 8x24
     267                  text run at (0,-5) width 8: "\x{2308}"
     268          RenderMathMLOperator {mo} at (56,0) size 8x33
     269            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
     270              RenderBlock (anonymous) at (0,0) size 8x16
     271                RenderText at (0,-5) size 8x24
     272                  text run at (0,-5) width 8: "\x{2309}"
     273          RenderMathMLOperator {mo} at (64,0) size 8x33
     274            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
     275              RenderBlock (anonymous) at (0,0) size 8x16
     276                RenderText at (0,-5) size 8x24
     277                  text run at (0,-5) width 8: "\x{230A}"
    258278          RenderMathMLOperator {mo} at (72,0) size 8x33
    259             RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    260               RenderBlock (anonymous) at (0,0) size 5x14
    261                 RenderText at (0,-6) size 5x24
    262                   text run at (0,-6) width 5: "]"
    263           RenderMathMLOperator {mo} at (86,0) size 9x33
    264             RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    265               RenderBlock (anonymous) at (0,0) size 8x16
    266                 RenderText at (0,-5) size 8x24
    267                   text run at (0,-5) width 8: "\x{2308}"
    268           RenderMathMLOperator {mo} at (100,0) size 9x33
    269             RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    270               RenderBlock (anonymous) at (0,0) size 8x16
    271                 RenderText at (0,-5) size 8x24
    272                   text run at (0,-5) width 8: "\x{2309}"
    273           RenderMathMLOperator {mo} at (115,0) size 8x33
    274             RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    275               RenderBlock (anonymous) at (0,0) size 8x16
    276                 RenderText at (0,-5) size 8x24
    277                   text run at (0,-5) width 8: "\x{230A}"
    278           RenderMathMLOperator {mo} at (129,0) size 9x33
    279279            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    280280              RenderBlock (anonymous) at (0,0) size 8x16
    281281                RenderText at (0,-5) size 8x24
    282282                  text run at (0,-5) width 8: "\x{230B}"
    283           RenderMathMLOperator {mo} at (143,6) size 12x20
     283          RenderMathMLOperator {mo} at (80,6) size 12x20
    284284            RenderMathMLBlock (anonymous, flex) at (0,0) size 11x20
    285285              RenderBlock (anonymous) at (0,0) size 7x20
    286286                RenderText at (0,-3) size 7x24
    287287                  text run at (0,-3) width 7: "\x{222B}"
    288           RenderMathMLOperator {mo} at (161,0) size 4x33
    289             RenderMathMLBlock (anonymous, flex) at (0,0) size 3x12
     288          RenderMathMLOperator {mo} at (91,0) size 8x33
     289            RenderMathMLBlock (anonymous, flex) at (1,0) size 4x12
    290290              RenderBlock (anonymous) at (0,0) size 3x12
    291291                RenderText at (0,-6) size 3x24
    292292                  text run at (0,-6) width 3: "|"
    293           RenderMathMLOperator {mo} at (170,8) size 9x16
     293          RenderMathMLOperator {mo} at (98,8) size 9x16
    294294            RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    295295              RenderBlock (anonymous) at (0,0) size 8x16
    296296                RenderText at (0,-5) size 8x24
    297297                  text run at (0,-5) width 8: "\x{2016}"
    298           RenderMathMLOperator {mo} at (184,8) size 9x16
    299             RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
     298          RenderMathMLOperator {mo} at (106,8) size 18x16
     299            RenderMathMLBlock (anonymous, flex) at (4,0) size 9x16
    300300              RenderBlock (anonymous) at (0,0) size 8x16
    301301                RenderText at (0,-5) size 8x24
    302302                  text run at (0,-5) width 8: "\x{2225}"
    303           RenderMathMLSpace {mspace} at (196,0) size 1x21
    304       RenderText {#text} at (602,85) size 5x18
    305         text run at (602,85) width 5: " "
     303          RenderMathMLSpace {mspace} at (123,0) size 1x21
     304      RenderText {#text} at (383,85) size 5x18
     305        text run at (383,85) width 5: " "
    306306      RenderBR {BR} at (0,0) size 0x0
    307       RenderMathMLMath {math} at (0,166) size 211x79 [padding: 0 1 0 1]
    308         RenderMathMLSquareRoot {msqrt} at (1,0) size 209x79 [intrinsic padding: 3 0 3 12]
    309           RenderMathMLRow (anonymous) at (12,3) size 197x73
    310             RenderMathMLOperator {mo} at (1,0) size 8x73
     307      RenderMathMLMath {math} at (0,166) size 138x79 [padding: 0 1 0 1]
     308        RenderMathMLSquareRoot {msqrt} at (1,0) size 136x79 [intrinsic padding: 3 0 3 12]
     309          RenderMathMLRow (anonymous) at (12,3) size 124x73
     310            RenderMathMLOperator {mo} at (0,0) size 7x73
    311311              RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    312312                RenderBlock (anonymous) at (0,0) size 5x14
    313313                  RenderText at (0,-6) size 5x24
    314314                    text run at (0,-6) width 5: "("
    315             RenderMathMLOperator {mo} at (13,0) size 8x73
     315            RenderMathMLOperator {mo} at (7,0) size 7x73
    316316              RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    317317                RenderBlock (anonymous) at (0,0) size 5x14
    318318                  RenderText at (0,-6) size 5x24
    319319                    text run at (0,-6) width 5: ")"
    320             RenderMathMLOperator {mo} at (26,0) size 11x73
     320            RenderMathMLOperator {mo} at (14,0) size 10x73
    321321              RenderMathMLBlock (anonymous, flex) at (0,0) size 10x14
    322322                RenderBlock (anonymous) at (0,0) size 8x14
    323323                  RenderText at (0,-6) size 8x24
    324324                    text run at (0,-6) width 8: "{"
    325             RenderMathMLOperator {mo} at (43,0) size 11x73
     325            RenderMathMLOperator {mo} at (24,0) size 10x73
    326326              RenderMathMLBlock (anonymous, flex) at (0,0) size 10x14
    327327                RenderBlock (anonymous) at (0,0) size 8x14
    328328                  RenderText at (0,-6) size 8x24
    329329                    text run at (0,-6) width 8: "}"
    330             RenderMathMLOperator {mo} at (59,0) size 8x73
     330            RenderMathMLOperator {mo} at (34,0) size 7x73
    331331              RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    332332                RenderBlock (anonymous) at (0,0) size 5x14
    333333                  RenderText at (0,-6) size 5x24
    334334                    text run at (0,-6) width 5: "["
    335             RenderMathMLOperator {mo} at (72,0) size 8x73
     335            RenderMathMLOperator {mo} at (41,0) size 7x73
    336336              RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14
    337337                RenderBlock (anonymous) at (0,0) size 5x14
    338338                  RenderText at (0,-6) size 5x24
    339339                    text run at (0,-6) width 5: "]"
    340             RenderMathMLOperator {mo} at (86,0) size 9x73
     340            RenderMathMLOperator {mo} at (48,0) size 8x73
    341341              RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    342342                RenderBlock (anonymous) at (0,0) size 8x16
    343343                  RenderText at (0,-5) size 8x24
    344344                    text run at (0,-5) width 8: "\x{2308}"
    345             RenderMathMLOperator {mo} at (100,0) size 9x73
     345            RenderMathMLOperator {mo} at (56,0) size 8x73
    346346              RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    347347                RenderBlock (anonymous) at (0,0) size 8x16
    348348                  RenderText at (0,-5) size 8x24
    349349                    text run at (0,-5) width 8: "\x{2309}"
    350             RenderMathMLOperator {mo} at (115,0) size 8x73
     350            RenderMathMLOperator {mo} at (64,0) size 8x73
    351351              RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    352352                RenderBlock (anonymous) at (0,0) size 8x16
    353353                  RenderText at (0,-5) size 8x24
    354354                    text run at (0,-5) width 8: "\x{230A}"
    355             RenderMathMLOperator {mo} at (129,0) size 9x73
     355            RenderMathMLOperator {mo} at (72,0) size 8x73
    356356              RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    357357                RenderBlock (anonymous) at (0,0) size 8x16
    358358                  RenderText at (0,-5) size 8x24
    359359                    text run at (0,-5) width 8: "\x{230B}"
    360             RenderMathMLOperator {mo} at (143,0) size 12x73
     360            RenderMathMLOperator {mo} at (80,0) size 12x73
    361361              RenderMathMLBlock (anonymous, flex) at (0,0) size 11x20
    362362                RenderBlock (anonymous) at (0,0) size 7x20
    363363                  RenderText at (0,-3) size 7x24
    364364                    text run at (0,-3) width 7: "\x{222B}"
    365             RenderMathMLOperator {mo} at (161,0) size 4x73
    366               RenderMathMLBlock (anonymous, flex) at (0,0) size 3x12
     365            RenderMathMLOperator {mo} at (91,0) size 8x73
     366              RenderMathMLBlock (anonymous, flex) at (1,0) size 4x12
    367367                RenderBlock (anonymous) at (0,0) size 3x12
    368368                  RenderText at (0,-6) size 3x24
    369369                    text run at (0,-6) width 3: "|"
    370             RenderMathMLOperator {mo} at (170,0) size 9x41
     370            RenderMathMLOperator {mo} at (98,0) size 9x41
    371371              RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
    372372                RenderBlock (anonymous) at (0,0) size 8x16
    373373                  RenderText at (0,-5) size 8x24
    374374                    text run at (0,-5) width 8: "\x{2016}"
    375             RenderMathMLOperator {mo} at (184,0) size 9x41
    376               RenderMathMLBlock (anonymous, flex) at (0,0) size 8x16
     375            RenderMathMLOperator {mo} at (106,0) size 18x41
     376              RenderMathMLBlock (anonymous, flex) at (4,0) size 9x16
    377377                RenderBlock (anonymous) at (0,0) size 8x16
    378378                  RenderText at (0,-5) size 8x24
    379379                    text run at (0,-5) width 8: "\x{2225}"
    380             RenderMathMLSpace {mspace} at (196,0) size 1x41
     380            RenderMathMLSpace {mspace} at (123,0) size 1x41
    381381      RenderText {#text} at (0,0) size 0x0
  • trunk/Source/WebCore/ChangeLog

    r165456 r165461  
     12014-03-11  Frédéric Wang  <fred.wang@free.fr>
     2
     3        Implement MathML spacing around operators .
     4        https://bugs.webkit.org/show_bug.cgi?id=115787
     5
     6        Reviewed by Chris Fleizach.
     7
     8        This makes the <mo> operators use the lspace/rspace properties to
     9        determine their spacing. The spacing is now consistent with the one
     10        of <mfenced> and as a consequence bug 118843 is fixed. This also ensures
     11        that the rendering of <mo> elements is updated when the form or
     12        attributes are changed.
     13
     14        Tests: mathml/presentation/dir-mo.html
     15               mathml/presentation/mo-form-dynamic.html
     16               mathml/presentation/mo-form-minus-plus.html
     17               mathml/presentation/mo-form.html
     18               mathml/presentation/mo-lspace-rspace-dynamic.html
     19               mathml/presentation/mo-lspace-rspace.html
     20               mathml/presentation/mo-whitespaces.html
     21
     22        * css/mathml.css:
     23        * mathml/MathMLInlineContainerElement.cpp:
     24        (WebCore::MathMLInlineContainerElement::childrenChanged):
     25        * mathml/MathMLInlineContainerElement.h:
     26        * rendering/mathml/RenderMathMLOperator.cpp:
     27        (WebCore::RenderMathMLOperator::setOperatorPropertiesFromOpDictEntry):
     28        (WebCore::RenderMathMLOperator::SetOperatorProperties):
     29        (WebCore::RenderMathMLOperator::updateFromElement):
     30        (WebCore::RenderMathMLOperator::updateOperatorProperties):
     31        (WebCore::RenderMathMLOperator::updateStyle):
     32        * rendering/mathml/RenderMathMLOperator.h:
     33        * rendering/mathml/RenderMathMLRow.cpp:
     34        (WebCore::RenderMathMLRow::updateOperatorProperties):
     35        * rendering/mathml/RenderMathMLRow.h:
     36        * rendering/mathml/RenderMathMLToken.h:
     37
    1382014-03-11  Brent Fulgham  <bfulgham@apple.com>
    239
  • trunk/Source/WebCore/css/mathml.css

    r163553 r165461  
    104104msubsup > mi:first-child + * + * {
    105105    -webkit-margin-start: 0.14em; /* This is larger than 0.1em because the child's font-size is smaller than the <msubsup>'s. */
    106 }
    107 
    108 /* FIXME: For a RenderMathMLOperator's margin-start and margin-end, or for a MathML "embellished operator", check the operator's lspace and rspace attributes,
    109    and the MathML operator dictionary. */
    110 math > mo, mrow > mo, msqrt > mo, mtd > mo {
    111     -webkit-margin-start: 0.2em;
    112     -webkit-margin-end: 0.2em;
    113 }
    114 math > mo:first-child, mrow > mo:first-child, msqrt > mo:first-child, mtd > mo:first-child,
    115 math > mo:last-child, mrow > mo:last-child, msqrt > mo:last-child, mtd > mo:last-child {
    116     -webkit-margin-start: 0.1em;
    117     -webkit-margin-end: 0.1em;
    118106}
    119107
  • trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp

    r162933 r165461  
    5656}
    5757
     58void MathMLInlineContainerElement::childrenChanged(const ChildChange& change)
     59{
     60    if (renderer()) {
     61        if (renderer()->isRenderMathMLRow())
     62            toRenderMathMLRow(renderer())->updateOperatorProperties();
     63        else if (hasLocalName(mathTag) || hasLocalName(msqrtTag)) {
     64            auto childRenderer = renderer()->firstChild();
     65            if (childRenderer && childRenderer->isRenderMathMLRow())
     66                toRenderMathMLRow(childRenderer)->updateOperatorProperties();
     67        }
     68    }
     69    MathMLElement::childrenChanged(change);
     70}
     71
    5872RenderPtr<RenderElement> MathMLInlineContainerElement::createElementRenderer(PassRef<RenderStyle> style)
    5973{
  • trunk/Source/WebCore/mathml/MathMLInlineContainerElement.h

    r162139 r165461  
    4141protected:
    4242    MathMLInlineContainerElement(const QualifiedName& tagName, Document&);
     43    void childrenChanged(const ChildChange&);
    4344
    4445private:
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp

    r165436 r165461  
    11611161
    11621162    // Leading and trailing space is specified as multiple of 1/18em.
    1163     m_leadingSpace = entry->lspace * style().fontSize() / 18;
    1164     m_trailingSpace = entry->rspace * style().fontSize() / 18;
     1163    m_leadingSpace = entry->lspace * style().font().size() / 18;
     1164    m_trailingSpace = entry->rspace * style().font().size() / 18;
    11651165}
    11661166
     
    11961196    else
    11971197        m_operatorFlags = 0; // This resets all the operator properties.
    1198     m_leadingSpace = 5 * style().fontSize() / 18; // This sets leading space to "thickmathspace".
    1199     m_trailingSpace = 5 * style().fontSize() / 18; // This sets trailing space to "thickmathspace".
    1200     m_minSize = style().fontSize(); // This sets minsize to "1em".
     1198    m_leadingSpace = 5 * style().font().size() / 18; // This sets leading space to "thickmathspace".
     1199    m_trailingSpace = 5 * style().font().size() / 18; // This sets trailing space to "thickmathspace".
     1200    m_minSize = style().font().size(); // This sets minsize to "1em".
    12011201    m_maxSize = intMaxForLayoutUnit; // This sets maxsize to "infinity".
    12021202
     
    12371237        if (maxsize != "infinity")
    12381238            parseMathMLLength(maxsize, m_maxSize, &style(), false);
    1239     }
    1240 
    1241     // FIXME: this should be removed when operator spacing is implemented (https://bugs.webkit.org/show_bug.cgi?id=115787). At the moment spacing for normal <mo> elements is handled in mathml.css and mfenced uses the arbitrary constants below.
    1242     if (isFencedOperator()) {
    1243         if (hasOperatorFlag(MathMLOperatorDictionary::Fence)) {
    1244             m_leadingSpace = 0.1f * style().fontSize();
    1245             m_trailingSpace = 0.1f * style().fontSize();
    1246         } else if (hasOperatorFlag(MathMLOperatorDictionary::Separator)) {
    1247             m_leadingSpace = 0;
    1248             m_trailingSpace = 0.25f * style().fontSize();
    1249         }
    1250     } else {
    1251         m_leadingSpace = 0;
    1252         m_trailingSpace = 0;
    12531239    }
    12541240}
     
    13751361}
    13761362
     1363void RenderMathMLOperator::updateFromElement()
     1364{
     1365    SetOperatorProperties();
     1366    RenderMathMLToken::updateFromElement();
     1367}
     1368
     1369void RenderMathMLOperator::updateOperatorProperties()
     1370{
     1371    SetOperatorProperties();
     1372    if (!isEmpty())
     1373        updateStyle();
     1374    setNeedsLayoutAndPrefWidthsRecalc();
     1375}
     1376
    13771377bool RenderMathMLOperator::shouldAllowStretching(UChar& stretchedCharacter)
    13781378{
     
    14281428
    14291429    // We add spacing around the operator.
     1430    // FIXME: The spacing should be added to the whole embellished operator (https://bugs.webkit.org/show_bug.cgi?id=124831).
     1431    // FIXME: The spacing should only be added inside (perhaps inferred) mrow (http://www.w3.org/TR/MathML/chapter3.html#presm.opspacing).
    14301432    const auto& wrapper = toRenderElement(firstChild());
    14311433    auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(&style(), FLEX);
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h

    r165436 r165461  
    5050    UChar character;
    5151    Form form;
    52     // FIXME: spacing around <mo> operators is not implemented yet (https://bugs.webkit.org/show_bug.cgi?id=115787).
    5352    unsigned short lspace;
    5453    unsigned short rspace;
     
    8281    void updateTokenContent(const String& operatorString);
    8382    void updateTokenContent() override final;
     83    void updateOperatorProperties();
    8484
    8585private:
     
    9494    virtual RenderMathMLOperator* unembellishedOperator() override { return this; }
    9595    void rebuildTokenContent(const String& operatorString);
     96    void updateFromElement() override;
    9697
    9798    bool shouldAllowStretching(UChar& characterForStretching);
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp

    r164700 r165461  
    5656}
    5757
     58void RenderMathMLRow::updateOperatorProperties()
     59{
     60    for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
     61        if (child->isRenderMathMLBlock()) {
     62            auto renderOperator = toRenderMathMLBlock(child)->unembellishedOperator();
     63            if (renderOperator)
     64                renderOperator->updateOperatorProperties();
     65        }
     66    }
     67    setNeedsLayoutAndPrefWidthsRecalc();
     68}
     69
    5870void RenderMathMLRow::layout()
    5971{
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.h

    r162158 r165461  
    4141
    4242    static RenderPtr<RenderMathMLRow> createAnonymousWithParentRenderer(RenderMathMLRoot&);
     43    void updateOperatorProperties();
    4344
    4445protected:
     
    5051};
    5152
     53RENDER_OBJECT_TYPE_CASTS(RenderMathMLRow, isRenderMathMLRow())
     54
    5255}
    5356
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.h

    r163793 r165461  
    4646    virtual void addChild(RenderObject* newChild, RenderObject* beforeChild) override;
    4747    virtual void updateTokenContent();
     48    void updateFromElement() override;
    4849
    4950protected:
     
    5253private:
    5354    virtual const char* renderName() const override { return isAnonymous() ? "RenderMathMLToken (anonymous)" : "RenderMathMLToken"; }
    54     void updateFromElement() override;
    5555    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
    5656    virtual void updateStyle();
Note: See TracChangeset for help on using the changeset viewer.