Changeset 115573 in webkit


Ignore:
Timestamp:
Apr 28, 2012 9:27:15 AM (12 years ago)
Author:
eae@chromium.org
Message:

Move Length and CSS length computation to float
https://bugs.webkit.org/show_bug.cgi?id=84801

Source/WebCore:

Patch by Emil A Eklund <eae@chromium.org> and Levi Weintraub <leviw@chromium.org> on 2012-04-26
Reviewed by Eric Seidel.

Change Length and CSS length computation to floating point. This gets us
closer to the goal of supporting subpixel layout and improves precision
for SVG which already uses floating point for its layout.

This change makes computedStyle return fractional values for pixel values
if a fraction is specified. It also changes the result of computations
where two or more values with fractional precision. Prior to this change
the result of Length(2.9) + Length(2.9) would be 4 as each value would be
floored. With this change the result is 5 as the addition is done with
floating point precision and then the result will be floored. Once we
enable subpixel layout the resulting value in this example would be 5.8.

Updated existing layout tests.

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::zoomAdjustedPixelValue):

  • css/CSSPrimitiveValue.cpp:

(WebCore::CSSPrimitiveValue::computeLength):

  • css/CSSPrimitiveValue.h:

(WebCore):
(WebCore::roundForImpreciseConversion):
Add specialized float version of roundForImpreciseConversion that matches
the int versions rounding logic.

If a value is sufficiently close to the next integer round it up to
ensure that a style rule such as "width: 4.999px" evaluates to 5px
instead of 4px. This is needed as, although Lengths are using floating
point, the layout system still uses integer precision and floors the
Length values.
This will change once we move to FractionalLayoutUnits but for now this
is needed to ensure compatibility with the existing system and tests.

Without this specialized rounding logic we fail a handful of tests
including acid3.

  • platform/Length.h:

(WebCore::Length::value):
(Length):
(WebCore::Length::intValue):

  • rendering/RenderTableCell.cpp:

(WebCore::RenderTableCell::styleOrColLogicalWidth):

LayoutTests:

Reviewed by Eric Seidel.

Change Length and CSS length computation to floating point. This gets us
closer to the goal of supporting subpixel layout and improves precision
for SVG which already uses floating point for its layout.

This change makes computedStyle return fractional values for pixel values
if a fraction is specified. It also changes the result of computations
where two or more values with fractional precision. Prior to this change
the result of Length(2.9) + Length(2.9) would be 4 as each value would be
floored. with this change the result is 5 as the addition is done with
floating point precision and then the result will be floored. Once we
enable subpixel layout the resulting value in this example would be 5.8.

  • fast/dom/length-attribute-mapping-expected.txt:
  • fast/dom/length-attribute-mapping.html:
  • platform/mac-snowleopard/fast/forms/001-expected.png:
  • platform/mac-snowleopard/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.png:
  • platform/mac/fast/forms/001-expected.txt:
  • platform/mac/fast/html/details-position-expected.png:
  • platform/mac/fast/html/details-position-expected.txt:
  • platform/mac/fast/replaced/width100percent-checkbox-expected.png:
  • platform/mac/fast/replaced/width100percent-checkbox-expected.txt:
  • platform/mac/fast/replaced/width100percent-radio-expected.png:
  • platform/mac/fast/replaced/width100percent-radio-expected.txt:
  • platform/mac/mathml/presentation/fractions-expected.png:
  • platform/mac/mathml/presentation/fractions-expected.txt:
  • platform/mac/mathml/presentation/fractions-vertical-alignment-expected.png:
  • platform/mac/mathml/presentation/fractions-vertical-alignment-expected.txt:
  • platform/mac/mathml/presentation/mo-stretch-expected.png:
  • platform/mac/mathml/presentation/mo-stretch-expected.txt:
  • platform/mac/mathml/presentation/subsup-expected.png:
  • platform/mac/mathml/presentation/subsup-expected.txt:
  • platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt:
  • platform/mac/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt:
  • platform/mac/tables/mozilla/bugs/bug1318-expected.png:
  • platform/mac/tables/mozilla/bugs/bug1318-expected.txt:
Location:
trunk
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r115572 r115573  
     12012-04-26  Emil A Eklund  <eae@chromium.org>
     2
     3        Move Length and CSS length computation to float
     4        https://bugs.webkit.org/show_bug.cgi?id=84801
     5
     6        Reviewed by Eric Seidel.
     7
     8        Change Length and CSS length computation to floating point. This gets us
     9        closer to the goal of supporting subpixel layout and improves precision
     10        for SVG which already uses floating point for its layout.
     11
     12        This change makes computedStyle return fractional values for pixel values
     13        if a fraction is specified. It also changes the result of computations
     14        where two or more values with fractional precision. Prior to this change
     15        the result of Length(2.9) + Length(2.9) would be 4 as each value would be
     16        floored. with this change the result is 5 as the addition is done with
     17        floating point precision and then the result will be floored. Once we
     18        enable subpixel layout the resulting value in this example would be 5.8.
     19
     20        * fast/dom/length-attribute-mapping-expected.txt:
     21        * fast/dom/length-attribute-mapping.html:
     22        * platform/mac-snowleopard/fast/forms/001-expected.png:
     23        * platform/mac-snowleopard/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.png:
     24        * platform/mac/fast/forms/001-expected.txt:
     25        * platform/mac/fast/html/details-position-expected.png:
     26        * platform/mac/fast/html/details-position-expected.txt:
     27        * platform/mac/fast/replaced/width100percent-checkbox-expected.png:
     28        * platform/mac/fast/replaced/width100percent-checkbox-expected.txt:
     29        * platform/mac/fast/replaced/width100percent-radio-expected.png:
     30        * platform/mac/fast/replaced/width100percent-radio-expected.txt:
     31        * platform/mac/mathml/presentation/fractions-expected.png:
     32        * platform/mac/mathml/presentation/fractions-expected.txt:
     33        * platform/mac/mathml/presentation/fractions-vertical-alignment-expected.png:
     34        * platform/mac/mathml/presentation/fractions-vertical-alignment-expected.txt:
     35        * platform/mac/mathml/presentation/mo-stretch-expected.png:
     36        * platform/mac/mathml/presentation/mo-stretch-expected.txt:
     37        * platform/mac/mathml/presentation/subsup-expected.png:
     38        * platform/mac/mathml/presentation/subsup-expected.txt:
     39        * platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt:
     40        * platform/mac/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt:
     41        * platform/mac/tables/mozilla/bugs/bug1318-expected.png:
     42        * platform/mac/tables/mozilla/bugs/bug1318-expected.txt:
     43
    1442012-04-28  Zan Dobersek  <zandobersek@gmail.com>
    245
  • trunk/LayoutTests/fast/dom/length-attribute-mapping-expected.txt

    r30635 r115573  
    88PASS: 50* is not mapped
    99PASS: 40*5 is not mapped
    10 PASS: 30.5 is mapped to 30px
     10PASS: 30.5 is mapped to 30.5px
    1111
    1212<col>:
     
    1717PASS: 50* is not mapped
    1818PASS: 40*5 is not mapped
    19 PASS: 30.5 is mapped to 30px
     19PASS: 30.5 is mapped to 30.5px
    2020
  • trunk/LayoutTests/fast/dom/length-attribute-mapping.html

    r27617 r115573  
    3434    test(img, "50*");
    3535    test(img, "40*5");
    36     test(img, "30.5", "30px");
     36    test(img, "30.5", "30.5px");
    3737    log("");
    3838
     
    4545    test(col, "50*");
    4646    test(col, "40*5");
    47     test(col, "30.5", "30px");
     47    test(col, "30.5", "30.5px");
    4848</script>
  • trunk/LayoutTests/platform/mac/fast/forms/001-expected.txt

    r80755 r115573  
    2020          RenderTableSection {TBODY} at (2,2) size 780x20
    2121            RenderTableRow {TR} at (0,0) size 780x20
    22               RenderTableCell {TD} at (0,0) size 18x20 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
     22              RenderTableCell {TD} at (0,0) size 20x20 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
    2323                RenderBlock {INPUT} at (3,4) size 12x12
    24               RenderTableCell {TD} at (18,9) size 762x2 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
     24              RenderTableCell {TD} at (20,9) size 760x2 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
    2525      RenderBlock {P} at (0,200) size 784x24
    2626        RenderTable {TABLE} at (0,0) size 784x24 [border: (2px outset #808080)]
    2727          RenderTableSection {TBODY} at (2,2) size 780x20
    2828            RenderTableRow {TR} at (0,0) size 780x20
    29               RenderTableCell {TD} at (0,0) size 18x20 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
     29              RenderTableCell {TD} at (0,0) size 20x20 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
    3030                RenderBlock {INPUT} at (3,4) size 12x12
    31               RenderTableCell {TD} at (18,9) size 762x2 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
     31              RenderTableCell {TD} at (20,9) size 760x2 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
    3232      RenderBlock {P} at (0,240) size 784x28
    3333        RenderTable {TABLE} at (0,0) size 784x28 [border: (2px outset #808080)]
  • trunk/LayoutTests/platform/mac/fast/html/details-position-expected.txt

    r109192 r115573  
    77      RenderBlock {DETAILS} at (0,0) size 784x18
    88      RenderBlock {DETAILS} at (0,18) size 784x0
    9 layer at (50,150) size 48x18
    10   RenderBlock (positioned) {SUMMARY} at (50,150) size 48x18
     9layer at (50,150) size 49x18
     10  RenderBlock (positioned) {SUMMARY} at (50,150) size 49x18
    1111    RenderDetailsMarker {DIV} at (0,4) size 10x10: right
    1212    RenderText {#text} at (16,0) size 32x18
     
    1717    RenderText {#text} at (16,0) size 46x18
    1818      text run at (16,0) width 46: "relative"
    19 layer at (250,150) size 68x18
    20   RenderBlock (positioned) {SUMMARY} at (250,150) size 68x18
     19layer at (250,150) size 69x18
     20  RenderBlock (positioned) {SUMMARY} at (250,150) size 69x18
    2121    RenderDetailsMarker {DIV} at (0,4) size 10x10: right
    2222    RenderText {#text} at (16,0) size 52x18
  • trunk/LayoutTests/platform/mac/fast/replaced/width100percent-checkbox-expected.txt

    r80755 r115573  
    1010        RenderTableSection {TBODY} at (0,0) size 784x22
    1111          RenderTableRow {TR} at (0,1) size 784x20
    12             RenderTableCell {TD} at (1,1) size 6x20 [r=0 c=0 rs=1 cs=1]
    13               RenderBlock {INPUT} at (3,4) size 4x12
    14             RenderTableCell {TD} at (8,1) size 6x20 [r=0 c=1 rs=1 cs=1]
    15               RenderBlock {INPUT} at (3,4) size 4x12
    16             RenderTableCell {TD} at (15,1) size 6x20 [r=0 c=2 rs=1 cs=1]
    17               RenderBlock {INPUT} at (3,4) size 4x12
    18             RenderTableCell {TD} at (22,1) size 761x20 [r=0 c=3 rs=1 cs=1]
     12            RenderTableCell {TD} at (1,1) size 8x20 [r=0 c=0 rs=1 cs=1]
     13              RenderBlock {INPUT} at (3,4) size 6x12
     14            RenderTableCell {TD} at (10,1) size 8x20 [r=0 c=1 rs=1 cs=1]
     15              RenderBlock {INPUT} at (3,4) size 6x12
     16            RenderTableCell {TD} at (19,1) size 8x20 [r=0 c=2 rs=1 cs=1]
     17              RenderBlock {INPUT} at (3,4) size 6x12
     18            RenderTableCell {TD} at (28,1) size 755x20 [r=0 c=3 rs=1 cs=1]
    1919              RenderText {#text} at (1,1) size 4x18
    2020                text run at (1,1) width 4: " "
  • trunk/LayoutTests/platform/mac/fast/replaced/width100percent-radio-expected.txt

    r80755 r115573  
    1010        RenderTableSection {TBODY} at (0,0) size 784x23
    1111          RenderTableRow {TR} at (0,1) size 784x21
    12             RenderTableCell {TD} at (1,1) size 6x21 [r=0 c=0 rs=1 cs=1]
    13               RenderBlock {INPUT} at (3,4) size 4x13
    14             RenderTableCell {TD} at (8,1) size 6x21 [r=0 c=1 rs=1 cs=1]
    15               RenderBlock {INPUT} at (3,4) size 4x13
    16             RenderTableCell {TD} at (15,1) size 6x21 [r=0 c=2 rs=1 cs=1]
    17               RenderBlock {INPUT} at (3,4) size 4x13
    18             RenderTableCell {TD} at (22,1) size 761x20 [r=0 c=3 rs=1 cs=1]
     12            RenderTableCell {TD} at (1,1) size 8x21 [r=0 c=0 rs=1 cs=1]
     13              RenderBlock {INPUT} at (3,4) size 6x13
     14            RenderTableCell {TD} at (10,1) size 8x21 [r=0 c=1 rs=1 cs=1]
     15              RenderBlock {INPUT} at (3,4) size 6x13
     16            RenderTableCell {TD} at (19,1) size 8x21 [r=0 c=2 rs=1 cs=1]
     17              RenderBlock {INPUT} at (3,4) size 6x13
     18            RenderTableCell {TD} at (28,1) size 755x20 [r=0 c=3 rs=1 cs=1]
    1919              RenderText {#text} at (1,1) size 4x18
    2020                text run at (1,1) width 4: " "
  • trunk/LayoutTests/platform/mac/mathml/presentation/fractions-expected.txt

    r95566 r115573  
    9696        RenderText {#text} at (0,7) size 138x18
    9797          text run at (0,7) width 138: "numerator alignment: "
    98         RenderMathMLMath {math} at (138,0) size 89x34
    99           RenderMathMLFraction {mfrac} at (1,0) size 87x34
    100             RenderMathMLBlock {mfrac} at (0,0) size 87x16
     98        RenderMathMLMath {math} at (138,0) size 90x34
     99          RenderMathMLFraction {mfrac} at (1,0) size 88x34
     100            RenderMathMLBlock {mfrac} at (0,0) size 88x16
    101101              RenderInline {mi} at (0,0) size 7x16
    102102                RenderText {#text} at (3,0) size 7x16
    103103                  text run at (3,0) width 7: "x"
    104             RenderMathMLBlock {mfrac} at (0,16) size 87x18
    105               RenderMathMLRow {mrow} at (4,2) size 80x16
    106                 RenderInline {mn} at (0,0) size 8x16
    107                   RenderText {#text} at (0,0) size 8x16
    108                     text run at (0,0) width 8: "1"
    109                 RenderMathMLOperator {mo} at (8,0) size 10x16
    110                   RenderMathMLBlock {mo} at (0,0) size 9x16
    111                     RenderText {mo} at (0,0) size 9x16
    112                       text run at (0,0) width 9: "+"
    113                 RenderInline {mn} at (0,0) size 8x16
    114                   RenderText {#text} at (18,0) size 8x16
    115                     text run at (18,0) width 8: "2"
    116                 RenderMathMLOperator {mo} at (26,0) size 10x16
    117                   RenderMathMLBlock {mo} at (0,0) size 9x16
    118                     RenderText {mo} at (0,0) size 9x16
    119                       text run at (0,0) width 9: "+"
    120                 RenderInline {mn} at (0,0) size 8x16
    121                   RenderText {#text} at (36,0) size 8x16
    122                     text run at (36,0) width 8: "3"
    123                 RenderMathMLOperator {mo} at (44,0) size 10x16
    124                   RenderMathMLBlock {mo} at (0,0) size 9x16
    125                     RenderText {mo} at (0,0) size 9x16
    126                       text run at (0,0) width 9: "+"
    127                 RenderInline {mn} at (0,0) size 8x16
    128                   RenderText {#text} at (54,0) size 8x16
    129                     text run at (54,0) width 8: "4"
    130                 RenderMathMLOperator {mo} at (62,0) size 10x16
    131                   RenderMathMLBlock {mo} at (0,0) size 9x16
    132                     RenderText {mo} at (0,0) size 9x16
    133                       text run at (0,0) width 9: "+"
    134                 RenderInline {mn} at (0,0) size 8x16
    135                   RenderText {#text} at (72,0) size 8x16
    136                     text run at (72,0) width 8: "5"
    137         RenderText {#text} at (227,7) size 4x18
    138           text run at (227,7) width 4: " "
    139         RenderMathMLMath {math} at (231,0) size 89x34
    140           RenderMathMLFraction {mfrac} at (1,0) size 87x34
    141             RenderMathMLBlock {mfrac} at (0,0) size 87x16
     104            RenderMathMLBlock {mfrac} at (0,16) size 88x18
     105              RenderMathMLRow {mrow} at (5,2) size 80x16
     106                RenderInline {mn} at (0,0) size 8x16
     107                  RenderText {#text} at (0,0) size 8x16
     108                    text run at (0,0) width 8: "1"
     109                RenderMathMLOperator {mo} at (8,0) size 10x16
     110                  RenderMathMLBlock {mo} at (0,0) size 9x16
     111                    RenderText {mo} at (0,0) size 9x16
     112                      text run at (0,0) width 9: "+"
     113                RenderInline {mn} at (0,0) size 8x16
     114                  RenderText {#text} at (18,0) size 8x16
     115                    text run at (18,0) width 8: "2"
     116                RenderMathMLOperator {mo} at (26,0) size 10x16
     117                  RenderMathMLBlock {mo} at (0,0) size 9x16
     118                    RenderText {mo} at (0,0) size 9x16
     119                      text run at (0,0) width 9: "+"
     120                RenderInline {mn} at (0,0) size 8x16
     121                  RenderText {#text} at (36,0) size 8x16
     122                    text run at (36,0) width 8: "3"
     123                RenderMathMLOperator {mo} at (44,0) size 10x16
     124                  RenderMathMLBlock {mo} at (0,0) size 9x16
     125                    RenderText {mo} at (0,0) size 9x16
     126                      text run at (0,0) width 9: "+"
     127                RenderInline {mn} at (0,0) size 8x16
     128                  RenderText {#text} at (54,0) size 8x16
     129                    text run at (54,0) width 8: "4"
     130                RenderMathMLOperator {mo} at (62,0) size 10x16
     131                  RenderMathMLBlock {mo} at (0,0) size 9x16
     132                    RenderText {mo} at (0,0) size 9x16
     133                      text run at (0,0) width 9: "+"
     134                RenderInline {mn} at (0,0) size 8x16
     135                  RenderText {#text} at (72,0) size 8x16
     136                    text run at (72,0) width 8: "5"
     137        RenderText {#text} at (228,7) size 4x18
     138          text run at (228,7) width 4: " "
     139        RenderMathMLMath {math} at (232,0) size 90x34
     140          RenderMathMLFraction {mfrac} at (1,0) size 88x34
     141            RenderMathMLBlock {mfrac} at (0,0) size 88x16
     142              RenderInline {mi} at (0,0) size 8x16
     143                RenderText {#text} at (40,0) size 8x16
     144                  text run at (40,0) width 8: "x"
     145            RenderMathMLBlock {mfrac} at (0,16) size 88x18
     146              RenderMathMLRow {mrow} at (5,2) size 80x16
     147                RenderInline {mn} at (0,0) size 8x16
     148                  RenderText {#text} at (0,0) size 8x16
     149                    text run at (0,0) width 8: "1"
     150                RenderMathMLOperator {mo} at (8,0) size 10x16
     151                  RenderMathMLBlock {mo} at (0,0) size 9x16
     152                    RenderText {mo} at (0,0) size 9x16
     153                      text run at (0,0) width 9: "+"
     154                RenderInline {mn} at (0,0) size 8x16
     155                  RenderText {#text} at (18,0) size 8x16
     156                    text run at (18,0) width 8: "2"
     157                RenderMathMLOperator {mo} at (26,0) size 10x16
     158                  RenderMathMLBlock {mo} at (0,0) size 9x16
     159                    RenderText {mo} at (0,0) size 9x16
     160                      text run at (0,0) width 9: "+"
     161                RenderInline {mn} at (0,0) size 8x16
     162                  RenderText {#text} at (36,0) size 8x16
     163                    text run at (36,0) width 8: "3"
     164                RenderMathMLOperator {mo} at (44,0) size 10x16
     165                  RenderMathMLBlock {mo} at (0,0) size 9x16
     166                    RenderText {mo} at (0,0) size 9x16
     167                      text run at (0,0) width 9: "+"
     168                RenderInline {mn} at (0,0) size 8x16
     169                  RenderText {#text} at (54,0) size 8x16
     170                    text run at (54,0) width 8: "4"
     171                RenderMathMLOperator {mo} at (62,0) size 10x16
     172                  RenderMathMLBlock {mo} at (0,0) size 9x16
     173                    RenderText {mo} at (0,0) size 9x16
     174                      text run at (0,0) width 9: "+"
     175                RenderInline {mn} at (0,0) size 8x16
     176                  RenderText {#text} at (72,0) size 8x16
     177                    text run at (72,0) width 8: "5"
     178        RenderText {#text} at (322,7) size 4x18
     179          text run at (322,7) width 4: " "
     180        RenderMathMLMath {math} at (326,0) size 90x34
     181          RenderMathMLFraction {mfrac} at (1,0) size 88x34
     182            RenderMathMLBlock {mfrac} at (0,0) size 88x16
    142183              RenderInline {mi} at (0,0) size 7x16
    143                 RenderText {#text} at (40,0) size 7x16
    144                   text run at (40,0) width 7: "x"
    145             RenderMathMLBlock {mfrac} at (0,16) size 87x18
    146               RenderMathMLRow {mrow} at (4,2) size 80x16
    147                 RenderInline {mn} at (0,0) size 8x16
    148                   RenderText {#text} at (0,0) size 8x16
    149                     text run at (0,0) width 8: "1"
    150                 RenderMathMLOperator {mo} at (8,0) size 10x16
    151                   RenderMathMLBlock {mo} at (0,0) size 9x16
    152                     RenderText {mo} at (0,0) size 9x16
    153                       text run at (0,0) width 9: "+"
    154                 RenderInline {mn} at (0,0) size 8x16
    155                   RenderText {#text} at (18,0) size 8x16
    156                     text run at (18,0) width 8: "2"
    157                 RenderMathMLOperator {mo} at (26,0) size 10x16
    158                   RenderMathMLBlock {mo} at (0,0) size 9x16
    159                     RenderText {mo} at (0,0) size 9x16
    160                       text run at (0,0) width 9: "+"
    161                 RenderInline {mn} at (0,0) size 8x16
    162                   RenderText {#text} at (36,0) size 8x16
    163                     text run at (36,0) width 8: "3"
    164                 RenderMathMLOperator {mo} at (44,0) size 10x16
    165                   RenderMathMLBlock {mo} at (0,0) size 9x16
    166                     RenderText {mo} at (0,0) size 9x16
    167                       text run at (0,0) width 9: "+"
    168                 RenderInline {mn} at (0,0) size 8x16
    169                   RenderText {#text} at (54,0) size 8x16
    170                     text run at (54,0) width 8: "4"
    171                 RenderMathMLOperator {mo} at (62,0) size 10x16
    172                   RenderMathMLBlock {mo} at (0,0) size 9x16
    173                     RenderText {mo} at (0,0) size 9x16
    174                       text run at (0,0) width 9: "+"
    175                 RenderInline {mn} at (0,0) size 8x16
    176                   RenderText {#text} at (72,0) size 8x16
    177                     text run at (72,0) width 8: "5"
    178         RenderText {#text} at (320,7) size 4x18
    179           text run at (320,7) width 4: " "
    180         RenderMathMLMath {math} at (324,0) size 89x34
    181           RenderMathMLFraction {mfrac} at (1,0) size 87x34
    182             RenderMathMLBlock {mfrac} at (0,0) size 87x16
    183               RenderInline {mi} at (0,0) size 7x16
    184                 RenderText {#text} at (77,0) size 7x16
    185                   text run at (77,0) width 7: "x"
    186             RenderMathMLBlock {mfrac} at (0,16) size 87x18
    187               RenderMathMLRow {mrow} at (4,2) size 80x16
     184                RenderText {#text} at (78,0) size 7x16
     185                  text run at (78,0) width 7: "x"
     186            RenderMathMLBlock {mfrac} at (0,16) size 88x18
     187              RenderMathMLRow {mrow} at (5,2) size 80x16
    188188                RenderInline {mn} at (0,0) size 8x16
    189189                  RenderText {#text} at (0,0) size 8x16
  • trunk/LayoutTests/platform/mac/mathml/presentation/fractions-vertical-alignment-expected.txt

    r95566 r115573  
    8484        RenderText {math:mo} at (0,0) size 9x16
    8585          text run at (0,0) width 9: "+"
    86     RenderMathMLFraction {math:mfrac} at (164,36) size 73x70
    87       RenderMathMLBlock {math:mfrac} at (0,0) size 73x16
     86    RenderMathMLFraction {math:mfrac} at (164,36) size 75x70
     87      RenderMathMLBlock {math:mfrac} at (0,0) size 75x16
    8888        RenderInline {math:mi} at (0,0) size 11x16
    89           RenderText {#text} at (31,0) size 11x16
    90             text run at (31,0) width 11: "B"
    91       RenderMathMLBlock {math:mfrac} at (0,16) size 73x54
    92         RenderMathMLRow {math:mrow} at (4,2) size 66x52
     89          RenderText {#text} at (32,0) size 11x16
     90            text run at (32,0) width 11: "B"
     91      RenderMathMLBlock {math:mfrac} at (0,16) size 75x54
     92        RenderMathMLRow {math:mrow} at (5,2) size 67x52
    9393          RenderInline {math:mi} at (0,0) size 11x16
    9494            RenderText {#text} at (0,10) size 11x16
     
    9898              RenderText {math:mo} at (0,0) size 9x16
    9999                text run at (0,0) width 9: "+"
    100           RenderMathMLFraction {math:mfrac} at (21,0) size 45x52
    101             RenderMathMLBlock {math:mfrac} at (0,0) size 45x16
    102               RenderInline {math:mi} at (0,0) size 13x16
    103                 RenderText {#text} at (16,0) size 13x16
    104                   text run at (16,0) width 13: "D"
    105             RenderMathMLBlock {math:mfrac} at (0,16) size 45x36
    106               RenderMathMLRow {math:mrow} at (4,2) size 38x34
     100          RenderMathMLFraction {math:mfrac} at (21,0) size 46x52
     101            RenderMathMLBlock {math:mfrac} at (0,0) size 46x16
     102              RenderInline {math:mi} at (0,0) size 12x16
     103                RenderText {#text} at (17,0) size 12x16
     104                  text run at (17,0) width 12: "D"
     105            RenderMathMLBlock {math:mfrac} at (0,16) size 46x36
     106              RenderMathMLRow {math:mrow} at (5,2) size 38x34
    107107                RenderInline {math:mi} at (0,0) size 10x16
    108108                  RenderText {#text} at (0,10) size 10x16
  • trunk/LayoutTests/platform/mac/mathml/presentation/mo-stretch-expected.txt

    r114975 r115573  
    55    RenderBody {BODY} at (8,8) size 784x182
    66      RenderMathMLMath {math} at (0,0) size 784x85
    7         RenderMathMLRow {mrow} at (310,0) size 165x85
    8           RenderMathMLRow {mrow} at (0,0) size 117x85
    9             RenderMathMLRow {mrow} at (0,0) size 54x85
    10               RenderInline {mi} at (0,0) size 4x16
    11                 RenderText {#text} at (0,38) size 4x16
    12                   text run at (0,38) width 4: "f"
    13               RenderMathMLRow {mrow} at (5,0) size 49x85
     7        RenderMathMLRow {mrow} at (308,0) size 168x85
     8          RenderMathMLRow {mrow} at (0,0) size 120x85
     9            RenderMathMLRow {mrow} at (0,0) size 55x85
     10              RenderInline {mi} at (0,0) size 5x16
     11                RenderText {#text} at (0,38) size 5x16
     12                  text run at (0,38) width 5: "f"
     13              RenderMathMLRow {mrow} at (6,0) size 49x85
    1414                RenderMathMLOperator {mo} at (0,0) size 6x85
    1515                RenderMathMLFraction {mfrac} at (6,10) size 37x70
     
    5151                          text run at (24,10) width 7: "e"
    5252                RenderMathMLOperator {mo} at (43,0) size 6x85
    53             RenderMathMLOperator {mo} at (54,38) size 10x16
     53            RenderMathMLOperator {mo} at (55,38) size 10x16
    5454              RenderMathMLBlock {mo} at (0,0) size 9x16
    5555                RenderText {mo} at (0,0) size 9x16
    5656                  text run at (0,0) width 9: "+"
    57             RenderMathMLRow {mrow} at (64,13) size 53x63
    58               RenderInline {mi} at (0,0) size 8x16
    59                 RenderText {#text} at (0,25) size 8x16
    60                   text run at (0,25) width 8: "g"
    61               RenderMathMLRow {mrow} at (9,0) size 44x63
     57            RenderMathMLRow {mrow} at (65,13) size 55x63
     58              RenderInline {mi} at (0,0) size 9x16
     59                RenderText {#text} at (0,25) size 9x16
     60                  text run at (0,25) width 9: "g"
     61              RenderMathMLRow {mrow} at (10,0) size 45x63
    6262                RenderMathMLOperator {mo} at (0,0) size 6x63
    63                 RenderMathMLSubSup {msubsup} at (6,7) size 32x52
     63                RenderMathMLSubSup {msubsup} at (6,7) size 33x52
    6464                  RenderMathMLBlock {msubsup} at (0,0) size 7x34
    6565                    RenderInline {mi} at (0,0) size 7x16
    6666                      RenderText {#text} at (0,18) size 7x16
    6767                        text run at (0,18) width 7: "x"
    68                   RenderMathMLBlock {msubsup} at (8,0) size 24x52
    69                     RenderMathMLBlock {msubsup} at (0,0) size 24x26
     68                  RenderMathMLBlock {msubsup} at (8,0) size 25x52
     69                    RenderMathMLBlock {msubsup} at (0,0) size 25x26
    7070                      RenderMathMLRow {mrow} at (0,0) size 23x26
    7171                        RenderMathMLFraction {mfrac} at (0,0) size 10x26
     
    8585                          RenderText {#text} at (18,8) size 5x12
    8686                            text run at (18,8) width 5: "c"
    87                     RenderMathMLBlock {msubsup} at (0,26) size 24x26
     87                    RenderMathMLBlock {msubsup} at (0,26) size 25x26
    8888                      RenderMathMLRow {mrow} at (1,0) size 23x26
    8989                        RenderMathMLFraction {mfrac} at (0,0) size 10x26
     
    103103                          RenderText {#text} at (18,8) size 5x12
    104104                            text run at (18,8) width 5: "e"
    105                 RenderMathMLOperator {mo} at (38,0) size 6x63
    106           RenderMathMLOperator {mo} at (117,38) size 10x16
     105                RenderMathMLOperator {mo} at (39,0) size 6x63
     106          RenderMathMLOperator {mo} at (120,38) size 10x16
    107107            RenderMathMLBlock {mo} at (0,0) size 9x16
    108108              RenderText {mo} at (0,0) size 9x16
    109109                text run at (0,0) width 9: "+"
    110           RenderMathMLRow {mrow} at (127,19) size 38x53
     110          RenderMathMLRow {mrow} at (130,19) size 38x53
    111111            RenderMathMLSubSup {msubsup} at (0,0) size 17x53
    112112              RenderMathMLBlock {msubsup} at (0,0) size 10x53
     
    172172                    text run at (3,2) width 8: "y"
    173173            RenderMathMLOperator {mo} at (23,0) size 5x41
    174 layer at (323,8) size 5x10 scrollHeight 14
    175   RenderMathMLBlock {mo} at (0,0) size 5x10
    176 layer at (323,18) size 5x10 scrollHeight 13
    177   RenderMathMLBlock {mo} at (0,10) size 5x10
    178     RenderText {mo} at (0,-1) size 5x14
    179       text run at (0,-1) width 5: "\x{239C}"
    180 layer at (323,28) size 5x10 scrollHeight 13
    181   RenderMathMLBlock {mo} at (0,20) size 5x10
    182     RenderText {mo} at (0,-1) size 5x14
    183       text run at (0,-1) width 5: "\x{239C}"
    184 layer at (323,38) size 5x10 scrollHeight 13
     174layer at (322,8) size 5x10 scrollHeight 14
     175  RenderMathMLBlock {mo} at (0,0) size 5x10
     176layer at (322,18) size 5x10 scrollHeight 13
     177  RenderMathMLBlock {mo} at (0,10) size 5x10
     178    RenderText {mo} at (0,-1) size 5x14
     179      text run at (0,-1) width 5: "\x{239C}"
     180layer at (322,28) size 5x10 scrollHeight 13
     181  RenderMathMLBlock {mo} at (0,20) size 5x10
     182    RenderText {mo} at (0,-1) size 5x14
     183      text run at (0,-1) width 5: "\x{239C}"
     184layer at (322,38) size 5x10 scrollHeight 13
    185185  RenderMathMLBlock {mo} at (0,30) size 5x10
    186186    RenderText {mo} at (0,-1) size 5x14
    187187      text run at (0,-1) width 5: "\x{239C}"
    188 layer at (323,48) size 5x10 scrollHeight 13
     188layer at (322,48) size 5x10 scrollHeight 13
    189189  RenderMathMLBlock {mo} at (0,40) size 5x10
    190190    RenderText {mo} at (0,-1) size 5x14
    191191      text run at (0,-1) width 5: "\x{239C}"
    192 layer at (323,58) size 5x10 scrollHeight 13
     192layer at (322,58) size 5x10 scrollHeight 13
    193193  RenderMathMLBlock {mo} at (0,50) size 5x10
    194194    RenderText {mo} at (0,-1) size 5x14
    195195      text run at (0,-1) width 5: "\x{239C}"
    196 layer at (323,68) size 5x10 scrollHeight 13
     196layer at (322,68) size 5x10 scrollHeight 13
    197197  RenderMathMLBlock {mo} at (0,60) size 5x10
    198198    RenderText {mo} at (0,-1) size 5x14
    199199      text run at (0,-1) width 5: "\x{239C}"
    200 layer at (323,78) size 5x4 scrollHeight 13
     200layer at (322,78) size 5x4 scrollHeight 13
    201201  RenderMathMLBlock {mo} at (0,70) size 5x4
    202202    RenderText {mo} at (0,-1) size 5x14
    203203      text run at (0,-1) width 5: "\x{239C}"
    204 layer at (323,82) size 5x11 scrollHeight 13
     204layer at (322,82) size 5x11 scrollHeight 13
    205205  RenderMathMLBlock {mo} at (0,74) size 5x11
    206 layer at (366,8) size 5x10 scrollHeight 14
    207   RenderMathMLBlock {mo} at (0,0) size 5x10
    208 layer at (366,18) size 5x10 scrollHeight 13
    209   RenderMathMLBlock {mo} at (0,10) size 5x10
    210     RenderText {mo} at (0,-1) size 5x14
    211       text run at (0,-1) width 5: "\x{239F}"
    212 layer at (366,28) size 5x10 scrollHeight 13
    213   RenderMathMLBlock {mo} at (0,20) size 5x10
    214     RenderText {mo} at (0,-1) size 5x14
    215       text run at (0,-1) width 5: "\x{239F}"
    216 layer at (366,38) size 5x10 scrollHeight 13
     206layer at (365,8) size 5x10 scrollHeight 14
     207  RenderMathMLBlock {mo} at (0,0) size 5x10
     208layer at (365,18) size 5x10 scrollHeight 13
     209  RenderMathMLBlock {mo} at (0,10) size 5x10
     210    RenderText {mo} at (0,-1) size 5x14
     211      text run at (0,-1) width 5: "\x{239F}"
     212layer at (365,28) size 5x10 scrollHeight 13
     213  RenderMathMLBlock {mo} at (0,20) size 5x10
     214    RenderText {mo} at (0,-1) size 5x14
     215      text run at (0,-1) width 5: "\x{239F}"
     216layer at (365,38) size 5x10 scrollHeight 13
    217217  RenderMathMLBlock {mo} at (0,30) size 5x10
    218218    RenderText {mo} at (0,-1) size 5x14
    219219      text run at (0,-1) width 5: "\x{239F}"
    220 layer at (366,48) size 5x10 scrollHeight 13
     220layer at (365,48) size 5x10 scrollHeight 13
    221221  RenderMathMLBlock {mo} at (0,40) size 5x10
    222222    RenderText {mo} at (0,-1) size 5x14
    223223      text run at (0,-1) width 5: "\x{239F}"
    224 layer at (366,58) size 5x10 scrollHeight 13
     224layer at (365,58) size 5x10 scrollHeight 13
    225225  RenderMathMLBlock {mo} at (0,50) size 5x10
    226226    RenderText {mo} at (0,-1) size 5x14
    227227      text run at (0,-1) width 5: "\x{239F}"
    228 layer at (366,68) size 5x10 scrollHeight 13
     228layer at (365,68) size 5x10 scrollHeight 13
    229229  RenderMathMLBlock {mo} at (0,60) size 5x10
    230230    RenderText {mo} at (0,-1) size 5x14
    231231      text run at (0,-1) width 5: "\x{239F}"
    232 layer at (366,78) size 5x4 scrollHeight 13
     232layer at (365,78) size 5x4 scrollHeight 13
    233233  RenderMathMLBlock {mo} at (0,70) size 5x4
    234234    RenderText {mo} at (0,-1) size 5x14
    235235      text run at (0,-1) width 5: "\x{239F}"
    236 layer at (366,82) size 5x11 scrollHeight 13
     236layer at (365,82) size 5x11 scrollHeight 13
    237237  RenderMathMLBlock {mo} at (0,74) size 5x11
    238238layer at (391,21) size 5x10 scrollHeight 14
     
    260260layer at (391,73) size 5x11 scrollHeight 13
    261261  RenderMathMLBlock {mo} at (0,52) size 5x11
    262 layer at (429,21) size 5x10 scrollHeight 14
    263   RenderMathMLBlock {mo} at (0,0) size 5x10
    264 layer at (429,31) size 5x10 scrollHeight 13
    265   RenderMathMLBlock {mo} at (0,10) size 5x10
    266     RenderText {mo} at (0,-1) size 5x14
    267       text run at (0,-1) width 5: "\x{23A5}"
    268 layer at (429,41) size 5x10 scrollHeight 13
    269   RenderMathMLBlock {mo} at (0,20) size 5x10
    270     RenderText {mo} at (0,-1) size 5x14
    271       text run at (0,-1) width 5: "\x{23A5}"
    272 layer at (429,51) size 5x10 scrollHeight 13
     262layer at (430,21) size 5x10 scrollHeight 14
     263  RenderMathMLBlock {mo} at (0,0) size 5x10
     264layer at (430,31) size 5x10 scrollHeight 13
     265  RenderMathMLBlock {mo} at (0,10) size 5x10
     266    RenderText {mo} at (0,-1) size 5x14
     267      text run at (0,-1) width 5: "\x{23A5}"
     268layer at (430,41) size 5x10 scrollHeight 13
     269  RenderMathMLBlock {mo} at (0,20) size 5x10
     270    RenderText {mo} at (0,-1) size 5x14
     271      text run at (0,-1) width 5: "\x{23A5}"
     272layer at (430,51) size 5x10 scrollHeight 13
    273273  RenderMathMLBlock {mo} at (0,30) size 5x10
    274274    RenderText {mo} at (0,-1) size 5x14
    275275      text run at (0,-1) width 5: "\x{23A5}"
    276 layer at (429,61) size 5x10 scrollHeight 13
     276layer at (430,61) size 5x10 scrollHeight 13
    277277  RenderMathMLBlock {mo} at (0,40) size 5x10
    278278    RenderText {mo} at (0,-1) size 5x14
    279279      text run at (0,-1) width 5: "\x{23A5}"
    280 layer at (429,71) size 5x2 scrollHeight 13
     280layer at (430,71) size 5x2 scrollHeight 13
    281281  RenderMathMLBlock {mo} at (0,50) size 5x2
    282282    RenderText {mo} at (0,-1) size 5x14
    283283      text run at (0,-1) width 5: "\x{23A5}"
    284 layer at (429,73) size 5x11 scrollHeight 13
     284layer at (430,73) size 5x11 scrollHeight 13
    285285  RenderMathMLBlock {mo} at (0,52) size 5x11
    286 layer at (445,27) size 10x10 scrollHeight 14
     286layer at (446,27) size 10x10 scrollHeight 14
    287287  RenderMathMLBlock {mo} at (0,0) size 10x10
    288 layer at (445,37) size 10x10 scrollHeight 13
     288layer at (446,37) size 10x10 scrollHeight 13
    289289  RenderMathMLBlock {mo} at (0,10) size 10x10
    290290    RenderText {mo} at (0,-1) size 10x14
    291291      text run at (0,-1) width 10: "\x{23AE}"
    292 layer at (445,47) size 10x10 scrollHeight 13
     292layer at (446,47) size 10x10 scrollHeight 13
    293293  RenderMathMLBlock {mo} at (0,20) size 10x10
    294294    RenderText {mo} at (0,-1) size 10x14
    295295      text run at (0,-1) width 10: "\x{23AE}"
    296 layer at (445,57) size 10x10 scrollHeight 13
     296layer at (446,57) size 10x10 scrollHeight 13
    297297  RenderMathMLBlock {mo} at (0,30) size 10x10
    298298    RenderText {mo} at (0,-1) size 10x14
    299299      text run at (0,-1) width 10: "\x{23AE}"
    300 layer at (445,67) size 10x2 scrollHeight 13
     300layer at (446,67) size 10x2 scrollHeight 13
    301301  RenderMathMLBlock {mo} at (0,40) size 10x2
    302302    RenderText {mo} at (0,-1) size 10x14
    303303      text run at (0,-1) width 10: "\x{23AE}"
    304 layer at (445,69) size 10x11 scrollHeight 13
     304layer at (446,69) size 10x11 scrollHeight 13
    305305  RenderMathMLBlock {mo} at (0,42) size 10x11
    306306layer at (396,146) size 5x10 scrollHeight 14
     
    328328layer at (415,176) size 5x11 scrollHeight 13
    329329  RenderMathMLBlock {mo} at (0,30) size 5x11
    330 layer at (323,9) size 5x11 backgroundClip at (323,8) size 5x10 clip at (323,8) size 5x10 outlineClip at (323,8) size 5x10
     330layer at (322,9) size 5x11 backgroundClip at (322,8) size 5x10 clip at (322,8) size 5x10 outlineClip at (322,8) size 5x10
    331331  RenderBlock (relative positioned) {mo} at (0,0) size 5x11
    332332    RenderText {mo} at (0,-1) size 5x14
    333333      text run at (0,-1) width 5: "\x{239B}"
    334 layer at (323,79) size 5x11 backgroundClip at (323,82) size 5x11 clip at (323,82) size 5x11 outlineClip at (323,82) size 5x11
     334layer at (322,79) size 5x11 backgroundClip at (322,82) size 5x11 clip at (322,82) size 5x11 outlineClip at (322,82) size 5x11
    335335  RenderBlock (relative positioned) {mo} at (0,0) size 5x11
    336336    RenderText {mo} at (0,-1) size 5x14
    337337      text run at (0,-1) width 5: "\x{239D}"
    338 layer at (366,9) size 5x11 backgroundClip at (366,8) size 5x10 clip at (366,8) size 5x10 outlineClip at (366,8) size 5x10
     338layer at (365,9) size 5x11 backgroundClip at (365,8) size 5x10 clip at (365,8) size 5x10 outlineClip at (365,8) size 5x10
    339339  RenderBlock (relative positioned) {mo} at (0,0) size 5x11
    340340    RenderText {mo} at (0,-1) size 5x14
    341341      text run at (0,-1) width 5: "\x{239E}"
    342 layer at (366,79) size 5x11 backgroundClip at (366,82) size 5x11 clip at (366,82) size 5x11 outlineClip at (366,82) size 5x11
     342layer at (365,79) size 5x11 backgroundClip at (365,82) size 5x11 clip at (365,82) size 5x11 outlineClip at (365,82) size 5x11
    343343  RenderBlock (relative positioned) {mo} at (0,0) size 5x11
    344344    RenderText {mo} at (0,-1) size 5x14
     
    352352    RenderText {mo} at (0,-1) size 5x14
    353353      text run at (0,-1) width 5: "\x{23A3}"
    354 layer at (429,22) size 5x11 backgroundClip at (429,21) size 5x10 clip at (429,21) size 5x10 outlineClip at (429,21) size 5x10
     354layer at (430,22) size 5x11 backgroundClip at (430,21) size 5x10 clip at (430,21) size 5x10 outlineClip at (430,21) size 5x10
    355355  RenderBlock (relative positioned) {mo} at (0,0) size 5x11
    356356    RenderText {mo} at (0,-1) size 5x14
    357357      text run at (0,-1) width 5: "\x{23A4}"
    358 layer at (429,70) size 5x11 backgroundClip at (429,73) size 5x11 clip at (429,73) size 5x11 outlineClip at (429,73) size 5x11
     358layer at (430,70) size 5x11 backgroundClip at (430,73) size 5x11 clip at (430,73) size 5x11 outlineClip at (430,73) size 5x11
    359359  RenderBlock (relative positioned) {mo} at (0,0) size 5x11
    360360    RenderText {mo} at (0,-1) size 5x14
    361361      text run at (0,-1) width 5: "\x{23A6}"
    362 layer at (445,28) size 10x11 backgroundClip at (445,27) size 10x10 clip at (445,27) size 10x10 outlineClip at (445,27) size 10x10
     362layer at (446,28) size 10x11 backgroundClip at (446,27) size 10x10 clip at (446,27) size 10x10 outlineClip at (446,27) size 10x10
    363363  RenderBlock (relative positioned) {mo} at (0,0) size 10x11
    364364    RenderText {mo} at (0,-1) size 10x14
    365365      text run at (0,-1) width 10: "\x{2320}"
    366 layer at (445,66) size 10x11 backgroundClip at (445,69) size 10x11 clip at (445,69) size 10x11 outlineClip at (445,69) size 10x11
     366layer at (446,66) size 10x11 backgroundClip at (446,69) size 10x11 clip at (446,69) size 10x11 outlineClip at (446,69) size 10x11
    367367  RenderBlock (relative positioned) {mo} at (0,0) size 10x11
    368368    RenderText {mo} at (0,-1) size 10x14
  • trunk/LayoutTests/platform/mac/mathml/presentation/subsup-expected.txt

    r114975 r115573  
    2626        RenderText {#text} at (0,1) size 148x18
    2727          text run at (0,1) width 148: "long subscript w/ both: "
    28         RenderMathMLMath {math} at (148,0) size 44x24
    29           RenderMathMLSubSup {msubsup} at (1,0) size 42x24
     28        RenderMathMLMath {math} at (148,0) size 45x24
     29          RenderMathMLSubSup {msubsup} at (1,0) size 43x24
    3030            RenderMathMLBlock {msubsup} at (0,0) size 9x20
    3131              RenderInline {mi} at (0,0) size 9x16
    3232                RenderText {#text} at (0,4) size 9x16
    3333                  text run at (0,4) width 9: "Z"
    34             RenderMathMLBlock {msubsup} at (10,0) size 32x24
    35               RenderMathMLBlock {msubsup} at (0,0) size 32x12
     34            RenderMathMLBlock {msubsup} at (10,0) size 33x24
     35              RenderMathMLBlock {msubsup} at (0,0) size 33x12
    3636                RenderInline {mi} at (0,0) size 3x12
    3737                  RenderText {#text} at (0,0) size 3x12
    3838                    text run at (0,0) width 3: "j"
    39               RenderMathMLBlock {msubsup} at (0,12) size 32x12
     39              RenderMathMLBlock {msubsup} at (0,12) size 33x12
    4040                RenderMathMLRow {mrow} at (1,0) size 31x12
    4141                  RenderInline {mi} at (0,0) size 5x12
     
    6060        RenderText {#text} at (0,1) size 160x18
    6161          text run at (0,1) width 160: "long superscript w/ both: "
    62         RenderMathMLMath {math} at (160,0) size 29x24
    63           RenderMathMLSubSup {msubsup} at (1,0) size 27x24
     62        RenderMathMLMath {math} at (160,0) size 30x24
     63          RenderMathMLSubSup {msubsup} at (1,0) size 28x24
    6464            RenderMathMLBlock {msubsup} at (0,0) size 9x20
    6565              RenderInline {mi} at (0,0) size 9x16
    6666                RenderText {#text} at (0,4) size 9x16
    6767                  text run at (0,4) width 9: "Z"
    68             RenderMathMLBlock {msubsup} at (10,0) size 17x24
    69               RenderMathMLBlock {msubsup} at (0,0) size 17x12
     68            RenderMathMLBlock {msubsup} at (10,0) size 18x24
     69              RenderMathMLBlock {msubsup} at (0,0) size 18x12
    7070                RenderMathMLRow {mrow} at (1,0) size 16x12
    7171                  RenderInline {mi} at (0,0) size 5x12
     
    7979                    RenderText {#text} at (13,0) size 3x12
    8080                      text run at (13,0) width 3: "j"
    81               RenderMathMLBlock {msubsup} at (0,12) size 17x12
     81              RenderMathMLBlock {msubsup} at (0,12) size 18x12
    8282                RenderInline {mi} at (0,0) size 5x12
    8383                  RenderText {#text} at (0,0) size 5x12
     
    8787        RenderText {#text} at (0,1) size 88x18
    8888          text run at (0,1) width 88: "long w/ both: "
    89         RenderMathMLMath {math} at (88,0) size 44x24
    90           RenderMathMLSubSup {msubsup} at (1,0) size 42x24
     89        RenderMathMLMath {math} at (88,0) size 45x24
     90          RenderMathMLSubSup {msubsup} at (1,0) size 43x24
    9191            RenderMathMLBlock {msubsup} at (0,0) size 9x20
    9292              RenderInline {mi} at (0,0) size 9x16
    9393                RenderText {#text} at (0,4) size 9x16
    9494                  text run at (0,4) width 9: "Z"
    95             RenderMathMLBlock {msubsup} at (10,0) size 32x24
    96               RenderMathMLBlock {msubsup} at (0,0) size 32x12
     95            RenderMathMLBlock {msubsup} at (10,0) size 33x24
     96              RenderMathMLBlock {msubsup} at (0,0) size 33x12
    9797                RenderMathMLRow {mrow} at (0,0) size 16x12
    9898                  RenderInline {mi} at (0,0) size 5x12
     
    106106                    RenderText {#text} at (13,0) size 3x12
    107107                      text run at (13,0) width 3: "j"
    108               RenderMathMLBlock {msubsup} at (0,12) size 32x12
     108              RenderMathMLBlock {msubsup} at (0,12) size 33x12
    109109                RenderMathMLRow {mrow} at (1,0) size 31x12
    110110                  RenderInline {mi} at (0,0) size 5x12
  • trunk/LayoutTests/platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt

    r103407 r115573  
    3131              RenderSVGRect {rect} at (0,0) size 102x26 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00]
    3232              RenderSVGPath {path} at (15,5) size 72x16 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"]
    33       RenderTable at (1,256) size 138x45
    34         RenderTableSection (anonymous) at (0,0) size 138x45
    35           RenderTableRow (anonymous) at (0,0) size 138x45
    36             RenderTableCell {P} at (0,0) size 138x45 [r=0 c=0 rs=1 cs=1]
     33      RenderTable at (1,256) size 139x45
     34        RenderTableSection (anonymous) at (0,0) size 139x45
     35          RenderTableRow (anonymous) at (0,0) size 139x45
     36            RenderTableCell {P} at (0,0) size 139x45 [r=0 c=0 rs=1 cs=1]
    3737              RenderEmbeddedObject {OBJECT} at (9,0) size 120x44 [bgcolor=#FF0000] [border: (9px solid #0000FF)]
    3838                layer at (0,0) size 102x26
     
    4242                    RenderSVGRect {rect} at (0,0) size 102x26 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00]
    4343                    RenderSVGPath {path} at (15,5) size 72x16 [fill={[type=SOLID] [color=#008000]}] [data="M 500 50 L 150 200 L 850 200 Z"]
    44       RenderTable {TABLE} at (1,356) size 138x45
    45         RenderTableSection {TBODY} at (0,0) size 138x45
    46           RenderTableRow {TR} at (0,0) size 138x45
    47             RenderTableCell {TD} at (0,0) size 138x45 [r=0 c=0 rs=1 cs=1]
     44      RenderTable {TABLE} at (1,356) size 139x45
     45        RenderTableSection {TBODY} at (0,0) size 139x45
     46          RenderTableRow {TR} at (0,0) size 139x45
     47            RenderTableCell {TD} at (0,0) size 139x45 [r=0 c=0 rs=1 cs=1]
    4848              RenderEmbeddedObject {OBJECT} at (9,0) size 120x44 [bgcolor=#FF0000] [border: (9px solid #0000FF)]
    4949                layer at (0,0) size 102x26
  • trunk/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt

    r103407 r115573  
    11layer at (0,0) size 800x600
    22  RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x376
    4   RenderBlock {html} at (0,0) size 800x376
    5     RenderBody {body} at (5,5) size 790x366
    6       RenderTable {table} at (44,0) size 701x366
    7         RenderTableSection (anonymous) at (0,0) size 701x366
    8           RenderTableRow {tr} at (0,0) size 701x366
    9             RenderTableCell {td} at (0,0) size 701x366 [r=0 c=0 rs=1 cs=3]
    10               RenderTable {table} at (6,6) size 689x354
    11                 RenderTableSection (anonymous) at (0,0) size 689x354
     3layer at (0,0) size 800x375
     4  RenderBlock {html} at (0,0) size 800x375
     5    RenderBody {body} at (5,5) size 790x365
     6      RenderTable {table} at (44,0) size 701x365
     7        RenderTableSection (anonymous) at (0,0) size 701x365
     8          RenderTableRow {tr} at (0,0) size 701x365
     9            RenderTableCell {td} at (0,0) size 701x365 [r=0 c=0 rs=1 cs=3]
     10              RenderTable {table} at (6,6) size 689x353
     11                RenderTableSection (anonymous) at (0,0) size 689x353
    1212                  RenderTableRow {tr} at (0,1) size 689x64
    1313                    RenderTableCell {td} at (1,1) size 687x64 [r=0 c=0 rs=1 cs=2]
     
    2222                      RenderText {#text} at (144,5) size 55x13
    2323                        text run at (144,5) width 55: "PNG Image"
    24                   RenderTableRow {tr} at (0,90) size 689x263
    25                     RenderTableCell {td} at (1,90) size 343x263 [r=2 c=0 rs=1 cs=1]
    26                       RenderEmbeddedObject {object} at (5,5) size 333x250
    27                         layer at (0,0) size 333x250
    28                           RenderView at (0,0) size 333x250
    29                         layer at (0,0) size 333x250
    30                           RenderSVGRoot {svg} at (0,0) size 333x250
    31                             RenderSVGContainer {g} at (18,31) size 260x164
    32                               RenderSVGRect {rect} at (20,31) size 36x57 [stroke={[type=SOLID] [color=#000000]}] [x=30.00] [y=46.00] [width=50.00] [height=80.00]
    33                               RenderSVGRect {rect} at (90,32) size 35x56 [fill={[type=SOLID] [color=#FF0000]}] [x=130.00] [y=46.00] [width=50.00] [height=80.00]
     24                  RenderTableRow {tr} at (0,90) size 689x262
     25                    RenderTableCell {td} at (1,90) size 343x262 [r=2 c=0 rs=1 cs=1]
     26                      RenderEmbeddedObject {object} at (5,5) size 333x249
     27                        layer at (0,0) size 333x249
     28                          RenderView at (0,0) size 333x249
     29                        layer at (0,0) size 333x249
     30                          RenderSVGRoot {svg} at (0,0) size 333x249
     31                            RenderSVGContainer {g} at (18,31) size 260x163
     32                              RenderSVGRect {rect} at (20,31) size 37x57 [stroke={[type=SOLID] [color=#000000]}] [x=30.00] [y=46.00] [width=50.00] [height=80.00]
     33                              RenderSVGRect {rect} at (90,31) size 35x57 [fill={[type=SOLID] [color=#FF0000]}] [x=130.00] [y=46.00] [width=50.00] [height=80.00]
    3434                              RenderSVGRect {rect} at (173,31) size 36x57 [stroke={[type=SOLID] [color=#000000]}] [x=250.00] [y=46.00] [width=50.00] [height=80.00]
    35                               RenderSVGRect {rect} at (242,32) size 36x56 [fill={[type=SOLID] [color=#FF0000]}] [x=350.00] [y=46.00] [width=50.00] [height=80.00]
    36                               RenderSVGRect {rect} at (18,133) size 41x62 [stroke={[type=SOLID] [color=#0000FF] [stroke width=8.00]}] [x=30.00] [y=196.00] [width=50.00] [height=80.00]
    37                               RenderSVGRect {rect} at (87,133) size 41x62 [stroke={[type=SOLID] [color=#0000FF] [stroke width=8.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=130.00] [y=196.00] [width=50.00] [height=80.00]
    38                               RenderSVGRect {rect} at (170,133) size 41x62 [stroke={[type=SOLID] [color=#0000FF] [stroke width=8.00]}] [x=250.00] [y=196.00] [width=50.00] [height=80.00]
    39                               RenderSVGRect {rect} at (242,136) size 36x56 [fill={[type=SOLID] [color=#00FF00]}] [x=350.00] [y=196.00] [width=50.00] [height=80.00]
    40                             RenderSVGText {text} at (10,303) size 267x47 contains 1 chunk(s)
    41                               RenderSVGInlineText {#text} at (0,0) size 267x47
    42                                 chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 16 width 266.67: "$Revision: 1.7 $"
    43                             RenderSVGRect {rect} at (0,0) size 333x250 [stroke={[type=SOLID] [color=#000000]}] [x=1.00] [y=1.00] [width=478.00] [height=358.00]
     35                              RenderSVGRect {rect} at (242,31) size 36x57 [fill={[type=SOLID] [color=#FF0000]}] [x=350.00] [y=46.00] [width=50.00] [height=80.00]
     36                              RenderSVGRect {rect} at (18,132) size 41x62 [stroke={[type=SOLID] [color=#0000FF] [stroke width=8.00]}] [x=30.00] [y=196.00] [width=50.00] [height=80.00]
     37                              RenderSVGRect {rect} at (87,132) size 41x62 [stroke={[type=SOLID] [color=#0000FF] [stroke width=8.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=130.00] [y=196.00] [width=50.00] [height=80.00]
     38                              RenderSVGRect {rect} at (170,132) size 41x62 [stroke={[type=SOLID] [color=#0000FF] [stroke width=8.00]}] [x=250.00] [y=196.00] [width=50.00] [height=80.00]
     39                              RenderSVGRect {rect} at (242,135) size 36x56 [fill={[type=SOLID] [color=#00FF00]}] [x=350.00] [y=196.00] [width=50.00] [height=80.00]
     40                            RenderSVGText {text} at (10,303) size 268x47 contains 1 chunk(s)
     41                              RenderSVGInlineText {#text} at (0,0) size 268x47
     42                                chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 16 width 267.47: "$Revision: 1.7 $"
     43                            RenderSVGRect {rect} at (0,0) size 333x249 [stroke={[type=SOLID] [color=#000000]}] [x=1.00] [y=1.00] [width=478.00] [height=358.00]
    4444                      RenderText {#text} at (0,0) size 0x0
    4545                    RenderTableCell {td} at (345,90) size 343x262 [r=2 c=1 rs=1 cs=1]
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug1318-expected.txt

    r80755 r115573  
    1919              RenderText {#text} at (0,0) size 0x0
    2020          RenderTableRow {TR} at (0,74) size 784x21
    21             RenderTableCell {TD} at (0,76) size 556x17 [r=1 c=0 rs=1 cs=1]
     21            RenderTableCell {TD} at (0,76) size 551x17 [r=1 c=0 rs=1 cs=1]
    2222              RenderInline {FONT} at (0,0) size 140x15
    23                 RenderText {#text} at (415,1) size 140x15
    24                   text run at (415,1) width 140: "I agree with the program"
     23                RenderText {#text} at (410,1) size 140x15
     24                  text run at (410,1) width 140: "I agree with the program"
    2525              RenderText {#text} at (0,0) size 0x0
    26             RenderTableCell {TD} at (556,74) size 64x21 [r=1 c=1 rs=1 cs=1]
     26            RenderTableCell {TD} at (551,74) size 71x21 [r=1 c=1 rs=1 cs=1]
    2727              RenderBlock {INPUT} at (3,4) size 12x13
    2828          RenderTableRow {TR} at (0,95) size 784x21
    29             RenderTableCell {TD} at (0,97) size 556x17 [r=2 c=0 rs=1 cs=1]
     29            RenderTableCell {TD} at (0,97) size 551x17 [r=2 c=0 rs=1 cs=1]
    3030              RenderInline {FONT} at (0,0) size 153x15
    31                 RenderText {#text} at (402,1) size 153x15
    32                   text run at (402,1) width 153: "I think vouchers are wrong"
     31                RenderText {#text} at (397,1) size 153x15
     32                  text run at (397,1) width 153: "I think vouchers are wrong"
    3333              RenderText {#text} at (0,0) size 0x0
    34             RenderTableCell {TD} at (556,95) size 64x21 [r=2 c=1 rs=1 cs=1]
     34            RenderTableCell {TD} at (551,95) size 71x21 [r=2 c=1 rs=1 cs=1]
    3535              RenderBlock {INPUT} at (3,4) size 12x13
    3636          RenderTableRow {TR} at (0,116) size 784x24
    37             RenderTableCell {TD} at (0,119) size 620x17 [r=3 c=0 rs=1 cs=2]
     37            RenderTableCell {TD} at (0,119) size 622x17 [r=3 c=0 rs=1 cs=2]
    3838              RenderInline {A} at (0,0) size 76x18 [color=#0000EE]
    3939                RenderInline {FONT} at (0,0) size 76x15
    40                   RenderText {#text} at (272,1) size 76x15
    41                     text run at (272,1) width 76: "View Results"
     40                  RenderText {#text} at (273,1) size 76x15
     41                    text run at (273,1) width 76: "View Results"
    4242              RenderInline {FONT} at (0,0) size 0x0
    4343                RenderText {#text} at (0,0) size 0x0
    44             RenderTableCell {TD} at (620,116) size 164x24 [r=3 c=2 rs=1 cs=2]
    45               RenderButton {INPUT} at (63,3) size 39x18 [bgcolor=#C0C0C0]
     44            RenderTableCell {TD} at (622,116) size 162x24 [r=3 c=2 rs=1 cs=2]
     45              RenderButton {INPUT} at (62,3) size 39x18 [bgcolor=#C0C0C0]
    4646                RenderBlock (anonymous) at (8,2) size 23x13
    4747                  RenderText at (0,0) size 23x13
  • trunk/Source/WebCore/ChangeLog

    r115569 r115573  
     12012-04-26  Emil A Eklund  <eae@chromium.org> and Levi Weintraub  <leviw@chromium.org>
     2
     3        Move Length and CSS length computation to float
     4        https://bugs.webkit.org/show_bug.cgi?id=84801
     5
     6        Reviewed by Eric Seidel.
     7
     8        Change Length and CSS length computation to floating point. This gets us
     9        closer to the goal of supporting subpixel layout and improves precision
     10        for SVG which already uses floating point for its layout.
     11
     12        This change makes computedStyle return fractional values for pixel values
     13        if a fraction is specified. It also changes the result of computations
     14        where two or more values with fractional precision. Prior to this change
     15        the result of Length(2.9) + Length(2.9) would be 4 as each value would be
     16        floored. With this change the result is 5 as the addition is done with
     17        floating point precision and then the result will be floored. Once we
     18        enable subpixel layout the resulting value in this example would be 5.8.
     19
     20        Updated existing layout tests.
     21
     22        * css/CSSComputedStyleDeclaration.cpp:
     23        (WebCore::zoomAdjustedPixelValue):
     24        * css/CSSPrimitiveValue.cpp:
     25        (WebCore::CSSPrimitiveValue::computeLength):
     26        * css/CSSPrimitiveValue.h:
     27        (WebCore):
     28        (WebCore::roundForImpreciseConversion):
     29        Add specialized float version of roundForImpreciseConversion that matches
     30        the int versions rounding logic.
     31       
     32        If a value is sufficiently close to the next integer round it up to
     33        ensure that a style rule such as "width: 4.999px" evaluates to 5px
     34        instead of 4px. This is needed as, although Lengths are using floating
     35        point, the layout system still uses integer precision and floors the
     36        Length values.
     37        This will change once we move to FractionalLayoutUnits but for now this
     38        is needed to ensure compatibility with the existing system and tests.
     39       
     40        Without this specialized rounding logic we fail a handful of tests
     41        including acid3.
     42       
     43        * platform/Length.h:
     44        (WebCore::Length::value):
     45        (Length):
     46        (WebCore::Length::intValue):
     47        * rendering/RenderTableCell.cpp:
     48        (WebCore::RenderTableCell::styleOrColLogicalWidth):
     49
    1502012-04-28  Alexander Pavlov  <apavlov@chromium.org>
    251
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r114766 r115573  
    521521}
    522522
    523 inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(int value, const RenderStyle* style)
    524 {
    525     return cssValuePool().createValue(adjustForAbsoluteZoom(value, style), CSSPrimitiveValue::CSS_PX);
     523inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(double value, const RenderStyle* style)
     524{
     525    return cssValuePool().createValue(adjustFloatForAbsoluteZoom(value, style), CSSPrimitiveValue::CSS_PX);
    526526}
    527527
  • trunk/Source/WebCore/css/CSSPrimitiveValue.cpp

    r113922 r115573  
    432432template<> Length CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, float multiplier, bool computingFontSize)
    433433{
    434     return Length(roundForImpreciseConversion<int>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize)), Fixed);
     434    return Length(roundForImpreciseConversion<float>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize)), Fixed);
    435435}
    436436
  • trunk/Source/WebCore/css/CSSPrimitiveValue.h

    r113922 r115573  
    4343struct Length;
    4444
     45// Dimension calculations are imprecise, often resulting in values of e.g.
     46// 44.99998. We need to go ahead and round if we're really close to the next
     47// integer value.
    4548template<typename T> inline T roundForImpreciseConversion(double value)
    4649{
    47     // Dimension calculations are imprecise, often resulting in values of e.g.
    48     // 44.99998.  We need to go ahead and round if we're really close to the
    49     // next integer value.
    5050    value += (value < 0) ? -0.01 : +0.01;
    5151    return ((value > std::numeric_limits<T>::max()) || (value < std::numeric_limits<T>::min())) ? 0 : static_cast<T>(value);
     52}
     53
     54template<> inline float roundForImpreciseConversion(double value)
     55{
     56    double ceiledValue = ceil(value);
     57    double proximityToNextInt = ceiledValue - value;
     58    if (proximityToNextInt <= 0.01 && value > 0)
     59        return static_cast<float>(ceiledValue);
     60    if (proximityToNextInt >= 0.99 && value < 0)
     61        return static_cast<float>(floor(value));
     62    return static_cast<float>(value);
    5263}
    5364
  • trunk/Source/WebCore/platform/Length.h

    r114208 r115573  
    110110    }
    111111   
    112     int value() const
    113     {
     112    inline float value() const
     113    {
     114        return getFloatValue();
     115    }
     116
     117     int intValue() const
     118     {
    114119        if (isCalculated()) {
    115120            ASSERT_NOT_REACHED();
     
    117122        }
    118123        return getIntValue();
    119     }
    120 
    121     // FIXME: When we switch to sub-pixel layout, value will return float by default, and this will inherit
    122     // the current implementation of value().
    123     int intValue() const
    124     {
    125         return value();
    126124    }
    127125
  • trunk/Source/WebCore/rendering/RenderTableCell.cpp

    r113823 r115573  
    144144        // See Bugzilla bug 8126 for details.
    145145        if (colWidthSum.isFixed() && colWidthSum.value() > 0)
    146             colWidthSum = Length(max(0, colWidthSum.value() - borderAndPaddingLogicalWidth()), Fixed);
     146            colWidthSum = Length(max(0.0f, colWidthSum.value() - borderAndPaddingLogicalWidth()), Fixed);
    147147        return colWidthSum;
    148148    }
Note: See TracChangeset for help on using the changeset viewer.