Unable to move selection into editable roots with 0 height
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Feb 2019 20:52:58 +0000 (20:52 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Feb 2019 20:52:58 +0000 (20:52 +0000)
commit0b502e7c2f58f3b2328bcaaabdbb0b08ccc16d42
tree6b5662b8693045384df9a4993a399dc0dfa1f065
parent1cb9d7630886c238eb2f82e0b5c7c0ad589b2c20
Unable to move selection into editable roots with 0 height
https://bugs.webkit.org/show_bug.cgi?id=194143
<rdar://problem/47767284>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Currently, positions inside editable elements of height 0 are not considered to be candidates when
canonicalizing a position to its visible counterpart. This prevents us from moving the selection into these
editable roots at all. To fix this, we relax this constraint by allowing positions anchored by root editable
elements to be candidates.

Test: editing/selection/insert-text-in-empty-content-editable.html

* dom/Position.cpp:
(WebCore::Position::isCandidate const):

LayoutTests:

Add a new layout test that executes editing commands in a contenteditable element of height 0, and adjust an
existing layout test that copies and pastes an image element to wait until the image has loaded.

* editing/pasteboard/styled-element-markup.html:
* editing/selection/insert-text-in-empty-content-editable-expected.txt: Added.
* editing/selection/insert-text-in-empty-content-editable.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240905 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/styled-element-markup.html
LayoutTests/editing/selection/insert-text-in-empty-content-editable-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/insert-text-in-empty-content-editable.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Position.cpp