| Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| index 7e2b702a73f1ba5aaa67065078c5f0207003e606..5b8deff1daa4e99639f810d86ae8191f8e71825b 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| @@ -1008,19 +1008,33 @@ IntSize LayoutBox::scrolledContentOffset() const
|
| return result;
|
| }
|
|
|
| +
|
| +LayoutRect LayoutBox::clippingRect() const
|
| +{
|
| + LayoutRect result = LayoutRect(LayoutRect::infiniteIntRect());
|
| + if (hasOverflowClip() || style()->containsPaint())
|
| + result = overflowClipRect(LayoutPoint());
|
| +
|
| + if (hasClip())
|
| + result.intersect(clipRect(LayoutPoint()));
|
| +
|
| + return result;
|
| +}
|
| +
|
| bool LayoutBox::mapScrollingContentsRectToBoxSpace(LayoutRect& rect, ApplyOverflowClipFlag applyOverflowClip, VisualRectFlags visualRectFlags) const
|
| {
|
| - if (!hasOverflowClip())
|
| + if (!hasClipRelatedProperty())
|
| return true;
|
|
|
| - if (applyOverflowClip == ApplyNonScrollOverflowClip && scrollsOverflow()) {
|
| + if (applyOverflowClip == ApplyNonScrollOverflowClip && scrollsOverflow())
|
| return true;
|
| - }
|
|
|
| - LayoutSize offset = LayoutSize(-scrolledContentOffset());
|
| - rect.move(offset);
|
| + if (hasOverflowClip()) {
|
| + LayoutSize offset = LayoutSize(-scrolledContentOffset());
|
| + rect.move(offset);
|
| + }
|
|
|
| - LayoutRect clipRect = overflowClipRect(LayoutPoint());
|
| + LayoutRect clipRect = clippingRect();
|
|
|
| bool doesIntersect;
|
| if (visualRectFlags & EdgeInclusive) {
|
| @@ -1029,6 +1043,7 @@ bool LayoutBox::mapScrollingContentsRectToBoxSpace(LayoutRect& rect, ApplyOverfl
|
| rect.intersect(clipRect);
|
| doesIntersect = !rect.isEmpty();
|
| }
|
| +
|
| return doesIntersect;
|
| }
|
|
|
|
|