Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: third_party/WebKit/WebCore/rendering/RenderObject.cpp

Issue 10670: Do another merge using nifty new merge script (CL for that coming soon). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/WebCore/rendering/RenderObject.cpp
===================================================================
--- third_party/WebKit/WebCore/rendering/RenderObject.cpp (revision 5296)
+++ third_party/WebKit/WebCore/rendering/RenderObject.cpp (working copy)
@@ -1704,9 +1704,22 @@
rects.append(IntRect(tx, ty, width(), height() + borderTopExtra() + borderBottomExtra()));
}
-IntRect RenderObject::absoluteBoundingBoxRect()
+IntRect RenderObject::absoluteBoundingBoxRect(bool useTransforms)
{
- // FIXME: This doesn't work correctly with transforms.
+ if (useTransforms) {
+ Vector<FloatQuad> quads;
+ absoluteQuads(quads);
+
+ size_t n = quads.size();
+ if (!n)
+ return IntRect();
+
+ IntRect result = quads[0].enclosingBoundingBox();
+ for (size_t i = 1; i < n; ++i)
+ result.unite(quads[i].enclosingBoundingBox());
+ return result;
+ }
+
FloatPoint absPos = localToAbsolute();
Vector<IntRect> rects;
absoluteRects(rects, absPos.x(), absPos.y());
@@ -1721,6 +1734,24 @@
return result;
}
+void RenderObject::collectAbsoluteLineBoxQuads(Vector<FloatQuad>& quads, unsigned startOffset, unsigned endOffset, bool useSelectionHeight)
+{
+}
+
+void RenderObject::absoluteQuads(Vector<FloatQuad>& quads, bool topLevel)
+{
+ // 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
+ // shape).
+ if (topLevel && continuation()) {
+ FloatRect localRect(0, -collapsedMarginTop(),
+ width(), height() + collapsedMarginTop() + collapsedMarginBottom());
+ quads.append(localToAbsoluteQuad(localRect));
+ continuation()->absoluteQuads(quads, topLevel);
+ } else
+ quads.append(localToAbsoluteQuad(FloatRect(0, 0, width(), height() + borderTopExtra() + borderBottomExtra())));
+}
+
void RenderObject::addAbsoluteRectForLayer(IntRect& result)
{
if (hasLayer())
@@ -2398,6 +2429,20 @@
return FloatPoint();
}
+FloatQuad RenderObject::localToAbsoluteQuad(const FloatQuad& localQuad, bool fixed) const
+{
+ RenderObject* o = parent();
+ if (o) {
+ FloatQuad quad = localQuad;
+ quad.move(0.0f, static_cast<float>(o->borderTopExtra()));
+ if (o->hasOverflowClip())
+ quad -= o->layer()->scrolledContentOffset();
+ return o->localToAbsoluteQuad(quad, fixed);
+ }
+
+ return FloatQuad();
+}
+
IntRect RenderObject::caretRect(InlineBox* inlineBox, int caretOffset, int* extraWidthToEndOfLine)
{
if (extraWidthToEndOfLine)
@@ -3070,6 +3115,12 @@
return rect;
}
+FloatQuad RenderObject::absoluteContentQuad() const
+{
+ IntRect rect = contentBox();
+ return localToAbsoluteQuad(FloatRect(rect));
+}
+
void RenderObject::adjustRectForOutlineAndShadow(IntRect& rect) const
{
int outlineSize = !isInline() && continuation() ? continuation()->style()->outlineSize() : style()->outlineSize();
« no previous file with comments | « third_party/WebKit/WebCore/rendering/RenderObject.h ('k') | third_party/WebKit/WebCore/rendering/RenderPath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698