Bug 15316 - Events are executed in designMode
Summary: Events are executed in designMode
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 523.x (Safari 3)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-29 03:19 PDT by Alfonso Martínez de Lizarrondo
Modified: 2023-02-06 13:43 PST (History)
6 users (show)

See Also:


Attachments
testcase (411 bytes, text/html)
2007-09-29 03:21 PDT, Alfonso Martínez de Lizarrondo
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alfonso Martínez de Lizarrondo 2007-09-29 03:19:46 PDT
If a document is in designMode I don't think that events should be executed, as they will make the editing harder or even raise errors if they depend on scripts that aren't loaded while the document is being edited.

Tested in XP with r25792

IE executes them.
Firefox doesn't execute.
Opera does execute.

Test case following to show that executing events can be annoying. 
If you want to test how they can raise errors, copy some text from MS Word with comments and paste them, the functions called on the onmouseover and onmouseout events aren't available and they will generate errors in the JS console.
Comment 1 Alfonso Martínez de Lizarrondo 2007-09-29 03:21:54 PDT
Created attachment 16447 [details]
testcase

This is a simple example of trying to edit a document with an onclick event.
Slightly annoying.
Comment 2 Mark Rowe (bdash) 2007-09-29 18:28:44 PDT
I'm not sure that I would consider this a bug.  What if I wanted clicking on the link in your example to display a widget where I could configure the text and target of the hyperlink, for example.
Comment 3 Alfonso Martínez de Lizarrondo 2007-09-30 01:51:40 PDT
This message might give a much better explanation, as well as showing that the current behavior doesn't match the HTML5 spec (that might need some refinement).
http://lists.w3.org/Archives/Public/public-html/2007Sep/0159.html
Comment 4 Mark Rowe (bdash) 2007-09-30 02:15:39 PDT
You're right, that is much clearer about the specific issue.  It sounds like the Firefox behaviour is what is desirable here.  Event handlers added on the document from outside should be respected, those defined within the document itself are ignored.
Comment 5 Ian 'Hixie' Hickson 2008-08-19 14:43:45 PDT
HTML5 now requires this, though it gets the same effect using quite a different definition:
   http://www.whatwg.org/specs/web-apps/current-work/#scripting2
Comment 6 Ahmad Saleem 2023-02-06 13:43:28 PST
I am not sure whether this is intended bug in relation to this or not but in WebKit ToT (259906@main), if you click on link, you get dialog but once you dismiss dialog, the caret move to start of paragraph / line rather than staying at same place and allowing editing to edit link (hyperlink text). In case of Chrome Canary 112 and Firefox Nightly 111, the caret remains at same place as you intended when trying to edit the hyperlink text.