Closed Bug 1670531 Opened 4 years ago Closed 4 years ago

Only select selectable element if it isn't editable

Categories

(Core :: DOM: Selection, defect)

defect

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: m_kato, Assigned: m_kato)

References

Details

Attachments

(1 file)

When using <div contenteditable>A[]<span contenteditable=false><B</span>C</div> ([] is caret), then user uses [Shift] + [arrow right], Gecko select non-editable text and "C" character. Blink and Webkit only select non-editable text only.

Blocks: 1665167

When caret is [] in the following html then we use [shift] + [arrow right],
Gecko select non-editable text and "C" character. This behaviour is different
of Blink and WebKit. They select only non-editable element by this operation.

<div contenteditable>A[]<span contenteditable=false><B</span>C</div>

Another example is <img> element with contenteditable=false. If this
<img> element is editable, [shift] + [arrow right] doesn't select "C"
character, but if this <img> element isn't editable, [shift] + [arrow right]
selects additional "C" character on Gecko.

<div contenteditable>A[]<img contenteditable=false src=... />C</div>

So I would like to change this behaviour to Blink/Webkit way.

PeekOffsetForCharacter is looking for selection end. When it is selecting
elements, if traversed frame/content has non-select frame/content, we select
first character of editable text. But when we already have selected element,
it is unnecessary to select editable text.

Also, bug1524266-4.html is unfortunately work now and we don't support white
space compression for this situation (bug 1670518). Even if inner span is
editable, we don't compress white space. So we need a workaround for this
test.

Severity: -- → S3
Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/0567daec5c5f Only select selectable element if it isn't editable. r=masayuki
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: