document.execCommand('Indent') in the direct child of ShadowRoot causes a crash.
authorshinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 May 2012 08:24:22 +0000 (08:24 +0000)
committershinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 May 2012 08:24:22 +0000 (08:24 +0000)
commit84b810c6fecad5e9082fad35d197ffd9aab8bc2c
tree650d604644493371f58bc9d76e560f444bba4808
parentc9ffc38fec393817ef962e6d3e9fa2320d3d18f4
document.execCommand('Indent') in the direct child of ShadowRoot causes a crash.
https://bugs.webkit.org/show_bug.cgi?id=86341

Reviewed by Ryosuke Niwa.

.:

Exports necessary symbols.

* Source/autotools/symbols.filter:

Source/WebCore:

When document.execCommand('Indent') is executed in the direct child of ShadowRoot,
the scope variable of TextIterator becomes ShadowRoot. However, an element is assumed for it,
so a crash happended.

This patch enables TextIterator to have ShadowRoot as a scope variable.

Test: editing/shadow/execcommand-indent-in-shadow.html

* WebCore.exp.in:
* editing/ApplyBlockElementCommand.cpp:
(WebCore::ApplyBlockElementCommand::doApply):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply):
* editing/TextIterator.cpp:
(WebCore::TextIterator::rangeFromLocationAndLength):
* editing/TextIterator.h:
(TextIterator):
* editing/htmlediting.cpp:
(WebCore::indexForVisiblePosition):
(WebCore::visiblePositionForIndex):
* editing/htmlediting.h:
(WebCore):

Source/WebKit/chromium:

* src/WebRange.cpp:
(WebKit::WebRange::fromDocumentRange):

Source/WebKit2:

Exports necessary symbols.

* win/WebKit2.def:
* win/WebKit2CFLite.def:

LayoutTests:

* editing/shadow/execcommand-indent-in-shadow-expected.txt: Added.
* editing/shadow/execcommand-indent-in-shadow.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@117041 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/editing/shadow/execcommand-indent-in-shadow-expected.txt [new file with mode: 0644]
LayoutTests/editing/shadow/execcommand-indent-in-shadow.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/editing/ApplyBlockElementCommand.cpp
Source/WebCore/editing/InsertListCommand.cpp
Source/WebCore/editing/TextIterator.cpp
Source/WebCore/editing/TextIterator.h
Source/WebCore/editing/htmlediting.cpp
Source/WebCore/editing/htmlediting.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebRange.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/win/WebKit2.def
Source/WebKit2/win/WebKit2CFLite.def
Source/autotools/symbols.filter