[wp-trac] [WordPress Trac] #31661: Quicktags: Can't add them using just a keyboard in IE

WordPress Trac noreply at wordpress.org
Thu Mar 26 17:19:53 UTC 2015


#31661: Quicktags: Can't add them using just a keyboard in IE
----------------------------------+----------------------------------------
 Reporter:  Cheffheid             |       Owner:
     Type:  defect (bug)          |      Status:  new
 Priority:  normal                |   Milestone:  Awaiting Review
Component:  Editor                |     Version:  4.1
 Severity:  normal                |  Resolution:
 Keywords:  has-patch needs-      |     Focuses:  accessibility, javascript
  testing                         |
----------------------------------+----------------------------------------

Comment (by afercia):

 To my understanding, for IE 8- `createRange()` is a method of the
 selection and for IE 9+ and standard compliant browser is a method of the
 document, see for example what TinyMCE does:

 {{{
 rng = selection.createRange ? selection.createRange() : doc.createRange();
 }}}

 Additionally, quicktags.js is a bit old code and maybe the checks it does
 should be changed:

 {{{
 if ( document.selection ) { // IE

     `document.selection` is still used by IE 9 and 10 so the condition is
 true for IE 10-
     but then in this block `createRange()` works only in IE 8- so IE 9 and
 10 will fail

 } else if ( canvas.selectionStart || canvas.selectionStart === 0 ) { //
 FF, WebKit, Opera

     condition should be true for IE 11 too

 } else { // other browsers?

     no idea.

 }

 }}}

 Could someone more familiar than me with text selections please confirm
 this? Thanks very much.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31661#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list