[Webkit-unassigned] [Bug 89102] smart reloading delay creating dynamic elements

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 21 15:05:46 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=89102





--- Comment #5 from Elliott Sprehn <esprehn at gmail.com>  2012-06-21 15:05:46 PST ---
Created an attachment (id=148896)
 --> (https://bugs.webkit.org/attachment.cgi?id=148896&action=review)
Reduction

Reduction that shows what's needed to see this bug. The problem is when a script is inserted into the document with document.write and then it also does a document.write of new elements and tries to access them immediately sometimes the writes haven't happened yet.

given:

- index.html
  document.write('<script src=example.js></script>");

- example.js
   document.write('<div></div>');
   var div = document.querySelector('div');
   document.body.appendChild(document.createTextNode(div ? 'Exists', 'Missing');

When doing a full page refresh with Apple+R the div is always defined because the document.write happened immediately. Sometimes, but not always, when you put your cursor in the url bar and hit enter (cached refresh) the document.write happens _after_ the example.js is complete yielding two different DOMs:

<script></script>
<div></div>
Exists

OR

<script></script>
Missing
<div></div>

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list