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

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

Issue 1700743002: Merge most of LayoutBox::mapLocalToAncestor() into LayoutObject. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index bee8429e72b67a5571f2c88cbb6c162ebfd60bdc..52b6ac39c50ab18701cdc52660db2e3b66f32b80 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1696,22 +1696,6 @@ LayoutUnit LayoutBox::perpendicularContainingBlockLogicalHeight() const
void LayoutBox::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed, const PaintInvalidationState* paintInvalidationState) const
{
- if (ancestor == this)
- return;
-
- if (paintInvalidationState && paintInvalidationState->canMapToContainer(ancestor)) {
- LayoutSize offset = paintInvalidationState->paintOffset() + locationOffset();
- if (style()->hasInFlowPosition() && layer())
- offset += layer()->offsetForInFlowPosition();
- transformState.move(offset);
- return;
- }
-
- bool ancestorSkipped;
- LayoutObject* o = container(ancestor, &ancestorSkipped);
- if (!o)
- return;
-
bool isFixedPos = style()->position() == FixedPosition;
bool hasTransform = hasLayer() && layer()->transform();
// If this box has a transform, it acts as a fixed position container for fixed descendants,
@@ -1721,31 +1705,7 @@ void LayoutBox::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Transfo
else if (isFixedPos)
mode |= IsFixed;
- if (wasFixed)
- *wasFixed = mode & IsFixed;
-
- LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(transformState.mappedPoint()));
-
- bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || style()->preserves3D());
- if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
- TransformationMatrix t;
- getTransformFromContainer(o, containerOffset, t);
- transformState.applyTransform(t, preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
- } else {
- transformState.move(containerOffset.width(), containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
- }
-
- if (ancestorSkipped) {
- // There can't be a transform between paintInvalidationContainer and o, because transforms create containers, so it should be safe
- // to just subtract the delta between the paintInvalidationContainer and o.
- LayoutSize containerOffset = ancestor->offsetFromAncestorContainer(o);
- transformState.move(-containerOffset.width(), -containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
- return;
- }
-
- mode &= ~ApplyContainerFlip;
-
- o->mapLocalToAncestor(ancestor, transformState, mode, wasFixed);
+ LayoutBoxModelObject::mapLocalToAncestor(ancestor, transformState, mode, wasFixed, paintInvalidationState);
}
void LayoutBox::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState& transformState) const
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698