Commit 861d00a
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 77526cb commit 861d00a
File tree
2 files changed
+22
-22
lines changed- src/nu/validator/htmlparser/impl
- test-src/nu/validator/htmlparser/test
2 files changed
+22
-22
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 | | - | |
109 | | - | |
110 | | - | |
111 | 105 | | |
112 | 106 | | |
113 | 107 | | |
| |||
129 | 123 | | |
130 | 124 | | |
131 | 125 | | |
132 | | - | |
133 | | - | |
134 | | - | |
| 126 | + | |
135 | 127 | | |
136 | 128 | | |
137 | 129 | | |
| |||
0 commit comments