jfweemaes / ubiquity-xforms

Automatically exported from code.google.com/p/ubiquity-xforms
0 stars 0 forks source link

Loader fails the first time a document is loaded in Safari #573

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Each time you load a new document in Safari, the loader fails to load our 
library. If you then refresh the page, the loader appears to work correctly.

Original issue reported on code.google.com by phil.boo...@gtempaccount.com on 29 Sep 2009 at 11:10

GoogleCodeExporter commented 8 years ago
I've noticed that this problem does not apply to documents loaded into a 
frameset by 
Selenium. That is to say, when you load the Selenium frameset, you need to do 
an 
initial refresh to get things working, but after that all of the tests are 
loaded 
correctly first time.

This behaviour conflicts with standalone pages. If you navigate a link from one 
to 
another, both pages require an initial refresh in order for the load to kick in 
properly. The same is true if you drag and drop a different page into the 
window.

Original comment by phil.boo...@gtempaccount.com on 29 Sep 2009 at 11:39

GoogleCodeExporter commented 8 years ago

Original comment by phil.boo...@gtempaccount.com on 7 Oct 2009 at 3:07

GoogleCodeExporter commented 8 years ago
One suspicion that I have about this issue is that it may be related to the 
timing of 
Safari's onload event, which is discussed in numerous threads around the web 
(e.g. 
[1]). The consensus in most of these discussions seems to be to use an external 
library abstraction (e.g. DOMContentLoaded) rather than rely on the browser's 
onload 
event.

The UXF loading process of is all quite mysterious to me, so I'm attempting to 
piece 
it together now. Once I understand it better, I'll see if such an abstraction 
is 
available in the YUI and whether it applies to this issue.

[1] http://forums.whirlpool.net.au/forum-replies-archive.cfm/1124777.html

Original comment by phil.boo...@gtempaccount.com on 8 Oct 2009 at 10:53

GoogleCodeExporter commented 8 years ago

Original comment by phil.boo...@gtempaccount.com on 12 Oct 2009 at 11:13

GoogleCodeExporter commented 8 years ago
So after plenty of hit-and-miss investigation using calls to alert(), I noticed 
that 
loader-end.js was finishing loading before xforms-loader.js, which seemed 
surprising. 
This led me to try out a speculative fix, chaining the call for loader-end.js 
to the 
completion of xforms-loader.js. This fix works well for me locally and has no 
adverse 
effects in Firefox or IE. It is now awaiting review at r3055.

Unfortunately, the very nature of the bug precludes usage of the debugger to 
investigate the deeper cause of the problem. In order to set a breakpoint in 
Safari's 
debugger, you have to load the relevant page and scripts first. But, by the 
time 
you've done that, the opportunity to observe the problem has passed, because it 
only 
occurs on the first load of each session, not during refresh.

Original comment by phil.boo...@gtempaccount.com on 13 Oct 2009 at 11:30

GoogleCodeExporter commented 8 years ago
Fix is in trunk at r3063.

Original comment by phil.boo...@gtempaccount.com on 14 Oct 2009 at 8:57

GoogleCodeExporter commented 8 years ago
Unfortunately, some recent change appears to have broken this fix, because all 
documents are now failing to load the first time in Safari again.

Original comment by phil.boo...@gtempaccount.com on 15 Oct 2009 at 10:06

GoogleCodeExporter commented 8 years ago
Fix has been re-committed to trunk at r3083.

Original comment by phil.boo...@gtempaccount.com on 15 Oct 2009 at 10:29