Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#7648 closed defect (wontfix)

Dialog: exception thrown in show() under Konqueror

Reported by: lucidity Owned by:
Priority: high Milestone: tbd
Component: Dijit Version: 1.2beta
Keywords: isCollapsed, Konqueror, dojo.global, getSelection Cc: dominique.archambault@…
Blocked By: Blocking:

Description

dijit.Dialog,show throws a TypeError? exception during normal behaviour in Konqueror 3.5.9:

"Value undefined (result of expression _window.getSelection) is not an object. Cannot be called."

This is a test case to reproduce:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   <head>
      <title>dijit.Dialog Konqueror Exception Test Case</title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <script src="dojo/dojo.js.uncompressed.js" type="text/javascript"></script>
      <style>
         .dijitDialog { border: 1px solid black; background-color: white; }
         .dijitDialogTitleBar { border-bottom: 1px solid black; background-color: #cccccc; }
         .dijitDialogCloseIcon { color: blue; }
         .hide { display: none; }
      </style>
   </head>
   <body>
      <div id="popup" class="hide">Hello world!</div>
      <script type="text/javascript">
         dojo.require('dijit.Dialog');
         var dialogDiv = dojo.byId('popup');
         var popup = new dijit.Dialog({title:'Test Dialog'}, dialogDiv);
         dojo.removeClass(dialogDiv, 'hide');
         popup.startup();
         try {
            popup.show();
            alert('No errors, test succesful!');
         } catch (e) {
            alert('Error occurred, test failed!\n'+e);
         }
      </script>
   </body>
</html>

It seems that the method isCollapsed in dijit/_base/focus.js calls the getSelection method from the window object (_window, which is actually dojo.global).

However the getSelection method does not exist in the window object on Konqueror.

It seems to me the easy fix for this is to, as is done in other places in dojo, would be to had a simple condition to check the existence of a getSelection element in the window object.

However, I think it would be highly interesting to provide a centralized, browser-agnostic system for doing text selection tasks in dojo. After looking around in the dojo code base, it seems many methods and approach are taken, haphazardly.

Change History (3)

comment:1 Changed 11 years ago by bill

Resolution: wontfix
Status: newclosed
Summary: Exception thrown in dijit.Dialog.show under KonquerorDialog: exception thrown in show() under Konqueror

Hi,

Sorry, unfortunately dijit doesn't support Konqueror at all at this time.

As for "browser-agnostic system for doing text selection tasks in dojo", that what dijit/_base/focus.js is for (across dijit's supported browsers", and also the code in dijit/_editor/selection.js is some generalized selection code (even though it's in the editor directory).

comment:2 Changed 11 years ago by lucidity

Ah I see. I looked around a bit and found this page: http://dojotoolkit.org/book/dijit-functional-spec/dijit-basics

Sorry to have bothered you with this then - however I am disappointed to see you dropped support for Konqueror, as most of our staff here uses it, and we had selected dojo over other libraries in part because of its support of Konqueror.

comment:3 in reply to:  2 Changed 11 years ago by Adam Peller

Replying to lucidity:

Sorry to have bothered you with this then - however I am disappointed to see you dropped support for Konqueror, as most of our staff here uses it, and we had selected dojo over other libraries in part because of its support of Konqueror.

This isn't to say we wouldn't accept a cleanup patch which makes Konqueror or any other browser work, provided it helps the codebase overall and doesn't add much size or complexity. We particularly dread separate branches for small market share browsers, but code cleanup to use common routines would generally play well here. Please feel free to file patches with a CLA.

Note: See TracTickets for help on using tickets.