Diff
Modified: trunk/Source/WebCore/ChangeLog (90529 => 90530)
--- trunk/Source/WebCore/ChangeLog 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/ChangeLog 2011-07-07 03:48:15 UTC (rev 90530)
@@ -1,7 +1,46 @@
2011-07-06 Emil A Eklund <[email protected]>
+ Switch absoluteRects to to new layout types
+ https://bugs.webkit.org/show_bug.cgi?id=64035
+
Reviewed by Eric Seidel.
+ Move absoluteRects over to new layout unit abstraction.
+ Add flooredLayoutPoint, mapped to flooredIntPoint.
+
+ No new tests, no functionality changes.
+
+ * rendering/LayoutTypes.h:
+ (WebCore::flooredLayoutPoint):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::absoluteRects):
+ * rendering/RenderBlock.h:
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::absoluteRects):
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::absoluteRects):
+ * rendering/RenderInline.h:
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::absoluteBoundingBoxRect):
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::absoluteRects):
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::absoluteRects):
+ * rendering/RenderText.h:
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::absoluteRects):
+ * rendering/RenderView.h:
+ * rendering/svg/RenderSVGBlock.cpp:
+ (WebCore::RenderSVGBlock::absoluteRects):
+ * rendering/svg/RenderSVGBlock.h:
+ * rendering/svg/RenderSVGModelObject.cpp:
+ (WebCore::RenderSVGModelObject::absoluteRects):
+ * rendering/svg/RenderSVGModelObject.h:
+
+2011-07-06 Emil A Eklund <[email protected]>
+
+ Reviewed by Eric Seidel.
+
Switch offsetFromContainer and related to to new layout types
https://bugs.webkit.org/show_bug.cgi?id=63659
Modified: trunk/Source/WebCore/rendering/LayoutTypes.h (90529 => 90530)
--- trunk/Source/WebCore/rendering/LayoutTypes.h 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/LayoutTypes.h 2011-07-07 03:48:15 UTC (rev 90530)
@@ -57,6 +57,11 @@
return roundedIntPoint(p);
}
+inline LayoutPoint flooredLayoutPoint(const FloatPoint& p)
+{
+ return flooredIntPoint(p);
+}
+
inline LayoutUnit roundedLayoutUnit(float value)
{
return lroundf(value);
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (90529 => 90530)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-07-07 03:48:15 UTC (rev 90530)
@@ -5713,7 +5713,7 @@
m_rareData->m_pageLogicalOffset = logicalOffset;
}
-void RenderBlock::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset)
+void RenderBlock::absoluteRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset)
{
// For blocks inside inlines, we go ahead and include margins so that we run right up to the
// inline boxes above and below us (thus getting merged with them to form a single irregular
@@ -5721,12 +5721,12 @@
if (isAnonymousBlockContinuation()) {
// FIXME: This is wrong for block-flows that are horizontal.
// https://bugs.webkit.org/show_bug.cgi?id=46781
- rects.append(IntRect(accumulatedOffset.x(), accumulatedOffset.y() - collapsedMarginBefore(),
- width(), height() + collapsedMarginBefore() + collapsedMarginAfter()));
- continuation()->absoluteRects(rects, accumulatedOffset - toSize(location() +
+ rects.append(LayoutRect(accumulatedOffset.x(), accumulatedOffset.y() - collapsedMarginBefore(),
+ width(), height() + collapsedMarginBefore() + collapsedMarginAfter()));
+ continuation()->absoluteRects(rects, accumulatedOffset - toLayoutSize(location() +
inlineElementContinuation()->containingBlock()->location()));
} else
- rects.append(IntRect(accumulatedOffset, size()));
+ rects.append(LayoutRect(accumulatedOffset, size()));
}
void RenderBlock::absoluteQuads(Vector<FloatQuad>& quads)
Modified: trunk/Source/WebCore/rendering/RenderBlock.h (90529 => 90530)
--- trunk/Source/WebCore/rendering/RenderBlock.h 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/RenderBlock.h 2011-07-07 03:48:15 UTC (rev 90530)
@@ -629,7 +629,7 @@
int logicalLeftSelectionOffset(RenderBlock* rootBlock, int position);
int logicalRightSelectionOffset(RenderBlock* rootBlock, int position);
- virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset);
+ virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset);
virtual void absoluteQuads(Vector<FloatQuad>&);
int desiredColumnWidth() const;
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (90529 => 90530)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2011-07-07 03:48:15 UTC (rev 90530)
@@ -459,9 +459,9 @@
layer()->scrollToYOffset(newTop, RenderLayer::ScrollOffsetClamped);
}
-void RenderBox::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset)
+void RenderBox::absoluteRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset)
{
- rects.append(IntRect(accumulatedOffset, size()));
+ rects.append(LayoutRect(accumulatedOffset, size()));
}
void RenderBox::absoluteQuads(Vector<FloatQuad>& quads)
Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (90529 => 90530)
--- trunk/Source/WebCore/rendering/RenderInline.cpp 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp 2011-07-07 03:48:15 UTC (rev 90530)
@@ -465,22 +465,22 @@
m_lineBoxes.paint(this, paintInfo, paintOffset);
}
-void RenderInline::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset)
+void RenderInline::absoluteRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset)
{
if (!alwaysCreateLineBoxes())
- culledInlineAbsoluteRects(this, rects, toSize(accumulatedOffset));
+ culledInlineAbsoluteRects(this, rects, toLayoutSize(accumulatedOffset));
else if (InlineFlowBox* curr = firstLineBox()) {
for (; curr; curr = curr->nextLineBox())
- rects.append(enclosingIntRect(FloatRect(accumulatedOffset + curr->topLeft(), curr->size())));
+ rects.append(enclosingLayoutRect(FloatRect(accumulatedOffset + curr->topLeft(), curr->size())));
} else
- rects.append(IntRect(accumulatedOffset, IntSize()));
+ rects.append(LayoutRect(accumulatedOffset, LayoutSize()));
if (continuation()) {
if (continuation()->isBox()) {
RenderBox* box = toRenderBox(continuation());
- continuation()->absoluteRects(rects, toPoint(accumulatedOffset - containingBlock()->location() + box->size()));
+ continuation()->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location() + box->size()));
} else
- continuation()->absoluteRects(rects, toPoint(accumulatedOffset - containingBlock()->location()));
+ continuation()->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location()));
}
}
Modified: trunk/Source/WebCore/rendering/RenderInline.h (90529 => 90530)
--- trunk/Source/WebCore/rendering/RenderInline.h 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/RenderInline.h 2011-07-07 03:48:15 UTC (rev 90530)
@@ -48,7 +48,7 @@
virtual LayoutUnit marginStart() const;
virtual LayoutUnit marginEnd() const;
- virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset);
+ virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset);
virtual void absoluteQuads(Vector<FloatQuad>&);
virtual LayoutSize offsetFromContainer(RenderObject*, const LayoutPoint&) const;
Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (90529 => 90530)
--- trunk/Source/WebCore/rendering/RenderObject.cpp 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp 2011-07-07 03:48:15 UTC (rev 90530)
@@ -1107,7 +1107,7 @@
FloatPoint absPos = localToAbsolute();
Vector<IntRect> rects;
- absoluteRects(rects, flooredIntPoint(absPos));
+ absoluteRects(rects, flooredLayoutPoint(absPos));
size_t n = rects.size();
if (!n)
Modified: trunk/Source/WebCore/rendering/RenderObject.h (90529 => 90530)
--- trunk/Source/WebCore/rendering/RenderObject.h 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/RenderObject.h 2011-07-07 03:48:15 UTC (rev 90530)
@@ -592,7 +592,7 @@
// Return the offset from an object up the container() chain. Asserts that none of the intermediate objects have transforms.
LayoutSize offsetFromAncestorContainer(RenderObject*) const;
- virtual void absoluteRects(Vector<IntRect>&, const IntPoint&) { }
+ virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint&) { }
// FIXME: useTransforms should go away eventually
IntRect absoluteBoundingBoxRect(bool useTransforms = false);
Modified: trunk/Source/WebCore/rendering/RenderText.cpp (90529 => 90530)
--- trunk/Source/WebCore/rendering/RenderText.cpp 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/RenderText.cpp 2011-07-07 03:48:15 UTC (rev 90530)
@@ -269,10 +269,10 @@
return (e && e->isTextNode()) ? static_cast<Text*>(e)->dataImpl() : 0;
}
-void RenderText::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset)
+void RenderText::absoluteRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset)
{
for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
- rects.append(enclosingIntRect(FloatRect(accumulatedOffset + box->topLeft(), box->size())));
+ rects.append(enclosingLayoutRect(FloatRect(accumulatedOffset + box->topLeft(), box->size())));
}
void RenderText::absoluteRectsForRange(Vector<IntRect>& rects, unsigned start, unsigned end, bool useSelectionHeight)
Modified: trunk/Source/WebCore/rendering/RenderText.h (90529 => 90530)
--- trunk/Source/WebCore/rendering/RenderText.h 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/RenderText.h 2011-07-07 03:48:15 UTC (rev 90530)
@@ -56,7 +56,7 @@
InlineTextBox* createInlineTextBox();
void dirtyLineBoxes(bool fullLayout);
- virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset);
+ virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset);
void absoluteRectsForRange(Vector<IntRect>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false);
virtual void absoluteQuads(Vector<FloatQuad>&);
Modified: trunk/Source/WebCore/rendering/RenderView.cpp (90529 => 90530)
--- trunk/Source/WebCore/rendering/RenderView.cpp 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/RenderView.cpp 2011-07-07 03:48:15 UTC (rev 90530)
@@ -322,9 +322,9 @@
rect = m_layer->transform()->mapRect(rect);
}
-void RenderView::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset)
+void RenderView::absoluteRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset)
{
- rects.append(IntRect(accumulatedOffset, m_layer->size()));
+ rects.append(LayoutRect(accumulatedOffset, m_layer->size()));
}
void RenderView::absoluteQuads(Vector<FloatQuad>& quads)
Modified: trunk/Source/WebCore/rendering/RenderView.h (90529 => 90530)
--- trunk/Source/WebCore/rendering/RenderView.h 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/RenderView.h 2011-07-07 03:48:15 UTC (rev 90530)
@@ -82,7 +82,7 @@
bool printing() const;
- virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset);
+ virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset);
virtual void absoluteQuads(Vector<FloatQuad>&);
#if USE(ACCELERATED_COMPOSITING)
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGBlock.cpp (90529 => 90530)
--- trunk/Source/WebCore/rendering/svg/RenderSVGBlock.cpp 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGBlock.cpp 2011-07-07 03:48:15 UTC (rev 90530)
@@ -68,7 +68,7 @@
setHasOverflowClip(false);
}
-void RenderSVGBlock::absoluteRects(Vector<IntRect>&, const IntPoint&)
+void RenderSVGBlock::absoluteRects(Vector<LayoutRect>&, const LayoutPoint&)
{
// This code path should never be taken for SVG, as we're assuming useTransforms=true everywhere, absoluteQuads should be used.
ASSERT_NOT_REACHED();
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGBlock.h (90529 => 90530)
--- trunk/Source/WebCore/rendering/svg/RenderSVGBlock.h 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGBlock.h 2011-07-07 03:48:15 UTC (rev 90530)
@@ -36,7 +36,7 @@
virtual void setStyle(PassRefPtr<RenderStyle>);
virtual void updateBoxModelInfoFromStyle();
- virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset);
+ virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset);
virtual void destroy();
virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp (90529 => 90530)
--- trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp 2011-07-07 03:48:15 UTC (rev 90530)
@@ -70,7 +70,7 @@
return containerRelativeQuad.enclosingBoundingBox();
}
-void RenderSVGModelObject::absoluteRects(Vector<IntRect>&, const IntPoint&)
+void RenderSVGModelObject::absoluteRects(Vector<LayoutRect>&, const LayoutPoint&)
{
// This code path should never be taken for SVG, as we're assuming useTransforms=true everywhere, absoluteQuads should be used.
ASSERT_NOT_REACHED();
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.h (90529 => 90530)
--- trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.h 2011-07-07 03:42:02 UTC (rev 90529)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.h 2011-07-07 03:48:15 UTC (rev 90530)
@@ -55,7 +55,7 @@
virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false);
virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer, IntPoint*) const;
- virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset);
+ virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset);
virtual void absoluteQuads(Vector<FloatQuad>&);
virtual void destroy();