Status: New
Owner: [email protected]
Labels: Type-Defect Priority-Medium

New issue 1335 by [email protected]: playground history uri failure
http://code.google.com/p/google-caja/issues/detail?id=1335

if you load a uri like
  http://caja.appspot.com/#examples/cajalife.html
into firefox or safari, the example will usually fail to load, and the console will show a js error like
  'this.editor undefined'

the problem is codemirror has an odd startup sequence (due to its use of iframes). CodeMirror.editor is not set in codemirror.js, it's set during an onload handler defined in editor.js

in Playground.java onModuleLoad there's a call to History.fireCurrentHistoryState();

gwt tries to fire onModuleLoad when the page's document is constructed, which might be before onload (which fires after images and other assets are loaded).

so fireCurrentHistoryState will do an xhr to fetch the requested html, which can fire onsuccess before the page's onload fires. onsuccess then tries to reference CodeMirror.editor, which hasn't been constructed yet.


Reply via email to