Re: designMode and event listeners (detailed review of Editing)

On Thu, 06 Sep 2007 14:58:42 +0200, Simon Pieters <simonp@opera.com> wrote:

> On Thu, 06 Sep 2007 13:25:43 +0200, Simon Pieters <simonp@opera.com>  
> wrote:
>
>> The second paragraph doesn't match what Firefox does. This is how it  
>> works in Firefox, AFAICT:
>>
>> When you set designMode="on" on a document, all event listeners that  
>> were registered on the document with addEventListener() with a script  
>> that was itself in the same document must be ignored. Additionally, all  
>> event listeners that were registered using onXXX="" attributes in the  
>> markup, as well as .onXXX DOM attributes, must be ignored, regardless  
>> of where they came from.
>
> Test cases for this (for now, these assume that all of contentEditable,  
> designMode, addEventListener and attachEvent are supported):
>
>     http://simon.html5.org/test/html/editing/event-listeners/

For some reason I thought that designMode didn't work in IE, but it does;  
you just can't enable designMode for the same document. Some tests were  
also incorrect.

I have fixed the tests and updated them so that they are usable in  
different browsers. Currently they have the pass condition such that both  
Firefox and IE have either pass or N/A on all.

However, Firefox and IE have different strategies for "disabling" scripts  
when designMode is enabled, and I'm not sure which one is best.

IE seems to destroy all event listeners at the time designMode is enabled.  
(Firefox's logic is quoted above.)

Since Firefox only supports addEventListener and IE only attachEvent (and  
since IE can't enable designMode for the same document) it is possible to  
implement something that is compatible with both, but it might not be the  
sanest solution. It might be better to either follow IE's logic or follow  
Mozilla's logic. I don't know.

-- 
Simon Pieters
Opera Software

Received on Friday, 16 November 2007 15:26:16 UTC