| 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 bfa8daeabf98e24ca0b10994f63097df39737ca2..b2de1e362e42e9f920416ac90784ba2b85107034 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| @@ -1011,19 +1011,35 @@ 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());
|
| + // This won't work fully correctly for fixed-position elements, who should receive CSS clip but for whom the current object
|
| + // is not in the containing block chain.
|
| + LayoutRect clipRect = clippingRect();
|
|
|
| bool doesIntersect;
|
| if (visualRectFlags & EdgeInclusive) {
|
| @@ -1032,6 +1048,7 @@ bool LayoutBox::mapScrollingContentsRectToBoxSpace(LayoutRect& rect, ApplyOverfl
|
| rect.intersect(clipRect);
|
| doesIntersect = !rect.isEmpty();
|
| }
|
| +
|
| return doesIntersect;
|
| }
|
|
|
|
|