<?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>17093</bug_id>
          
          <creation_ts>2012-05-18 09:35:41 +0000</creation_ts>
          <short_desc>Step 25 - we (Opera) would prefer to follow WebKit and not add a new history position when doing document.open. The utility of this to users is questionable since many cases where it is used the content of the document before document.open is not useful (</short_desc>
          <delta_ts>2013-04-15 22:31:07 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#opening-the-input-stream</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>adrianba</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>ian</cc>
    
    <cc>james</cc>
    
    <cc>mike</cc>
    
    <cc>travil</cc>
    
    <cc>tross</cc>
    
    <cc>w3c</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>67831</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-05-18 09:35:41 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/
Multipage: http://www.whatwg.org/C#opening-the-input-stream
Complete: http://www.whatwg.org/c#opening-the-input-stream

Comment:
Step 25 - we (Opera) would prefer to follow WebKit and not add a new history
position when doing document.open. The utility of this to users is
questionable since many cases where it is used the content of the document
before document.open is not useful (e.g. it is a blank document) and other DOM
operations can be just as destructive, but not create new history positions.
In addition, any page that does document.open onload can leave the user in a
situation where it is hard to navigate back past a given point in history
because every time they load that page, an extra position is created.

Posted from: 2001:4c28:a030:30:219:99ff:fe0e:5501
User agent: Opera/9.80 (X11; Linux x86_64; U; Edition Next; en) Presto/2.10.289 Version/12.00</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67833</commentid>
    <comment_count>1</comment_count>
    <who name="James Graham">james</who>
    <bug_when>2012-05-18 09:36:21 +0000</bug_when>
    <thetext>*** Bug 17091 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68333</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-05-30 23:12:39 +0000</bug_when>
    <thetext>I did this IIRC because that&apos;s what Gecko does. What does IE do? Are any other browsers interested in changing their behaviour?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68343</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-05-31 00:28:13 +0000</bug_when>
    <thetext>IE has the same behavior as Opera as far as I can tell.  When doing document.open on an initial about:blank document no SHEntry is added, and when doing it in other cases one is added.  I&apos;ll attach a testcase that can be used to test this.

I would be fine with switching Gecko to the current IE/Opera behavior in the medium term (and in fact I have wanted to do so in the past, but it&apos;s been stymied by Gecko not having a good concept of &quot;initial about:blank&quot; yet; we&apos;re working on that, though).

We got a number of bug reports about not being able to go back and forward across document.open before we implemented our current behavior, iirc, but this was a while ago.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68344</commentid>
    <comment_count>4</comment_count>
      <attachid>1138</attachid>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-05-31 00:29:13 +0000</bug_when>
    <thetext>Created attachment 1138
Testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68401</commentid>
    <comment_count>5</comment_count>
    <who name="James Graham">james</who>
    <bug_when>2012-05-31 12:05:29 +0000</bug_when>
    <thetext>I think our plan was to move more in the direction of WebKit than the current Opera behaviour. But we would be open to arguments that the WebKit  behaviour is more user-hostile than the current Opera behaviour.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68441</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-05-31 17:38:12 +0000</bug_when>
    <thetext>If we change something here, I think it&apos;d be better to change it towards the IE/Opera behaviour described above, where initial about:blank pages force &quot;replaced&quot; to true, and otherwise it&apos;s unchanged. Especially in light of comment 3 paragraph 3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70877</commentid>
    <comment_count>7</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-18 17:40:32 +0000</bug_when>
    <thetext>This bug was cloned to create bug 18205 as part of operation convergence.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71555</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-07-27 00:11:37 +0000</bug_when>
    <thetext>Not sure what to do here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71763</commentid>
    <comment_count>9</comment_count>
    <who name="James Graham">james</who>
    <bug_when>2012-08-02 07:30:57 +0000</bug_when>
    <thetext>Neither are we :)

