Modified: branches/subpixellayout/Source/WebCore/rendering/RenderBox.cpp (109388 => 109389)
--- branches/subpixellayout/Source/WebCore/rendering/RenderBox.cpp 2012-03-01 20:15:12 UTC (rev 109388)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderBox.cpp 2012-03-01 20:20:41 UTC (rev 109389)
@@ -1482,7 +1482,7 @@
// our object was inline originally, since otherwise it would have ended up underneath
// the inlines.
RootInlineBox* root = box->root();
- root->block()->setStaticInlinePositionForChild(this, root->lineTopWithLeading(), LayoutUnit(box->logicalLeft()));
+ root->block()->setStaticInlinePositionForChild(this, root->lineTopWithLeading(), roundedLayoutUnit(box->logicalLeft()));
if (style()->hasStaticInlinePosition(box->isHorizontal()))
setChildNeedsLayout(true, false); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
} else {
@@ -2032,7 +2032,7 @@
// https://bugs.webkit.org/show_bug.cgi?id=46418
RenderStyle* styleToUse = style();
if (hasOverrideHeight() && parent()->isFlexibleBoxIncludingDeprecated())
- h = Length((overrideHeight() - borderAndPaddingLogicalHeight()), Fixed);
+ h = Length(overrideHeight() - borderAndPaddingLogicalHeight(), Fixed);
else if (treatAsReplaced)
h = Length(computeReplacedLogicalHeight(), Fixed);
else {
@@ -2634,7 +2634,7 @@
}
if (stretchesToMinIntrinsicLogicalWidth() && logicalWidth() < minPreferredLogicalWidth() - bordersPlusPadding) {
- computePositionedLogicalWidthUsing(Length((minPreferredLogicalWidth() - bordersPlusPadding), Fixed), containerBlock, containerDirection,
+ computePositionedLogicalWidthUsing(Length(minPreferredLogicalWidth() - bordersPlusPadding, Fixed), containerBlock, containerDirection,
containerLogicalWidth, bordersPlusPadding,
logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
logicalWidthResult, marginLogicalLeftAlias, marginLogicalRightAlias, logicalLeftResult);
@@ -3479,7 +3479,7 @@
}
// Pass off to the closest child.
- float minDist = numeric_limits<float>::max();
+ LayoutUnit minDist = numeric_limits<LayoutUnit>::max();
RenderBox* closestRenderer = 0;
LayoutPoint adjustedPoint = point;
if (isTableRow())
@@ -3532,7 +3532,7 @@
LayoutSize difference = cmp - point;
- float dist = difference.width() * difference.width() + difference.height() * difference.height();
+ LayoutUnit dist = difference.width() * difference.width() + difference.height() * difference.height();
if (dist < minDist) {
closestRenderer = renderer;
minDist = dist;
@@ -3856,7 +3856,7 @@
flipForWritingMode(rect);
if (hasTransform)
- rect = LayoutRect(layer()->currentTransform().mapRect(FloatRect(rect)));
+ rect = layer()->currentTransform().mapRect(rect);
if (isRelPositioned())
rect.move(relativePositionOffsetX(), relativePositionOffsetY());
@@ -3892,18 +3892,6 @@
return LayoutPoint(point.x() + width() - child->width() - (2 * child->x()), point.y());
}
-void RenderBox::flipForWritingMode(IntRect& rect) const
-{
- if (!style()->isFlippedBlocksWritingMode())
- return;
-
- if (isHorizontalWritingMode())
- rect.setY(height() - rect.maxY());
- else
- rect.setX(width() - rect.maxX());
-}
-
-
void RenderBox::flipForWritingMode(LayoutRect& rect) const
{
if (!style()->isFlippedBlocksWritingMode())
@@ -3915,20 +3903,13 @@
rect.setX(width() - rect.maxX());
}
-int RenderBox::flipForWritingMode(int position) const
+LayoutUnit RenderBox::flipForWritingMode(LayoutUnit position) const
{
if (!style()->isFlippedBlocksWritingMode())
return position;
return logicalHeight() - position;
}
-IntPoint RenderBox::flipForWritingMode(const IntPoint& position) const
-{
- if (!style()->isFlippedBlocksWritingMode())
- return position;
- return isHorizontalWritingMode() ? IntPoint(position.x(), height() - position.y()) : IntPoint(width() - position.x(), position.y());
-}
-
LayoutPoint RenderBox::flipForWritingMode(const LayoutPoint& position) const
{
if (!style()->isFlippedBlocksWritingMode())
@@ -3943,13 +3924,6 @@
return toRenderBlock(this)->flipForWritingModeIncludingColumns(point);
}
-IntSize RenderBox::flipForWritingMode(const IntSize& offset) const
-{
- if (!style()->isFlippedBlocksWritingMode())
- return offset;
- return isHorizontalWritingMode() ? IntSize(offset.width(), height() - offset.height()) : IntSize(width() - offset.width(), offset.height());
-}
-
LayoutSize RenderBox::flipForWritingMode(const LayoutSize& offset) const
{
if (!style()->isFlippedBlocksWritingMode())
Modified: branches/subpixellayout/Source/WebCore/rendering/RenderBox.h (109388 => 109389)
--- branches/subpixellayout/Source/WebCore/rendering/RenderBox.h 2012-03-01 20:15:12 UTC (rev 109388)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderBox.h 2012-03-01 20:20:41 UTC (rev 109389)
@@ -51,8 +51,8 @@
LayoutUnit width() const { return m_frameRect.width(); }
LayoutUnit height() const { return m_frameRect.height(); }
- int pixelSnappedWidth() const { return pixelSnappedIntRect(m_frameRect).width(); }
- int pixelSnappedHeight() const { return pixelSnappedIntRect(m_frameRect).height(); }
+ int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); }
+ int pixelSnappedHeight() const { return m_frameRect.pixelSnappedHeight(); }
// These represent your location relative to your container as a physical offset.
// In layout related methods you almost always want the logical location (e.g. x() and y()).
@@ -425,12 +425,9 @@
virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
LayoutPoint flipForWritingModeForChild(const RenderBox* child, const LayoutPoint&) const;
- int flipForWritingMode(int position) const; // The offset is in the block direction (y for horizontal writing modes, x for vertical writing modes).
- IntPoint flipForWritingMode(const IntPoint&) const;
+ LayoutUnit flipForWritingMode(LayoutUnit position) const; // The offset is in the block direction (y for horizontal writing modes, x for vertical writing modes).
LayoutPoint flipForWritingMode(const LayoutPoint&) const;
LayoutPoint flipForWritingModeIncludingColumns(const LayoutPoint&) const;
- IntSize flipForWritingMode(const IntSize&) const;
- void flipForWritingMode(IntRect&) const;
LayoutSize flipForWritingMode(const LayoutSize&) const;
void flipForWritingMode(LayoutRect&) const;
FloatPoint flipForWritingMode(const FloatPoint&) const;