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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 1413523007: Simplify computation of the invalidation rect for a frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 8e5a9be6d0cfbd939881e1cbf14a6d8c67e4bc10..597e7c877a1f8020f94fb8afedbb4adf4db3fe16 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -2035,54 +2035,9 @@ IntRect FrameView::windowClipRect(IncludeScrollbarsInRect scrollbarInclusion) co
{
ASSERT(m_frame->view() == this);
- // Set our clip rect to be our contents.
- IntRect clipRect = contentsToRootFrame(visibleContentRect(scrollbarInclusion));
- if (!m_frame->deprecatedLocalOwner())
- return clipRect;
-
- // Take our owner element and get its clip rect.
- // FIXME: Do we need to do this for remote frames?
- HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner();
- FrameView* parentView = ownerElement->document().view();
- if (parentView)
- clipRect.intersect(parentView->clipRectsForFrameOwner(ownerElement, nullptr));
- return clipRect;
-}
-
-IntRect FrameView::clipRectsForFrameOwner(const HTMLFrameOwnerElement* ownerElement, IntRect* unobscuredRect) const
-{
- ASSERT(ownerElement);
-
- if (unobscuredRect)
- *unobscuredRect = IntRect();
-
- // The layoutObject can sometimes be null when style="display:none" interacts
- // with external content and plugins.
- if (!ownerElement->layoutObject())
- return windowClipRect();
-
- // If we have no layer, just return our window clip rect.
- const PaintLayer* enclosingLayer = ownerElement->layoutObject()->enclosingLayer();
- if (!enclosingLayer)
- return windowClipRect();
-
- // FIXME: childrenClipRect relies on compositingState, which is not necessarily up to date.
- // https://code.google.com/p/chromium/issues/detail?id=343769
- DisableCompositingQueryAsserts disabler;
-
- // Apply the clip from the layer.
- IntRect elementRect = contentsToRootFrame(pixelSnappedIntRect(enclosingLayer->clipper().childrenClipRect()));
-
- if (unobscuredRect) {
- *unobscuredRect = elementRect;
-
- // If element is not in root frame, clip to the local frame.
- // FIXME: Do we need to do this for remote frames?
- if (m_frame->deprecatedLocalOwner())
- unobscuredRect->intersect(contentsToRootFrame(visibleContentRect()));
- }
-
- return intersection(elementRect, windowClipRect());
+ LayoutRect clipRect(LayoutPoint(), LayoutSize(visibleContentSize(scrollbarInclusion)));
+ layoutView()->mapRectToPaintInvalidationBacking(layoutView()->containerForPaintInvalidation(), clipRect, nullptr);
+ return enclosingIntRect(clipRect);
}
bool FrameView::shouldUseIntegerScrollOffset() const
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/layout/LayoutPart.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698