312 |
oldInsertionPoint += this.insertionPoint; |
oldInsertionPoint += this.insertionPoint; |
313 |
this.setInsertionPoint (oldInsertionPoint); |
this.setInsertionPoint (oldInsertionPoint); |
314 |
|
|
315 |
// 12. If there is a script that will execute as soon as ... |
// 12. If there is a pending external script |
316 |
while (this.scriptExecutedWhenParserResumes) { |
while (this.pendingExternalScript) { |
317 |
// 12.1. If the tree construction stage is being called reentrantly |
// 12.1. If the tree construction stage is being called reentrantly |
318 |
if (this.reentrant) { |
if (this.reentrant) { |
319 |
log ('parse: abort (reentrance)'); |
log ('parse: abort (reentrance)'); |
323 |
// 12.2. Otherwise |
// 12.2. Otherwise |
324 |
} else { |
} else { |
325 |
// 1. |
// 1. |
326 |
var script = this.scriptExecutedWhenParserResumes; |
var script = this.pendingExternalScript; |
327 |
this.scriptExecutedWhenParserResumes = null; |
this.pendingExternalScript = null; |
328 |
|
|
329 |
// 2. Pause until the script has completed loading. |
// 2. Pause until the script has completed loading. |
330 |
// |
// |
560 |
log ('Running a script: aborted (async)'); |
log ('Running a script: aborted (async)'); |
561 |
// ISSUE: What is the difference with the case above? |
// ISSUE: What is the difference with the case above? |
562 |
} else if (e.src != null && e.manakaiParserInserted) { |
} else if (e.src != null && e.manakaiParserInserted) { |
563 |
if (p.scriptExecutedWhenParserResumes) { |
if (p.pendingExternalScript) { |
564 |
log ('Error: There is a script that will execute as soon as the parser resumes.'); |
log ('Error: There is a pending external script.'); |
565 |
} |
} |
566 |
p.scriptExecutedWhenParserResumes = e; |
p.pendingExternalScript = e; |
567 |
log ('Running a script: aborted (src parser-inserted)'); |
log ('Running a script: aborted (src parser-inserted)'); |
568 |
} else if (e.src != null) { |
} else if (e.src != null) { |
569 |
p.scriptsExecutedSoon.push (e); |
p.scriptsExecutedSoon.push (e); |
765 |
+ p.input.s.substring (p.insertionPoint, p.input.s.length); |
+ p.input.s.substring (p.insertionPoint, p.input.s.length); |
766 |
p.insertionPoint += s.length; |
p.insertionPoint += s.length; |
767 |
|
|
768 |
// 3. If there is a script that will execute as soon as the parser resumes |
// 3. If there is a pending external script |
769 |
if (p.scriptExecutedAfterParserResumes) { |
if (p.pendingExternalScript) { |
770 |
log ('document.write: processed later (there is an unprocessed <script src>)'); |
log ('document.write: processed later (there is an unprocessed <script src>)'); |
771 |
logIndentLevel--; |
logIndentLevel--; |
772 |
log ('document.write: return'); |
log ('document.write: return'); |
944 |
executed. Currently it does not matter, since we don't allow dynamic |
executed. Currently it does not matter, since we don't allow dynamic |
945 |
modification to the |src| content/DOM attribute value yet. --> |
modification to the |src| content/DOM attribute value yet. --> |
946 |
|
|
947 |
|
<p>See also |
948 |
|
<a href="http://suika.fam.cx/gate/2005/sw/Live%20Scripting%20HTML%20Parser">SuikaWiki: |
949 |
|
Live Scripting HTML Parser</a>. |
950 |
|
|
951 |
</body> |
</body> |
952 |
</html> |
</html> |
953 |
<!-- $Date$ --> |
<!-- $Date$ --> |