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

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
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/web/WebPluginContainerImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 4e52266225c6394ddc02a87434a6671156200e92..176576337b2aca865332c15783bca542c3ec1245 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -2165,12 +2165,17 @@ IntRect FrameView::windowClipRect(IncludeScrollbarsInRect scrollbarInclusion) co
HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner();
FrameView* parentView = ownerElement->document().view();
if (parentView)
- clipRect.intersect(parentView->windowClipRectForFrameOwner(ownerElement));
+ clipRect.intersect(parentView->clipRectsForFrameOwner(ownerElement, nullptr));
return clipRect;
}
-IntRect FrameView::windowClipRectForFrameOwner(const HTMLFrameOwnerElement* ownerElement) const
+IntRect FrameView::clipRectsForFrameOwner(const HTMLFrameOwnerElement* ownerElement, IntRect* unobscuredRect) const
{
+ ASSERT(ownerElement);
+
+ if (unobscuredRect)
+ *unobscuredRect = IntRect();
+
// The renderer can sometimes be null when style="display:none" interacts
// with external content and plugins.
if (!ownerElement->layoutObject())
@@ -2186,8 +2191,18 @@ IntRect FrameView::windowClipRectForFrameOwner(const HTMLFrameOwnerElement* owne
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()));
+
+ 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());
}
bool FrameView::shouldUseIntegerScrollOffset() const
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/web/WebPluginContainerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698