Ticket #10811 (closed defect: wontfix)

Opened 6 months ago

Last modified 3 months ago

dijit.form.DateTextBox issues on Windows 7 Chrome

Reported by: mountainriver Owned by: bill
Priority: normal Milestone: tbd
Component: Dijit Version: 1.4.0
Severity: normal Keywords:
Cc: peller, alex

Description

for the example on:

http://www.dojotoolkit.org/reference-guide/dijit/form/DateTextBox.html#id2

issue:

The 'Changing Constraints on the Fly' example does not work reliably on Windows 7 Chrome (latest version as of 3/3/2010 - version 4.0.249.89). If you use the Chrome javascript console, the error message reads 'Uncaught Illegal Access: native_string.js:183'. There seems to be an issue when two instances of DateTextBox? exist on the same web page...

To reproduce this error, In Chrome on Windows 7, I turn on the Chrome javascript console (Developer > Javascript Console). I click on the 'View Example' button for 'Changing Constraints on the Fly', and wait for the pop-up to load. If it loads successfully, then I close the pop up example window, and click on the 'View Example' button again. (repeat if necessary - it usually takes no more than 10-20 tries). When it fails, I get the 'Uncaught Illegal Access' error in the javascript console, and the pop up example window hangs with the loading animation spinning... Are there any workarounds or is this a bug?

Change History

Changed 6 months ago by peller

  • owner changed from anonymous to doughays
  • component changed from General to Dijit

Changed 6 months ago by doughays

  • owner changed from doughays to bill

I am unable to reproduce this without Chrome's JavaScript? Console activated. It also fails with the latest Chrome 4 on Windows XP. If you close the CodeGlass? execution popup dialog and reattempt it, it will eventually work (at least for me). It has nothing to do with 2 DateTextBox? widgets on the same page since dijit/tests/form/test_DateTextBox.html has several boxes and loads successfully everytime with the Chrome's JavaScript? Console activated. I would suspect a CodeGlass? problem or a Chrome problem.

Assigning to bill to see if he wants to try and narrow down the culprit.

Changed 6 months ago by jli

This bug can be resolved by appending the following line:

dojo.requireLocalization("dojo.cldr", "gregorian", "ROOT");

just before the dojo.declare statement.

Changed 6 months ago by jli

Just a hint that this bug sometimes cannot be reproduced. It's because gregorian.js does not exist for all available locales (e.g. en-us). If the default locale (ROOT) does not set, error occurs and the date text box will not be initialized. If you set the date text box with an available locale (or nls file exists for your browser locale), no error will be found.

Changed 6 months ago by doughays

  • cc peller added

Changed 6 months ago by peller

en-us is not present because it does not override anything from en or ROOT. ROOT should be loaded regardless, and the 404's you see when there is no build should be ignored.

Changed 6 months ago by mountainriver

Hi,

Thanks for working on this issue.

I tried adding the dojo.requireLocalization("dojo.cldr","gregorian","ROOT"), but when I try loading the page about 50 times, I still randomly get the 'Uncaught Illegal Access: native_string.js:185' error with Chrome.

When this happens, at least one of the input fields remains a plain input field, instead of being an instance of dijit.form.DateTextBox?.

Here is the source code that I used on a separate test page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html dir="ltr">

<head>

<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dijit/themes/tundra/tundra.css"> <style type="text/css">

body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }

</style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js"

djConfig="parseOnLoad: true">

</script> <script type="text/javascript">

dojo.require("dojo.parser"); dojo.require("dijit.form.DateTextBox?"); dojo.requireLocalization("dojo.cldr", "gregorian", "ROOT");

</script>

</head>

<body class="tundra ">

<label for="fromDate">

From:

</label> <input id="fromDate" type="text" name="fromDate" dojoType="dijit.form.DateTextBox?" required="true" onChange="dijit.byId('toDate').constraints.min = arguments[0];" /> <label for="toDate">

To:

</label> <input id="toDate" type="text" name="toDate" dojoType="dijit.form.DateTextBox?" required="true" onChange="dijit.byId('fromDate').constraints.max = arguments[0];" />

</body>

</html>

Changed 6 months ago by mountainriver

I also tried adding locale="en-us" as attributes to the <input> tags, but still have the random "Uncaught Illegal Access: native_string.js:185" issue:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html dir="ltr">

<head>

<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dijit/themes/tundra/tundra.css"> <style type="text/css">

body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }

</style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js"

djConfig="parseOnLoad: true">

</script> <script type="text/javascript">

dojo.require("dojo.parser"); dojo.require("dijit.form.DateTextBox?"); dojo.requireLocalization("dojo.cldr", "gregorian", "ROOT");

</script>

</head>

<body class="tundra ">

<label for="fromDate">

From:

</label> <input id="fromDate" type="text" name="fromDate" dojoType="dijit.form.DateTextBox?"

required="true" onChange="dijit.byId('toDate').constraints.min = arguments[0];" locale="en-us"

/> <label for="toDate">

To:

</label> <input id="toDate" type="text" name="toDate" dojoType="dijit.form.DateTextBox?"

