Opened 11 years ago

Closed 11 years ago

#13059 closed defect (fixed)

dojo.byId(domnode.getAttribute('aria-activedescendant')) error in IE

Reported by: liucougar Owned by: liucougar
Priority: high Milestone: 1.7
Component: Core Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by liucougar)

In EmulateIE7 mode of both IE9 and IE8, if a domnode has no 'aria-activedescendant' specified, the following will lead to error:


in IE9 EmulateIE7 mode, the error is "Invalid procedure call or argument"

in IE8 EmulateIE7 mode, the error is "Invalid argument."

the problem seems to stem from the fact that, in IE8/IE9, some sort of aria support is included, so domnode.getAttribute('aria-activedescendant') would return a empty string if no 'aria-activedescendant' is specified, however, this empty string is special: it will lead to the above error in IE8/IE9

by adding a check for empty string in dojo.byId, this can be solved

NOTE: this error does not happen in real IE7, nor in native IE8 mode, nor in EmulateIE8 mode in IE9 and native IE9 mode

proposed patch:

  • ../svn/dojo/_base/html.js

    5555               if(typeof id != "string"){
    5656                       return id;
    5757               }
    58                var _d = doc || dojo.doc, te = _d.getElementById(id);
     58               var _d = doc || dojo.doc, te = id && _d.getElementById(id);
    5959               // is better than just id in case the
    6060               // user has a name=id inside a form
    6161               if(te && ( == id || == id)){

Change History (3)

comment:1 Changed 11 years ago by liucougar

Description: modified (diff)

comment:2 Changed 11 years ago by Adam Peller

looks good to me

comment:3 Changed 11 years ago by liucougar

Resolution: fixed
Status: newclosed

(In [25642]) fixes #13059: fixes IE dojo.byId error in EmulateIE7 mode


Note: See TracTickets for help on using tickets.