<?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>11105</bug_id>
          
          <creation_ts>2010-10-20 10:45:39 +0000</creation_ts>
          <short_desc>Prevent execution of scripts in documents that don&apos;t have a browsing context after &apos;already started&apos; has been set</short_desc>
          <delta_ts>2011-08-04 05:15:27 +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>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Henri Sivonen">hsivonen</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>Ms2ger</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>41602</commentid>
    <comment_count>0</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2010-10-20 10:45:39 +0000</bug_when>
    <thetext>In http://www.whatwg.org/specs/web-apps/current-work/#running-a-script before the step &quot;If scripting is disabled for the script element, then the user agent must abort these steps at this point. The script is not executed.&quot;, please add a step:
&quot;If the Document the element is in is not the active document of a browsing context, then the user agent must abort these steps at this point. The script is not executed.&quot;

Please also add a note saying that this means scripts in XHR responseXML, scripts in DOMParser-created documents, scripts in documents created by XSLTProcessor::transformToDocument and scripts that are first inserted by a script into a document that has been created with document.implementation.createDocument.

Note that what&apos;s being proposed here is 2 vs. 1 majority behavior for responseXML, DOMParser and XSLTProcessor::transformToDocument but 1 vs. 2 minority behavior for document.implementation.createDocument. (In the set Gecko, Presto, WebKit that is.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41603</commentid>
    <comment_count>1</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2010-10-20 10:46:42 +0000</bug_when>
    <thetext>Demos in http://hsivonen.iki.fi/test/moz/scripts/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43557</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-12-26 20:20:33 +0000</bug_when>
    <thetext>IIRC the spec already says that scripts in documents without browsing contexts don&apos;t run, but that happens later (in the same place that tries to run event handler attributes, e.g.).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43778</commentid>
    <comment_count>3</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2011-01-03 11:45:40 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; IIRC the spec already says that scripts in documents without browsing contexts
&gt; don&apos;t run, but that happens later (in the same place that tries to run event
&gt; handler attributes, e.g.).

I tried to find this in the spec but failed. If this indeed is already in the spec, please add a note to the &quot;run&quot; algorithm highlighting this. Furthermore, I think external scripts should fail after their &quot;already started&quot; flag has been set but before a fetch is initiated if there&apos;s no browsing context.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45296</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-02-08 21:27:46 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Partially Accepted
Change Description: see diff given below
Rationale: 

I looked this up. &quot;Scripting is disabled&quot; if there is no browsing context, so the current normative requirements seem to exactly match the intent of the proposal in comment 0, and seems to match the sentiment in the last sentence of comment 3.

I&apos;ve added a note.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45297</commentid>
    <comment_count>5</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-02-08 21:31:29 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r5856.
Check-in comment: Add a note about cases where scripts won&apos;t run. Also, update some references (unrelated to the bug below).
http://html5.org/tools/web-apps-tracker?from=5855&amp;to=5856</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53592</commentid>
    <comment_count>6</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:15:27 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>