Title: [117388] trunk/Source/WebCore
- Revision
- 117388
- Author
- le...@chromium.org
- Date
- 2012-05-16 20:37:21 -0700 (Wed, 16 May 2012)
Log 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (117387 => 117388)
--- trunk/Source/WebCore/ChangeLog 2012-05-17 03:35:39 UTC (rev 117387)
+++ trunk/Source/WebCore/ChangeLog 2012-05-17 03:37:21 UTC (rev 117388)
@@ -1,3 +1,24 @@
+2012-05-16 Levi Weintraub <le...@chromium.org>
+
+ 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):
+
2012-05-16 Tony Chang <t...@chromium.org>
rename display:-webkit-flexbox to display:-webkit-flex
Modified: trunk/Source/WebCore/rendering/RenderBox.h (117387 => 117388)
--- trunk/Source/WebCore/rendering/RenderBox.h 2012-05-17 03:35:39 UTC (rev 117387)
+++ trunk/Source/WebCore/rendering/RenderBox.h 2012-05-17 03:37:21 UTC (rev 117388)
@@ -73,6 +73,9 @@
LayoutUnit logicalWidth() const { return style()->isHorizontalWritingMode() ? width() : height(); }
LayoutUnit logicalHeight() const { return style()->isHorizontalWritingMode() ? height() : width(); }
+ int pixelSnappedLogicalHeight() const { return style()->isHorizontalWritingMode() ? pixelSnappedHeight() : pixelSnappedWidth(); }
+ int pixelSnappedLogicalWidth() const { return style()->isHorizontalWritingMode() ? pixelSnappedWidth() : pixelSnappedHeight(); }
+
void setLogicalLeft(LayoutUnit left)
{
if (style()->isHorizontalWritingMode())
Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (117387 => 117388)
--- trunk/Source/WebCore/rendering/RenderTableSection.cpp 2012-05-17 03:35:39 UTC (rev 117387)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp 2012-05-17 03:37:21 UTC (rev 117388)
@@ -618,7 +618,7 @@
int oldIntrinsicPaddingBefore = cell->intrinsicPaddingBefore();
int oldIntrinsicPaddingAfter = cell->intrinsicPaddingAfter();
- int logicalHeightWithoutIntrinsicPadding = cell->logicalHeight() - oldIntrinsicPaddingBefore - oldIntrinsicPaddingAfter;
+ int logicalHeightWithoutIntrinsicPadding = cell->pixelSnappedLogicalHeight() - oldIntrinsicPaddingBefore - oldIntrinsicPaddingAfter;
int intrinsicPaddingBefore = 0;
switch (cell->style()->verticalAlign()) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes