New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need more insight into the stack of open elements #237
Comments
This replaces our previous hacky <script>-only close tag detection, which only worked in non-empty <script> cases, with a more general hacky version that works for all elements, including empty elements, by monkeypatching parse5. (Eventually inikulin/parse5#237 should give us a better solution, but for now we lock our parse5 version and monkeypatch it.) In particular, this allows us to not parse stylesheets before their close tag is encountered, which fixes #2123 and fixes #2131.
This replaces our previous hacky <script>-only close tag detection, which only worked in non-empty <script> cases, with a more general hacky version that works for all elements, including empty elements, by monkeypatching parse5. (Eventually inikulin/parse5#237 should give us a better solution, but for now we lock our parse5 version and monkeypatch it.) In particular, this allows us to not parse stylesheets before their close tag is encountered, which fixes #2123 and fixes #2131.
This replaces our previous hacky <script>-only close tag detection, which only worked in non-empty <script> cases, with a more general hacky version that works for all elements, including empty elements, by monkeypatching parse5. (Eventually inikulin/parse5#237 should give us a better solution, but for now we lock our parse5 version and monkeypatch it.) In particular, this allows us to not parse stylesheets before their close tag is encountered, which fixes #2123 and fixes #2131.
Hi @domenic,
Can you point me to the parts of the spec that describe these notifications? It will help me to come up with a proper API for that. |
See the link for "the style element" in the OP, where the bullet points I quoted are found. Based on jsdom/jsdom#2132, an API that would work for our purposes would be two adapter functions, each taking an element, which are called when the element is pushed and when it is popped, respectively. |
This replaces our previous hacky <script>-only close tag detection, which only worked in non-empty <script> cases, with a more general hacky version that works for all elements, including empty elements, by monkeypatching parse5. (Eventually inikulin/parse5#237 should give us a better solution, but for now we lock our parse5 version and monkeypatch it.) In particular, this allows us to not parse stylesheets before their close tag is encountered, which fixes #2123 and fixes #2131.
I've tried to come up with some alternative but it seems that to implement the style element properly, we need some notification: it requires action when
Do you have any ideas on how we could implement this in a parse5 adapter? It's currently causing a pretty bad regression in jsdom ever since we switched from the htmlparser2 adapter, with bad consequences for our consumers.
The text was updated successfully, but these errors were encountered: