Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutInline.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutInline.cpp b/third_party/WebKit/Source/core/layout/LayoutInline.cpp |
| index beb5baffc3a597e215d6068661403b35f9344e67..06d55bc9cd41b48aa16670380553ab43481942d8 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutInline.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutInline.cpp |
| @@ -1193,9 +1193,9 @@ LayoutRect LayoutInline::visualOverflowRect() const { |
| return overflowRect; |
| } |
| -bool LayoutInline::mapToVisualRectInAncestorSpace( |
| +bool LayoutInline::mapToVisualRectInAncestorSpaceInternal( |
| const LayoutBoxModelObject* ancestor, |
| - LayoutRect& rect, |
| + TransformState& transformState, |
| VisualRectFlags visualRectFlags) const { |
| if (ancestor == this) |
| return true; |
| @@ -1205,26 +1205,39 @@ bool LayoutInline::mapToVisualRectInAncestorSpace( |
| if (!container) |
| return true; |
| + bool preserve3D = |
| + (container->style()->preserves3D() && !container->isText()) || |
| + (style()->preserves3D() && !isText()); |
|
Xianzhu
2017/03/03 01:24:42
Ditto about !isText().
chrishtr
2017/03/03 02:45:11
Done.
|
| + |
| + TransformState::TransformAccumulation accumulation = |
| + preserve3D ? TransformState::AccumulateTransform |
| + : TransformState::FlattenTransform; |
| + |
| if (style()->hasInFlowPosition() && layer()) { |
| // Apply the in-flow position offset when invalidating a rectangle. The |
| // layer is translated, but the layout box isn't, so we need to do this to |
| // get the right dirty rect. Since this is called from LayoutObject:: |
| // setStyle, the relative position flag on the LayoutObject has been |
| // cleared, so use the one on the style(). |
| - rect.move(layer()->offsetForInFlowPosition()); |
| + transformState.move(layer()->offsetForInFlowPosition(), accumulation); |
| } |
| LayoutBox* containerBox = |
| container->isBox() ? toLayoutBox(container) : nullptr; |
| if (containerBox && container != ancestor && |
| - !containerBox->mapScrollingContentsRectToBoxSpace(rect, visualRectFlags)) |
| + !containerBox->mapScrollingContentsRectToBoxSpace( |
| + transformState, accumulation, visualRectFlags)) |
| return false; |
| // TODO(wkorman): Generalize Ruby specialization and/or document more clearly. |
| - if (containerBox && !isRuby()) |
| + if (containerBox && !isRuby()) { |
| + transformState.flatten(); |
| + LayoutRect rect(transformState.lastPlanarQuad().boundingBox()); |
|
Xianzhu
2017/03/03 01:24:42
Do we need enclosingBoundingBox here?
|
| containerBox->flipForWritingMode(rect); |
| - return container->mapToVisualRectInAncestorSpace(ancestor, rect, |
| - visualRectFlags); |
| + transformState.setQuad(FloatQuad(FloatRect(rect))); |
| + } |
| + return container->mapToVisualRectInAncestorSpaceInternal( |
| + ancestor, transformState, visualRectFlags); |
| } |
| LayoutSize LayoutInline::offsetFromContainer( |