Commit 844e3e5
Fix outerHTML setter for DocumentFragment parent per spec
Setting outerHTML on an element whose parent is a DocumentFragment
was incorrectly throwing a NoModificationAllowedError. Per the HTML
spec[0], the outerHTML setter should only throw when the parent is a
Document. When the parent is a DocumentFragment, the spec requires
using a temporary body element as the context for fragment parsing.
Added web tests for DocumentFragment, Document, and no-parent cases.
[0] https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#the-outerhtml-property
Fixed: 40885158
Change-Id: I79169dfbef86fbf4b6dc4d133fe90c13ca938857
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7530588
Reviewed-by: Fernando Fiori <ffiori@microsoft.com>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Commit-Queue: Stephanie Zhang <stephanie.zhang@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1611702}1 parent a3cfe4c commit 844e3e5
2 files changed
Lines changed: 33 additions & 0 deletions
File tree
- html/webappapis/dynamic-markup-insertion/the-outerhtml-property
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments