Index: Source/core/frame/FrameView.cpp |
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp |
index acbd858b0686fc46ed2174cae7756cc06d1dec6b..760b99b9ed43b1b4de8ff18c3e56c28d935f7a2f 100644 |
--- a/Source/core/frame/FrameView.cpp |
+++ b/Source/core/frame/FrameView.cpp |
@@ -2202,6 +2202,30 @@ IntRect FrameView::windowClipRectForFrameOwner(const HTMLFrameOwnerElement* owne |
return intersection(clipRect, windowClipRect()); |
} |
+IntRect FrameView::unobscuredRectForFrameOwner(const HTMLFrameOwnerElement* ownerElement) const |
+{ |
+ if (!ownerElement->layoutObject()) |
+ return IntRect(); |
+ |
+ const DeprecatedPaintLayer* enclosingLayer = ownerElement->layoutObject()->enclosingLayer(); |
+ if (!enclosingLayer) |
+ return IntRect(); |
+ |
+ // 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())); |
+ |
+ // 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()) |
+ clipRect.intersect(contentsToRootFrame(visibleContentRect())); |
+ |
+ return clipRect; |
+} |
+ |
bool FrameView::shouldUseIntegerScrollOffset() const |
{ |
if (m_frame->settings() && !m_frame->settings()->preferCompositingToLCDTextEnabled()) |