| 04:57 | <malaclyps> | fjdslfs |
| 22:32 | <smaug____> | hsivonen: ping |
| 22:32 | <smaug____> | or who might remember parsing well |
| 22:33 | <smaug____> | <script>document.write('<div><iframe src="http://example.com"><\/iframe><\/div>');</script> |
| 22:34 | <smaug____> | should div be added to the document before iframe added to div? |
| 22:43 | <gsnedders> | Yes. |
| 22:44 | <gsnedders> | That's parsed no differently to <script></script><div><iframe src="http://example.com"></iframe></div> |
| 22:44 | <gsnedders> | smaug____: ^^ |
| 22:44 | <smaug____> | gsnedders: but does the spec say the order |
| 22:44 | <gsnedders> | smaug____: Yes, it does for both. |
| 22:45 | <smaug____> | so, what does it say? |
| 22:45 | <smaug____> | is div added to the document before iframe is added to div? |
| 22:45 | <gsnedders> | smaug____: the script is added to the document, then the div, then the iframe |
| 22:45 | <gsnedders> | smaug____: My "yes" above was in answer to that question — it is added before the iframe is added to the div. |
| 22:46 | <gsnedders> | (document.write isn't actually that interesting unless parsing has already finished or a script element is written) |
| 22:49 | <smaug____> | gsnedders: do you happen to remember where the spec says that? |
| 22:49 | <smaug____> | (Gecko doesn't seem to do that, and I'm not sure IE11 does it either) |
| 22:56 | <SimonSapin> | gsnedders: should fragmentClass be added to that list of required things? https://github.com/html5lib/html5lib-python/blob/c36197d01779cbb48d66563cf149af202ba6b7fc/html5lib/treebuilders/__init__.py#L16-L19 |
| 23:16 | <gsnedders> | SimonSapin: idk |
| 23:17 | <SimonSapin> | ok, I’ll try and find out |
| 23:17 | <gsnedders> | SimonSapin: (Note that I would not be in the least bit surprised if the comment was wrong) |
| 23:18 | <gsnedders> | smaug____: It's implicit of the whole parser section, where document.write is processed (upon script execution) by inserting characters into the input stream, and then just a matter of when elements get added during parsing, which is always as they're created. |
| 23:29 | <smaug____> | yeah, looks like so |
| 23:30 | <smaug____> | I wonder if that is actually a bug |
| 23:30 | <smaug____> | or something which should be changed |
| 23:47 | <gsnedders> | smaug____: Observing this through mutation observers? |
| 23:49 | <smaug____> | yup |
| 23:49 | <smaug____> | I could also just let hsivonen to fix his parser :) |