Changeset 121722 in webkit


Ignore:
Timestamp:
Jul 2, 2012 7:22:46 PM (12 years ago)
Author:
eae@chromium.org
Message:

Position replaced elements on pixel bounds
https://bugs.webkit.org/show_bug.cgi?id=90354

Reviewed by Eric Seidel.

To avoid sizing and repaint issues we should layout replaced elements on
pixel bounds. We already ensure that replaced elements are sized in full
pixels and that they are painted on pixel bounds. By also ensuring that
they are placed on pixel bounds we avoid pixel having the size be
expanded by pixel snapping and repainting/invalidation rect issues when
scrolling.

Test: fast/repaint/repaint-during-scroll-with-zoom.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::computePositionedLogicalWidthReplaced):
(WebCore::RenderBox::computePositionedLogicalHeightReplaced):

Location:
trunk
Files:
3 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/platform/chromium-win/fast/box-sizing/box-sizing-expected.txt

    r117821 r121722  
    8282    RenderBR {BR} at (6,46) size 0x19
    8383layer at (13,757) size 20x20
    84   RenderImage {IMG} at (13,757) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
     84  RenderImage {IMG} at (13,757) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
    8585layer at (43,757) size 20x20
    86   RenderImage {IMG} at (43,757) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
     86  RenderImage {IMG} at (43,757) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
    8787layer at (73,757) size 20x20
    88   RenderImage {IMG} at (73,757) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
     88  RenderImage {IMG} at (73,757) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
    8989layer at (103,757) size 20x20
    90   RenderImage {IMG} at (103,757) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
     90  RenderImage {IMG} at (103,757) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)]
  • trunk/LayoutTests/platform/chromium-win/media/media-document-audio-repaint-expected.txt

    r120939 r121722  
    1616              RenderBody {BODY} at (8,8) size 364x314 [bgcolor=#000000]
    1717          layer at (40,165) size 300x1
    18             RenderVideo {VIDEO} at (40,164) size 300x2
     18            RenderVideo {VIDEO} at (40,165) size 300x1
    1919          layer at (40,165) size 300x1
    2020            RenderDeprecatedFlexibleBox (relative positioned) {DIV} at (0,0) size 300x1
  • trunk/LayoutTests/platform/chromium-win/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute-expected.txt

    r117821 r121722  
    1515              RenderSVGRect {rect} at (0,0) size 250x113 [fill={[type=SOLID] [color=#ADD8E6]}] [x=0.00] [y=0.00] [width=250.00] [height=112.50]
    1616              RenderSVGRect {rect} at (12,5) size 226x102 [fill={[type=SOLID] [color=#008000]}] [x=12.50] [y=5.63] [width=225.00] [height=101.25]
    17 layer at (0,118) size 250x112
    18   RenderSVGRoot {svg} at (0,117) size 250x113
    19     RenderSVGRect {rect} at (0,117) size 250x113 [fill={[type=SOLID] [color=#ADD8E6]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
    20     RenderSVGRect {rect} at (12,122) size 226x103 [fill={[type=SOLID] [color=#008000]}] [x=5.00] [y=5.00] [width=90.00] [height=90.00]
     17layer at (0,118) size 250x113
     18  RenderSVGRoot {svg} at (0,118) size 250x113
     19    RenderSVGRect {rect} at (0,118) size 250x113 [fill={[type=SOLID] [color=#ADD8E6]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
     20    RenderSVGRect {rect} at (12,123) size 226x102 [fill={[type=SOLID] [color=#008000]}] [x=5.00] [y=5.00] [width=90.00] [height=90.00]
  • trunk/LayoutTests/platform/chromium-win/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-expected.txt

    r117911 r121722  
    1515              RenderSVGRect {rect} at (0,0) size 125x113 [fill={[type=SOLID] [color=#ADD8E6]}] [x=0.00] [y=0.00] [width=125.00] [height=112.50]
    1616              RenderSVGRect {rect} at (6,5) size 113x102 [fill={[type=SOLID] [color=#008000]}] [x=6.25] [y=5.63] [width=112.50] [height=101.25]
    17 layer at (0,118) size 125x112
    18   RenderSVGRoot {svg} at (0,117) size 125x113
    19     RenderSVGRect {rect} at (0,117) size 125x113 [fill={[type=SOLID] [color=#ADD8E6]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
    20     RenderSVGRect {rect} at (6,122) size 113x103 [fill={[type=SOLID] [color=#008000]}] [x=5.00] [y=5.00] [width=90.00] [height=90.00]
     17layer at (0,118) size 125x113
     18  RenderSVGRoot {svg} at (0,118) size 125x113
     19    RenderSVGRect {rect} at (0,118) size 125x113 [fill={[type=SOLID] [color=#ADD8E6]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
     20    RenderSVGRect {rect} at (6,123) size 113x102 [fill={[type=SOLID] [color=#008000]}] [x=5.00] [y=5.00] [width=90.00] [height=90.00]
  • trunk/Source/WebCore/ChangeLog

    r121720 r121722  
     12012-07-02  Emil A Eklund  <eae@chromium.org>
     2
     3        Position replaced elements on pixel bounds
     4        https://bugs.webkit.org/show_bug.cgi?id=90354
     5
     6        Reviewed by Eric Seidel.
     7
     8        To avoid sizing and repaint issues we should layout replaced elements on
     9        pixel bounds. We already ensure that replaced elements are sized in full
     10        pixels and that they are painted on pixel bounds. By also ensuring that
     11        they are placed on pixel bounds we avoid pixel having the size be
     12        expanded by pixel snapping and repainting/invalidation rect issues when
     13        scrolling.
     14
     15        Test: fast/repaint/repaint-during-scroll-with-zoom.html
     16
     17        * rendering/RenderBox.cpp:
     18        (WebCore::RenderBox::computePositionedLogicalWidthReplaced):
     19        (WebCore::RenderBox::computePositionedLogicalHeightReplaced):
     20
    1212012-07-02  Nico Weber  <thakis@chromium.org>
    222
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r121602 r121722  
    32663266    LayoutUnit logicalLeftPos = logicalLeftValue + marginLogicalLeftAlias;
    32673267    computeLogicalLeftPositionedOffset(logicalLeftPos, this, logicalWidth(), containerBlock, containerLogicalWidth);
    3268     setLogicalLeft(logicalLeftPos);
     3268    setLogicalLeft(logicalLeftPos.round());
    32693269}
    32703270
     
    33953395    LayoutUnit logicalTopPos = logicalTopValue + marginBeforeAlias;
    33963396    computeLogicalTopPositionedOffset(logicalTopPos, this, logicalHeight(), containerBlock, containerLogicalHeight);
    3397     setLogicalTop(logicalTopPos);
     3397    setLogicalTop(logicalTopPos.round());
    33983398}
    33993399
Note: See TracChangeset for help on using the changeset viewer.