Commit 0e04831
committed
Implement circa 2021 spec change for fragment parsing in foreign content
This change brings us into conformance with the “make breaking out of
foreign content apply in innerHTML” requirements from the HTML spec PR
at whatwg/html#6399 — and into interoperability
with current WebKit and Blink behaviour, making fragment parsing break
out of foreign content in the same way document parsing does.
Before this code change, when parsing elements like <p>, <div>, and
<nobr> inside SVG/MathML via innerHTML, they would stay in the foreign
namespace. But, with this change, they now correctly “break out”, and
are created in the HTML namespace.
TreeBuilder.java
----------------
- Start tags: Remove fragment-only restriction on break-out behavior
- End tags: Allow </p> and </br> to reach mode-handling-in-fragment case
- Use currentPtr > 0 to preserve context element when popping1 parent 6904dd1 commit 0e04831
File tree
3 files changed
+26
-14
lines changed- src/nu/validator/htmlparser/impl
- test-src
- nu/validator/htmlparser/test
- test/resources
3 files changed
+26
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1531 | 1531 | | |
1532 | 1532 | | |
1533 | 1533 | | |
1534 | | - | |
1535 | | - | |
1536 | | - | |
1537 | | - | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
1538 | 1542 | | |
1539 | | - | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
1540 | 1547 | | |
1541 | 1548 | | |
1542 | 1549 | | |
| |||
3220 | 3227 | | |
3221 | 3228 | | |
3222 | 3229 | | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
| 3234 | + | |
3223 | 3235 | | |
3224 | 3236 | | |
3225 | 3237 | | |
| |||
3564 | 3576 | | |
3565 | 3577 | | |
3566 | 3578 | | |
3567 | | - | |
3568 | 3579 | | |
3569 | 3580 | | |
3570 | | - | |
3571 | | - | |
3572 | | - | |
| 3581 | + | |
| 3582 | + | |
3573 | 3583 | | |
3574 | 3584 | | |
3575 | 3585 | | |
| |||
3650 | 3660 | | |
3651 | 3661 | | |
3652 | 3662 | | |
3653 | | - | |
3654 | 3663 | | |
3655 | | - | |
3656 | | - | |
3657 | | - | |
| 3664 | + | |
| 3665 | + | |
3658 | 3666 | | |
3659 | 3667 | | |
3660 | 3668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| |||
Submodule html5lib-tests updated 60 files
- .github/workflows/downstream.yml+76
- .github/workflows/lint.yml+25
- .gitignore+79
- lint+6
- lint_lib/__init__.py
- lint_lib/_vendor-patches/funcparserlib.patch+24
- lint_lib/_vendor/__init__.py
- lint_lib/_vendor/funcparserlib/LICENSE+18
- lint_lib/_vendor/funcparserlib/__init__.py
- lint_lib/_vendor/funcparserlib/lexer.py+211
- lint_lib/_vendor/funcparserlib/lexer.pyi+34
- lint_lib/_vendor/funcparserlib/parser.py+872
- lint_lib/_vendor/funcparserlib/parser.pyi+83
- lint_lib/_vendor/funcparserlib/py.typed
- lint_lib/_vendor/funcparserlib/util.py+72
- lint_lib/_vendor/funcparserlib/util.pyi+7
- lint_lib/_vendor/vendor.txt+1
- lint_lib/lint.py+280
- lint_lib/parser.py+177
- pyproject.toml+7
- serializer/core.test+2-2
- tokenizer/domjs.test+6-1
- tokenizer/test1.test+4
- tokenizer/test2.test+1-1
- tokenizer/test3.test+8-8
- tree-construction/blocks.dat-24
- tree-construction/comments01.dat+4-11
- tree-construction/doctype01.dat+5-1
- tree-construction/entities02.dat+2-2
- tree-construction/foreign-fragment.dat+109-23
- tree-construction/html5test-com.dat-1
- tree-construction/math.dat+23
- tree-construction/menuitem-element.dat+2-18
- tree-construction/namespace-sensitivity.dat+6
- tree-construction/plain-text-unsafe.dat
- tree-construction/quirks01.dat+53
- tree-construction/ruby.dat+1
- tree-construction/scriptdata01.dat-13
- tree-construction/search-element.dat+46
- tree-construction/svg.dat+23
- tree-construction/tables01.dat+51-14
- tree-construction/template.dat+86-17
- tree-construction/tests1.dat+15-45
- tree-construction/tests10.dat+25-21
- tree-construction/tests16.dat-2
- tree-construction/tests17.dat+4-6
- tree-construction/tests18.dat+81-43
- tree-construction/tests19.dat-56
- tree-construction/tests2.dat+11-1
- tree-construction/tests20.dat+265-5
- tree-construction/tests21.dat+6-25
- tree-construction/tests26.dat+60
- tree-construction/tests4.dat+16
- tree-construction/tests6.dat+1-1
- tree-construction/tests7.dat+41-6
- tree-construction/tests8.dat+3
- tree-construction/tests9.dat+31-21
- tree-construction/tests_innerHTML_1.dat+5-48
- tree-construction/webkit01.dat+45-17
- tree-construction/webkit02.dat+472
0 commit comments