<?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>11323</bug_id>
          
          <creation_ts>2010-11-16 09:55:55 +0000</creation_ts>
          <short_desc>Don&apos;t run scripts when the owner doc isn&apos;t the inserter parser&apos;s doc or when the owner doc is not the same at &quot;run&quot; and &quot;execute&quot; time</short_desc>
          <delta_ts>2011-08-04 05:36:15 +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>
          <dependson>11301</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Henri Sivonen">hsivonen</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>hsteen</cc>
    
    <cc>ian</cc>
    
    <cc>james</cc>
    
    <cc>jonas</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>42558</commentid>
    <comment_count>0</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2010-11-16 09:55:55 +0000</bug_when>
    <thetext>Context: https://bugzilla.mozilla.org/show_bug.cgi?id=592366

As a defense in depth measure, please make scripts not executable (with their &quot;already started&quot; flag set!) if 
 1) For a parser-inserted script at the time of the &quot;run&quot; algorithm the owner document of the script is not the document whose active parser is triggering the &quot;run&quot; algorithm.
 2) If the owner doc of the script at the time of &quot;execution&quot; is not the same as at the time of the &quot;run&quot; algorithm was invoked.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42989</commentid>
    <comment_count>1</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2010-12-02 13:01:55 +0000</bug_when>
    <thetext>If spec is changed on point #2, it would make sense to put the Opera/IE behavior of canceling a script and unblocking the parser if the script was the parser-blocking script when a pending script is removed from the tree:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-November/029039.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45291</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-02-08 20:56:33 +0000</bug_when>
    <thetext>For #1, I propose to add the following step after the  &quot;The user agent must set the element&apos;s &quot;already started&quot; flag.&quot; step of &quot;run&quot;:

9a. If the element has been flagged as &quot;parser-inserted&quot;, and the element&apos;s Document is not the Document of the parser that created the element, then abort these steps.


For #2, I propose to wrap the whole &quot;execute&quot; algorithm in a new &lt;ol&gt;, put the existing stuff as step 2 of that &lt;ol&gt;, and make the following step 1:

1. If the element has been flagged as &quot;parser-inserted&quot;, and the element&apos;s Document is not the Document of the parser that created the element, then abort these steps.


I&apos;ll deal with the WHATWG feedback cited in comment 1 as part of dealing with e-mail feedback.


Are the above proposals acceptable solutions to this bug?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45492</commentid>
    <comment_count>3</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-02-14 20:48:13 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r5883.
Check-in comment: Make a parser-inserted script not run if it is moved to another document before it executes (and not even fetch if it is parsed into another document than its parser&apos;s document).
http://html5.org/tools/web-apps-tracker?from=5882&amp;to=5883</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45493</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-02-14 20:48:53 +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: Accepted
Change Description: see diff given above and proposal in comment 2.
Rationale: Concurred with reporter&apos;s comments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45494</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-02-14 20:54:07 +0000</bug_when>
    <thetext>Answer to comment 1 is here:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-February/030355.html

Given how much of an edge case this particular issue is, I don&apos;t think there&apos;s really any value in changing the behaviour. However, if it turns out there are pages that do trigger this behaviour, let me know (by e-mail or in a new bug), and we can change the behaviour accordingly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54120</commentid>
    <comment_count>6</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:36:15 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>