Changeset 164700 in webkit


Ignore:
Timestamp:
Feb 25, 2014 10:52:37 PM (10 years ago)
Author:
fred.wang@free.fr
Message:

Add support for minsize/maxsize attributes.
https://bugs.webkit.org/show_bug.cgi?id=122567

Reviewed by Chris Fleizach.

Source/WebCore:

This change implements the minsize/maxsize attributes of the mo element.
We also switch stretch sizes from int to LayoutUnit to improve accuracy.

Tests: mathml/presentation/stretchy-minsize-maxsize-dynamic.html

mathml/presentation/stretchy-minsize-maxsize.html

  • rendering/mathml/RenderMathMLOperator.cpp:

(WebCore::RenderMathMLOperator::SetOperatorProperties):
(WebCore::RenderMathMLOperator::stretchTo):

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

(WebCore::RenderMathMLRow::layout):

LayoutTests:

Add some reftests for the minsize/maxsize attributes of the mo element.

  • platform/mac/mathml/presentation/mo-stretch-expected.txt:
  • mathml/presentation/stretchy-minsize-maxsize-dynamic-expected.html: Added.
  • mathml/presentation/stretchy-minsize-maxsize-dynamic.html: Added.
  • mathml/presentation/stretchy-minsize-maxsize-expected.html: Added.
  • mathml/presentation/stretchy-minsize-maxsize.html: Added.
