Closed
Bug 1027560
Opened 9 years ago
Closed 8 years ago
document.execCommand() incorrectly throws NS_ERROR_FAILURE for non-editables
Categories
(Core :: DOM: Editor, defect)
Tracking
()
RESOLVED
FIXED
mozilla41
Tracking | Status | |
---|---|---|
firefox41 | --- | fixed |
People
(Reporter: andyearnshaw, Assigned: nika)
Details
(Keywords: dev-doc-complete)
Attachments
(1 file, 2 obsolete files)
10.10 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36 Steps to reproduce: 1. Create a HTML document, can be empty. 2. Execute the following JavaScript: document.execCommand('inserttext', false, 'foo'); Actual results: The console logs the an unhelpful "NS_ERROR_FAILURE" exception, with no reasonable error message to explain the problem. Expected results: No error should be thrown, the result of `document.execCommand()` should be false. The HTML Editing API spec defines the outlines the following steps[1]: > When the execCommand(command, show UI, value) method on the HTMLDocument > interface is invoked, the user agent must run the following steps: > 1. If only one argument was provided, let show UI be false. > 2. If only one or two arguments were provided, let value be the empty string. > 3. If command is not supported or not enabled, return false. Chrome and IE both exhibit the correct behaviour, with both even allowing some commands to be used to edit the text in <input> and <textarea> elements. [1]: https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#execcommand()
Updated•9 years ago
|
Component: General → Editor
Comment 1•9 years ago
|
||
Confirmed 33.0a1 (2014-07-14), win 7 x64
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → michael
Assignee | ||
Comment 2•9 years ago
|
||
Patch is based off bug 1012662 - will probably merge more cleanly if that bug has already been merged. try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ec92cce1ffcb
Attachment #8605835 -
Flags: review?(ehsan)
Updated•9 years ago
|
Attachment #8605835 -
Flags: review?(ehsan) → review+
Comment 6•9 years ago
|
||
sorry had to back this out for failing tests like https://treeherder.mozilla.org/logviewer.html#?job_id=10146347&repo=mozilla-inbound
Flags: needinfo?(michael)
Assignee | ||
Comment 8•8 years ago
|
||
Updated patch which fixes the test bustage which I missed in the previous try push. try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=bec802fef2f8 I'm not sure about some of the file deletions that the updater tool did, so I'm asking for review again.
Attachment #8605835 -
Attachment is obsolete: true
Attachment #8613682 -
Flags: review?(ehsan)
Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(michael)
Comment 9•8 years ago
|
||
Comment on attachment 8613682 [details] [diff] [review] Return false from document.execCommand() and friends when not in editable document Review of attachment 8613682 [details] [diff] [review]: ----------------------------------------------------------------- Whoa! Those deletions are definitely wrong. James, what is going on here? (Michael, you can probably revert them manually for now. Nothing in testing/web-platform/meta/service-workers/ should change in this patch.)
Attachment #8613682 -
Flags: review?(ehsan) → review?(james)
Comment 10•8 years ago
|
||
Interesting… those stub- files aren't really tests, but I didn't think the update script would delete the associated metadata.
Assignee | ||
Comment 11•8 years ago
|
||
New version which doesn't delete a ton of random files - I can run try again on it if it makes sense to do so.
Attachment #8613682 -
Attachment is obsolete: true
Attachment #8613682 -
Flags: review?(james)
Attachment #8614116 -
Flags: review?(ehsan)
Comment 12•8 years ago
|
||
Comment on attachment 8614116 [details] [diff] [review] Return false from document.execCommand() and friends when not in editable document Review of attachment 8614116 [details] [diff] [review]: ----------------------------------------------------------------- Thanks! I don't think this needs another try run.
Attachment #8614116 -
Flags: review?(ehsan) → review+
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Comment 13•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e637319144d3
Keywords: checkin-needed
Comment 14•8 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e637319144d3
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox41:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Comment 15•8 years ago
|
||
Adding dev-doc-needed as the return value is not documented in the MDN reference page.
Keywords: dev-doc-needed
Comment 16•8 years ago
|
||
Updated https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand and https://developer.mozilla.org/en-US/Firefox/Releases/41#HTML_Editing_API
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•