| 12:41 | <nox> | What's the difference between "Set the parser pause flag to true" and "Block the tokenizer for this instance of the HTML parser"? |
| 13:09 | <gsnedders> | nox: does the former not have some affect on script execution? |
| 13:09 | <nox> | gsnedders: We "block the tokenizer" when waiting for the parsing-blocking script to finish loading, |
| 13:10 | <nox> | so it's not like these scripts are going to execute themselves anyway. |
| 13:10 | <gsnedders> | nox: um, do we spin the event loop at all? consider setTimeout(function{document.write("foo")}, 100) |
| 13:11 | <nox> | gsnedders: I'm not sure how to consider that, and actually that makes me scared. |
| 13:13 | <nox> | gsnedders: Does that even work? |
| 13:14 | <nox> | What's the insertion point for a document.write call inside setTimeout? |
| 13:26 | <nox> | gsnedders: Please tell me that's supposed to indirectly call document.open, otherwise my whole idea to avoid the concept of insertion point is useless. :( |
| 13:27 | <gsnedders> | nox: it adds it to the start of the input stream; it blows away the document if the parser has finished |
| 13:27 | <gsnedders> | nox: if you have a parser blocking script, you can easily have the timeout run before the end of the parse |
| 13:28 | <gsnedders> | this is, admittedly, an edge case you probably don't need to care about |
| 13:28 | <nox> | I see. |
| 13:28 | <nox> | I think I can avoid it anyway. |
| 13:28 | <gsnedders> | (standard disclaimer: I haven't really looked at the script-enabled side of this in a long time and my memory of the details might be wrong) |
| 13:28 | <nox> | gsnedders: If there is a parser blocking script, won't it rather add it at the end of the pending script input? |
| 13:28 | <gsnedders> | idk. |
| 13:29 | <gsnedders> | I'm also on a train and not about to try and load the spec :) |
| 13:29 | <nox> | After the input of past document.write() calls that was not yet processed. |
| 13:29 | <nox> | Ok. :) |
| 13:31 | <nox> | gsnedders: But if there is setTimeout(function{document.write("foo")}, 100) while there is a parser blocking script, whether "the parser pause flag" is set or we have "block the tokenizer for this instance", it will not process and tokenize "foo", right? |
| 13:35 | <gsnedders> | nox: not until unblocked |
| 13:35 | <nox> | gsnedders: Yeah I'm just trying to understand if there is a difference between the two. I don't see one. |
| 13:46 | <nox> | AFAIU, the insertion point is undefined when there is a parsing-blocking script, |
| 13:47 | <nox> | so I'm confused how can document.write adds anything to the input stream when called in setTimeout. |
| 13:53 | <gsnedders> | the event queue won't get spun till after the parser-blocking script has finished loading, but before the end of the parse |
| 13:58 | <nox> | gsnedders: So timers won't run until the blocking script finishes loading, and by that time we will have set insertion point again, is that it? |
| 14:02 | <gsnedders> | nox: I think |
| 14:02 | <nox> | gsnedders: OK |
| 14:02 | <nox> | gsnedders: I can still avoid insertion points if that's correct. |
| 14:02 | <nox> | WOOO |
| 15:06 | <nox> | gsnedders: But at that point ignore-destructive-writes counter will be greater than 0, so document.write should just abort itself... The plot deepens. |
| 15:10 | <gsnedders> | nox: you could try looking in wpt for tests for this? |
| 15:24 | <nox> | gsnedders: I don't even understand simpler tests hah. |
| 15:25 | <gsnedders> | nox: jgraham wrote a lot of good tests for this sort of nonsense when Opera was implementing this |
| 15:25 | <nox> | Never mind, brainfarted. |
| 15:26 | <gsnedders> | nox: hence I suspect there's decent tests |
| 15:26 | <nox> | gsnedders: Read "If the insertion point is undefined and either the Document's ignore-opens-during-unload counter" too fast, |
| 15:26 | <nox> | and saw "or" instead of "and". |
| 15:26 | <nox> | That changes... a lot of things hah. |
| 22:47 | <botie> | jarek, at 2016-11-18 09:31 UTC, zcorpan said: https://discourse.wicg.io/t/one-inch-is-not-an-inch/1228 |