alignment of megaliths
Saturday, 2. June 2007, 20:48:28
Never an easy decision to make!
I can now confirm a few points where Opera 9.5 is going to deviate somewhat from the specs or from our earlier implementations in order to be better aligned with other browsers. If you are a webmaster or JavaScript author please check that the changes will not cause problems for you!
We'll do the following:
- Capturing event listeners will fire on target. This behaviour will be kept until Firefox fixes their bug. Opera's new implementation is not expected to cause problems since most sites using the addEventListener API will have been tested against Firefox. A possible exception is widget code which may expect Opera's old behaviour.
- Implementation of capturing load event handlers changed: load events from within the document will now only be captured when the capturing event listener is attached to the document. In other words, earlier you could do
window.addEventListener('load', func, true)and expect func to be called for all "load" events inside the document. From 9.5 you will have to dodocument.addEventListener('load', func, true)to get this capturing behaviour. (Please do not copy that code unless you know what the "true" part of it means!) This will probably become the official specification. Again, this will probably only break code specifically written for Opera such as widgets, and the change is known to fix large number of websites that use event capture by mistake.
- We've changed the relationship between body.clientHeight and documentElement.clientHeight in standards mode. The value of body.clientHeight is now viewport height, documentElement.clientHeight is document height. This is AFAIK what Firefox does too. This change can break your website if you use browser detection before reading clientHeight from body or documentElement.
I believe Firefox will support adding capturing load events to document. There you go, alignment of megaliths!
(Like the post title? Found it on Wikipedia
quick spec for IEs document.activeElementinternal whiteboard scribblings![]()
By WildEnte, # 2. June 2007, 21:02:09
Not reliably at all, no. Sniffers are terribly unreliable and unpredictable things. You never know if they are being used responsibly or irresponsibly. Sniffing out the sniffers would be even less reliable than the code that uses them.
The changes are basically needed because the vast majority of sites that use these features, expect the new approach. In the few cases where sites have specifically tailored their code to work with Opera's implementation, we hope that since they have already allowed for Opera once, they will update to take care of the new approaches. This is why we want to let them know early so they have the time to adapt. If needed, there is the possible fallback of BrowserJS, but it's best if Web developers can have the time they need to update their code.
The first change is, unfortunately, not in line with the DOM 2 events spec (to my knowledge, the DOM 3 events spec is not yet decided on this subject, and there are ongoing discussions in the working group). However, it is in line with all major implementations, including Gecko, KHTML/KJS, WebKit, and even iCab. This is one case where (IMHO) the real Web is dictating that the spec will probably need to be changed, and we can attest to that.
The second change is allowed by the current spec, since the DOM events spec does not cover the window object at all, and only recognises the document object. Opera 9.5 complies with that, and captures load events on the document (just like KHTML/KJS and WebKit). When it comes to the window object, it has always been browsers trying to be compatible with each other, without a spec to follow (though that will change). In this case, Opera 9.5 will be compatible with the other implementations when it comes to the window object, which is a positive thing.
The last change relates to two properties that are extensions to JavaScript (initially introduced by Internet Explorer, I think). So basically, since we implement properties added by another browser, we should do so correctly, so we are doing that in 9.5, and implementing them in the same way as Internet Explorer in standards mode. Opera 9.2's approach was incompatible, and was a bug. That bug will be fixed in Opera 9.5.
By tarquinwj, # 2. June 2007, 22:46:49
By Andrew Gregory, # 3. June 2007, 03:50:14
(hint; Tarquin WJ == Mark WJ
By tarquinwj, # 3. June 2007, 06:58:45
By xErath, # 3. June 2007, 20:58:23
By Robin_reala, # 4. June 2007, 09:40:48
And what about Wii Browser?..
By FataL, # 4. June 2007, 16:34:41
Since then, from what I have read in bug reports, they experimented with fixing it again, found that it broke too much, and reverted the fix. I assume that if Firefox were to fix the bug, and the Web pages were to change to accommodate that, that Webkit would also fix it. But please don't trust my memory on that one - I am not in any way a spokesperson for Webkit, check their bug tracking system if you want more details.
As for Opera on Wii, the current release uses a version of the scripting engine that contains the change to capture phase firing on target, and the clientHeight fix, but it seems not the load capturing change.
By tarquinwj, # 4. June 2007, 22:26:21
By FataL, # 5. June 2007, 13:43:01
By velmu, # 8. June 2007, 08:11:49