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

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

Issue 1198433002: *** NOT FOR LANDING *** mapLocalToContainer and offsetFromContainer cleanup. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: There's also work that LayoutBoxModelObject::offsetFromContainer could do instead of LayoutObject. Created 5 years, 6 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 | « Source/core/layout/LayoutInline.h ('k') | Source/core/layout/LayoutMultiColumnFlowThread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutInline.cpp
diff --git a/Source/core/layout/LayoutInline.cpp b/Source/core/layout/LayoutInline.cpp
index a7f8d2498b278cc8fcd15b269bcb1b6a5ed8e47a..7fb2268c8141a9111fe60fd1bd20a994e0bb2e57 100644
--- a/Source/core/layout/LayoutInline.cpp
+++ b/Source/core/layout/LayoutInline.cpp
@@ -1126,73 +1126,6 @@ void LayoutInline::mapRectToPaintInvalidationBacking(const LayoutBoxModelObject*
o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, paintInvalidationState);
}
-LayoutSize LayoutInline::offsetFromContainer(const LayoutObject* container, const LayoutPoint& point, bool* offsetDependsOnPoint) const
-{
- ASSERT(container == this->container());
-
- LayoutSize offset;
- if (isRelPositioned())
- offset += offsetForInFlowPosition();
-
- offset += container->columnOffset(point);
-
- if (container->hasOverflowClip())
- offset -= toLayoutBox(container)->scrolledContentOffset();
-
- if (offsetDependsOnPoint)
- *offsetDependsOnPoint = (container->isBox() && container->style()->isFlippedBlocksWritingMode()) || container->isLayoutFlowThread();
-
- return offset;
-}
-
-void LayoutInline::mapLocalToContainer(const LayoutBoxModelObject* paintInvalidationContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed, const PaintInvalidationState* paintInvalidationState) const
-{
- if (paintInvalidationContainer == this)
- return;
-
- if (paintInvalidationState && paintInvalidationState->canMapToContainer(paintInvalidationContainer)) {
- LayoutSize offset = paintInvalidationState->paintOffset();
- if (style()->hasInFlowPosition() && layer())
- offset += layer()->offsetForInFlowPosition();
- transformState.move(offset);
- return;
- }
-
- bool containerSkipped;
- LayoutObject* o = container(paintInvalidationContainer, &containerSkipped);
- if (!o)
- return;
-
- if (mode & ApplyContainerFlip && o->isBox()) {
- if (o->style()->isFlippedBlocksWritingMode()) {
- IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint());
- transformState.move(toLayoutBox(o)->flipForWritingMode(LayoutPoint(centerPoint)) - centerPoint);
- }
- mode &= ~ApplyContainerFlip;
- }
-
- 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 (containerSkipped) {
- // 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 = paintInvalidationContainer->offsetFromAncestorContainer(o);
- transformState.move(-containerOffset.width(), -containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
- return;
- }
-
- o->mapLocalToContainer(paintInvalidationContainer, transformState, mode, wasFixed, paintInvalidationState);
-}
-
void LayoutInline::updateDragState(bool dragOn)
{
LayoutBoxModelObject::updateDragState(dragOn);
« no previous file with comments | « Source/core/layout/LayoutInline.h ('k') | Source/core/layout/LayoutMultiColumnFlowThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698