Opened 10 years ago

Closed 10 years ago

#8860 closed defect (fixed)

dijit/tests/test_Dialog.html fails in Opera 9.64

Reported by: Łukasz Krzyżak Owned by:
Priority: high Milestone: 1.4
Component: Dijit Version: 1.3.0b3
Keywords: opera dialog Cc:
Blocked By: Blocking:

Description

steps to reproduce:

  1. open

http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/test_Dialog.html

  1. set focus on text input above "Hello" button
  2. open any dialog with buttons on top (f.x. "Show dialog")
  3. watch error console:
    Event thread: click
    Error:
    name: TypeError
    message: Statement on line 52: Cannot convert undefined or null to Object
    Backtrace:
      Line 52 of linked script http://localhost:8080/hades/js/dojo/dojo-cib.js?v=704b5d3d2eb0e284d72fc4f93c1ee86d05732c84
        				  return !s.createRange().htmlText.length; // Boolean
      ...  Line 3534 of linked script http://localhost:8080/hades/js/dojo/dojo.js?v=704b5d3d2eb0e284d72fc4f93c1ee86d05732c84
        		return callback.apply(thisObject, cbArguments || []);
      ...  Line 3505 of linked script http://localhost:8080/hades/js/dojo/dojo.js?v=704b5d3d2eb0e284d72fc4f93c1ee86d05732c84
        		return dojo.withDoc.call(null, globalObject.document, callback, thisObject, cbArguments);
      Line 150 of linked script http://localhost:8080/hades/js/dojo/dojo-cib.js?v=704b5d3d2eb0e284d72fc4f93c1ee86d05732c84
        		return {
      Line 31981 of linked script http://localhost:8080/hades/js/dojo/dojo-cib.js?v=704b5d3d2eb0e284d72fc4f93c1ee86d05732c84
        			this._savedFocus = dijit.getFocus(this);
      Line 37 of eval script 
        			dijit.byId('loadingDialog').show();
    

problem seems to be in dijit/base/focus.js on line 32

opera does define _document.selection so code take IE patch, but doesn't define s.createRange().htmlText (it's TextRange? object in IE if I'm not wrong)

quick fix: add check in line 32, and if dojo.isOpera, use: s.createRange().text.length instead of htmlText

if(!dojo.isOpera) {
   return !s.createRange().htmlText.length; // Boolean
} else {
  return !s.createRange().text.length;
}

Change History (2)

comment:1 Changed 10 years ago by bill

Milestone: tbd1.4

1.3rc1 has been release; bumping remaining tickets to 1.4 (except for documentation/testing tickets)

comment:2 Changed 10 years ago by bill

Resolution: fixed
Status: newclosed

This is working now; Jared did some fixes to focus.js that got opera working in [19678].

Note: See TracTickets for help on using tickets.