Crash when setting text direction via MakeTextWritingDirection* editing commands.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jul 2015 01:37:40 +0000 (01:37 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jul 2015 01:37:40 +0000 (01:37 +0000)
commitfa6b0f8239a13fbc94e96d2bd41c0946572bfe59
tree74782fa912d14800b0d346f6397f565e4a3306d7
parent63bb08ed154007481efa100e06f2660ad7df8241
Crash when setting text direction via MakeTextWritingDirection* editing commands.
<https://webkit.org/b/146665>
<rdar://problem/20835477>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Fix two buggy clients of enclosingBlock(node) that would fail if the returned
element is the same as the node passed in.

Test: editing/style/change-text-direction-crash.html

* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
(WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):

LayoutTests:

Add a test that covers some very simple MakeTextWritingDirection* command usage.

* editing/style/change-text-direction-crash-expected.txt: Added.
* editing/style/change-text-direction-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/style/change-text-direction-crash-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/change-text-direction-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/ApplyStyleCommand.cpp