Unfortunately I haven't had success in reproducing it so far. It seems like the problem depends on page complexity so I'm basically throwing floats, divs and images at the page in the hope of eventually reaching a tipping point. I'll work on the mockup again when I have more time and post it if I succeed.
And no, it's not only opera. IE7 is affected as well and probably others but I have only tested Firefox, opera, IE7 so far. I'm not entirely sure that it's the DOM that's incomplete, it might be something else specific to canvas. I have run my test-code with an added alert( $('#bigbox' ); and the element is always found, even in the failure-case. Does canvas maybe need additional time after DOM-load to set something up? I'm pretty convinced that it cannot be a general problem with roundcorners-canvas as the setTimeout() workaround points very decidedly at a timing problem. The longer the delay the less likely I can trigger the problem. Anything above 250 makes it go away completely, although I assume the value will be different on slower/faster machines. regards, moe On Mon, 2007-12-03 at 02:34 -0500, John Resig wrote: > If you're having issues in Opera, then I assume that there's something > else at play here, since we're just using the native DOMContentLoaded > event that they trigger. > > Do you have a simple page online, anywhere, that demonstrates the issue? > > --John > > On Dec 3, 2007 12:59 AM, moe <[EMAIL PROTECTED]> wrote: > > > > hi, > > > > i spent the last half hour reading up on this and it > > seems that this bug was supposed to be fixed. at least > > the only related and still open ticket that i can find > > in trac refers to safari - which i'm not testing. > > > > well, here it strikes again. > > > > i can unfortunately not provide a complete test-case as > > i haven't managed to reproduce it from scratch and the > > page where it happens is private (corporate foobar). > > > > well, here's the meat that i can provide for now: > > > > * works well in firefox > > > > * fires too early in IE7 and opera > > > > * seems to only affect reasonable complex pages > > where load/render times come into play > > > > * happens in conjunction with roundcorners-canvas from > > http://code.google.com/p/jquery-roundcorners-canvas/ > > > > the code that triggers the problem: > > > > $(function() { > > $('#bigbox').corner("round 5px"); > > } > > > > this works fine in firefox but blows up in opera > > (every time) and in IE7 (roughly every second time). > > wrt opera you may take "blows up" quite literally > > as it annihilates the page layout to the point of > > unreadability; page gets overwidth, floats jump > > to just about anywhere. seems like roundcorners- > > canvas does some funny things when the DOM > > (or something else?) is not complete. i > > even had opera crash multiple times. > > it's not as bad in IE7, there it just fails > > silently (no rounding) without further impact. > > > > > > regardless i can make it work in all browsers (100%) > > using the following workaround: > > > > $(function() { > > setTimeout( > > function() { > > $('#bigbox').corner("round 5px"); > > }, 500 > > ); > > } > > > > i'm positive that this must be a timing issue because > > it also strikes when i remove all other javascript > > and css, except the includes of jquery and > > roundcorners-canvas. > > > > it doesn't seem to matter where i include the above code snippets. > > they behave the same when included inline at the top or bottom > > (before </body>) of the page and when included from an external > > js file. i also get identical behaviour when i omit the > > $(function())-wrapper, except that the variant without > > the timer will then also fail in firefox. > > > > so, am i missing something obvious here (ouch!) or > > has our ol'friend the timing bug returned? > > > > > > regards, moe > > > > > > >