Diff
Added: branches/subpixellayout/LayoutTests/fast/sub-pixel/client-width-height-snapping-expected.txt (0 => 113907)
--- branches/subpixellayout/LayoutTests/fast/sub-pixel/client-width-height-snapping-expected.txt (rev 0)
+++ branches/subpixellayout/LayoutTests/fast/sub-pixel/client-width-height-snapping-expected.txt 2012-04-11 20:57:36 UTC (rev 113907)
@@ -0,0 +1,6 @@
+PASS div.clientWidth is 11
+PASS div.clientHeight is 11
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: branches/subpixellayout/LayoutTests/fast/sub-pixel/client-width-height-snapping.html (0 => 113907)
--- branches/subpixellayout/LayoutTests/fast/sub-pixel/client-width-height-snapping.html (rev 0)
+++ branches/subpixellayout/LayoutTests/fast/sub-pixel/client-width-height-snapping.html 2012-04-11 20:57:36 UTC (rev 113907)
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<div id="TestDiv" style="position: absolute; left: 10.4px; top: 10.4px; width: 10.4px; height: 10.4px;"></div>
+<script>
+
+var div = document.getElementById("TestDiv");
+
+shouldBe('div.clientWidth', '11');
+shouldBe('div.clientHeight', '11');
+
+</script>
+<script src=""
+<script>
+if (window.layoutTestController)
+ layoutTestController.notifyDone();
+</script>
+</body>
+</html>
Modified: branches/subpixellayout/Source/WebCore/css/LengthFunctions.cpp (113906 => 113907)
--- branches/subpixellayout/Source/WebCore/css/LengthFunctions.cpp 2012-04-11 20:51:21 UTC (rev 113906)
+++ branches/subpixellayout/Source/WebCore/css/LengthFunctions.cpp 2012-04-11 20:57:36 UTC (rev 113907)
@@ -29,30 +29,30 @@
namespace WebCore {
-int minimumValueForLength(const Length& length, int maximumValue, RenderView* renderView, bool roundPercentages)
+LayoutUnit minimumValueForLength(const Length& length, LayoutUnit maximumValue, RenderView* renderView, bool roundPercentages)
{
switch (length.type()) {
case Fixed:
return length.value();
case Percent:
if (roundPercentages)
- return static_cast<int>(round(maximumValue * length.percent() / 100.0f));
+ return static_cast<LayoutUnit>(round(maximumValue * length.percent() / 100.0f));
// Don't remove the extra cast to float. It is needed for rounding on 32-bit Intel machines that use the FPU stack.
- return static_cast<int>(static_cast<float>(maximumValue * length.percent() / 100.0f));
+ return static_cast<LayoutUnit>(static_cast<float>(maximumValue * length.percent() / 100.0f));
case Calculated:
return length.nonNanCalculatedValue(maximumValue);
case ViewportPercentageWidth:
if (renderView)
- return static_cast<int>(renderView->viewportSize().width() * length.viewportPercentageLength() / 100.0f);
+ return static_cast<LayoutUnit>(renderView->viewportSize().width() * length.viewportPercentageLength() / 100.0f);
return 0;
case ViewportPercentageHeight:
if (renderView)
- return static_cast<int>(renderView->viewportSize().height() * length.viewportPercentageLength() / 100.0f);
+ return static_cast<LayoutUnit>(renderView->viewportSize().height() * length.viewportPercentageLength() / 100.0f);
return 0;
case ViewportPercentageMin:
if (renderView) {
IntSize viewportSize = renderView->viewportSize();
- return static_cast<int>(std::min(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f);
+ return static_cast<LayoutUnit>(std::min(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f);
}
return 0;
case Auto:
@@ -68,7 +68,7 @@
return 0;
}
-int valueForLength(const Length& length, int maximumValue, RenderView* renderView, bool roundPercentages)
+LayoutUnit valueForLength(const Length& length, LayoutUnit maximumValue, RenderView* renderView, bool roundPercentages)
{
switch (length.type()) {
case Fixed:
Modified: branches/subpixellayout/Source/WebCore/css/LengthFunctions.h (113906 => 113907)
--- branches/subpixellayout/Source/WebCore/css/LengthFunctions.h 2012-04-11 20:51:21 UTC (rev 113906)
+++ branches/subpixellayout/Source/WebCore/css/LengthFunctions.h 2012-04-11 20:57:36 UTC (rev 113907)
@@ -31,8 +31,8 @@
class RenderView;
-int minimumValueForLength(const Length&, int maximumValue, RenderView* = 0, bool roundPercentages = false);
-int valueForLength(const Length&, int maximumValue, RenderView* = 0, bool roundPercentages = false);
+LayoutUnit minimumValueForLength(const Length&, LayoutUnit maximumValue, RenderView* = 0, bool roundPercentages = false);
+LayoutUnit valueForLength(const Length&, LayoutUnit maximumValue, RenderView* = 0, bool roundPercentages = false);
float floatValueForLength(const Length&, int maximumValue, RenderView* = 0);
float floatValueForLength(const Length&, float maximumValue, RenderView* = 0);
Modified: branches/subpixellayout/Source/WebCore/dom/Document.cpp (113906 => 113907)
--- branches/subpixellayout/Source/WebCore/dom/Document.cpp 2012-04-11 20:51:21 UTC (rev 113906)
+++ branches/subpixellayout/Source/WebCore/dom/Document.cpp 2012-04-11 20:57:36 UTC (rev 113907)
@@ -1850,10 +1850,10 @@
// The percentage is calculated with respect to the width even for margin top and bottom.
// http://www.w3.org/TR/CSS2/box.html#margin-properties
- marginTop = style->marginTop().isAuto() ? marginTop : valueForLength(style->marginTop(), width, view);
- marginRight = style->marginRight().isAuto() ? marginRight : valueForLength(style->marginRight(), width, view);
- marginBottom = style->marginBottom().isAuto() ? marginBottom : valueForLength(style->marginBottom(), width, view);
- marginLeft = style->marginLeft().isAuto() ? marginLeft : valueForLength(style->marginLeft(), width, view);
+ marginTop = style->marginTop().isAuto() ? marginTop : static_cast<int>(valueForLength(style->marginTop(), width, view));
+ marginRight = style->marginRight().isAuto() ? marginRight : static_cast<int>(valueForLength(style->marginRight(), width, view));
+ marginBottom = style->marginBottom().isAuto() ? marginBottom : static_cast<int>(valueForLength(style->marginBottom(), width, view));
+ marginLeft = style->marginLeft().isAuto() ? marginLeft : static_cast<int>(valueForLength(style->marginLeft(), width, view));
}
void Document::setIsViewSource(bool isViewSource)
Modified: branches/subpixellayout/Source/WebCore/rendering/RenderFrameSet.cpp (113906 => 113907)
--- branches/subpixellayout/Source/WebCore/rendering/RenderFrameSet.cpp 2012-04-11 20:51:21 UTC (rev 113906)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderFrameSet.cpp 2012-04-11 20:57:36 UTC (rev 113907)
@@ -223,7 +223,7 @@
// Count the total percentage of all of the percentage columns/rows -> totalPercent
// Count the number of columns/rows which are percentages -> countPercent
if (grid[i].isPercent()) {
- gridLayout[i] = max(valueForLength(grid[i], availableLen), 0);
+ gridLayout[i] = max<int>(valueForLength(grid[i], availableLen), 0);
totalPercent += gridLayout[i];
countPercent++;
}
Modified: branches/subpixellayout/Source/WebCore/rendering/RenderMarquee.cpp (113906 => 113907)
--- branches/subpixellayout/Source/WebCore/rendering/RenderMarquee.cpp 2012-04-11 20:51:21 UTC (rev 113906)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderMarquee.cpp 2012-04-11 20:57:36 UTC (rev 113907)
@@ -289,7 +289,7 @@
}
bool positive = range > 0;
int clientSize = (isHorizontal() ? m_layer->renderBox()->clientWidth() : m_layer->renderBox()->clientHeight());
- int increment = abs(valueForLength(m_layer->renderer()->style()->marqueeIncrement(), clientSize));
+ int increment = abs(static_cast<int>(valueForLength(m_layer->renderer()->style()->marqueeIncrement(), clientSize)));
int currentPos = (isHorizontal() ? m_layer->scrollXOffset() : m_layer->scrollYOffset());
newPos = currentPos + (addIncrement ? increment : -increment);
if (positive)
Modified: branches/subpixellayout/Source/WebCore/rendering/RenderTable.cpp (113906 => 113907)
--- branches/subpixellayout/Source/WebCore/rendering/RenderTable.cpp 2012-04-11 20:51:21 UTC (rev 113906)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderTable.cpp 2012-04-11 20:57:36 UTC (rev 113907)
@@ -629,7 +629,7 @@
if (!paintInfo.shouldPaintWithinRoot(this))
return;
- LayoutRect rect(paintOffset, size());
+ LayoutRect rect(paintOffset, flooredIntSize(size()));
subtractCaptionRect(rect);
if (!boxShadowShouldBeAppliedToBackground(determineBackgroundBleedAvoidance(paintInfo.context)))
Modified: branches/subpixellayout/Source/WebCore/rendering/RenderTableSection.cpp (113906 => 113907)
--- branches/subpixellayout/Source/WebCore/rendering/RenderTableSection.cpp 2012-04-11 20:51:21 UTC (rev 113906)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderTableSection.cpp 2012-04-11 20:57:36 UTC (rev 113907)
@@ -334,7 +334,7 @@
LayoutUnit baselineDescent = 0;
// Our base size is the biggest logical height from our cells' styles (excluding row spanning cells).
- m_rowPos[r + 1] = max(m_rowPos[r] + minimumValueForLength(m_grid[r].logicalHeight, 0, viewRenderer), 0);
+ m_rowPos[r + 1] = max(m_rowPos[r] + static_cast<int>(minimumValueForLength(m_grid[r].logicalHeight, 0, viewRenderer)), 0);
Row& row = m_grid[r].row;
unsigned totalCols = row.size();