Chromium Code Reviews| 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 |