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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>141254</bug_id>
          
          <creation_ts>2015-02-04 11:14:34 -0800</creation_ts>
          <short_desc>Script ordering for scripts dynamically inserted is wrong</short_desc>
          <delta_ts>2022-07-30 13:23:51 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Windows 8</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryan Molden">rmolden</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1066866</commentid>
    <comment_count>0</comment_count>
    <who name="Ryan Molden">rmolden</who>
    <bug_when>2015-02-04 11:14:34 -0800</bug_when>
    <thetext>When scripts are dynamically inserted by another script, via &lt;DOM script node&gt;.parentElement.insertBefore they are run out of order vis-à-vis the statically declared scripts in the HTML file.

Repro: 

Extract attached archive to directory, modify A.js to set the newly created script node&apos;s src attribute to the proper path where you extracted the repro files, load test.html in WebKit.

Expected:

Alert ordering to be &quot;Executing A.js&quot; -&gt;  &quot;Executing A1.js&quot; -&gt; &quot;Executing B.js&quot;


Actual:

Alert ordering is &quot;Executing A.js&quot; -&gt;  &quot;Executing B.js&quot; -&gt; &quot;Executing A1.js&quot;

In IE ordering is as expected. In Chrome it is the same as WebKit. Not sure who is correct here via the standards, but if there is latitude allowed I think IEs ordering is the most sensible and logical.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1066867</commentid>
    <comment_count>1</comment_count>
      <attachid>246038</attachid>
    <who name="Ryan Molden">rmolden</who>
    <bug_when>2015-02-04 11:15:31 -0800</bug_when>
    <thetext>Created attachment 246038
Repro for bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887855</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-30 07:21:19 -0700</bug_when>
    <thetext>I am unable to reproduce this bug in Safari 15.6 based on attached test case, I noticed following behavior across all browsers (Chrome Canary 106 and Firefox Nightly 105):

Alert ordering is &quot;Executing A.js&quot; -&gt;  &quot;Executing B.js&quot;

A1.js does not get loaded at all in any browsers.

I am not sure about web-spec but since all browsers are in consensus. Do we need to do more or this can be marked as &quot;RESOLVED WONTFIX&quot; or accordingly anything appropriate. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887887</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-07-30 13:23:51 -0700</bug_when>
    <thetext>All browsers match. -&gt; Config changed</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>246038</attachid>
            <date>2015-02-04 11:15:31 -0800</date>
            <delta_ts>2015-02-04 11:15:31 -0800</delta_ts>
            <desc>Repro for bug</desc>
            <filename>Test.zip</filename>
            <type>application/octet-stream</type>
            <size>989</size>
            <attacher name="Ryan Molden">rmolden</attacher>
            
              <data encoding="base64">UEsDBBQAAAAIAINYREZlrujRSQEAAG8CAAAEAAAAQS5qc2VSy07DMBC8V+o/rCK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