Skip to content

DOM: implement outerHTML setter with fragment replacement semantics #335

Description

@mplsllc

Status

The original innerHTML/outerHTML issue #262 is now effectively complete for parsing and serialization: innerHTML = uses the real hubbub fragment parser, and fixes1168 added real innerHTML/outerHTML read-back serialization plus correct HTML tagName behavior.

The remaining DOM surface is the outerHTML setter, which is still absent.

Scope

Implement element.outerHTML = markup by parsing the supplied HTML fragment in the context of the element's parent and replacing the element with the resulting nodes.

Requirements:

  • correct parent/context handling
  • replacement with zero, one, or multiple parsed nodes
  • DOM mutation/reconvert marking through the existing mutation pipeline
  • wrapper/node lifetime safety when the original element is removed
  • no regex/tag-stripping fallback

Acceptance

  • Replacing an element with one element works.
  • Replacing it with multiple sibling nodes works.
  • Empty string removes the element.
  • Subsequent DOM reads and rendering reflect the replacement.
  • Focused QuickJS harness coverage and iMac verification.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: js-engineDuktape, ES5 evaluator, JS bindingsenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions