Changeset 180815 in webkit


Ignore:
Timestamp:
Feb 27, 2015 10:21:05 PM (9 years ago)
Author:
Alan Bujtas
Message:

Subpixel-layout: width: max-content; property might cause unnecessary scrollbar.
https://bugs.webkit.org/show_bug.cgi?id=142065

Reviewed by Simon Fraser.

Source/WebCore:

We should not pixelsnap (ceil in this case) logical coordinates during layout.
Should this cause content to be partially cut off, we need to
find the broken piece in the computation logic.

Covered by the unskipped test.

  • rendering/RootInlineBox.cpp:

(WebCore::RootInlineBox::paddedLayoutOverflowRect):

LayoutTests:

Rebaseline. Scroll layer shrinks in certain cases.

  • platform/mac-mavericks/editing/input/caret-at-the-edge-of-input-expected.txt:
  • platform/mac-mavericks/fast/css/text-overflow-input-expected.txt:
  • platform/mac-mavericks/fast/forms/basic-inputs-expected.txt:
  • platform/mac-mavericks/fast/forms/control-restrict-line-height-expected.txt:
  • platform/mac-mavericks/fast/forms/input-disabled-color-expected.txt:
  • platform/mac-mavericks/fast/forms/search/search-size-with-decorations-expected.txt:
  • platform/mac-mavericks/http/tests/navigation/javascriptlink-frames-expected.txt:
  • platform/mac/TestExpectations:
  • platform/mac/fast/forms/control-restrict-line-height-expected.txt:
  • platform/mac/fast/forms/input-appearance-selection-expected.txt:
  • platform/mac/fast/forms/input-text-scroll-left-on-blur-expected.txt:
  • platform/mac/fast/forms/input-type-text-min-width-expected.txt:
  • platform/mac/fast/forms/minWidthPercent-expected.txt:
  • platform/mac/fast/forms/search/search-size-with-decorations-expected.txt:
  • platform/mac/tables/mozilla/bugs/bug96334-expected.txt:
Location:
trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r180812 r180815  
     12015-02-27  Zalan Bujtas  <zalan@apple.com>
     2
     3        Subpixel-layout: width: max-content; property might cause unnecessary scrollbar.
     4        https://bugs.webkit.org/show_bug.cgi?id=142065
     5
     6        Reviewed by Simon Fraser.
     7
     8        Rebaseline. Scroll layer shrinks in certain cases.
     9
     10        * platform/mac-mavericks/editing/input/caret-at-the-edge-of-input-expected.txt:
     11        * platform/mac-mavericks/fast/css/text-overflow-input-expected.txt:
     12        * platform/mac-mavericks/fast/forms/basic-inputs-expected.txt:
     13        * platform/mac-mavericks/fast/forms/control-restrict-line-height-expected.txt:
     14        * platform/mac-mavericks/fast/forms/input-disabled-color-expected.txt:
     15        * platform/mac-mavericks/fast/forms/search/search-size-with-decorations-expected.txt:
     16        * platform/mac-mavericks/http/tests/navigation/javascriptlink-frames-expected.txt:
     17        * platform/mac/TestExpectations:
     18        * platform/mac/fast/forms/control-restrict-line-height-expected.txt:
     19        * platform/mac/fast/forms/input-appearance-selection-expected.txt:
     20        * platform/mac/fast/forms/input-text-scroll-left-on-blur-expected.txt:
     21        * platform/mac/fast/forms/input-type-text-min-width-expected.txt:
     22        * platform/mac/fast/forms/minWidthPercent-expected.txt:
     23        * platform/mac/fast/forms/search/search-size-with-decorations-expected.txt:
     24        * platform/mac/tables/mozilla/bugs/bug96334-expected.txt:
     25
    1262015-02-27  David Kilzer  <ddkilzer@apple.com>
    227
  • trunk/LayoutTests/platform/mac-mavericks/editing/input/caret-at-the-edge-of-input-expected.txt

    r177774 r180815  
    1111        RenderText {#text} at (0,0) size 0x0
    1212        RenderText {#text} at (0,0) size 0x0
    13 layer at (13,31) size 70x13 scrollX 36 scrollWidth 294
     13layer at (13,31) size 70x13 scrollX 36 scrollWidth 293
    1414  RenderBlock {DIV} at (3,3) size 70x13
    1515    RenderText {#text} at (0,0) size 293x13
  • trunk/LayoutTests/platform/mac-mavericks/fast/css/text-overflow-input-expected.txt

    r180490 r180815  
    149149    RenderText {#text} at (0,0) size 293x13
    150150      text run at (0,0) width 293: "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
    151 layer at (13,96) size 139x13 scrollWidth 341
     151layer at (13,96) size 139x13 scrollWidth 340
    152152  RenderBlock {DIV} at (0,0) size 140x13
    153153    RenderText {#text} at (0,0) size 340x13
     
    197197    RenderText {#text} at (0,0) size 293x13
    198198      text run at (0,0) width 293: "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
    199 layer at (13,222) size 139x13 scrollWidth 341
     199layer at (13,222) size 139x13 scrollWidth 340
    200200  RenderBlock {DIV} at (0,0) size 140x13
    201201    RenderText {#text} at (0,0) size 340x13
  • trunk/LayoutTests/platform/mac-mavericks/fast/forms/basic-inputs-expected.txt

    r180490 r180815  
    7171        RenderText {#text} at (76,1) size 9x18
    7272          text run at (76,1) width 9: "b"
    73 layer at (31,330) size 139x13 scrollWidth 165
     73layer at (31,330) size 139x13 scrollWidth 164
    7474  RenderBlock {DIV} at (3,3) size 140x13
    7575    RenderText {#text} at (0,0) size 164x13
  • trunk/LayoutTests/platform/mac-mavericks/fast/forms/control-restrict-line-height-expected.txt

    r177774 r180815  
    2727          RenderBlock {DIV} at (147,1) size 14x11
    2828      RenderText {#text} at (0,0) size 0x0
    29 layer at (21,75) size 139x13 scrollWidth 277
     29layer at (21,75) size 139x13 scrollWidth 276
    3030  RenderBlock {DIV} at (0,0) size 140x13
    3131    RenderText {#text} at (0,0) size 276x13
  • trunk/LayoutTests/platform/mac-mavericks/fast/forms/input-disabled-color-expected.txt

    r177774 r180815  
    7676    RenderText {#text} at (0,0) size 351x13
    7777      text run at (0,0) width 351: "The text in this disabled field should displayed as dimmed or grey"
    78 layer at (166,31) size 139x13 scrollWidth 155
     78layer at (166,31) size 139x13 scrollWidth 154
    7979  RenderBlock {DIV} at (3,3) size 140x13
    8080    RenderText {#text} at (0,0) size 154x13
     
    8484    RenderText {#text} at (0,0) size 351x13
    8585      text run at (0,0) width 351: "The text in this disabled field should displayed as dimmed or grey"
    86 layer at (166,54) size 139x13 scrollWidth 155
     86layer at (166,54) size 139x13 scrollWidth 154
    8787  RenderBlock {DIV} at (3,3) size 140x13
    8888    RenderText {#text} at (0,0) size 154x13
     
    9292    RenderText {#text} at (0,0) size 351x13
    9393      text run at (0,0) width 351: "The text in this disabled field should displayed as dimmed or grey"
    94 layer at (166,77) size 139x13 scrollWidth 155
     94layer at (166,77) size 139x13 scrollWidth 154
    9595  RenderBlock {DIV} at (3,3) size 140x13
    9696    RenderText {#text} at (0,0) size 154x13
     
    100100    RenderText {#text} at (0,0) size 351x13
    101101      text run at (0,0) width 351: "The text in this disabled field should displayed as dimmed or grey"
    102 layer at (166,100) size 139x13 scrollWidth 155
     102layer at (166,100) size 139x13 scrollWidth 154
    103103  RenderBlock {DIV} at (3,3) size 140x13
    104104    RenderText {#text} at (0,0) size 154x13
     
    108108    RenderText {#text} at (0,0) size 351x13
    109109      text run at (0,0) width 351: "The text in this disabled field should displayed as dimmed or grey"
    110 layer at (166,123) size 139x13 scrollWidth 155
     110layer at (166,123) size 139x13 scrollWidth 154
    111111  RenderBlock {DIV} at (3,3) size 140x13
    112112    RenderText {#text} at (0,0) size 154x13
     
    116116    RenderText {#text} at (0,0) size 351x13
    117117      text run at (0,0) width 351: "The text in this disabled field should displayed as dimmed or grey"
    118 layer at (166,146) size 139x13 scrollWidth 155
     118layer at (166,146) size 139x13 scrollWidth 154
    119119  RenderBlock {DIV} at (3,3) size 140x13
    120120    RenderText {#text} at (0,0) size 154x13
     
    124124    RenderText {#text} at (0,0) size 351x13
    125125      text run at (0,0) width 351: "The text in this disabled field should displayed as dimmed or grey"
    126 layer at (166,169) size 139x13 scrollWidth 155
     126layer at (166,169) size 139x13 scrollWidth 154
    127127  RenderBlock {DIV} at (3,3) size 140x13
    128128    RenderText {#text} at (0,0) size 154x13
     
    132132    RenderText {#text} at (0,0) size 351x13
    133133      text run at (0,0) width 351: "The text in this disabled field should displayed as dimmed or grey"
    134 layer at (166,192) size 139x13 scrollWidth 155
     134layer at (166,192) size 139x13 scrollWidth 154
    135135  RenderBlock {DIV} at (3,3) size 140x13
    136136    RenderText {#text} at (0,0) size 154x13
     
    140140    RenderText {#text} at (0,0) size 351x13
    141141      text run at (0,0) width 351: "The text in this disabled field should displayed as dimmed or grey"
    142 layer at (166,215) size 139x13 scrollWidth 155
     142layer at (166,215) size 139x13 scrollWidth 154
    143143  RenderBlock {DIV} at (3,3) size 140x13
    144144    RenderText {#text} at (0,0) size 154x13
     
    148148    RenderText {#text} at (0,0) size 351x13
    149149      text run at (0,0) width 351: "The text in this disabled field should displayed as dimmed or grey"
    150 layer at (166,238) size 139x13 scrollWidth 155
     150layer at (166,238) size 139x13 scrollWidth 154
    151151  RenderBlock {DIV} at (3,3) size 140x13
    152152    RenderText {#text} at (0,0) size 154x13
     
    156156    RenderText {#text} at (0,0) size 351x13
    157157      text run at (0,0) width 351: "The text in this disabled field should displayed as dimmed or grey"
    158 layer at (166,261) size 139x13 scrollWidth 155
     158layer at (166,261) size 139x13 scrollWidth 154
    159159  RenderBlock {DIV} at (3,3) size 140x13
    160160    RenderText {#text} at (0,0) size 154x13
     
    164164    RenderText {#text} at (0,0) size 351x13
    165165      text run at (0,0) width 351: "The text in this disabled field should displayed as dimmed or grey"
    166 layer at (166,284) size 139x13 scrollWidth 155
     166layer at (166,284) size 139x13 scrollWidth 154
    167167  RenderBlock {DIV} at (3,3) size 140x13
    168168    RenderText {#text} at (0,0) size 154x13
     
    172172    RenderText {#text} at (0,0) size 351x13
    173173      text run at (0,0) width 351: "The text in this disabled field should displayed as dimmed or grey"
    174 layer at (166,307) size 139x13 scrollWidth 155
     174layer at (166,307) size 139x13 scrollWidth 154
    175175  RenderBlock {DIV} at (3,3) size 140x13
    176176    RenderText {#text} at (0,0) size 154x13
  • trunk/LayoutTests/platform/mac-mavericks/fast/forms/search/search-size-with-decorations-expected.txt

    r180441 r180815  
    6060layer at (21,13) size 139x13
    6161  RenderBlock {DIV} at (0,0) size 140x13
    62 layer at (21,36) size 139x13 scrollWidth 141
     62layer at (21,36) size 139x13 scrollWidth 140
    6363  RenderBlock {DIV} at (0,0) size 140x13
    6464    RenderText {#text} at (0,0) size 140x13
     
    6666layer at (30,59) size 139x13
    6767  RenderBlock {DIV} at (0,0) size 140x13
    68 layer at (30,82) size 139x13 scrollWidth 141
     68layer at (30,82) size 139x13 scrollWidth 140
    6969  RenderBlock {DIV} at (0,0) size 140x13
    7070    RenderText {#text} at (0,0) size 140x13
     
    7272layer at (35,105) size 139x13
    7373  RenderBlock {DIV} at (0,0) size 140x13
    74 layer at (35,128) size 139x13 scrollWidth 141
     74layer at (35,128) size 139x13 scrollWidth 140
    7575  RenderBlock {DIV} at (0,0) size 140x13
    7676    RenderText {#text} at (0,0) size 140x13
    7777      text run at (0,0) width 140: "12345678901234567890"
    78 layer at (35,151) size 278x13 scrollWidth 280
     78layer at (35,151) size 278x13 scrollWidth 279
    7979  RenderBlock {DIV} at (0,0) size 279x13
    8080    RenderText {#text} at (0,0) size 279x13
  • trunk/LayoutTests/platform/mac-mavericks/http/tests/navigation/javascriptlink-frames-expected.txt

    r177774 r180815  
    9898                  RenderText {#text} at (0,0) size 532x37
    9999                    text run at (0,0) width 532: "This is an anchor point named \"anchor1\"."
    100         layer at (390,363) size 139x13 scrollWidth 151
     100        layer at (390,363) size 139x13 scrollWidth 150
    101101          RenderBlock {DIV} at (3,3) size 140x13
    102102            RenderText {#text} at (0,0) size 150x13
  • trunk/LayoutTests/platform/mac/TestExpectations

    r180796 r180815  
    12551255webkit.org/b/140537 fast/css/ex-unit-with-no-x-height.html [ Failure ]
    12561256
    1257 # Subpixel bug about rounding
    1258 webkit.org/b/142065 fast/css-intrinsic-dimensions/width-avoid-floats.html [ ImageOnlyFailure ]
    1259 
    12601257# Sometimes has an extra space at the end
    12611258fast/forms/focus-selection-textarea.html [ Pass Failure ]
  • trunk/LayoutTests/platform/mac/fast/forms/control-restrict-line-height-expected.txt

    r177774 r180815  
    2727          RenderBlock {DIV} at (138,1) size 14x11
    2828      RenderText {#text} at (0,0) size 0x0
    29 layer at (21,75) size 130x13 scrollWidth 273
     29layer at (21,75) size 130x13 scrollWidth 272
    3030  RenderBlock {DIV} at (0,0) size 131x13
    3131    RenderText {#text} at (0,0) size 272x13
  • trunk/LayoutTests/platform/mac/fast/forms/input-appearance-selection-expected.txt

    r177774 r180815  
    7575        RenderBR {BR} at (47,482) size 1x0
    7676      RenderBlock {P} at (0,575) size 784x0
    77 layer at (13,47) size 130x13 scrollWidth 136
     77layer at (13,47) size 130x13 scrollWidth 135
    7878  RenderBlock {DIV} at (3,3) size 131x13
    7979    RenderText {#text} at (0,0) size 135x13
  • trunk/LayoutTests/platform/mac/fast/forms/input-text-scroll-left-on-blur-expected.txt

    r177774 r180815  
    1717          text run at (0,0) width 765: "Tests scrolling back to the beginning when a text field blurs. The first field should be scrolled to the left, the second and"
    1818          text run at (0,18) width 164: "third scrolled to the right."
    19 layer at (13,13) size 130x13 scrollWidth 309
     19layer at (13,13) size 130x13 scrollWidth 308
    2020  RenderBlock {DIV} at (3,3) size 131x13
    2121    RenderText {#text} at (0,0) size 308x13
     
    2525    RenderText {#text} at (-177,0) size 309x13
    2626      text run at (-177,0) width 308: "this text field has a lot of text in it so that it needs to scroll"
    27 layer at (302,13) size 130x13 scrollX 179 scrollWidth 309
     27layer at (302,13) size 130x13 scrollX 178 scrollWidth 308
    2828  RenderBlock {DIV} at (3,3) size 131x13
    2929    RenderText {#text} at (0,0) size 308x13
  • trunk/LayoutTests/platform/mac/fast/forms/input-type-text-min-width-expected.txt

    r177774 r180815  
    1010      RenderTextControl {INPUT} at (2,38) size 13x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
    1111      RenderText {#text} at (0,0) size 0x0
    12 layer at (13,49) size 7x13 scrollWidth 41
     12layer at (13,49) size 7x13 scrollWidth 40
    1313  RenderBlock {DIV} at (3,3) size 7x13
    1414    RenderText {#text} at (0,0) size 40x13
  • trunk/LayoutTests/platform/mac/fast/forms/minWidthPercent-expected.txt

    r174585 r180815  
    1111                RenderTextControl {INPUT} at (1,3) size 113x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
    1212                RenderText {#text} at (0,0) size 0x0
    13 layer at (14,16) size 107x13 scrollWidth 114
     13layer at (14,16) size 107x13 scrollWidth 113
    1414  RenderBlock {DIV} at (3,3) size 107x13
    1515    RenderText {#text} at (0,0) size 113x13
  • trunk/LayoutTests/platform/mac/fast/forms/search/search-size-with-decorations-expected.txt

    r180441 r180815  
    6060layer at (21,13) size 130x13
    6161  RenderBlock {DIV} at (0,0) size 131x13
    62 layer at (21,36) size 130x13 scrollWidth 132
     62layer at (21,36) size 130x13 scrollWidth 131
    6363  RenderBlock {DIV} at (0,0) size 131x13
    6464    RenderText {#text} at (0,0) size 131x13
     
    6666layer at (30,59) size 130x13
    6767  RenderBlock {DIV} at (0,0) size 131x13
    68 layer at (30,82) size 130x13 scrollWidth 132
     68layer at (30,82) size 130x13 scrollWidth 131
    6969  RenderBlock {DIV} at (0,0) size 131x13
    7070    RenderText {#text} at (0,0) size 131x13
     
    7272layer at (35,105) size 130x13
    7373  RenderBlock {DIV} at (0,0) size 131x13
    74 layer at (35,128) size 130x13 scrollWidth 132
     74layer at (35,128) size 130x13 scrollWidth 131
    7575  RenderBlock {DIV} at (0,0) size 131x13
    7676    RenderText {#text} at (0,0) size 131x13
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug96334-expected.txt

    r177774 r180815  
    4040                text run at (2,2) width 752: "KEEPoTHEoTEXToHEREoASoLONGoASoPOSSIBLEooKEEPoTHEoTEXToHEREoASoLONGoASoPOSSIBLE"
    4141                text run at (2,20) width 602: "THIS SIMULATES THE PROBLEM ON THE WWW.MAPBLAST.COM/ \"CREATE MAP\""
    42 layer at (31,31) size 130x13 scrollWidth 138
     42layer at (31,31) size 130x13 scrollWidth 137
    4343  RenderBlock {DIV} at (3,3) size 131x13
    4444    RenderText {#text} at (0,0) size 137x13
  • trunk/Source/WebCore/ChangeLog

    r180809 r180815  
     12015-02-27  Zalan Bujtas  <zalan@apple.com>
     2
     3        Subpixel-layout: width: max-content; property might cause unnecessary scrollbar.
     4        https://bugs.webkit.org/show_bug.cgi?id=142065
     5
     6        Reviewed by Simon Fraser.
     7
     8        We should not pixelsnap (ceil in this case) logical coordinates during layout.
     9        Should this cause content to be partially cut off, we need to
     10        find the broken piece in the computation logic.
     11
     12        Covered by the unskipped test.
     13
     14        * rendering/RootInlineBox.cpp:
     15        (WebCore::RootInlineBox::paddedLayoutOverflowRect):
     16
    1172015-02-27  Ryosuke Niwa  <rniwa@webkit.org>
    218
  • trunk/Source/WebCore/rendering/RootInlineBox.cpp

    r180155 r180815  
    838838        return lineLayoutOverflow;
    839839   
    840     // FIXME: Audit whether to use pixel snapped values when not using integers for layout: https://bugs.webkit.org/show_bug.cgi?id=63656
    841840    if (isHorizontal()) {
    842841        if (isLeftToRightDirection())
    843             lineLayoutOverflow.shiftMaxXEdgeTo(std::max<LayoutUnit>(lineLayoutOverflow.maxX(), pixelSnappedLogicalRight() + endPadding));
     842            lineLayoutOverflow.shiftMaxXEdgeTo(std::max<LayoutUnit>(lineLayoutOverflow.maxX(), logicalRight() + endPadding));
    844843        else
    845             lineLayoutOverflow.shiftXEdgeTo(std::min<LayoutUnit>(lineLayoutOverflow.x(), pixelSnappedLogicalLeft() - endPadding));
     844            lineLayoutOverflow.shiftXEdgeTo(std::min<LayoutUnit>(lineLayoutOverflow.x(), logicalLeft() - endPadding));
    846845    } else {
    847846        if (isLeftToRightDirection())
    848             lineLayoutOverflow.shiftMaxYEdgeTo(std::max<LayoutUnit>(lineLayoutOverflow.maxY(), pixelSnappedLogicalRight() + endPadding));
     847            lineLayoutOverflow.shiftMaxYEdgeTo(std::max<LayoutUnit>(lineLayoutOverflow.maxY(), logicalRight() + endPadding));
    849848        else
    850             lineLayoutOverflow.shiftYEdgeTo(std::min<LayoutUnit>(lineLayoutOverflow.y(), pixelSnappedLogicalLeft() - endPadding));
     849            lineLayoutOverflow.shiftYEdgeTo(std::min<LayoutUnit>(lineLayoutOverflow.y(), logicalLeft() - endPadding));
    851850    }
    852851   
Note: See TracChangeset for help on using the changeset viewer.