Closed Bug 1705519 Opened 3 years ago Closed 3 years ago

execCommand("SelectAll") doesn't seem to work if not in an editor.

Categories

(Core :: DOM: Editor, defect, P3)

defect

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: emilio, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached file Test-case

Other browsers seem to select the non-editable content, just like if you pressed Ctrl+A. Masayuki is this known / intended?

This causes testing/web-platform/tests/inert/inert-node-is-unselectable.tentative.html to fail.

Flags: needinfo?(masayuki)

It's just our traditional behavior. We should follow the other browsers.

Assignee: nobody → masayuki
Severity: -- → S3
Status: NEW → ASSIGNED
Flags: needinfo?(masayuki)
Priority: -- → P3

This causes testing/web-platform/tests/inert/inert-node-is-unselectable.tentative.html to fail.

Unfortunately, not supporting execCommand("selectall") in non-editable document is not the only cause of the fail. With fixed build, it keeps failing with this assertion:

assert_equals: expected "I'm selectable." but got "\r\nI'm selectable.\r\n"

Flags: needinfo?(emilio)
OS: Unspecified → All
Hardware: Unspecified → All

When document.execCommand("selectall") is called, it should behave exactly
same as "Select All" in the UI for compatibility with the other browsers.

And also this patch fixes a bug of the WPT. selectionchange event should
be fired, but asynchronously. Therefore, Chrome also fails the check.

Ah, thanks for the heads-up, we should probably just call trim() in the test or such. Thanks for the super-quick answer/fix!

Flags: needinfo?(emilio)
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/2c112a607a2b
Make `Document::ExecCommand` not stop handling `selectall` command when there is no editable content r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/28590 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
Blocks: 1706301
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: