Repository navigation
Add positional HTML insertion methods - #12753
Conversation
ee46eb1 to
b48a945
Compare
f9a87e5 to
d256495
Compare
53adea8 to
01fc7bc
Compare
|
Fixes from Opus review: Blockers
Suggestions
Nits
|
dec53b2 to
73e73db
Compare
73e73db to
0c5b590
Compare
0c5b590 to
b21b5d3
Compare
d7c9a5e to
f23f3cf
Compare
f23f3cf to
ee138bf
Compare
…usted Types sinks This aligns positional HTML insertion and streaming methods with whatwg/html#12753: Bug: 491743369 Change-Id: Ie0b6f8175b7de75b9842bf90cccd168dbced1275 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8494796 Reviewed-by: Mason Freed <[email protected]> Commit-Queue: Noam Rosenthal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1710333}
…usted Types sinks This aligns positional HTML insertion and streaming methods with whatwg/html#12753: Bug: 491743369 Change-Id: Ie0b6f8175b7de75b9842bf90cccd168dbced1275 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8494796 Reviewed-by: Mason Freed <[email protected]> Commit-Queue: Noam Rosenthal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1710333}
031a042 to
3cae80f
Compare
AI reviewReviewed at #12753 031a042 and web-platform-tests/wpt#60555 0d5e8d9. Suggestions
Nits
|
3cae80f to
9ad27b2
Compare
All addressed (here and in the WPT PR, including commit messages). |
9ad27b2 to
7944b13
Compare
…entTypeChildNode and align Trusted Types sinks, a=testonly Automatic update from web-platform-tests Move positional HTML methods to NonDocumentTypeChildNode and align Trusted Types sinks This aligns positional HTML insertion and streaming methods with whatwg/html#12753: Bug: 491743369 Change-Id: Ie0b6f8175b7de75b9842bf90cccd168dbced1275 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8494796 Reviewed-by: Mason Freed <[email protected]> Commit-Queue: Noam Rosenthal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1710333} -- wpt-commits: c3a310677da334e3d08e4704a4c7788ff8f5fdb5 wpt-pr: 63224
AI feedbackReviewed at 7944b13. Lint and the full build pass. Checked and fine: the IDL and method steps line up. Nothing can run author script between computing the parent or reference child and inserting, because Trusted Types runs first, so the pre-insert and replace calls can't throw. Blockers
Nits
|
7944b13 to
cdd3145
Compare
Throwing an exception when using those methods with an |
2af3135 to
b450495
Compare
Add `appendHTML`, `prependHTML`, `beforeHTML`, `afterHTML`, and `replaceWithHTML`, alongside their `*Unsafe` variants. Add helper algorithms for HTML insertion (filter and pre-insert/replace with/set HTML, parse HTML for insertion, and the target and parent for HTML insertion), and call those from the appropriate web-exposed methods. `NonDocumentTypeChildNode` methods fail silently when the child has no parent, like their equivalent DOM methods, and fail with a `HierarchyRequestError` for an invalid parent. Note that a `template` element is considered an invalid parent, as setting HTML on `template` elements affects their template contents rather than their children, and an `html` element is disallowed as the parent/target for pre-inserting or replacing HTML because parsing with an `html` context element always produces both a `head` and a `body` element. Note that the new `NonDocumentTypeChildNode` methods are also exposed on `CharacterData`. Rename "set and filter HTML" to "filter and set HTML" to be more consistent with the order of operations and with the newly added helper methods.
b450495 to
49e5663
Compare
Add
appendHTML(),prependHTML(),beforeHTML(),afterHTML(), andreplaceWithHTML(), alongside their*Unsafe()variants.NonDocumentTypeChildNodemethods fail silently when the child has no parent, like their equivalent DOM methods, and fail with a"HierarchyRequestError"DOMExceptionfor an invalid parent (Document, hostlessDocumentFragment,templateelement, orhtmlelement).appendHTML()andprependHTML()(and their*Unsafe()variants) also throw a"HierarchyRequestError"DOMExceptionwhen called on anhtmlelement, as parsing a fragment with anhtmlcontext element always produces both aheadand abodyelement.Note that the new
NonDocumentTypeChildNodemethods are also exposed onCharacterData.Renamed "set and filter HTML" to "filter and set HTML" to be more consistent with the order of operations and with the newly added helper methods.
Closes #10122
/dynamic-markup-insertion.html ( diff )
/index.html ( diff )
/infrastructure.html ( diff )
/parsing.html ( diff )