Open
Bug 345845
Opened 18 years ago
Updated 3 years ago
[midas] document.queryCommandEnabled return wrong value for 'insertlink' if no selection
Categories
(Core :: DOM: Editor, defect, P5)
Tracking
()
NEW
People
(Reporter: lists, Unassigned)
References
Details
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7) Gecko/20040616 Build Identifier: You can use document.queryCommandEnabled() to find out if a command may be executed using document.execCommand(). The command: 'insertlink' <manual> command: insertlink value: a URI description: This command will not do anything if no selection is made. If there is a selection, a link will be inserted around the selection with the url parameter as the href of the link. </manual> If you do a document.queryCommand('insertlink', "http://www.w3.org"); the function SHOULD return 'false' IF NO SELECTION is made. There is no other way - e.g. a command - to find out, if a user selected text for the insert link command. Reproducible: Always Steps to Reproduce: 1. Create a new html document. 2. Insert the following lines within <script>-tags of your document. function reproduce() { document.designMode="on"; alert(document.queryCommandEnabled('createlink')); } 3. call reproduce() within your document. Actual Results: 'true' Expected Results: 'false' OT: The implementation of a command 'unselect' would be helpful, because that would allow to unselect selected text after the user e.g. changed the format. That would decrease the risk of deleting the selected text with the next keystroke.
Reporter | ||
Comment 1•18 years ago
|
||
Errata: If you do a document.queryCommand('insertlink', "http://www.w3.org"); is to be changed to document.queryCommandEnabled('insertlink', "http://www.w3.org");
Updated•18 years ago
|
Component: General → Editor
QA Contact: general
Updated•17 years ago
|
QA Contact: editor
Comment 2•13 years ago
|
||
Confirmed. And that’s not solved by bug 676401.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 3•13 years ago
|
||
Note to self: we could add an `isSelectionCollapsed' read-only boolean attribute to <nsIEditor> and use it in many of the `IsCommandEnabled' methods that have been patched in bug 676401. The current browserscope/richtext2 test suite should not be affected.
Comment 4•3 years ago
|
||
Bulk-downgrade of unassigned, 4 years untouched DOM/Storage bugs' priority.
If you have reason to believe this is wrong (especially for the severity), please write a comment and ni :jstutte.
Severity: normal → S4
Priority: -- → P5
You need to log in
before you can comment on or make changes to this bug.
Description
•