⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 119456 in webkit


Ignore:
Timestamp:
Jun 4, 2012, 9:42:55 PM (14 years ago)
Author:
eae@chromium.org
Message:

Add missing FractionalLayoutUnit += operator and move LineWidth to use all floats
https://bugs.webkit.org/show_bug.cgi?id=88259

Patch by Emil A Eklund <eae@chromium.org> and Levi Weintraub <leviw@chromium.org> on 2012-06-04
Reviewed by Ryosuke Niwa.

Source/WebCore:

Fix two rounding bugs in LineLayout and RenderBlock that caused inlines
and floats to wrap incorrectly.

Tests: fast/sub-pixel/float-containing-block-with-margin.html

fast/sub-pixel/float-with-right-margin-zoom.html
fast/sub-pixel/inline-block-with-padding.html

  • platform/FractionalLayoutUnit.h:

(WebCore::operator+=):
Add missing float version of += operator thus avoiding a silent cast to
int loosing precision.

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::LineWidth::computeAvailableWidthFromLeftAndRight):
(WebCore::LineWidth::updateAvailableWidth):
Change LineWidth left/right to floating point and instead of rounding the
left and right edge separately.

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::resolveFlexibleLengths):
Use explicit cast to avoid compiler ambiguity warning.

LayoutTests:

  • fast/dom/elementFromPoint-relative-to-viewport.html:
  • fast/events/offsetX-offsetY.html:

Remove special casing for subpixel layout as it is no longer needed.

  • fast/sub-pixel/float-containing-block-with-margin-expected.html: Added.
  • fast/sub-pixel/float-containing-block-with-margin.html: Added.
  • fast/sub-pixel/float-with-right-margin-zoom-expected.txt: Added.
  • fast/sub-pixel/float-with-right-margin-zoom.html: Added.
  • fast/sub-pixel/inline-block-with-padding-expected.txt: Added.
  • fast/sub-pixel/inline-block-with-padding.html: Added.

New tests for wrapping logic.

  • platform/chromium-linux/css2.1/t100801-c544-valgn-03-d-agi-expected.png:
  • platform/chromium-linux/css2.1/t100801-c544-valgn-03-d-agi-expected.txt:
  • platform/chromium-linux/fast/line-grid/line-align-left-edges-expected.png:
  • platform/chromium-linux/fast/line-grid/line-grid-contains-value-expected.png:
  • platform/chromium-linux/fast/multicol/float-multicol-expected.png:
  • platform/chromium-win/fast/events/offsetX-offsetY-expected.txt:
  • platform/chromium-win/fast/line-grid/line-grid-contains-value-expected.txt:
  • platform/chromium-win/fast/multicol/float-multicol-expected.txt:

Update expectations to match pre-subpixel rendering.

  • platform/chromium/TestExpectations:

Mark updated tests as failing on mac and windows temporarily.

  • platform/chromium/fast/dom/elementFromPoint-relative-to-viewport-expected.txt:

Remove special casing for subpixel layout as it is no longer needed.

  • platform/chromium/fast/line-grid/line-align-left-edges-expected.txt:

Update expectations to match pre-subpixel rendering.

  • platform/efl/Skipped:
  • platform/gtk-wk2/Skipped:
  • platform/mac-lion/Skipped:
  • platform/mac-snowleopard/Skipped:
  • platform/mac-wk2/Skipped:
  • platform/mac/Skipped:
  • platform/qt-4.8/Skipped:
  • platform/qt/Skipped:
  • platform/win-wk2/Skipped:
  • platform/win-xp/Skipped:
  • platform/win/Skipped:
  • platform/wincairo/Skipped:
  • platform/wk2/Skipped:

Skip new sub-pixel tests on platforms that does not enable sub-pixel layout.