I think we are sold on the WebKit behaviour not being ideal, so maybe the IE/current Opera behaviour is the one to spec in the hope that WebKit will align? You should probably ask someone from WebKit if they are strongly attached to their current behaviour.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75620</commentid>
    <comment_count>10</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-10-08 20:01:03 +0000</bug_when>
    <thetext>abarth: any comments here? mihaip and bradee-oh might be good people to ping too, but they don&apos;t seem to have accounts here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75628</commentid>
    <comment_count>11</comment_count>
    <who name="Adam Barth">w3c</who>
    <bug_when>2012-10-08 20:51:07 +0000</bug_when>
    <thetext>WebKit unlikely to implement the Gecko behavior any time soon because WebKit does not implement wyciwyg.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80705</commentid>
    <comment_count>12</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-12-30 04:25:13 +0000</bug_when>
    <thetext>Ok, I&apos;m going to make it so that if we&apos;re at the initial about:blank when you do document.open() then it does it with replacement, and otherwise it does not.

However, I don&apos;t know what &quot;the initial about:blank&quot; is exactly. If you mutate it via the DOM, is it still the initial about:blank? What&apos;s the definition I should use here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84084</commentid>
    <comment_count>13</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-03-07 22:02:52 +0000</bug_when>
    <thetext>Y&apos;all didn&apos;t respond, so I used the definition we used elsewhere for similar things.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84085</commentid>
    <comment_count>14</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-03-07 22:03:53 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7738.
Check-in comment: document.open() replaces when the current doc is the initial about:blank
http://html5.org/tools/web-apps-tracker?from=7737&amp;to=7738</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84280</commentid>
    <comment_count>15</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-03-12 02:19:49 +0000</bug_when>
    <thetext>It&apos;s not clear to me from the definition you used whether doing open() and then close() and then another open() will cause the second open() to be a replace or not....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84382</commentid>
    <comment_count>16</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-03-14 00:37:49 +0000</bug_when>
    <thetext>It&apos;s the same Document all the way through, so yes, both would be replace() assuming that the Document is the first (aka about:blank) Document created for the browsing context when the browsing context was created.

Is that not Web-compatible? If so, please don&apos;t hesitate to reopen the bug, that&apos;s easy to change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84387</commentid>
    <comment_count>17</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-03-14 00:54:17 +0000</bug_when>
    <thetext>I don&apos;t think it&apos;s web-compatible enough.  Once there&apos;s been one open/close the document should no longer be considered an initial document, imo.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86245</commentid>
    <comment_count>18</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-15 22:30:23 +0000</bug_when>
    <thetext>Roger. I keyed this off whether &apos;unload&apos; gets invoked, since that seemed a pretty good indicator that the document is no longer fresh. That ok? Reopen if not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86246</commentid>
    <comment_count>19</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-04-15 22:31:07 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7838.
Check-in comment: Make document.open() do a replace only once
http://html5.org/tools/web-apps-tracker?from=7837&amp;to=7838</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1138</attachid>
            <date>2012-05-31 00:29:13 +0000</date>
            <delta_ts>2012-05-31 00:29:13 +0000</delta_ts>
            <desc>Testcase</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>299</size>
            <attacher name="Boris Zbarsky">bzbarsky</attacher>
            
              <data encoding="base64">PCFkb2N0eXBlIGh0bWw+CjxodG1sPgo8Ym9keT4KICA8c2NyaXB0PgogICAgdmFyIGkgPSAwOwog
ICAgZnVuY3Rpb24gZm9vKCkgewogICAgICB2YXIgZG9jID0gd2luZG93WzBdLmRvY3VtZW50Owog
ICAgICBkb2Mub3BlbigpOwogICAgICBkb2Mud3JpdGUoKytpKTsKICAgICAgZG9jLmNsb3NlKCk7
CiAgICB9CiAgPC9zY3JpcHQ+CiAgPGlucHV0IHR5cGU9ImJ1dHRvbiIgb25jbGljaz0iZm9vKCki
IHZhbHVlPSJDbGljayBtZSB0byB3cml0ZSB0aGluZ3MiPgogIDxpZnJhbWU+PC9pZnJhbWU+Cjwv
Ym9keT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>