Index: third_party/WebKit/Source/core/layout/LayoutFlowThread.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlowThread.cpp b/third_party/WebKit/Source/core/layout/LayoutFlowThread.cpp |
index 8b4bd6719ef78051ad1afa6a6fe0bc16beb7baa3..1ddbf24ab06c856b1bef4bd5f2c4354835611cf9 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutFlowThread.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutFlowThread.cpp |
@@ -29,6 +29,7 @@ |
#include "core/layout/LayoutFlowThread.h" |
+#include "core/layout/FragmentainerIterator.h" |
#include "core/layout/LayoutMultiColumnSet.h" |
namespace blink { |
@@ -121,6 +122,27 @@ void LayoutFlowThread::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, L |
} |
} |
+void LayoutFlowThread::absoluteQuadsForDescendant(const LayoutBox& descendant, Vector<FloatQuad>& quads) |
+{ |
+ LayoutPoint offsetFromFlowThread; |
+ for (const LayoutObject* object = &descendant; object != this;) { |
+ const LayoutObject* container = object->container(); |
+ offsetFromFlowThread += object->offsetFromContainer(container); |
+ object = container; |
+ } |
+ LayoutRect boundingRectInFlowThread(offsetFromFlowThread, descendant.frameRect().size()); |
+ // Set up a fragments relative to the descendant, in the flow thread coordinate space, and |
+ // convert each of them, individually, to absolute coordinates. |
+ for (FragmentainerIterator iterator(*this, boundingRectInFlowThread); !iterator.atEnd(); iterator.advance()) { |
+ LayoutRect fragment = boundingRectInFlowThread; |
+ // We use inclusiveIntersect() because intersect() would reset the coordinates for |
+ // zero-height objects. |
+ fragment.inclusiveIntersect(iterator.fragmentainerInFlowThread()); |
+ fragment.moveBy(-offsetFromFlowThread); |
+ quads.append(descendant.localToAbsoluteQuad(FloatRect(fragment))); |
+ } |
+} |
+ |
bool LayoutFlowThread::nodeAtPoint(HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction) |
{ |
if (hitTestAction == HitTestBlockBackground) |