summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpilgrim <pilgrim@chromium.org>2015-12-11 16:00:40 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-12 00:01:34 +0000
commitef8e116de39bc2c321cb120f5d5e1f2b8c6d1d98 (patch)
tree418868c6384ac5d62dbd0e52244c6e3c3ff156fe
parent4514a7974f1acd2cd696aa3e1833c2e7be970668 (diff)
downloadchromium_src-ef8e116de39bc2c321cb120f5d5e1f2b8c6d1d98.zip
chromium_src-ef8e116de39bc2c321cb120f5d5e1f2b8c6d1d98.tar.gz
chromium_src-ef8e116de39bc2c321cb120f5d5e1f2b8c6d1d98.tar.bz2
[Line Layout API] Convert InlineFlowBox::isLastChildForLayoutObject to new line layout API
This function originally took to LayoutObject*, one of which was the inline flow box's own layout object, access to which is going away. There are no functional changes. BUG=499321 Review URL: https://codereview.chromium.org/1516103004 Cr-Commit-Position: refs/heads/master@{#364842}
-rw-r--r--third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp b/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
index 21373a0..27a1ee1 100644
--- a/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
+++ b/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
@@ -268,7 +268,7 @@ LineBoxList* InlineFlowBox::lineBoxes() const
return LineLayoutInline(lineLayoutItem()).lineBoxes();
}
-static inline bool isLastChildForLayoutObject(LayoutObject* ancestor, LayoutObject* child)
+static inline bool isLastChildForLayoutObject(LineLayoutItem ancestor, LineLayoutItem child)
{
if (!child)
return false;
@@ -276,16 +276,16 @@ static inline bool isLastChildForLayoutObject(LayoutObject* ancestor, LayoutObje
if (child == ancestor)
return true;
- LayoutObject* curr = child;
- LayoutObject* parent = curr->parent();
- while (parent && (!parent->isLayoutBlock() || parent->isInline())) {
- if (parent->slowLastChild() != curr)
+ LineLayoutItem curr = child;
+ LineLayoutItem parent = curr.parent();
+ while (parent && (!parent.isLayoutBlock() || parent.isInline())) {
+ if (parent.slowLastChild() != curr)
return false;
if (parent == ancestor)
return true;
curr = parent;
- parent = curr->parent();
+ parent = curr.parent();
}
return true;
@@ -327,7 +327,8 @@ void InlineFlowBox::determineSpacingForFlowBoxes(bool lastLine, bool isLogically
if (!lineBoxList->lastLineBox()->isConstructed()) {
LayoutInline& inlineFlow = toLayoutInline(layoutObject());
- bool isLastObjectOnLine = !isAncestorAndWithinBlock(lineLayoutItem(), LineLayoutItem(logicallyLastRunLayoutObject)) || (isLastChildForLayoutObject(&layoutObject(), logicallyLastRunLayoutObject) && !isLogicallyLastRunWrapped);
+ LineLayoutItem logicallyLastRunLayoutItem = LineLayoutItem(logicallyLastRunLayoutObject);
+ bool isLastObjectOnLine = !isAncestorAndWithinBlock(lineLayoutItem(), logicallyLastRunLayoutItem) || (isLastChildForLayoutObject(lineLayoutItem(), logicallyLastRunLayoutItem) && !isLogicallyLastRunWrapped);
// We include the border under these conditions:
// (1) The next line was not created, or it is constructed. We check the previous line for rtl.