Whatwg spec describes conception of the speculative HTML parsing.
So, there are many places in spec with the term active speculative parser. Spec says that HTML parser that owns an instance of speculative parser that performs in parallel. So parsing of HTML parser and parsing of Speculative parser are performed in parallel, independent of each other having their own resources.
I am inerested in a few things.
The first one.
Spec says that the speculative parser acting like HTML parser with some restriction, so that means it performs same steps like it does HTML parser.
Example with an end tag whose name is "script". Does it means that speculative parser will perform all steps (independently) from HTML parser?
But what about the step:
If the active speculative HTML parser is null and the JavaScript execution context stack is empty, then perform a microtask checkpoint.
Will that step be performed in two independent thread for HTML parser and speculative parser or not? If that step has affection only for HTML parser and haven't for speculative parser, it should say explicitly. You can argue that this is noncense because speculative parser can't perform it instruction due with the reason that step doesn't follow to the condition: "speculative parser is null".
Ok, what about an example in another algorithm:
If the active speculative HTML parser is not null, then return the result of creating a speculative mock element given given namespace, the tag name of the given token, and the attributes of the given token.
What can you say now? I want to know what steps can be applied to this or that parser and how they should fit together.
Second one:
Spec has algorithm speculative fetch with some rules for it. One of that rules describes:
If the speculative HTML parser encounters one of the following elements, then act as if that element is processed for the purpose of its effect of subsequent speculative fetches.
What does it mean: "act as if that element is processed for the purpose of its effect of subsequent speculative fetches."?
Addition 1, (step 2, note):
The result is not used. This step allows for a speculative fetch to be initiated from non-speculative parsing. The fetch is still speculative at this point, because, for example, by the time the element is inserted, intended parent might have been removed from the document.
The last sentence is unclear to me, could you clarify what there is going on?