Commit 1708cfe3 authored by pilgrim's avatar pilgrim Committed by Commit bot

[Layout API] Use ownerLayoutItem() in LayoutView (part 2)

Direct access to LayoutPart is deprecated and being removed soon. The
replacement is LayoutPartItem, which routes methods through the new
block layout API. (See linked crbug for details.) This means the
ownerLayoutObject() method is also deprecated, to be replaced with
ownerLayoutItem().

There are no functional changes, although I did need to add two methods
to LayoutBoxItem.

BUG=499321

Review-Url: https://codereview.chromium.org/2268823006
Cr-Commit-Position: refs/heads/master@{#415447}
parent 16d55b8e
......@@ -321,7 +321,8 @@ void LayoutView::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Transf
return;
if (mode & TraverseDocumentBoundaries) {
if (LayoutPart* parentDocLayoutObject = frame()->ownerLayoutObject()) {
LayoutPartItem parentDocLayoutItem = frame()->ownerLayoutItem();
if (!parentDocLayoutItem.isNull()) {
if (!(mode & InputIsInFrameCoordinates)) {
transformState.move(-frame()->view()->scrollOffset());
} else {
......@@ -329,9 +330,9 @@ void LayoutView::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Transf
mode &= ~InputIsInFrameCoordinates;
}
transformState.move(parentDocLayoutObject->contentBoxOffset());
transformState.move(parentDocLayoutItem.contentBoxOffset());
parentDocLayoutObject->mapLocalToAncestor(ancestor, transformState, mode);
parentDocLayoutItem.mapLocalToAncestor(ancestor, transformState, mode);
}
}
}
......
......@@ -72,6 +72,16 @@ public:
return toBox()->overflowClipRect(location, behavior);
}
LayoutSize contentBoxOffset() const
{
return toBox()->contentBoxOffset();
}
void mapLocalToAncestor(const LayoutBoxModelObject* ancestor, TransformState& state, MapCoordinatesFlags flags = ApplyContainerFlip) const
{
toBox()->mapLocalToAncestor(ancestor, state, flags);
}
private:
LayoutBox* toBox()
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment