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

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

Issue 1852193002: Remove LayoutView's special version mapToVisualRectInAncestorSpace(). Base URL: https://chromium.googlesource.com/chromium/src.git@SVGRootClip
Patch Set: Created 4 years, 8 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/LayoutView.h » ('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 a13a9e4024071cf51eb6d4d514f4c365624035ab..34a2342d179dee4d501ea2df0e052a57a5b5310f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1983,30 +1983,25 @@ bool LayoutBox::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ances
topLeft += layer()->offsetForInFlowPosition();
}
- // FIXME: We ignore the lightweight clipping rect that controls use, since if |o| is in mid-layout,
- // its controlClipRect will be wrong. For overflow clip we use the values cached by the layer.
rect.setLocation(topLeft);
if (container->hasOverflowClip()) {
LayoutBox* containerBox = toLayoutBox(container);
- containerBox->mapScrollingContentsRectToBoxSpace(rect);
+ if (!container->isLayoutView() || position != FixedPosition)
+ containerBox->mapScrollingContentsRectToBoxSpace(rect);
if (container != ancestor && !containerBox->applyOverflowClip(rect, visualRectFlags))
return false;
+ } else if (container->isLayoutView()) {
+ if (!toLayoutView(container)->mapContentRectToFrameSpace(this, rect, visualRectFlags))
+ return false;
}
if (ancestorSkipped) {
- // If the ancestor is below o, then we need to map the rect into paintInvalidationContainer's coordinates.
- LayoutSize containerOffset = ancestor->offsetFromAncestorContainer(container);
- rect.move(-containerOffset);
- // If the ancestor is fixed, then the rect is already in its coordinates so doesn't need viewport-adjusting.
- if (ancestor->style()->position() != FixedPosition && container->isLayoutView() && position == FixedPosition)
- toLayoutView(container)->adjustOffsetForFixedPosition(rect);
+ // If the ancestor is below container, then we need to map the rect into ancestor's coordinates.
+ rect.move(-ancestor->offsetFromAncestorContainer(container));
return true;
}
- if (container->isLayoutView())
- return toLayoutView(container)->mapToVisualRectInAncestorSpace(ancestor, rect, position == FixedPosition ? IsFixed : 0, visualRectFlags);
- else
- return container->mapToVisualRectInAncestorSpace(ancestor, rect, visualRectFlags);
+ return container->mapToVisualRectInAncestorSpace(ancestor, rect, visualRectFlags);
}
void LayoutBox::inflatePaintInvalidationRectForReflectionAndFilter(LayoutRect& paintInvalidationRect) const
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698