required="true" onChange="dijit.byId('fromDate').constraints.max = arguments[0];" locale="en-us"

/>

</body> <!-- NOTE: the following script tag is not intended for usage in real world!! it is part of the CodeGlass? and you should just remove it when you use the code -->

</html>

Changed 6 months ago by peller

  • cc alex added

Alex, can you shed any light on this? Should this be pursued as a Chrome bug?

Changed 6 months ago by jli

Further update: one more line is required to fix the bug. Here is my code:

dojo.provide("jli.DateTextBox");
dojo.requireLocalization("dojo.cldr", "gregorian", "ROOT");
dojo.requireLocalization("dijit.form", "validate", "ROOT");
dojo.require("dijit.form.DateTextBox");
dojo.declare("jli.DateTextBox", dijit.form.DateTextBox, {
......

Changed 6 months ago by mountainriver

Could you please provide a complete working example of this? I still get the 'Uncaught illegal access: native_string.js:185' issue.

NOTE: I reload the test page (using the code below) 50 times

There should be both declarative style and programmatic style solutions to this issue, right?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html dir="ltr">

<head>

<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dijit/themes/tundra/tundra.css"> <style type="text/css">

body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }

</style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js"

djConfig="parseOnLoad: true">

</script> <script type="text/javascript">

dojo.require("dojo.parser"); dojo.require("dijit.form.DateTextBox?"); dojo.requireLocalization("dojo.cldr", "gregorian", "ROOT"); dojo.requireLocalization("dijit.form", "validate", "ROOT");

</script>

</head>

<body class="tundra">

<h3>testing dijit.form.DateTextBox?</h3> <label for="fromDate">

From:

</label> <input id="fromDate" type="text" name="fromDate" dojoType="dijit.form.DateTextBox?"

required="true" onChange="dijit.byId('toDate').constraints.min = arguments[0];" locale="en-us"

/> <label for="toDate">

To:

</label> <input id="toDate" type="text" name="toDate" dojoType="dijit.form.DateTextBox?"

required="true" onChange="dijit.byId('fromDate').constraints.max = arguments[0];" locale="en-us"

/>

</body>

</html>

Changed 6 months ago by jli

Try this one:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html dir="ltr">

    <head>

        <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dijit/themes/tundra/tundra.css"> <style type="text/css">

            body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }

        </style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js"

                djConfig="parseOnLoad: true">

        </script> <script type="text/javascript">
		dojo.require("dijit.dijit");

                dojo.require("dojo.parser"); dojo.require("dijit.form.DateTextBox"); dojo.requireLocalization("dojo.cldr", "gregorian", "ROOT"); dojo.requireLocalization("dijit.form", "validate", "ROOT");

        </script>

    </head>

    <body class="tundra">

        <h3>testing dijit.form.DateTextBox</h3> <label for="fromDate">

            From:

        </label> <input id="fromDate" type="text" name="fromDate" dojoType="dijit.form.DateTextBox"

                required="true" onChange="dijit.byId('toDate').constraints.min = arguments[0];" locale="en-us"

        /> <label for="toDate">

            To:

        </label> <input id="toDate" type="text" name="toDate" dojoType="dijit.form.DateTextBox"

                required="true" onChange="dijit.byId('fromDate').constraints.max = arguments[0];" locale="en-us"

        />

    </body>

</html> 

Changed 5 months ago by mountainriver

Hi All,

This sample code works great for the latest Chrome (5.0.342.9) on OS X Snow Leopard, but on the latest Chrome (4.1.249.1045) for Windows 7, I still get 'uncaught illegal access' about 20% to 30% of all the times that I have reloaded the page.

Hope this helps, Doug

Changed 5 months ago by robg

I was experiencing this same issue in Chrome 5.0.342.9 beta on Ubuntu and spent a couple days banging my head against it. I've also repro'd this issue on Chrome 5.0.342.7 beta (Ubuntu), and Chrome 4.1.249.1025 (WinXP). The requireLocalization changes seem to help, but didn't clear up the issue completely.

Using a local roll-up with dojo 1.4.2, I tracked the issue to the pattern.replace in locale.js, line 497. The fact that the 'illegal access' originates in Chrome JS/native code that's called from 'replace' seems to suggest that the issue is a Chrome bug, and not a dojo bug (I think).

The bug I filed with Chromium is here: http://code.google.com/p/chromium/issues/detail?id=42370

Changed 3 months ago by mountainriver

Good news: I tested the latest Chrome (Win 7: 5.0.375.55) and (OS X: 5.0.375.55) and the issue has been resolved...dijit.form.DateTextBox? is reliable now.

I tested the issue with: http://docs.dojocampus.org/dijit/form/DateTextBox, and with my own test code w/dojo 1.4.2 and the issue has been resolved.

Thanks for all your help!

Changed 3 months ago by bill

  • status changed from new to closed
  • resolution set to wontfix

OK great, closing this ticket then, since the browser bug was fixed there's no need to update dojo.

Note: See TracTickets for help on using tickets.