#17216 closed defect (fixed)
IE9 in Quirks mode dijit/Editor fails to restore selection properly
Reported by: | Nick Fenwick | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.9.1 |
Component: | Editor | Version: | 1.9.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
If you are unfortunate enough to be working on a page that IE9 renders in quirks mode, e.g. it's missing a DOCTYPE entirely, I've found the selection is not restored when a toolbar button is used.
- Load nightly tests page in IE9 - http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/editor/test_FontChoice.html
- Press F12 to open dev tools and force document mode to Quirks (from Standards)
- Page reloads in Quirks mode
- Select some text and try to change its font using the Font dropdown
Expected result: text stays selected and font is changed. Actual result: font is not changed and cursor resets to start of Editor
It seems to stem from the _getBookmark function coming up with a 'mark' object that consists of a string rather than an object with startContainer, endContainer etc. attributes. Thus all the operations on mark that try to use these attributes fail and _restoreSelection cannot work.
Note that IE10 in Quirks mode does not have this problem, it's only IE9 Quirks mode.
It seems that we should use the code path designed for IE < 9 if quirks mode is enabled.
I've made a sandbox that demonstrates the fixed code, with the guts of two Editor functions overridden with a "HACK HERE" comment indicating the change: http://dojo-sandbox.net/public/a7041/0
Attachments (1)
Change History (5)
Changed 9 years ago by
Attachment: | 17216.patch added |
---|
comment:1 Changed 9 years ago by
By the way, the best way to run that sandbox is to load it in IE9 in the default mode (Standards mode), click 'Launch For Debug' which will launch the bucket in a popup window, then hit f12 and switch to Quirks mode. Switching the main dojo-sandbox GUI to quirks mode tends to break it horribly.
comment:2 Changed 9 years ago by
Component: | General → Editor |
---|---|
Milestone: | tbd → 1.9.1 |
Owner: | set to bill |
Status: | new → assigned |
OK thanks, I can check that in, but remember that for 2.0 we won't be supporting quirksmode anymore.
comment:3 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Example patch to trunk.