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

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

Issue 2727093002: Account for perspective and preserve-3d in mapToVisualRectInAncestorSpace (Closed)
Patch Set: none Created 3 years, 10 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/LayoutInline.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutInline.cpp b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
index beb5baffc3a597e215d6068661403b35f9344e67..0ca9f0c68c9b5df3ea98a2f5e951b0b7f8a226a5 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,37 @@ bool LayoutInline::mapToVisualRectInAncestorSpace(
if (!container)
return true;
+ bool preserve3D = container->style()->preserves3D() || style()->preserves3D();
+
+ 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());
containerBox->flipForWritingMode(rect);
- return container->mapToVisualRectInAncestorSpace(ancestor, rect,
- visualRectFlags);
+ transformState.setQuad(FloatQuad(FloatRect(rect)));
+ }
+ return container->mapToVisualRectInAncestorSpaceInternal(
+ ancestor, transformState, visualRectFlags);
}
LayoutSize LayoutInline::offsetFromContainer(
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutInline.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698