Diff
Modified: trunk/Source/WebCore/ChangeLog (109804 => 109805)
--- trunk/Source/WebCore/ChangeLog 2012-03-05 22:53:43 UTC (rev 109804)
+++ trunk/Source/WebCore/ChangeLog 2012-03-05 22:58:55 UTC (rev 109805)
@@ -1,3 +1,46 @@
+2012-03-05 Emil A Eklund <[email protected]>
+
+ Replace uses of x(), y() and width(), height() pairs with locationOffset and size()
+ https://bugs.webkit.org/show_bug.cgi?id=80196
+
+ Reviewed by Julien Chaffraix.
+
+ Replace IntSize(x(), y()) with locationOffset()
+ Replace IntSize(width(), height()) with size()
+ Replace IntRect(0, 0, width(), height()) with IntRect(IntPoint(), size())
+ Replace IntRect::move(x(), y()) with IntRect::move(locationOffset())
+
+ No new tests.
+
+ * html/HTMLCanvasElement.cpp:
+ (WebCore::HTMLCanvasElement::createImageBuffer):
+ (WebCore::HTMLCanvasElement::baseTransform):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::simplifiedLayout):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::mapLocalToContainer):
+ (WebCore::RenderBox::computeRectForRepaint):
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::borderBoxRect):
+ * rendering/RenderDeprecatedFlexibleBox.cpp:
+ (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::layoutBlock):
+ * rendering/RenderListMarker.cpp:
+ (WebCore::RenderListMarker::localSelectionRect):
+ * rendering/RenderReplaced.cpp:
+ (WebCore::RenderReplaced::localSelectionRect):
+ * rendering/RenderScrollbar.cpp:
+ (WebCore::RenderScrollbar::updateScrollbarParts):
+ (WebCore::RenderScrollbar::buttonRect):
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::setCellLogicalWidths):
+ (WebCore::RenderTableSection::layoutRows):
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::viewRect):
+ * rendering/svg/RenderSVGRoot.cpp:
+ (WebCore::RenderSVGRoot::layout):
+
2012-03-05 Anders Carlsson <[email protected]>
Always update the scroll layer position on the main thread when we have an overlay
Modified: trunk/Source/WebCore/html/HTMLCanvasElement.cpp (109804 => 109805)
--- trunk/Source/WebCore/html/HTMLCanvasElement.cpp 2012-03-05 22:53:43 UTC (rev 109804)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.cpp 2012-03-05 22:58:55 UTC (rev 109805)
@@ -490,7 +490,7 @@
m_hasCreatedImageBuffer = true;
- FloatSize logicalSize(width(), height());
+ FloatSize logicalSize = size();
FloatSize deviceSize = convertLogicalToDevice(logicalSize);
if (!deviceSize.isExpressibleAsIntSize())
return;
@@ -572,7 +572,7 @@
AffineTransform HTMLCanvasElement::baseTransform() const
{
ASSERT(m_hasCreatedImageBuffer);
- FloatSize unscaledSize(width(), height());
+ FloatSize unscaledSize = size();
FloatSize deviceSize = convertLogicalToDevice(unscaledSize);
IntSize size(deviceSize.width(), deviceSize.height());
AffineTransform transform;
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (109804 => 109805)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2012-03-05 22:53:43 UTC (rev 109804)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2012-03-05 22:58:55 UTC (rev 109805)
@@ -2439,7 +2439,7 @@
if ((!posChildNeedsLayout() && !needsSimplifiedNormalFlowLayout()) || normalChildNeedsLayout() || selfNeedsLayout())
return false;
- LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), hasColumns() || hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(view(), this, locationOffset(), hasColumns() || hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
if (needsPositionedMovementLayout() && !tryLayoutDoingPositionedMovementOnly())
return false;
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (109804 => 109805)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2012-03-05 22:53:43 UTC (rev 109804)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2012-03-05 22:58:55 UTC (rev 109805)
@@ -1357,8 +1357,7 @@
if (RenderView* v = view()) {
if (v->layoutStateEnabled() && !repaintContainer) {
LayoutState* layoutState = v->layoutState();
- LayoutSize offset = layoutState->m_paintOffset;
- offset.expand(x(), y());
+ LayoutSize offset = layoutState->m_paintOffset + locationOffset();
if (style()->position() == RelativePosition && layer())
offset += layer()->relativePositionOffset();
transformState.move(offset);
@@ -1608,7 +1607,7 @@
#endif
LayoutPoint topLeft = rect.location();
- topLeft.move(x(), y());
+ topLeft.move(locationOffset());
EPosition position = styleToUse->position();
@@ -1618,7 +1617,7 @@
fixed = position == FixedPosition;
rect = layer()->transform()->mapRect(rect);
topLeft = rect.location();
- topLeft.move(x(), y());
+ topLeft.move(locationOffset());
} else if (position == FixedPosition)
fixed = true;
Modified: trunk/Source/WebCore/rendering/RenderBox.h (109804 => 109805)
--- trunk/Source/WebCore/rendering/RenderBox.h 2012-03-05 22:53:43 UTC (rev 109804)
+++ trunk/Source/WebCore/rendering/RenderBox.h 2012-03-05 22:58:55 UTC (rev 109805)
@@ -127,7 +127,7 @@
LayoutRect frameRect() const { return m_frameRect; }
void setFrameRect(const LayoutRect& rect) { m_frameRect = rect; }
- LayoutRect borderBoxRect() const { return LayoutRect(0, 0, width(), height()); }
+ LayoutRect borderBoxRect() const { return LayoutRect(LayoutPoint(), size()); }
virtual LayoutRect borderBoundingBox() const { return borderBoxRect(); }
// The content area of the box (excludes padding and border).
Modified: trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp (109804 => 109805)
--- trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp 2012-03-05 22:53:43 UTC (rev 109804)
+++ trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp 2012-03-05 22:58:55 UTC (rev 109805)
@@ -226,7 +226,7 @@
return;
LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
- LayoutStateMaintainer statePusher(view(), this, LayoutSize(x(), y()), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
if (inRenderFlowThread()) {
// Regions changing widths can force us to relayout our children.
Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (109804 => 109805)
--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp 2012-03-05 22:53:43 UTC (rev 109804)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp 2012-03-05 22:58:55 UTC (rev 109805)
@@ -203,7 +203,7 @@
return;
LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
- LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
if (inRenderFlowThread()) {
// Regions changing widths can force us to relayout our children.
Modified: trunk/Source/WebCore/rendering/RenderListMarker.cpp (109804 => 109805)
--- trunk/Source/WebCore/rendering/RenderListMarker.cpp 2012-03-05 22:53:43 UTC (rev 109804)
+++ trunk/Source/WebCore/rendering/RenderListMarker.cpp 2012-03-05 22:58:55 UTC (rev 109805)
@@ -1094,7 +1094,7 @@
{
InlineBox* box = inlineBoxWrapper();
if (!box)
- return IntRect(0, 0, width(), height());
+ return IntRect(IntPoint(), size());
RootInlineBox* root = m_inlineBoxWrapper->root();
int newLogicalTop = root->block()->style()->isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - root->selectionBottom() : root->selectionTop() - m_inlineBoxWrapper->logicalTop();
if (root->block()->style()->isHorizontalWritingMode())
Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (109804 => 109805)
--- trunk/Source/WebCore/rendering/RenderReplaced.cpp 2012-03-05 22:53:43 UTC (rev 109804)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp 2012-03-05 22:58:55 UTC (rev 109805)
@@ -495,7 +495,7 @@
if (!m_inlineBoxWrapper)
// We're a block-level replaced element. Just return our own dimensions.
- return IntRect(0, 0, width(), height());
+ return IntRect(IntPoint(), size());
RootInlineBox* root = m_inlineBoxWrapper->root();
int newLogicalTop = root->block()->style()->isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - root->selectionBottom() : root->selectionTop() - m_inlineBoxWrapper->logicalTop();
Modified: trunk/Source/WebCore/rendering/RenderScrollbar.cpp (109804 => 109805)
--- trunk/Source/WebCore/rendering/RenderScrollbar.cpp 2012-03-05 22:53:43 UTC (rev 109804)
+++ trunk/Source/WebCore/rendering/RenderScrollbar.cpp 2012-03-05 22:58:55 UTC (rev 109805)
@@ -202,7 +202,7 @@
}
if (newThickness != oldThickness) {
- setFrameRect(IntRect(x(), y(), isHorizontal ? width() : newThickness, isHorizontal ? newThickness : height()));
+ setFrameRect(IntRect(location(), IntSize(isHorizontal ? width() : newThickness, isHorizontal ? newThickness : height())));
if (RenderBox* box = owningRenderer())
box->setChildNeedsLayout(true);
}
@@ -297,7 +297,7 @@
bool isHorizontal = orientation() == HorizontalScrollbar;
if (partType == BackButtonStartPart)
- return IntRect(x(), y(), isHorizontal ? partRenderer->width() : width(), isHorizontal ? height() : partRenderer->height());
+ return IntRect(location(), IntSize(isHorizontal ? partRenderer->width() : width(), isHorizontal ? height() : partRenderer->height()));
if (partType == ForwardButtonEndPart)
return IntRect(isHorizontal ? x() + width() - partRenderer->width() : x(),
Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (109804 => 109805)
--- trunk/Source/WebCore/rendering/RenderTableSection.cpp 2012-03-05 22:53:43 UTC (rev 109804)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp 2012-03-05 22:58:55 UTC (rev 109805)
@@ -304,7 +304,7 @@
if (!statePusher.didPush()) {
// Technically, we should also push state for the row, but since
// rows don't push a coordinate transform, that's not necessary.
- statePusher.push(this, LayoutSize(x(), y()));
+ statePusher.push(this, locationOffset());
}
cell->repaint();
}
@@ -502,7 +502,7 @@
int vspacing = table()->vBorderSpacing();
unsigned nEffCols = table()->numEffCols();
- LayoutStateMaintainer statePusher(view(), this, LayoutSize(x(), y()), style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(view(), this, locationOffset(), style()->isFlippedBlocksWritingMode());
for (unsigned r = 0; r < totalRows; r++) {
// Set the row's x/y position and width/height.
Modified: trunk/Source/WebCore/rendering/RenderView.cpp (109804 => 109805)
--- trunk/Source/WebCore/rendering/RenderView.cpp 2012-03-05 22:53:43 UTC (rev 109804)
+++ trunk/Source/WebCore/rendering/RenderView.cpp 2012-03-05 22:58:55 UTC (rev 109805)
@@ -703,7 +703,7 @@
IntRect RenderView::viewRect() const
{
if (printing())
- return IntRect(0, 0, width(), height());
+ return IntRect(IntPoint(), size());
if (m_frameView)
return m_frameView->visibleContentRect();
return IntRect();
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp (109804 => 109805)
--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp 2012-03-05 22:53:43 UTC (rev 109804)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp 2012-03-05 22:58:55 UTC (rev 109805)
@@ -218,7 +218,7 @@
bool needsLayout = selfNeedsLayout();
LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && needsLayout);
- LayoutSize oldSize(width(), height());
+ LayoutSize oldSize = size();
computeLogicalWidth();
computeLogicalHeight();
buildLocalToBorderBoxTransform();