This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20579 - Should entering designMode disable scripting for the document?
Summary: Should entering designMode disable scripting for the document?
Status: RESOLVED WORKSFORME
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-06 16:46 UTC by contributor
Modified: 2013-03-14 00:36 UTC (History)
11 users (show)

See Also:


Attachments

Description contributor 2013-01-06 16:46:10 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html
Multipage: http://www.whatwg.org/C#making-entire-documents-editable:-the-designmode-idl-attribute
Complete: http://www.whatwg.org/c#making-entire-documents-editable:-the-designmode-idl-attribute

Comment:
Should entering designMode disable scripting for the document?

Posted from: 173.48.81.109 by bzbarsky@mit.edu
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20121217 Firefox/20.0
Comment 1 Boris Zbarsky 2013-01-06 16:47:12 UTC
This testcase:

<!DOCTYPE html>
<body onclick="alert('hey there')">
  Click me: do I alert?
  <script>
    document.designMode = "on";
  </script>
  <script>
    alert('Hey, I still run');
  </script>
</body>

suggests non-WebKit UAs disable scripting in designmode: neither the second <script> nor the click handler run in IE9, Gecko, or Presto.
Comment 2 Aryeh Gregor 2013-01-09 12:17:43 UTC
For reference, my thoughts on the matter from some time ago:

https://bugzilla.mozilla.org/show_bug.cgi?id=765780#c7
http://lists.w3.org/Archives/Public/public-html/2011Jul/0069.html

If you decide to go like non-WebKit browsers and disable scripting, make sure to specify whether the current script runs to completion or not when designMode is turned on.  IE doesn't, last I checked (IE9) -- if you do

  <script>
  document.designMode = "on";
  alert('First alert');
  </script>
  <script>
  alert('Second alert');
  </script>

then WebKit alerts both, Gecko/Opera only alert the first, and IE alerts neither.
Comment 3 Ian 'Hixie' Hickson 2013-03-07 22:58:33 UTC
Since there's no complete interop here, I'm very very sorely tempted to leave it as is (so in this case, matching WebKit, allowing script). It has the additional benefit of being the simplest of the options.

But I'm certainly eager to entertain the alternatives, especially since not running script is more common, even if it is done differently in different browsers.

Is anyone aware of compat needs one way or the other?
Comment 4 Boris Zbarsky 2013-03-12 02:20:35 UTC
Note that I'm contemplating changing the Gecko behavior to match WebKit here.
Comment 5 Travis Leithead [MSFT] 2013-03-13 20:01:11 UTC
FWIW, IE is also contemplating moving to not disabling scripting in designMode (more closely matches contenteditable).
Comment 6 Ian 'Hixie' Hickson 2013-03-14 00:36:28 UTC
Alright. I'm marking this WORKSFORME for now then. Please reopen if either of you decide otherwise, ideally explaining why in a way that might convince the other browser vendors to agree with you. :-)