w3c / w3c/DOM-Parsing

Serializing DOM as rendered, including Shadow DOM

Open
#58 4 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

As a web developer, there are times when I may want to get a string representation of the DOM as rendered. For example, I want to copy and paste the rendered DOM into a service that checks for SEO, Microdata, HTML markup validation, accessibility, etc.

With shadow DOM, doing this manually would very difficult, because there is no "rendered" version available -- in JavaScript you would have to manually replace the slot elements.

I think it would be helpful if we had a way to do this natively, either as part of XMLSerializer, or as a DOM property: .renderedInnerHTML or similar.

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 reviewing the issue's proposed entry points, XMLSerializer and a renderedInnerHTML-style DOM property, along with how Shadow DOM slots affect serialization. Define the desired rendered output and scope before implementation; the work is done when the behavior is specified and covered for Shadow DOM serialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.