Skip to content

Commit

Permalink
Merge r176619 - Twitter avatar moves when hovering/unhovering the "fo…
Browse files Browse the repository at this point in the history
…llow" button.

https://bugs.webkit.org/show_bug.cgi?id=139147
rdar://problem/19096508

Reviewed by Simon Fraser.

This patch ensures that the out of flow positioned render boxes (RenderReplaced) do not
get repositioned when their inline box wrappers move.
Ideally, out of flow positioned renderers do not have inline wrappers by the time we start
placing inline boxes, but in certain case (optimized code path for descendantsHaveSameLineHeightAndBaseline()),
they are still part of the inline box tree.
This patch prevents those renderer boxes from getting positioned as part of the inline box placement.
They will get removed later at RenderBlockFlow::computeBlockDirectionPositionsForLine().

Source/WebCore:

Test: fast/inline/out-of-flow-positioned-render-replaced-box-moves.html

* rendering/InlineBox.cpp:
(WebCore::InlineBox::adjustPosition):

LayoutTests:

* fast/inline/out-of-flow-positioned-render-replaced-box-moves-expected.html: Added.
* fast/inline/out-of-flow-positioned-render-replaced-box-moves.html: Added.

Canonical link: https://commits.webkit.org/154760.245@webkitgtk/2.6
git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@178282 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
alanbaradlay authored and carlosgcampos committed Jan 12, 2015
1 parent e41740c commit 8e18924
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 0 deletions.
19 changes: 19 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,22 @@
2014-12-01 Zalan Bujtas <zalan@apple.com>

Twitter avatar moves when hovering/unhovering the "follow" button.
https://bugs.webkit.org/show_bug.cgi?id=139147
rdar://problem/19096508

Reviewed by Simon Fraser.

This patch ensures that the out of flow positioned render boxes (RenderReplaced) do not
get repositioned when their inline box wrappers move.
Ideally, out of flow positioned renderers do not have inline wrappers by the time we start
placing inline boxes, but in certain case (optimized code path for descendantsHaveSameLineHeightAndBaseline()),
they are still part of the inline box tree.
This patch prevents those renderer boxes from getting positioned as part of the inline box placement.
They will get removed later at RenderBlockFlow::computeBlockDirectionPositionsForLine().

* fast/inline/out-of-flow-positioned-render-replaced-box-moves-expected.html: Added.
* fast/inline/out-of-flow-positioned-render-replaced-box-moves.html: Added.

2014-11-21 Chris Dumez <cdumez@apple.com>

Crash when setting 'transition-delay' CSS property to a calculated value
Expand Down
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<title>This tests that when inline content gets changed (width changes), the out of flow positioned element on the same line does not move.</title>
<style>
h2 {
display: inline;
line-height: 300px;
}

img {
position: absolute;
top: 100px;
left: 100px;
width: 100px;
height: 100px;
}

button {
width: 100px;
}
</style>
</head>
<body>
<h2>
<a><img src="foo.png">foobar</a>
</h2>
<button>button</button>
</body>
</html>
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<title>This tests that when inline content gets changed (width changes), the out of flow positioned element on the same line does not move.</title>
<style>
h2 {
display: inline;
line-height: 300px;
}

img {
position: absolute;
top: 100px;
left: 100px;
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<h2>
<a><img src="foo.png">foobar</a>
</h2>
<button id=changethis>button</button>
<script>
if (window.testRunner)
testRunner.waitUntilDone();
setTimeout(function() {
document.getElementById("changethis").style.width = "100px";
if (window.testRunner)
testRunner.notifyDone();
}, 10);
</script>
</body>
</html>
21 changes: 21 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,24 @@
2014-12-01 Zalan Bujtas <zalan@apple.com>

Twitter avatar moves when hovering/unhovering the "follow" button.
https://bugs.webkit.org/show_bug.cgi?id=139147
rdar://problem/19096508

Reviewed by Simon Fraser.

This patch ensures that the out of flow positioned render boxes (RenderReplaced) do not
get repositioned when their inline box wrappers move.
Ideally, out of flow positioned renderers do not have inline wrappers by the time we start
placing inline boxes, but in certain case (optimized code path for descendantsHaveSameLineHeightAndBaseline()),
they are still part of the inline box tree.
This patch prevents those renderer boxes from getting positioned as part of the inline box placement.
They will get removed later at RenderBlockFlow::computeBlockDirectionPositionsForLine().

Test: fast/inline/out-of-flow-positioned-render-replaced-box-moves.html

* rendering/InlineBox.cpp:
(WebCore::InlineBox::adjustPosition):

2014-11-26 Philippe Normand <pnormand@igalia.com>

[GStreamer] HTTP source element lacks SCHEDULING query support
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/rendering/InlineBox.cpp
Expand Up @@ -176,6 +176,9 @@ void InlineBox::adjustPosition(float dx, float dy)
{
m_topLeft.move(dx, dy);

if (m_renderer.isOutOfFlowPositioned())
return;

if (m_renderer.isReplaced())
toRenderBox(renderer()).move(dx, dy);
}
Expand Down

0 comments on commit 8e18924

Please sign in to comment.