w3c / w3c/DOM-Parsing

Element.outerHTML setter specification doesn't match majority of browsers

Open
#70 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
28
Forks
14
Avg merge
3h 10m
Merged PRs (30d)
1

Description

While working on trying to align WebKit's Element.outerHTML setter with other browsers, I noticed a few issues:

  1. WebKit & Blink have logic in the setter to merge with the previous & next Text nodes after inserting the fragment. This is not present in the specification and Gecko doesn't seem to implement it.
  2. WebKit & Blink throw a NoModificationAllowedError if the parent is not an Element while the specification allows setting outerHTML when the parent is a DocumentFragment. Gecko doesn't throw so they may be matching the spec here, not sure.
  3. The specification says that we should early return without throwing if the parent is null. Per point 2, WebKit & Blink throw a NoModificationAllowedError instead. It seems Gecko matches the spec.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the outerHTML setter specification with the WebKit, Blink, and Gecko behavior described in the issue. Review the three discrepancies around text-node merging, DocumentFragment parents, and null parents, then identify the agreed specification change or browser behavior to document. Done means the mismatch is resolved with a clear, reviewed outcome.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.