Location:
trunk
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r164689 r164700  
     12014-02-25  Frédéric Wang  <fred.wang@free.fr>
     2
     3        Add support for minsize/maxsize attributes.
     4        https://bugs.webkit.org/show_bug.cgi?id=122567
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Add some reftests for the minsize/maxsize attributes of the mo element.
     9
     10        * platform/mac/mathml/presentation/mo-stretch-expected.txt:
     11        * mathml/presentation/stretchy-minsize-maxsize-dynamic-expected.html: Added.
     12        * mathml/presentation/stretchy-minsize-maxsize-dynamic.html: Added.
     13        * mathml/presentation/stretchy-minsize-maxsize-expected.html: Added.
     14        * mathml/presentation/stretchy-minsize-maxsize.html: Added.
     15
    1162014-02-25  Joseph Pecoraro  <pecoraro@apple.com>
    217
  • trunk/LayoutTests/platform/mac/mathml/presentation/mo-stretch-expected.txt

    r164537 r164700  
    11layer at (0,0) size 800x600
    22  RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x256
    4   RenderBlock {HTML} at (0,0) size 800x256
    5     RenderBody {BODY} at (8,8) size 784x240
    6       RenderMathMLMath {math} at (0,0) size 195x20 [padding: 0 1 0 1]
    7         RenderMathMLRow {mrow} at (1,0) size 193x20
    8           RenderMathMLOperator {mo} at (1,3) size 8x14
     3layer at (0,0) size 800x260
     4  RenderBlock {HTML} at (0,0) size 800x260
     5    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
    99            RenderMathMLBlock (flex) {mo} 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,3) size 8x14
     13          RenderMathMLOperator {mo} at (13,5) size 8x14
    1414            RenderMathMLBlock (flex) {mo} 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,3) size 11x14
     18          RenderMathMLOperator {mo} at (26,5) size 11x14
    1919            RenderMathMLBlock (flex) {mo} 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,3) size 11x14
     23          RenderMathMLOperator {mo} at (43,5) size 11x14
    2424            RenderMathMLBlock (flex) {mo} 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,3) size 8x14
     28          RenderMathMLOperator {mo} at (59,5) size 8x14
    2929            RenderMathMLBlock (flex) {mo} 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,3) size 8x14
     33          RenderMathMLOperator {mo} at (72,5) size 8x14
    3434            RenderMathMLBlock (flex) {mo} 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,2) size 9x16
     38          RenderMathMLOperator {mo} at (86,4) size 9x16
    3939            RenderMathMLBlock (flex) {mo} 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,2) size 9x16
     43          RenderMathMLOperator {mo} at (100,4) size 9x16
    4444            RenderMathMLBlock (flex) {mo} 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,2) size 8x16
     48          RenderMathMLOperator {mo} at (115,4) size 8x16
    4949            RenderMathMLBlock (flex) {mo} 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,2) size 9x16
     53          RenderMathMLOperator {mo} at (129,4) size 9x16
    5454            RenderMathMLBlock (flex) {mo} 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,0) size 12x20
     58          RenderMathMLOperator {mo} at (143,2) size 12x20
    5959            RenderMathMLBlock (flex) {mo} 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,3) size 4x12
     63          RenderMathMLOperator {mo} at (161,0) size 4x25
    6464            RenderMathMLBlock (flex) {mo} at (0,0) size 3x12
    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,2) size 9x16
     68          RenderMathMLOperator {mo} at (170,4) size 9x16
    6969            RenderMathMLBlock (flex) {mo} 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,2) size 9x16
     73          RenderMathMLOperator {mo} at (183,4) size 9x16
    7474            RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
    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,0) size 5x18
    79         text run at (194,0) width 5: " "
     78      RenderText {#text} at (194,2) size 5x18
     79        text run at (194,2) width 5: " "
    8080      RenderBR {BR} at (0,0) size 0x0
    81       RenderMathMLMath {math} at (0,20) size 199x142 [padding: 0 1 0 1]
    82         RenderMathMLRow {mrow} at (1,0) size 197x142
    83           RenderMathMLOperator {mo} at (1,0) size 8x142
     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
    8484            RenderMathMLBlock (flex) {mo} 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 8x142
     88          RenderMathMLOperator {mo} at (13,0) size 8x143
    8989            RenderMathMLBlock (flex) {mo} 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 11x142
     93          RenderMathMLOperator {mo} at (26,0) size 11x143
    9494            RenderMathMLBlock (flex) {mo} 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 11x142
     98          RenderMathMLOperator {mo} at (43,0) size 11x143
    9999            RenderMathMLBlock (flex) {mo} 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 8x142
     103          RenderMathMLOperator {mo} at (59,0) size 8x143
    104104            RenderMathMLBlock (flex) {mo} 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 (72,0) size 8x142
     108          RenderMathMLOperator {mo} at (72,0) size 8x143
    109109            RenderMathMLBlock (flex) {mo} at (0,0) size 7x14
    110110              RenderBlock (anonymous) at (0,0) size 5x14
    111111                RenderText at (0,-6) size 5x24
    112112                  text run at (0,-6) width 5: "]"
    113           RenderMathMLOperator {mo} at (86,0) size 9x142
     113          RenderMathMLOperator {mo} at (86,0) size 9x143
    114114            RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
    115115              RenderBlock (anonymous) at (0,0) size 8x16
    116116                RenderText at (0,-5) size 8x24
    117117                  text run at (0,-5) width 8: "\x{2308}"
    118           RenderMathMLOperator {mo} at (100,0) size 9x142
     118          RenderMathMLOperator {mo} at (100,0) size 9x143
    119119            RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
    120120              RenderBlock (anonymous) at (0,0) size 8x16
    121121                RenderText at (0,-5) size 8x24
    122122                  text run at (0,-5) width 8: "\x{2309}"
    123           RenderMathMLOperator {mo} at (115,0) size 8x142
     123          RenderMathMLOperator {mo} at (115,0) size 8x143
    124124            RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
    125125              RenderBlock (anonymous) at (0,0) size 8x16
    126126                RenderText at (0,-5) size 8x24
    127127                  text run at (0,-5) width 8: "\x{230A}"
    128           RenderMathMLOperator {mo} at (129,0) size 9x142
     128          RenderMathMLOperator {mo} at (129,0) size 9x143
    129129            RenderMathMLBlock (flex) {mo} 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 12x142
     133          RenderMathMLOperator {mo} at (143,0) size 12x143
    134134            RenderMathMLBlock (flex) {mo} 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 4x142
     138          RenderMathMLOperator {mo} at (161,0) size 4x143
    139139            RenderMathMLBlock (flex) {mo} at (0,0) size 3x12
    140140              RenderBlock (anonymous) at (0,0) size 3x12
     
    152152                  text run at (0,-5) width 8: "\x{2225}"
    153153          RenderMathMLSpace {mspace} at (196,0) size 1x76
    154       RenderText {#text} at (198,81) size 5x18
    155         text run at (198,81) width 5: " "
    156       RenderMathMLMath {math} at (202,45) size 199x92 [padding: 0 1 0 1]
    157         RenderMathMLRow {mrow} at (1,0) size 197x92
    158           RenderMathMLOperator {mo} at (1,0) size 8x92
     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
    159159            RenderMathMLBlock (flex) {mo} 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 8x92
     163          RenderMathMLOperator {mo} at (13,0) size 8x93
    164164            RenderMathMLBlock (flex) {mo} 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 11x92
     168          RenderMathMLOperator {mo} at (26,0) size 11x93
    169169            RenderMathMLBlock (flex) {mo} 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 11x92
     173          RenderMathMLOperator {mo} at (43,0) size 11x93
    174174            RenderMathMLBlock (flex) {mo} 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 8x92
     178          RenderMathMLOperator {mo} at (59,0) size 8x93
    179179            RenderMathMLBlock (flex) {mo} 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 (72,0) size 8x92
     183          RenderMathMLOperator {mo} at (72,0) size 8x93
    184184            RenderMathMLBlock (flex) {mo} at (0,0) size 7x14
    185185              RenderBlock (anonymous) at (0,0) size 5x14
    186186                RenderText at (0,-6) size 5x24
    187187                  text run at (0,-6) width 5: "]"
    188           RenderMathMLOperator {mo} at (86,0) size 9x92
     188          RenderMathMLOperator {mo} at (86,0) size 9x93
    189189            RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
    190190              RenderBlock (anonymous) at (0,0) size 8x16
    191191                RenderText at (0,-5) size 8x24
    192192                  text run at (0,-5) width 8: "\x{2308}"
    193           RenderMathMLOperator {mo} at (100,0) size 9x92
     193          RenderMathMLOperator {mo} at (100,0) size 9x93
    194194            RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
    195195              RenderBlock (anonymous) at (0,0) size 8x16
    196196                RenderText at (0,-5) size 8x24
    197197                  text run at (0,-5) width 8: "\x{2309}"
    198           RenderMathMLOperator {mo} at (115,0) size 8x92
     198          RenderMathMLOperator {mo} at (115,0) size 8x93
    199199            RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
    200200              RenderBlock (anonymous) at (0,0) size 8x16
    201201                RenderText at (0,-5) size 8x24
    202202                  text run at (0,-5) width 8: "\x{230A}"
    203           RenderMathMLOperator {mo} at (129,0) size 9x92
     203          RenderMathMLOperator {mo} at (129,0) size 9x93
    204204            RenderMathMLBlock (flex) {mo} 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 12x92
     208          RenderMathMLOperator {mo} at (143,0) size 12x93
    209209            RenderMathMLBlock (flex) {mo} 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 4x92
     213          RenderMathMLOperator {mo} at (161,0) size 4x93
    214214            RenderMathMLBlock (flex) {mo} at (0,0) size 3x12
    215215              RenderBlock (anonymous) at (0,0) size 3x12
     
    227227                  text run at (0,-5) width 8: "\x{2225}"
    228228          RenderMathMLSpace {mspace} at (196,0) size 1x51
    229       RenderText {#text} at (400,81) size 5x18
    230         text run at (400,81) width 5: " "
    231       RenderMathMLMath {math} at (404,75) size 199x32 [padding: 0 1 0 1]
    232         RenderMathMLRow {mrow} at (1,0) size 197x32
    233           RenderMathMLOperator {mo} at (1,9) size 8x14
     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
    234234            RenderMathMLBlock (flex) {mo} 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,9) size 8x14
     238          RenderMathMLOperator {mo} at (13,0) size 8x33
    239239            RenderMathMLBlock (flex) {mo} at (0,0) size 7x14
    240240              RenderBlock (anonymous) at (0,0) size 5x14
     
    251251                RenderText at (0,-6) size 8x24
    252252                  text run at (0,-6) width 8: "}"
    253           RenderMathMLOperator {mo} at (59,9) size 8x14
     253          RenderMathMLOperator {mo} at (59,0) size 8x33
    254254            RenderMathMLBlock (flex) {mo} 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 (72,9) size 8x14
     258          RenderMathMLOperator {mo} at (72,0) size 8x33
    259259            RenderMathMLBlock (flex) {mo} at (0,0) size 7x14
    260260              RenderBlock (anonymous) at (0,0) size 5x14
    261261                RenderText at (0,-6) size 5x24
    262262                  text run at (0,-6) width 5: "]"
    263           RenderMathMLOperator {mo} at (86,8) size 9x16
     263          RenderMathMLOperator {mo} at (86,0) size 9x33
    264264            RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
    265265              RenderBlock (anonymous) at (0,0) size 8x16
    266266                RenderText at (0,-5) size 8x24
    267267                  text run at (0,-5) width 8: "\x{2308}"
    268           RenderMathMLOperator {mo} at (100,8) size 9x16
     268          RenderMathMLOperator {mo} at (100,0) size 9x33
    269269            RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
    270270              RenderBlock (anonymous) at (0,0) size 8x16
    271271                RenderText at (0,-5) size 8x24
    272272                  text run at (0,-5) width 8: "\x{2309}"
    273           RenderMathMLOperator {mo} at (115,8) size 8x16
     273          RenderMathMLOperator {mo} at (115,0) size 8x33
    274274            RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
    275275              RenderBlock (anonymous) at (0,0) size 8x16
    276276                RenderText at (0,-5) size 8x24
    277277                  text run at (0,-5) width 8: "\x{230A}"
    278           RenderMathMLOperator {mo} at (129,8) size 9x16
     278          RenderMathMLOperator {mo} at (129,0) size 9x33
    279279            RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
    280280              RenderBlock (anonymous) at (0,0) size 8x16
     
    286286                RenderText at (0,-3) size 7x24
    287287                  text run at (0,-3) width 7: "\x{222B}"
    288           RenderMathMLOperator {mo} at (161,0) size 4x32
     288          RenderMathMLOperator {mo} at (161,0) size 4x33
    289289            RenderMathMLBlock (flex) {mo} at (0,0) size 3x12
    290290              RenderBlock (anonymous) at (0,0) size 3x12
     
    302302                  text run at (0,-5) width 8: "\x{2225}"
    303303          RenderMathMLSpace {mspace} at (196,0) size 1x21
    304       RenderText {#text} at (602,81) size 5x18
    305         text run at (602,81) width 5: " "
     304      RenderText {#text} at (602,85) size 5x18
     305        text run at (602,85) width 5: " "
    306306      RenderBR {BR} at (0,0) size 0x0
    307       RenderMathMLMath {math} at (0,162) size 211x78 [padding: 0 1 0 1]
    308         RenderMathMLSquareRoot {msqrt} at (1,0) size 209x78 [intrinsic padding: 3 0 3 12]
    309           RenderMathMLRow (anonymous) at (12,3) size 197x72
    310             RenderMathMLOperator {mo} at (1,0) size 8x72
     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
    311311              RenderMathMLBlock (flex) {mo} 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 8x72
     315            RenderMathMLOperator {mo} at (13,0) size 8x73
    316316              RenderMathMLBlock (flex) {mo} 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 11x72
     320            RenderMathMLOperator {mo} at (26,0) size 11x73
    321321              RenderMathMLBlock (flex) {mo} 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 11x72
     325            RenderMathMLOperator {mo} at (43,0) size 11x73
    326326              RenderMathMLBlock (flex) {mo} 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 8x72
     330            RenderMathMLOperator {mo} at (59,0) size 8x73
    331331              RenderMathMLBlock (flex) {mo} 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 8x72
     335            RenderMathMLOperator {mo} at (72,0) size 8x73
    336336              RenderMathMLBlock (flex) {mo} 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 9x72
     340            RenderMathMLOperator {mo} at (86,0) size 9x73
    341341              RenderMathMLBlock (flex) {mo} 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 9x72
     345            RenderMathMLOperator {mo} at (100,0) size 9x73
    346346              RenderMathMLBlock (flex) {mo} 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 8x72
     350            RenderMathMLOperator {mo} at (115,0) size 8x73
    351351              RenderMathMLBlock (flex) {mo} 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 9x72
     355            RenderMathMLOperator {mo} at (129,0) size 9x73
    356356              RenderMathMLBlock (flex) {mo} 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 12x72
     360            RenderMathMLOperator {mo} at (143,0) size 12x73
    361361              RenderMathMLBlock (flex) {mo} 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 4x72
     365            RenderMathMLOperator {mo} at (161,0) size 4x73
    366366              RenderMathMLBlock (flex) {mo} at (0,0) size 3x12
    367367                RenderBlock (anonymous) at (0,0) size 3x12
  • trunk/Source/WebCore/ChangeLog

    r164699 r164700  
     12014-02-25  Frédéric Wang  <fred.wang@free.fr>
     2
     3        Add support for minsize/maxsize attributes.
     4        https://bugs.webkit.org/show_bug.cgi?id=122567
     5
     6        Reviewed by Chris Fleizach.
     7
     8        This change implements the minsize/maxsize attributes of the mo element.
     9        We also switch stretch sizes from int to LayoutUnit to improve accuracy.
     10
     11        Tests: mathml/presentation/stretchy-minsize-maxsize-dynamic.html
     12               mathml/presentation/stretchy-minsize-maxsize.html
     13
     14        * rendering/mathml/RenderMathMLOperator.cpp:
     15        (WebCore::RenderMathMLOperator::SetOperatorProperties):
     16        (WebCore::RenderMathMLOperator::stretchTo):
     17        * rendering/mathml/RenderMathMLOperator.h:
     18        * rendering/mathml/RenderMathMLRow.cpp:
     19        (WebCore::RenderMathMLRow::layout):
     20
    1212014-02-25  Mihnea Ovidenie  <mihnea@adobe.com>
    222
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp

    r164537 r164700  
    12401240        parseMathMLLength(element().fastGetAttribute(MathMLNames::rspaceAttr), m_trailingSpace, &style(), false); // FIXME: Negative trailing space must be implemented (https://bugs.webkit.org/show_bug.cgi?id=124830).
    12411241
    1242         // FIXME: Attributes minsize/maxsize are not implemented (https://bugs.webkit.org/show_bug.cgi?id=122567).
    12431242        parseMathMLLength(element().fastGetAttribute(MathMLNames::minsizeAttr), m_minSize, &style(), false);
    12441243        const AtomicString& maxsize = element().fastGetAttribute(MathMLNames::maxsizeAttr);
     
    12531252}
    12541253
    1255 void RenderMathMLOperator::stretchTo(int heightAboveBaseline, int depthBelowBaseline)
    1256 {
    1257     if (heightAboveBaseline <= m_stretchHeightAboveBaseline && depthBelowBaseline <= m_stretchDepthBelowBaseline)
     1254void RenderMathMLOperator::stretchTo(LayoutUnit heightAboveBaseline, LayoutUnit depthBelowBaseline)
     1255{
     1256    if (heightAboveBaseline == m_stretchHeightAboveBaseline && depthBelowBaseline == m_stretchDepthBelowBaseline)
    12581257        return;
    12591258
     
    12651264        // We make the operator stretch symmetrically above and below the axis.
    12661265        // FIXME: We should read the axis from the MATH table (https://bugs.webkit.org/show_bug.cgi?id=122297). For now, we use the same value as in RenderMathMLFraction::firstLineBaseline().
    1267         int axis = static_cast<int>(lroundf(style().fontMetrics().xHeight() / 2));
    1268         int halfStretchSize = std::max(m_stretchHeightAboveBaseline - axis, m_stretchDepthBelowBaseline + axis);
     1266        LayoutUnit axis = style().fontMetrics().xHeight() / 2;
     1267        LayoutUnit halfStretchSize = std::max(m_stretchHeightAboveBaseline - axis, m_stretchDepthBelowBaseline + axis);
    12691268        m_stretchHeightAboveBaseline = halfStretchSize + axis;
    12701269        m_stretchDepthBelowBaseline = halfStretchSize - axis;
    12711270    }
     1271    // We try to honor the minsize/maxsize condition by increasing or decreasing both height and depth proportionately.
     1272    // The MathML specification does not indicate what to do when maxsize < minsize, so we follow Gecko and make minsize take precedence.
     1273    LayoutUnit size = stretchSize();
     1274    float aspect = 1.0;
     1275    if (size > 0) {
     1276        if (size < m_minSize)
     1277            aspect = float(m_minSize) / size;
     1278        else if (m_maxSize < size)
     1279            aspect = float(m_maxSize) / size;
     1280    }
     1281    m_stretchHeightAboveBaseline *= aspect;
     1282    m_stretchDepthBelowBaseline *= aspect;
    12721283    updateStyle();
    12731284}
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h

    r164536 r164700  
    4545    Separator = 0x10, // This has no visual effect but allows to expose semantic information via the accessibility tree.
    4646    Stretchy = 0x20,
    47     Symmetric = 0x40, // FIXME: This is not implemented yet (https://bugs.webkit.org/show_bug.cgi?id=124827).
     47    Symmetric = 0x40
    4848};
    4949struct Entry {
     
    6565    MathMLElement& element() { return toMathMLElement(nodeForNonAnonymous()); }
    6666
    67     void stretchTo(int heightAboveBaseline, int depthBelowBaseline);
    68     int stretchSize() const { return m_stretchHeightAboveBaseline + m_stretchDepthBelowBaseline; }
     67    void stretchTo(LayoutUnit heightAboveBaseline, LayoutUnit depthBelowBaseline);
     68    LayoutUnit stretchSize() const { return m_stretchHeightAboveBaseline + m_stretchDepthBelowBaseline; }
    6969   
    7070    bool hasOperatorFlag(MathMLOperatorDictionary::Flag flag) const { return m_operatorFlags & flag; }
     
    111111    void fillWithExtensionGlyph(PaintInfo&, const LayoutPoint& from, const LayoutPoint& to);
    112112
    113     int m_stretchHeightAboveBaseline;
    114     int m_stretchDepthBelowBaseline;
     113    LayoutUnit m_stretchHeightAboveBaseline;
     114    LayoutUnit m_stretchDepthBelowBaseline;
    115115    bool m_isStretched;
    116116
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp

    r164538 r164700  
    6868                continue;
    6969        }
    70         int childHeightAboveBaseline = 0, childDepthBelowBaseline = 0;
     70        LayoutUnit childHeightAboveBaseline = 0, childDepthBelowBaseline = 0;
    7171        if (child->isRenderMathMLBlock()) {
    7272            RenderMathMLBlock* mathmlChild = toRenderMathMLBlock(child);
     
    8383            childDepthBelowBaseline = 0;
    8484        }
    85         stretchHeightAboveBaseline = std::max<int>(stretchHeightAboveBaseline, roundToInt(childHeightAboveBaseline));
    86         stretchDepthBelowBaseline = std::max<int>(stretchDepthBelowBaseline, roundToInt(childDepthBelowBaseline));
     85        stretchHeightAboveBaseline = std::max<LayoutUnit>(stretchHeightAboveBaseline, childHeightAboveBaseline);
     86        stretchDepthBelowBaseline = std::max<LayoutUnit>(stretchDepthBelowBaseline, childDepthBelowBaseline);
    8787    }
    8888    if (stretchHeightAboveBaseline + stretchDepthBelowBaseline <= 0)
Note: See TracChangeset for help on using the changeset viewer.