Index: third_party/WebKit/Source/core/layout/LayoutView.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp |
index 7df99b4f73a07bd936ade3e848a9ac99304f0a9c..6be4f7502fd4aad85a41b7a0cdd73c107b85ac50 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp |
@@ -323,7 +323,7 @@ LayoutRect LayoutView::visualOverflowRect() const |
return LayoutRect(documentRect()); |
} |
-void LayoutView::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed, const PaintInvalidationState* paintInvalidationState) const |
+void LayoutView::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const |
{ |
ASSERT_UNUSED(wasFixed, !wasFixed || *wasFixed == static_cast<bool>(mode & IsFixed)); |
@@ -346,10 +346,11 @@ void LayoutView::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Transf |
if (mode & TraverseDocumentBoundaries) { |
if (LayoutPart* parentDocLayoutObject = frame()->ownerLayoutObject()) { |
- transformState.move(-frame()->view()->scrollOffset()); |
+ if (!(mode & DontApplyFrameScrollOffsetAndClip)) |
+ transformState.move(-frame()->view()->scrollOffset()); |
transformState.move(parentDocLayoutObject->contentBoxOffset()); |
- parentDocLayoutObject->mapLocalToAncestor(ancestor, transformState, mode, wasFixed, paintInvalidationState); |
+ parentDocLayoutObject->mapLocalToAncestor(ancestor, transformState, mode, wasFixed); |
} |
} |
} |
@@ -444,7 +445,7 @@ void LayoutView::invalidateTreeIfNeeded(const PaintInvalidationState& paintInval |
LayoutRect dirtyRect = viewRect(); |
if (doingFullPaintInvalidation() && !dirtyRect.isEmpty()) { |
const LayoutBoxModelObject& paintInvalidationContainer = paintInvalidationState.paintInvalidationContainer(); |
- PaintLayer::mapRectToPaintInvalidationBacking(this, &paintInvalidationContainer, dirtyRect, &paintInvalidationState); |
+ paintInvalidationState.mapLocalRectToPaintInvalidationBacking(dirtyRect); |
invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRect, PaintInvalidationFull); |
invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalidationContainer, paintInvalidationState, PaintInvalidationFull); |
} |
@@ -475,19 +476,16 @@ void LayoutView::invalidatePaintForViewAndCompositedLayers() |
compositor()->fullyInvalidatePaint(); |
} |
-void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, const PaintInvalidationState* invalidationState) const |
+void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect) const |
{ |
- mapToVisibleRectInAncestorSpace(ancestor, rect, IsNotFixedPosition, invalidationState); |
+ mapToVisibleRectInAncestorSpace(ancestor, rect, 0); |
} |
-void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, ViewportConstrainedPosition viewportConstraint, |
- const PaintInvalidationState* paintInvalidationState) const |
+void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, MapCoordinatesFlags mode) const |
{ |
if (document().printing()) |
return; |
- // TODO(chrishtr): fix PaintInvalidationState offsets for LayoutViews. |
- |
if (style()->isFlippedBlocksWritingMode()) { |
// We have to flip by hand since the view's logical height has not been determined. We |
// can use the viewport width and height. |
@@ -497,7 +495,8 @@ void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* anc |
rect.setX(viewWidth() - rect.maxX()); |
} |
- adjustViewportConstrainedOffset(rect, viewportConstraint); |
+ if (mode & IsFixed) |
+ adjustOffsetForFixedPosition(rect); |
// Apply our transform if we have one (because of full page zooming). |
if (!ancestor && layer() && layer()->transform()) |
@@ -512,7 +511,7 @@ void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* anc |
return; |
if (LayoutBox* obj = owner->layoutBox()) { |
- if (!paintInvalidationState || !paintInvalidationState->viewClippingAndScrollOffsetDisabled()) { |
+ if (!(mode & DontApplyFrameScrollOffsetAndClip)) { |
// Intersect the viewport with the paint invalidation rect. |
LayoutRect viewRectangle = viewRect(); |
rect.intersect(viewRectangle); |
@@ -523,15 +522,12 @@ void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* anc |
// Adjust for frame border. |
rect.move(obj->contentBoxOffset()); |
- obj->mapToVisibleRectInAncestorSpace(ancestor, rect, 0); |
+ obj->mapToVisibleRectInAncestorSpace(ancestor, rect); |
} |
} |
-void LayoutView::adjustViewportConstrainedOffset(LayoutRect& rect, ViewportConstrainedPosition viewportConstraint) const |
+void LayoutView::adjustOffsetForFixedPosition(LayoutRect& rect) const |
{ |
- if (viewportConstraint != IsFixedPosition) |
- return; |
- |
if (m_frameView) { |
rect.move(toIntSize(m_frameView->scrollPosition())); |
if (hasOverflowClip()) |