Changeset 117388 in webkit


Ignore:
Timestamp:
May 16, 2012 8:37:21 PM (12 years ago)
Author:
leviw@chromium.org
Message:

Use pixelSnappedLogicalHeight for TableSection layout
https://bugs.webkit.org/show_bug.cgi?id=86665

Reviewed by Eric Seidel.

We do table layout using integers to ensure we follow the spec (see
https://trac.webkit.org/wiki/LayoutUnit for details), but were previously
flooring the logical height used in layoutRows. This caused us to mis-
calculate the intrinsic padding and grow cells beyond their proper height.

No new tests. Fully covered by existing tests with sub-pixel enabled.

  • rendering/RenderBox.h:

(WebCore::RenderBox::pixelSnappedLogicalHeight): Added these convenience
methods.
(WebCore::RenderBox::pixelSnappedLogicalWidth):

  • rendering/RenderTableSection.cpp:

(WebCore::RenderTableSection::layoutRows):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r117385 r117388  
     12012-05-16  Levi Weintraub  <leviw@chromium.org>
     2
     3        Use pixelSnappedLogicalHeight for TableSection layout
     4        https://bugs.webkit.org/show_bug.cgi?id=86665
     5
     6        Reviewed by Eric Seidel.
     7
     8        We do table layout using integers to ensure we follow the spec (see
     9        https://trac.webkit.org/wiki/LayoutUnit for details), but were previously
     10        flooring the logical height used in layoutRows. This caused us to mis-
     11        calculate the intrinsic padding and grow cells beyond their proper height.
     12
     13        No new tests. Fully covered by existing tests with sub-pixel enabled.
     14
     15        * rendering/RenderBox.h:
     16        (WebCore::RenderBox::pixelSnappedLogicalHeight): Added these convenience
     17        methods.
     18        (WebCore::RenderBox::pixelSnappedLogicalWidth):
     19        * rendering/RenderTableSection.cpp:
     20        (WebCore::RenderTableSection::layoutRows):
     21
    1222012-05-16  Tony Chang  <tony@chromium.org>
    223
  • trunk/Source/WebCore/rendering/RenderBox.h

    r116446 r117388  
    7474    LayoutUnit logicalHeight() const { return style()->isHorizontalWritingMode() ? height() : width(); }
    7575
     76    int pixelSnappedLogicalHeight() const { return style()->isHorizontalWritingMode() ? pixelSnappedHeight() : pixelSnappedWidth(); }
     77    int pixelSnappedLogicalWidth() const { return style()->isHorizontalWritingMode() ? pixelSnappedWidth() : pixelSnappedHeight(); }
     78
    7679    void setLogicalLeft(LayoutUnit left)
    7780    {
  • trunk/Source/WebCore/rendering/RenderTableSection.cpp

    r117339 r117388  
    619619            int oldIntrinsicPaddingBefore = cell->intrinsicPaddingBefore();
    620620            int oldIntrinsicPaddingAfter = cell->intrinsicPaddingAfter();
    621             int logicalHeightWithoutIntrinsicPadding = cell->logicalHeight() - oldIntrinsicPaddingBefore - oldIntrinsicPaddingAfter;
     621            int logicalHeightWithoutIntrinsicPadding = cell->pixelSnappedLogicalHeight() - oldIntrinsicPaddingBefore - oldIntrinsicPaddingAfter;
    622622
    623623            int intrinsicPaddingBefore = 0;
Note: See TracChangeset for help on using the changeset viewer.