<?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>22863</bug_id>
          
          <creation_ts>2013-08-02 19:10:33 +0000</creation_ts>
          <short_desc>Have scripts&apos;s document, base URL, etc, be packaged into a &quot;script settings&quot; object owned by globals</short_desc>
          <delta_ts>2013-11-08 23:53:01 +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></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>trivial</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ian &apos;Hixie&apos; Hickson">ian</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bobbyholley</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>cam</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>91547</commentid>
    <comment_count>0</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-08-02 19:10:33 +0000</bug_when>
    <thetext>Instead of each script having a &quot;script&apos;s document&quot;, &quot;script&apos;s base URL&quot;, etc, we should package those settings into a single &quot;script settings&quot; object owned by each global, and then when scripts are created they just use the settings of their global. Then, consider changing references to the &quot;entry script&quot; to all be references to the &quot;entry script&apos;s settings object&quot; or some such. Maybe same with incumbent script.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91554</commentid>
    <comment_count>1</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-08-02 21:48:14 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8124.
Check-in comment: Rejigger how scripts are described. Work in progress.
http://html5.org/tools/web-apps-tracker?from=8123&amp;to=8124</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95379</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-10-26 00:01:29 +0000</bug_when>
    <thetext>So, each script should have:
  - code entry-point
  - muted errors flag
  - a reference to a settings bag

Each Window, Worker, etc should have:
  - a settings bag, which should have:
      - a script execution environment per language
      - a global object
      - a browsing context
      - a document
      - a referrer source
      - a URL character encoding
      - a base URL</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95585</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-10-30 23:23:18 +0000</bug_when>
    <thetext>http://html5.org/tools/web-apps-tracker?from=8246&amp;to=8247

I must admit I&apos;ve now forgotten the original purpose of this (other than to do a cleanup... there was some plan to make the stack cleaner or something).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95601</commentid>
    <comment_count>4</comment_count>
    <who name="Bobby Holley (:bholley)">bobbyholley</who>
    <bug_when>2013-10-31 09:35:00 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #3)
&gt; http://html5.org/tools/web-apps-tracker?from=8246&amp;to=8247
&gt; 
&gt; I must admit I&apos;ve now forgotten the original purpose of this (other than to
&gt; do a cleanup... there was some plan to make the stack cleaner or something).

It had to do with a discussion about the incumbent script stack and what needed to be stored. I asked whether we could get away with just storing globals, and you realized that most script state was actually shared for all the scripts in a given global, and wanted to update the spec to reflect that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95720</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-11-01 23:06:29 +0000</bug_when>
    <thetext>Ok. Nothing else needs doing specifically here then, right? (Please reopen if something more needs doing.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95965</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-11-07 17:53:21 +0000</bug_when>
    <thetext>I remember what I needed to do. The stack of incumbent scripts has to be changed to be a stack of settings objects, so that bug 18242 can make sense.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95990</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-11-07 22:30:17 +0000</bug_when>
    <thetext>Also, the origin of scripts needs to move into the settings global if possible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95992</commentid>
    <comment_count>8</comment_count>
    <who name="Bobby Holley (:bholley)">bobbyholley</who>
    <bug_when>2013-11-07 22:35:39 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #7)
&gt; Also, the origin of scripts needs to move into the settings global if
&gt; possible.

Well, scripts have 2 origins, right? The origin of their execution context, and the origin the script was loaded from, both of which are relevant for implementations. That&apos;s in the spec somewhere, right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95999</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-11-07 23:03:07 +0000</bug_when>
    <thetext>There&apos;s probably dozens of relevant origins, but what I&apos;m talking about in comment 7 is about moving the &quot;origin&quot; and &quot;effective script origin&quot; of scripts as defined in the spec from something that&apos;s a feature of scripts to something that&apos;s a feature of their script settings object, since all scripts that share a script settings object also share the same origin and effective script origin, as far as I can tell. This is distinct from the the &quot;muted errors flag&quot;, which is based on where the script came from.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96000</commentid>
    <comment_count>10</comment_count>
    <who name="Bobby Holley (:bholley)">bobbyholley</who>
    <bug_when>2013-11-07 23:06:16 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #9)
&gt; This is distinct from the the
&gt; &quot;muted errors flag&quot;, which is based on where the script came from.

Yes, that was my concern. Sounds great.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96063</commentid>
    <comment_count>11</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-11-08 23:47:52 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8262.
Check-in comment: Move the spec from a stack of incumbent scripts to a stack of script settings object. This should in theory have no concrete effects (though I may have changed some of the origin used for Web Workers started from document.domain-affected scripts that were called from other scripts with different original origins).
http://html5.org/tools/web-apps-tracker?from=8261&amp;to=8262</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>