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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutFlowThread.cpp

Issue 2360913004: Support for multiple block fragments in getClientRects(). (Closed)
Patch Set: fast/overflow/overflow-height-float-not-removed-crash3.html crashed because saturated LayoutUnits caused zero height Created 4 years, 3 months 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/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)

Powered by Google App Engine
This is Rietveld 408576698