Triggers assertion if dragging from outside of <meter> in a shadow tree to inside...
authorshinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Mar 2012 02:42:48 +0000 (02:42 +0000)
committershinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Mar 2012 02:42:48 +0000 (02:42 +0000)
commit6eb52c2ab7ab1e627193ecf3533033316d912af7
treeb1337ddf467f6709ec6303e4a5d86015f41c9713
parent5cc40afc9780186c1fdf8babb8f63c9cd68d41e0
Triggers assertion if dragging from outside of <meter> in a shadow tree to inside of it.
https://bugs.webkit.org/show_bug.cgi?id=82177

Reviewed by Dimitri Glazkov.

Source/WebCore:

VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries has moved the start position or
the end position to the invalid position, i.e. position after (before) the non-existing node.

This patch fixes the problem, and adds assertion that the selection does not cross shadow boundaries.

Test: fast/dom/shadow/drag-to-meter-in-shadow-crash.html

* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries):

LayoutTests:

* fast/dom/shadow/drag-to-meter-in-shadow-crash-expected.txt: Added.
* fast/dom/shadow/drag-to-meter-in-shadow-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/shadow/drag-to-meter-in-shadow-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/shadow/drag-to-meter-in-shadow-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/VisibleSelection.cpp