createMarkupInternal should protect its pointer to the Range's common ancestor
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Sep 2017 20:25:47 +0000 (20:25 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Sep 2017 20:25:47 +0000 (20:25 +0000)
commit3204b1a9bf7be659a5d09968d4a84feeb940396e
tree7758436c50aea28bc6152f2e061d1a7cbcf67f93
parent1d9615ff925b66485d47756f12e25b1c877cc32b
createMarkupInternal should protect its pointer to the Range's common ancestor
https://bugs.webkit.org/show_bug.cgi?id=177033
<rdar://problem/34265390>

Reviewed by Tim Horton.

Source/WebCore:

Adds basic safeguarding to codepaths hit while executing an outdent command.

Test: editing/execCommand/outdent-with-media-query-listener-in-iframe.html

* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::outdentRegion):

Avoid an infinite loop if endOfCurrentParagraph is a null position.

* editing/markup.cpp:
(WebCore::createMarkupInternal):

Protect the raw pointer to the Range's common ancestor node.

LayoutTests:

Adds a test that removes the common ancestor node of a range in the middle of executing an outdent.

* editing/execCommand/outdent-with-media-query-listener-in-iframe-expected.txt: Added.
* editing/execCommand/outdent-with-media-query-listener-in-iframe.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/execCommand/outdent-with-media-query-listener-in-iframe-expected.txt [new file with mode: 0644]
LayoutTests/editing/execCommand/outdent-with-media-query-listener-in-iframe.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/IndentOutdentCommand.cpp
Source/WebCore/editing/markup.cpp