Crash in previousLinePosition when moving into a root inline box without leaves
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 00:18:19 +0000 (00:18 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 00:18:19 +0000 (00:18 +0000)
commitee5839ffaf8e34482e506336e1e7cad7bd7bc887
tree5079890f41baadb146e78cf9f2d0330ee580785e
parent89ea5d0b7ee63e58f05cd36007c3c256dfd8137e
Crash in previousLinePosition when moving into a root inline box without leaves
https://bugs.webkit.org/show_bug.cgi?id=76812

Reviewed by Enrica Casucci.

Source/WebCore:

The crash was caused by us assuming that every root inline box has at least one leaf,
which isn't true when we create inline boxes for an empty text run with margin, border, etc...

Test: editing/selection/move-into-empty-root-inline-box.html

* editing/visible_units.cpp:
(WebCore::previousLinePosition):
(WebCore::nextLinePosition):

LayoutTests:

Add a regression test for the crash. Unfortunately, we can only test previousLinePosition.

* editing/selection/move-into-empty-root-inline-box-expected.txt: Added.
* editing/selection/move-into-empty-root-inline-box.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/selection/move-into-empty-root-inline-box-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/move-into-empty-root-inline-box.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/visible_units.cpp