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

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

Issue 1974323002: Move inlineElementContinuation() to LayoutBlockFlow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review. Created 4 years, 7 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/LayoutBlockFlow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index 1c5a2d9ed0e9e69867a937c85c60985efbb795b9..6abb8c9b86f975b0c840b9de557dbfc8828b50e0 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -2287,6 +2287,12 @@ void LayoutBlockFlow::setStaticInlinePositionForChild(LayoutBox& child, LayoutUn
child.layer()->setStaticInlinePosition(inlinePosition);
}
+LayoutInline* LayoutBlockFlow::inlineElementContinuation() const
+{
+ LayoutBoxModelObject* continuation = this->continuation();
+ return continuation && continuation->isInline() ? toLayoutInline(continuation) : nullptr;
+}
+
void LayoutBlockFlow::addChild(LayoutObject* newChild, LayoutObject* beforeChild)
{
if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) {
@@ -3336,6 +3342,18 @@ bool LayoutBlockFlow::hitTestFloats(HitTestResult& result, const HitTestLocation
return false;
}
+LayoutSize LayoutBlockFlow::accumulateInFlowPositionOffsets() const
+{
+ if (!isAnonymousBlock() || !isInFlowPositioned())
+ return LayoutSize();
+ LayoutSize offset;
+ for (const LayoutObject* p = inlineElementContinuation(); p && p->isLayoutInline(); p = p->parent()) {
+ if (p->isInFlowPositioned())
+ offset += toLayoutInline(p)->offsetForInFlowPosition();
+ }
+ return offset;
+}
+
LayoutUnit LayoutBlockFlow::logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit logicalHeight) const
{
if (m_floatingObjects && m_floatingObjects->hasLeftObjects())
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.h ('k') | third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698