From b5cab56eca1f2e2c3a55f163703903437f285190 Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Mon, 14 Jan 2013 22:44:02 +0000 Subject: [PATCH] [Cherry-pick] Positioned children of an overflow:visible container should ignore scroll offset when updating layer position [Title] [Cherry-pick] Positioned children of an overflow:visible container should ignore scroll offset when updating layer position [Issue] N_SE-31159 [Problem] display Delicious/Join page clipped. [Cause] renderLayer which has relative property is placed in wrong position. [Solution] Cherry-pick the opensource patch. [Cherry-pick] Positioned children of an overflow:visible container should ignore scroll offset when updating layer position https://bugs.webkit.org/show_bug.cgi?id=106814 Source/WebCore: Patch by Tien-Ren Chen on 2013-01-14 Reviewed by Simon Fraser. This patch fixes a bug in RenderLayer::updateLayerPosition that scrollLeft / scrollTop of a block should only be effective when the block has overflow clipping. The bug results in rendering artifacts and triggers a RenderGeometryMap assertion falure. Fixes http://crbug.com/167985 Test: fast/overflow/overflow-visible-should-ignore-scroll.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPosition): LayoutTests: This patch fixes a bug in RenderLayer::updateLayerPosition that scrollLeft / scrollTop of a block should only be effective when the block has overflow clipping. The bug results in rendering artifacts and triggers a RenderGeometryMap assertion falure. Fixes http://crbug.com/167985 Patch by Tien-Ren Chen on 2013-01-14 Reviewed by Simon Fraser. * fast/overflow/overflow-visible-should-ignore-scroll-expected.html: Added. * fast/overflow/overflow-visible-should-ignore-scroll.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139669 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- ...flow-visible-should-ignore-scroll-expected.html | 7 +++++++ .../overflow-visible-should-ignore-scroll.html | 24 ++++++++++++++++++++++ Source/WebCore/rendering/RenderLayer.cpp | 12 +++++++---- 3 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 LayoutTests/fast/overflow/overflow-visible-should-ignore-scroll-expected.html create mode 100644 LayoutTests/fast/overflow/overflow-visible-should-ignore-scroll.html diff --git a/LayoutTests/fast/overflow/overflow-visible-should-ignore-scroll-expected.html b/LayoutTests/fast/overflow/overflow-visible-should-ignore-scroll-expected.html new file mode 100644 index 0000000..31056ef --- /dev/null +++ b/LayoutTests/fast/overflow/overflow-visible-should-ignore-scroll-expected.html @@ -0,0 +1,7 @@ + + + +AbsoluteRelative
+This test is successful if both words in the above line are displayed properly. + + diff --git a/LayoutTests/fast/overflow/overflow-visible-should-ignore-scroll.html b/LayoutTests/fast/overflow/overflow-visible-should-ignore-scroll.html new file mode 100644 index 0000000..7c49342 --- /dev/null +++ b/LayoutTests/fast/overflow/overflow-visible-should-ignore-scroll.html @@ -0,0 +1,24 @@ + + + + + + + +
+AbsoluteRelative
+This test is successful if both words in the above line are displayed properly. +
+ + diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp index b21d8d3..e949980 100755 --- a/Source/WebCore/rendering/RenderLayer.cpp +++ b/Source/WebCore/rendering/RenderLayer.cpp @@ -845,8 +845,10 @@ void RenderLayer::updateLayerPosition() RenderLayer* positionedParent = enclosingPositionedAncestor(); // For positioned layers, we subtract out the enclosing positioned layer's scroll offset. - LayoutSize offset = positionedParent->scrolledContentOffset(); - localPoint -= offset; + if (positionedParent->renderer()->hasOverflowClip()) { + LayoutSize offset = positionedParent->scrolledContentOffset(); + localPoint -= offset; + } if (renderer()->isOutOfFlowPositioned() && positionedParent->renderer()->isRelPositioned() && positionedParent->renderer()->isRenderInline()) { LayoutSize offset = toRenderInline(positionedParent->renderer())->relativePositionedInlineOffset(toRenderBox(renderer())); @@ -865,8 +867,10 @@ void RenderLayer::updateLayerPosition() localPoint += columnOffset; } - IntSize scrollOffset = parent()->scrolledContentOffset(); - localPoint -= scrollOffset; + if (parent()->renderer()->hasOverflowClip()) { + IntSize scrollOffset = parent()->scrolledContentOffset(); + localPoint -= scrollOffset; + } } if (renderer()->isRelPositioned()) { -- 2.7.4