Skip to content

Commit ab5ea50

Browse files
committed
Merged anonymous blocks should invalidate simple line layout path.
https://bugs.webkit.org/show_bug.cgi?id=145104 rdar://problem/20980930 Reviewed by Antti Koivisto. When anonymous blocks are merged together, it's not guaranteed that the final block can use simple line layout. This patch ensures that the flow block, where the other block's content gets moved to, is no longer on simple line layout path. Whether the final flow block ends up using inline boxes or simple line layout will be determined during the next layout. Source/WebCore: Test: fast/block/crash-when-anonymous-blocks-are-merged-with-simple-line-layout.html * rendering/RenderElement.cpp: (WebCore::RenderElement::insertChildInternal): LayoutTests: * fast/block/crash-when-anonymous-blocks-are-merged-with-simple-line-layout-expected.txt: Added. * fast/block/crash-when-anonymous-blocks-are-merged-with-simple-line-layout.html: Added. Canonical link: https://commits.webkit.org/163176@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184577 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent d0e3bd7 commit ab5ea50

5 files changed

Lines changed: 55 additions & 0 deletions

File tree

LayoutTests/ChangeLog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2015-05-19 Zalan Bujtas <zalan@apple.com>
2+
3+
Merged anonymous blocks should invalidate simple line layout path.
4+
https://bugs.webkit.org/show_bug.cgi?id=145104
5+
rdar://problem/20980930
6+
7+
Reviewed by Antti Koivisto.
8+
9+
When anonymous blocks are merged together, it's not guaranteed that the final block can use simple line layout.
10+
This patch ensures that the flow block, where the other block's content gets moved to, is no longer on simple line layout path.
11+
Whether the final flow block ends up using inline boxes or simple line layout will be determined during the next layout.
12+
13+
* fast/block/crash-when-anonymous-blocks-are-merged-with-simple-line-layout-expected.txt: Added.
14+
* fast/block/crash-when-anonymous-blocks-are-merged-with-simple-line-layout.html: Added.
15+
116
2015-05-14 Chris Fleizach <cfleizach@apple.com>
217

318
AX: Select text mechanism returns results outside of text control regions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Pass if no crash or assert in debug.
2+
foo
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>This tests when 2 anonymous blocks are merged and the 'to' block has simple line layout path.</title>
5+
</head>
6+
<script>
7+
if (window.testRunner)
8+
testRunner.dumpAsText();
9+
</script>
10+
</head>
11+
<body>
12+
<div>Pass if no crash or assert in debug.</div>foo<div id="removethis"></div><span>
13+
<script>
14+
document.body.offsetWidth;
15+
var elem = document.getElementById("removethis");
16+
elem.parentNode.removeChild(elem);
17+
</script>
18+
</body>
19+
</html>

Source/WebCore/ChangeLog

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
2015-05-19 Zalan Bujtas <zalan@apple.com>
2+
3+
Merged anonymous blocks should invalidate simple line layout path.
4+
https://bugs.webkit.org/show_bug.cgi?id=145104
5+
rdar://problem/20980930
6+
7+
Reviewed by Antti Koivisto.
8+
9+
When anonymous blocks are merged together, it's not guaranteed that the final block can use simple line layout.
10+
This patch ensures that the flow block, where the other block's content gets moved to, is no longer on simple line layout path.
11+
Whether the final flow block ends up using inline boxes or simple line layout will be determined during the next layout.
12+
13+
Test: fast/block/crash-when-anonymous-blocks-are-merged-with-simple-line-layout.html
14+
15+
* rendering/RenderElement.cpp:
16+
(WebCore::RenderElement::insertChildInternal):
17+
118
2015-05-19 Beth Dakin <bdakin@apple.com>
219

320
Crash in WebCore::RenderLayer::updateScrollbarsAfterLayout

Source/WebCore/rendering/RenderElement.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,8 @@ void RenderElement::insertChildInternal(RenderObject* newChild, RenderObject* be
593593

594594
if (AXObjectCache* cache = document().axObjectCache())
595595
cache->childrenChanged(this, newChild);
596+
if (is<RenderBlockFlow>(*this))
597+
downcast<RenderBlockFlow>(*this).invalidateLineLayoutPath();
596598
}
597599

598600
void RenderElement::removeChildInternal(RenderObject& oldChild, NotifyChildrenType notifyChildren)

0 commit comments

Comments
 (0)