<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>13144</bug_id>
          
          <creation_ts>2011-07-05 14:37:21 +0000</creation_ts>
          <short_desc>designMode needs to persist when an iframe is navigated</short_desc>
          <delta_ts>2011-09-23 18:58:29 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>LC1 HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#making-entire-documents-editable</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ayg</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>50672</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-07-05 14:37:21 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html
Multipage: http://www.whatwg.org/C#making-entire-documents-editable
Complete: http://www.whatwg.org/c#making-entire-documents-editable

Comment:
designMode needs to persist when an iframe is navigated

Posted from: 68.175.61.233
User agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.797.0 Safari/535.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50673</commentid>
    <comment_count>1</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-07-05 14:49:16 +0000</bug_when>
    <thetext>Testcase:

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1058

This sets designMode to &quot;on&quot; on an iframe&apos;s document, then navigates the iframe to a bunch of different pages.  In IE9, Firefox 6.0a2, and Chrome 14 dev, designMode remains on across all the navigations, including cross-domain and to and from about:blank.  In Opera 11.50, it apparently switches to off when the document is navigated to a different domain, which is of course wrong because it doesn&apos;t match the other browsers.

As I read the current spec, new Document objects have their designMode off, and navigating a page creates a new Document object.  This does not seem to be correct.  The navigation algorithm probably needs to set designMode on the new document to on if the old document was in an iframe and had designMode on.

This does only apply to iframes.  I couldn&apos;t test easily with Live DOM Viewer, but I created two pages like

  &lt;!doctype html&gt;&lt;script&gt;
  document.designMode = &quot;on&quot;;
  location = &quot;/tmp/test2.html&quot;;
  &lt;/script&gt;

and

  &lt;!doctype html&gt;&lt;script&gt;alert(document.designMode)&lt;/script&gt;

and Firefox 6.0a2, Chrome 14 dev, and Opera 11.50 all alert &quot;off&quot;.  (IE9 doesn&apos;t perform the navigation, since it immediately stops executing script when designMode is turned on.)

I didn&apos;t test with XML or any other funky cases, but presumably for consistency we&apos;d want the same behavior for HTML over HTTP as everything else.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53807</commentid>
    <comment_count>2</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:17:31 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55192</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-08-16 04:58:26 +0000</bug_when>
    <thetext>Well keeping it cross-origin sounds like a disaster waiting to happen.

But that aside, is designMode something you are speccing or is that going to remain on my side of the fence?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55237</commentid>
    <comment_count>4</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-08-16 15:02:55 +0000</bug_when>
    <thetext>The definition of editing host/editable depends on the definition of designMode, so if you&apos;re going to keep those you have to keep designMode too.  For now I&apos;ll stick to just defining execCommand() and friends, and how user keystrokes map to various method calls, and Selection once I steal that from DOM Range.  You can keep the rest.  At some point it might make sense for me to take more, but I have plenty to do right now with what I have, so no rush.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57217</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-23 00:22:37 +0000</bug_when>
    <thetext>I can&apos;t reproduce this.

The testcase linked above isn&apos;t testing it, since setting location is async and so all it is actually testing is the value of designMode against the same document a bunch of times in a row.

This test (click the button) shows that it resets as I would expect on navigation:

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1144

You can also test it by just seeing if the page is editable; it doesn&apos;t seem to be.

Can you confirm if my testing is valid or whether I missed something?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57249</commentid>
    <comment_count>6</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-09-23 18:58:20 +0000</bug_when>
    <thetext>Okay, I was probably just being stupid.  Navigation is async, right.  Never mind this.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>