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

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

Issue 1033603007: Blink: Pass 'unobscured' rect to WebPlugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 4e52266225c6394ddc02a87434a6671156200e92..cafc83cfb5e073218df0c7aec02a1a2f7a0541e3 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -2164,30 +2164,50 @@ IntRect FrameView::windowClipRect(IncludeScrollbarsInRect scrollbarInclusion) co
// 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->windowClipRectForFrameOwner(ownerElement));
+ if (parentView) {
+ IntRect elementClipRect;
+ parentView->getClipRectsForFrameOwner(ownerElement, &elementClipRect, nullptr);
+ clipRect.intersect(elementClipRect);
+ }
return clipRect;
}
-IntRect FrameView::windowClipRectForFrameOwner(const HTMLFrameOwnerElement* ownerElement) const
+void FrameView::getClipRectsForFrameOwner(const HTMLFrameOwnerElement* ownerElement, IntRect* clipRect, IntRect* unobscuredRect) const
Julien - ping for review 2015/03/27 21:26:07 In Blink, we don't prefix getters with get so it s
tommycli 2015/03/27 22:42:51 Done.
{
+ ASSERT(ownerElement);
+ ASSERT(clipRect);
+
+ *clipRect = windowClipRect();
+ if (unobscuredRect)
+ *unobscuredRect = IntRect();
+
// The renderer can sometimes be null when style="display:none" interacts
// with external content and plugins.
if (!ownerElement->layoutObject())
- return windowClipRect();
+ return;
// If we have no layer, just return our window clip rect.
const DeprecatedPaintLayer* enclosingLayer = ownerElement->layoutObject()->enclosingLayer();
if (!enclosingLayer)
- return windowClipRect();
+ return;
// 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 clipRect = contentsToRootFrame(pixelSnappedIntRect(enclosingLayer->clipper().childrenClipRect()));
- return intersection(clipRect, windowClipRect());
+ IntRect elementRect = contentsToRootFrame(pixelSnappedIntRect(enclosingLayer->clipper().childrenClipRect()));
+
+ clipRect->intersect(elementRect);
+
+ 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()));
+ }
}
bool FrameView::shouldUseIntegerScrollOffset() const

Powered by Google App Engine
This is Rietveld 408576698