Location:
trunk
Files:
6 added
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r119455 r119456  
     12012-06-04  Emil A Eklund  <eae@chromium.org> and Levi Weintraub  <leviw@chromium.org>
     2
     3        Add missing FractionalLayoutUnit += operator and move LineWidth to use all floats
     4        https://bugs.webkit.org/show_bug.cgi?id=88259
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * fast/dom/elementFromPoint-relative-to-viewport.html:
     9        * fast/events/offsetX-offsetY.html:
     10        Remove special casing for subpixel layout as it is no longer needed.
     11       
     12        * fast/sub-pixel/float-containing-block-with-margin-expected.html: Added.
     13        * fast/sub-pixel/float-containing-block-with-margin.html: Added.
     14        * fast/sub-pixel/float-with-right-margin-zoom-expected.txt: Added.
     15        * fast/sub-pixel/float-with-right-margin-zoom.html: Added.
     16        * fast/sub-pixel/inline-block-with-padding-expected.txt: Added.
     17        * fast/sub-pixel/inline-block-with-padding.html: Added.
     18        New tests for wrapping logic.
     19       
     20        * platform/chromium-linux/css2.1/t100801-c544-valgn-03-d-agi-expected.png:
     21        * platform/chromium-linux/css2.1/t100801-c544-valgn-03-d-agi-expected.txt:
     22        * platform/chromium-linux/fast/line-grid/line-align-left-edges-expected.png:
     23        * platform/chromium-linux/fast/line-grid/line-grid-contains-value-expected.png:
     24        * platform/chromium-linux/fast/multicol/float-multicol-expected.png:
     25        * platform/chromium-win/fast/events/offsetX-offsetY-expected.txt:
     26        * platform/chromium-win/fast/line-grid/line-grid-contains-value-expected.txt:
     27        * platform/chromium-win/fast/multicol/float-multicol-expected.txt:
     28        Update expectations to match pre-subpixel rendering.
     29       
     30        * platform/chromium/TestExpectations:
     31        Mark updated tests as failing on mac and windows temporarily.
     32       
     33        * platform/chromium/fast/dom/elementFromPoint-relative-to-viewport-expected.txt:
     34        Remove special casing for subpixel layout as it is no longer needed.
     35       
     36        * platform/chromium/fast/line-grid/line-align-left-edges-expected.txt:
     37        Update expectations to match pre-subpixel rendering.
     38
     39        * platform/efl/Skipped:
     40        * platform/gtk-wk2/Skipped:
     41        * platform/mac-lion/Skipped:
     42        * platform/mac-snowleopard/Skipped:
     43        * platform/mac-wk2/Skipped:
     44        * platform/mac/Skipped:
     45        * platform/qt-4.8/Skipped:
     46        * platform/qt/Skipped:
     47        * platform/win-wk2/Skipped:
     48        * platform/win-xp/Skipped:
     49        * platform/win/Skipped:
     50        * platform/wincairo/Skipped:
     51        * platform/wk2/Skipped:
     52        Skip new sub-pixel tests on platforms that does not enable sub-pixel layout.
     53
    1542012-06-04  Tony Chang  <tony@chromium.org>
    255
  • trunk/LayoutTests/fast/dom/elementFromPoint-relative-to-viewport.html

    r117815 r119456  
    2929    <div id="test-offscreen" class="test"></div>
    3030    <div class="pusher">This box is here to create even more scrollbars!</div>
    31     <div id="subpixel-test"></div>
    3231</div>
    3332<p id="description"></p>
    3433<div id="console"></div>
    3534<script>
    36     var r = document.getElementById('subpixel-test').getBoundingClientRect();
    37     var hasSubpixelSupport = r.right - r.left == 4.5;
    38 
    3935    window.onclick = function(e)
    4036    {
     
    8884
    8985        shouldBe(unscrolledBox, "'0'");
    90         shouldBe(scrolledDownBox, hasSubpixelSupport && hasZoom ? "'4'" : "'5'");
     86        shouldBe(scrolledDownBox, "'5'");
    9187        shouldBe(scrolledRightBox, "'3'");
    92         shouldBe(scrolledDownAndRightBox, hasSubpixelSupport && hasZoom  ? "'7'" : "'8'");
     88        shouldBe(scrolledDownAndRightBox, "'8'");
    9389    }
    9490
  • trunk/LayoutTests/fast/events/offsetX-offsetY.html

    r117815 r119456  
    2424    function test()
    2525    {
    26       var r = document.getElementById('subpixel-test').getBoundingClientRect();
    27       var hasSubpixelSupport = r.right - r.left == 4.5;
    28 
    2926      // Scroll so that frame view offsets are non-zero
    3027      window.scrollTo(20, 100);
     
    4138      dispatchEvent(410, 30, 'fixed-box', 10, 10);
    4239      dispatchEvent(36, 272, 'with-bordertopextra', 4, 4);
    43       dispatchEvent(639, 207, 'in-columns', hasSubpixelSupport ? 34 : 35, 5);
     40      dispatchEvent(639, 207, 'in-columns', 35, 5);
    4441      dispatchEvent(563, 410, 'inside-overflow', 7, 6);
    4542      dispatchEvent(112, 369, 'transformed', 11, 16);
     
    185182/*      -webkit-transform: rotate(10deg);*/
    186183    }
    187 
    188     #subpixel-test {
    189       width: 4.5px;
    190     }
    191184  </style>
    192185</head>
     
    230223<div id="results"></div>
    231224<div id="mousepos"></div>
    232 <div id="subpixel-test"></div>
    233225
    234226</body>
  • trunk/LayoutTests/platform/chromium-linux/css2.1/t100801-c544-valgn-03-d-agi-expected.txt

    r117821 r119456  
    7070          text run at (641,105) width 15: " "
    7171        RenderImage {IMG} at (656,104) size 15x15
     72        RenderText {#text} at (671,105) size 15x16
     73          text run at (671,105) width 15: " "
     74        RenderInline {BIG} at (0,0) size 60x21 [color=#C0C0C0]
     75          RenderText {#text} at (686,101) size 60x21
     76            text run at (686,101) width 60: "xxx"
    7277        RenderText {#text} at (0,0) size 0x0
    73         RenderInline {BIG} at (0,0) size 60x21 [color=#C0C0C0]
    74           RenderText {#text} at (9,171) size 60x21
    75             text run at (9,171) width 60: "xxx"
    76         RenderText {#text} at (69,175) size 15x16
    77           text run at (69,175) width 15: " "
    78         RenderImage {IMG} at (84,136) size 90x91
    79         RenderText {#text} at (174,175) size 60x16
    80           text run at (174,175) width 15: " "
    81           text run at (189,175) width 45: "\x{C9}\x{C9}\x{C9}"
     78        RenderImage {IMG} at (9,136) size 90x91
     79        RenderText {#text} at (99,175) size 60x16
     80          text run at (99,175) width 15: " "
     81          text run at (114,175) width 45: "\x{C9}\x{C9}\x{C9}"
  • trunk/LayoutTests/platform/chromium-win/fast/events/offsetX-offsetY-expected.txt

    r117821 r119456  
    1919PASS: event at (410, 30) hit fixed-box at offset (10, 10)
    2020FAIL: event at (36, 272) expected to hit with-bordertopextra at (4, 4) but hit filler at (56, 372)
    21 PASS: event at (639, 207) hit in-columns at offset (34, 5)
     21FAIL: event at (639, 207) expected to hit in-columns at (35, 5) but hit in-columns at (34, 5)
    2222FAIL: event at (563, 410) expected to hit inside-overflow at (7, 6) but hit overflow-contents at (163, 112)
    2323FAIL: event at (112, 369) expected to hit transformed at (11, 16) but hit transformed at (7, 2)
  • trunk/LayoutTests/platform/chromium-win/fast/line-grid/line-grid-contains-value-expected.txt

    r107109 r119456  
    3535        text run at (0,15) width 587: "This header should be centered"
    3636        text run at (0,101) width 303: "in the grid lines."
    37     RenderBlock {DIV} at (10,167) size 600x138
     37    RenderBlock {DIV} at (10,166) size 600x139
    3838      RenderText {#text} at (0,36) size 104x15
    3939        text run at (0,36) width 104: "This text should snap"
  • trunk/LayoutTests/platform/chromium-win/fast/multicol/float-multicol-expected.txt

    r117821 r119456  
    137137              text run at (526,80) width 44: "please "
    138138              text run at (570,80) width 60: "turn it on"
    139           RenderText {#text} at (432,100) size 219x159
     139          RenderText {#text} at (432,100) size 214x159
    140140            text run at (432,100) width 214: "when it asks. Talkback reports give"
    141141            text run at (432,120) width 136: "us really valuable data "
     
    144144            text run at (432,160) width 30: "how "
    145145            text run at (462,160) width 178: "often people are encountering"
    146             text run at (432,180) width 219: "them. And all you have to do is click"
    147             text run at (432,200) width 42: "\"OK\". "
    148             text run at (474,200) width 151: "If you find something you"
    149             text run at (432,220) width 217: "think is a bug, check to see if it's not"
    150             text run at (432,240) width 48: "already "
     146            text run at (432,180) width 187: "them. And all you have to do is"
     147            text run at (432,200) width 74: "click \"OK\". "
     148            text run at (506,200) width 125: "If you find something"
     149            text run at (432,220) width 200: "you think is a bug, check to see if"
     150            text run at (432,240) width 91: "it's not already "
    151151          RenderInline {A} at (0,0) size 79x19 [color=#0000EE]
    152             RenderText {#text} at (480,240) size 79x19
    153               text run at (480,240) width 79: "known about"
    154           RenderText {#text} at (559,240) size 186x39
    155             text run at (559,240) width 59: ", and then"
    156             text run at (432,260) width 42: "please "
    157             text run at (474,260) width 63: "follow the "
     152            RenderText {#text} at (523,240) size 79x19
     153              text run at (523,240) width 79: "known about"
     154          RenderText {#text} at (602,240) size 200x39
     155            text run at (602,240) width 30: ", and"
     156            text run at (432,260) width 71: "then please "
     157            text run at (503,260) width 63: "follow the "
    158158          RenderInline {A} at (0,0) size 157x19 [color=#0000EE]
    159             RenderText {#text} at (537,260) size 157x19
    160               text run at (537,260) width 157: "bug submission procedure"
    161           RenderText {#text} at (694,260) size 4x19
    162             text run at (694,260) width 4: "."
     159            RenderText {#text} at (566,260) size 157x19
     160              text run at (566,260) width 157: "bug submission procedure"
     161          RenderText {#text} at (723,260) size 4x19
     162            text run at (723,260) width 4: "."
    163163      RenderBlock (floating) {DIV} at (472,332) size 79x412 [bgcolor=#008000]
    164164        RenderBlock {P} at (0,16) size 78x20
     
    209209            RenderText {#text} at (620,0) size 29x19
    210210              text run at (620,0) width 29: "page"
    211           RenderText {#text} at (649,0) size 219x199
     211          RenderText {#text} at (649,0) size 218x199
    212212            text run at (649,0) width 4: " "
    213213            text run at (653,0) width 75: "dedicated to"
    214214            text run at (510,20) width 202: "ways to get involved with helping."
    215215            text run at (510,40) width 122: "This doesn't involve "
    216             text run at (632,40) width 97: "knowing how to"
    217             text run at (510,60) width 213: "code, although a little knowledge of"
    218             text run at (510,80) width 145: "HTML is helpful. Being "
    219             text run at (655,80) width 50: "involved"
     216            text run at (632,40) width 81: "knowing how"
     217            text run at (510,60) width 213: "to code, although a little knowledge"
     218            text run at (510,80) width 161: "of HTML is helpful. Being "
     219            text run at (671,80) width 50: "involved"
    220220            text run at (510,100) width 69: "with QA is "
    221221            text run at (579,100) width 147: "good for people wanting"
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r119406 r119456  
    37993799
    38003800BUGWK88131 DEBUG : fast/dom/HTMLMeterElement/meter-element-crash.html = PASS TEXT
     3801
     3802// Temporary until I get a chance to rebaseline for mac and windows.
     3803BUG_eae WIN MAC : css2.1/t100801-c544-valgn-03-d-agi.html = PASS FAIL
     3804BUG_eae WIN MAC : fast/dom/elementFromPoint-relative-to-viewport.html = PASS FAIL
     3805BUG_eae WIN MAC : fast/forms/001.html = PASS FAIL
     3806BUG_eae WIN MAC : fast/inline/inline-box-background-long-image.html = PASS FAIL
     3807BUG_eae WIN MAC : fast/inline/inline-box-background-repeat-x.html = PASS FAIL
     3808BUG_eae WIN MAC : fast/inline/inline-box-background-repeat-y.html = PASS FAIL
     3809BUG_eae WIN MAC : fast/inline/inline-box-background.html = PASS FAIL
     3810BUG_eae WIN MAC : fast/line-grid/line-align-left-edges.html = PASS FAIL
     3811BUG_eae WIN MAC : fast/line-grid/line-grid-contains-value.html = PASS FAIL
     3812BUG_eae WIN MAC : fast/replaced/width100percent-checkbox.html = PASS FAIL
     3813BUG_eae WIN MAC : fast/replaced/width100percent-radio.html = PASS FAIL
     3814BUG_eae WIN MAC : tables/mozilla/bugs/bug1318.html = PASS FAIL
     3815BUG_eae WIN MAC : tables/mozilla/bugs/bug4527.html = PASS FAIL
  • trunk/LayoutTests/platform/chromium/fast/dom/elementFromPoint-relative-to-viewport-expected.txt

    r117903 r119456  
    1313PASS scrolledDownAndRightBoxOffscreen is '8'
    1414PASS unscrolledBoxInitial is '0'
    15 PASS scrolledDownBoxInitial is '4'
     15PASS scrolledDownBoxInitial is '5'
    1616PASS scrolledRightBoxInitial is '3'
    17 PASS scrolledDownAndRightBoxInitial is '7'
     17PASS scrolledDownAndRightBoxInitial is '8'
    1818PASS successfullyParsed is true
    1919
  • trunk/LayoutTests/platform/chromium/fast/line-grid/line-align-left-edges-expected.txt

    r117903 r119456  
    1010        text run at (0,3) width 312: "X X X X X X X"
    1111    RenderBlock {DIV} at (37,67) size 710x37 [border: (3px solid #000000)]
    12       RenderText {#text} at (10,6) size 264x24
    13         text run at (10,6) width 264: "X X X X X X"
     12      RenderText {#text} at (11,6) size 264x24
     13        text run at (11,6) width 264: "X X X X X X"
    1414    RenderBlock (floating) {DIV} at (0,141) size 78x78 [bgcolor=#FFFF00]
    1515    RenderBlock (anonymous) at (0,141) size 784x60
     
    2222layer at (181,308) size 300x30
    2323  RenderBlock (positioned) {DIV} at (172,300) size 301x30 [bgcolor=#DDDDDD]
    24     RenderText {#text} at (19,3) size 120x24
    25       text run at (19,3) width 120: "X X X"
     24    RenderText {#text} at (20,3) size 120x24
     25      text run at (20,3) width 120: "X X X"
  • trunk/LayoutTests/platform/efl/Skipped

    r119377 r119456  
    11721172fast/sub-pixel/client-rect-has-subpixel-precision.html
    11731173fast/sub-pixel/client-width-height-snapping.html
     1174fast/sub-pixel/float-containing-block-with-margin.html
     1175fast/sub-pixel/float-with-right-margin-zoom.html
    11741176fast/sub-pixel/float-wrap-with-subpixel-top.html
    11751177fast/sub-pixel/inline-block-with-margin.html
     1178fast/sub-pixel/inline-block-with-padding.html
    11761179fast/sub-pixel/layout-boxes-with-zoom.html
    11771180fast/sub-pixel/size-of-box-with-zoom.html
  • trunk/LayoutTests/platform/gtk-wk2/Skipped

    r118978 r119456  
    343343fast/sub-pixel/client-rect-has-subpixel-precision.html
    344344fast/sub-pixel/client-width-height-snapping.html
     345fast/sub-pixel/float-containing-block-with-margin.html
     346fast/sub-pixel/float-with-right-margin-zoom.html
    345347fast/sub-pixel/float-wrap-with-subpixel-top.html
    346348fast/sub-pixel/inline-block-with-margin.html
     349fast/sub-pixel/inline-block-with-padding.html
    347350fast/sub-pixel/layout-boxes-with-zoom.html
    348351fast/sub-pixel/size-of-box-with-zoom.html
  • trunk/LayoutTests/platform/mac-lion/Skipped

    r118978 r119456  
    101101fast/sub-pixel/client-rect-has-subpixel-precision.html
    102102fast/sub-pixel/client-width-height-snapping.html
     103fast/sub-pixel/float-containing-block-with-margin.html
     104fast/sub-pixel/float-with-right-margin-zoom.html
    103105fast/sub-pixel/float-wrap-with-subpixel-top.html
    104106fast/sub-pixel/inline-block-with-margin.html
     107fast/sub-pixel/inline-block-with-padding.html
    105108fast/sub-pixel/layout-boxes-with-zoom.html
    106109fast/sub-pixel/size-of-box-with-zoom.html
  • trunk/LayoutTests/platform/mac-snowleopard/Skipped

    r118978 r119456  
    199199fast/sub-pixel/client-rect-has-subpixel-precision.html
    200200fast/sub-pixel/client-width-height-snapping.html
     201fast/sub-pixel/float-containing-block-with-margin.html
     202fast/sub-pixel/float-with-right-margin-zoom.html
    201203fast/sub-pixel/float-wrap-with-subpixel-top.html
    202204fast/sub-pixel/inline-block-with-margin.html
     205fast/sub-pixel/inline-block-with-padding.html
    203206fast/sub-pixel/layout-boxes-with-zoom.html
    204207fast/sub-pixel/size-of-box-with-zoom.html
  • trunk/LayoutTests/platform/mac-wk2/Skipped

    r119007 r119456  
    205205fast/sub-pixel/client-rect-has-subpixel-precision.html
    206206fast/sub-pixel/client-width-height-snapping.html
     207fast/sub-pixel/float-containing-block-with-margin.html
     208fast/sub-pixel/float-with-right-margin-zoom.html
    207209fast/sub-pixel/float-wrap-with-subpixel-top.html
    208210fast/sub-pixel/inline-block-with-margin.html
     211fast/sub-pixel/inline-block-with-padding.html
    209212fast/sub-pixel/layout-boxes-with-zoom.html
    210213fast/sub-pixel/size-of-box-with-zoom.html
  • trunk/LayoutTests/platform/mac/Skipped

    r119388 r119456  
    801801fast/sub-pixel/client-rect-has-subpixel-precision.html
    802802fast/sub-pixel/client-width-height-snapping.html
     803fast/sub-pixel/float-containing-block-with-margin.html
     804fast/sub-pixel/float-with-right-margin-zoom.html
    803805fast/sub-pixel/float-wrap-with-subpixel-top.html
    804806fast/sub-pixel/inline-block-with-margin.html
     807fast/sub-pixel/inline-block-with-padding.html
    805808fast/sub-pixel/layout-boxes-with-zoom.html
    806809fast/sub-pixel/size-of-box-with-zoom.html
  • trunk/LayoutTests/platform/qt-4.8/Skipped

    r119323 r119456  
    8181fast/sub-pixel/client-rect-has-subpixel-precision.html
    8282fast/sub-pixel/client-width-height-snapping.html
     83fast/sub-pixel/float-containing-block-with-margin.html
     84fast/sub-pixel/float-with-right-margin-zoom.html
    8385fast/sub-pixel/float-wrap-with-subpixel-top.html
    8486fast/sub-pixel/inline-block-with-margin.html
     87fast/sub-pixel/inline-block-with-padding.html
    8588fast/sub-pixel/layout-boxes-with-zoom.html
    8689fast/sub-pixel/size-of-box-with-zoom.html
  • trunk/LayoutTests/platform/qt/Skipped

    r119388 r119456  
    217217fast/sub-pixel/client-rect-has-subpixel-precision.html
    218218fast/sub-pixel/client-width-height-snapping.html
     219fast/sub-pixel/float-containing-block-with-margin.html
     220fast/sub-pixel/float-with-right-margin-zoom.html
    219221fast/sub-pixel/float-wrap-with-subpixel-top.html
    220222fast/sub-pixel/inline-block-with-margin.html
     223fast/sub-pixel/inline-block-with-padding.html
    221224fast/sub-pixel/layout-boxes-with-zoom.html
    222225fast/sub-pixel/size-of-box-with-zoom.html
  • trunk/LayoutTests/platform/win-wk2/Skipped

    r118978 r119456  
    938938fast/sub-pixel/client-rect-has-subpixel-precision.html
    939939fast/sub-pixel/client-width-height-snapping.html
     940fast/sub-pixel/float-containing-block-with-margin.html
     941fast/sub-pixel/float-with-right-margin-zoom.html
    940942fast/sub-pixel/float-wrap-with-subpixel-top.html
    941943fast/sub-pixel/inline-block-with-margin.html
     944fast/sub-pixel/inline-block-with-padding.html
    942945fast/sub-pixel/layout-boxes-with-zoom.html
    943946fast/sub-pixel/size-of-box-with-zoom.html
  • trunk/LayoutTests/platform/win-xp/Skipped

    r118978 r119456  
    3838fast/sub-pixel/client-rect-has-subpixel-precision.html
    3939fast/sub-pixel/client-width-height-snapping.html
     40fast/sub-pixel/float-containing-block-with-margin.html
     41fast/sub-pixel/float-with-right-margin-zoom.html
    4042fast/sub-pixel/float-wrap-with-subpixel-top.html
    4143fast/sub-pixel/inline-block-with-margin.html
     44fast/sub-pixel/inline-block-with-padding.html
    4245fast/sub-pixel/layout-boxes-with-zoom.html
    4346fast/sub-pixel/size-of-box-with-zoom.html
  • trunk/LayoutTests/platform/win/Skipped

    r119450 r119456  
    17401740fast/sub-pixel/client-rect-has-subpixel-precision.html
    17411741fast/sub-pixel/client-width-height-snapping.html
     1742fast/sub-pixel/float-containing-block-with-margin.html
     1743fast/sub-pixel/float-with-right-margin-zoom.html
    17421744fast/sub-pixel/float-wrap-with-subpixel-top.html
    17431745fast/sub-pixel/inline-block-with-margin.html
     1746fast/sub-pixel/inline-block-with-padding.html
    17441747fast/sub-pixel/layout-boxes-with-zoom.html
    17451748fast/sub-pixel/size-of-box-with-zoom.html
  • trunk/LayoutTests/platform/wincairo/Skipped

    r119388 r119456  
    20892089fast/sub-pixel/client-rect-has-subpixel-precision.html
    20902090fast/sub-pixel/client-width-height-snapping.html
     2091fast/sub-pixel/float-containing-block-with-margin.html
     2092fast/sub-pixel/float-with-right-margin-zoom.html
    20912093fast/sub-pixel/float-wrap-with-subpixel-top.html
    20922094fast/sub-pixel/inline-block-with-margin.html
     2095fast/sub-pixel/inline-block-with-padding.html
    20932096fast/sub-pixel/layout-boxes-with-zoom.html
    20942097fast/sub-pixel/size-of-box-with-zoom.html
  • trunk/LayoutTests/platform/wk2/Skipped

    r118978 r119456  
    8888fast/sub-pixel/client-rect-has-subpixel-precision.html
    8989fast/sub-pixel/client-width-height-snapping.html
     90fast/sub-pixel/float-containing-block-with-margin.html
     91fast/sub-pixel/float-with-right-margin-zoom.html
    9092fast/sub-pixel/float-wrap-with-subpixel-top.html
    9193fast/sub-pixel/inline-block-with-margin.html
     94fast/sub-pixel/inline-block-with-padding.html
    9295fast/sub-pixel/layout-boxes-with-zoom.html
    9396fast/sub-pixel/size-of-box-with-zoom.html
  • trunk/Source/WebCore/ChangeLog

    r119455 r119456  
     12012-06-04  Emil A Eklund  <eae@chromium.org> and Levi Weintraub  <leviw@chromium.org>
     2
     3        Add missing FractionalLayoutUnit += operator and move LineWidth to use all floats
     4        https://bugs.webkit.org/show_bug.cgi?id=88259
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Fix two rounding bugs in LineLayout and RenderBlock that caused inlines
     9        and floats to wrap incorrectly.
     10
     11        Tests: fast/sub-pixel/float-containing-block-with-margin.html
     12               fast/sub-pixel/float-with-right-margin-zoom.html
     13               fast/sub-pixel/inline-block-with-padding.html
     14
     15        * platform/FractionalLayoutUnit.h:
     16        (WebCore::operator+=):
     17        Add missing float version of += operator thus avoiding a silent cast to
     18        int loosing precision.
     19       
     20        * rendering/RenderBlockLineLayout.cpp:
     21        (WebCore::LineWidth::computeAvailableWidthFromLeftAndRight):
     22        (WebCore::LineWidth::updateAvailableWidth):
     23        Change LineWidth left/right to floating point and instead of rounding the
     24        left and right edge separately.
     25       
     26        * rendering/RenderFlexibleBox.cpp:
     27        (WebCore::RenderFlexibleBox::resolveFlexibleLengths):
     28        Use explicit cast to avoid compiler ambiguity warning.
     29
    1302012-06-04  Tony Chang  <tony@chromium.org>
    231
  • trunk/Source/WebCore/platform/FractionalLayoutUnit.h

    r116905 r119456  
    554554}
    555555
     556inline FractionalLayoutUnit& operator+=(FractionalLayoutUnit& a, float b)
     557{
     558    a = a + b;
     559    return a;
     560}
     561
    556562inline float& operator+=(float& a, const FractionalLayoutUnit& b)
    557563{
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r118420 r119456  
    9999    void computeAvailableWidthFromLeftAndRight()
    100100    {
    101         m_availableWidth = max(0, m_right - m_left) + m_overhangWidth;
     101        m_availableWidth = max(0.0f, m_right - m_left) + m_overhangWidth;
    102102    }
    103103
     
    107107    float m_committedWidth;
    108108    float m_overhangWidth; // The amount by which |m_availableWidth| has been inflated to account for possible contraction due to ruby overhang.
    109     int m_left;
    110     int m_right;
     109    float m_left;
     110    float m_right;
    111111    float m_availableWidth;
    112112    bool m_isFirstLine;
     
    116116{
    117117    LayoutUnit height = m_block->logicalHeight();
    118     m_left = m_block->pixelSnappedLogicalLeftOffsetForLine(height, m_isFirstLine);
    119     m_right = m_block->pixelSnappedLogicalRightOffsetForLine(height, m_isFirstLine);
     118    m_left = m_block->logicalLeftOffsetForLine(height, m_isFirstLine);
     119    m_right = m_block->logicalRightOffsetForLine(height, m_isFirstLine);
    120120
    121121    computeAvailableWidthFromLeftAndRight();
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r119455 r119456  
    866866            LayoutUnit childSize = preferredChildSize;
    867867            if (availableFreeSpace > 0 && totalPositiveFlexibility > 0 && flexSign == PositiveFlexibility && isfinite(totalPositiveFlexibility))
    868                 childSize += lroundf(availableFreeSpace * child->style()->positiveFlex() / totalPositiveFlexibility);
     868                childSize += static_cast<int>(lroundf(availableFreeSpace * child->style()->positiveFlex() / totalPositiveFlexibility));
    869869            else if (availableFreeSpace < 0 && totalWeightedNegativeFlexibility > 0 && flexSign == NegativeFlexibility && isfinite(totalWeightedNegativeFlexibility))
    870                 childSize += lroundf(availableFreeSpace * child->style()->negativeFlex() * preferredChildSize / totalWeightedNegativeFlexibility);
     870                childSize += static_cast<int>(lroundf(availableFreeSpace * child->style()->negativeFlex() * preferredChildSize / totalWeightedNegativeFlexibility));
    871871
    872872            LayoutUnit adjustedChildSize = adjustChildSizeForMinAndMax(child, childSize, flexboxAvailableContentExtent);
Note: See TracChangeset for help on using the changeset viewer.