Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: Upstream outerHTML property from DOM Parsing #10270

Merged
merged 3 commits into from Apr 18, 2024

Conversation

lukewarlow
Copy link
Member

@lukewarlow lukewarlow commented Apr 10, 2024

@lukewarlow lukewarlow force-pushed the domparsing-outerhtml branch 3 times, most recently from 16281f7 to 59444fb Compare April 15, 2024 10:30
@lukewarlow lukewarlow marked this pull request as ready for review April 15, 2024 10:30
source Show resolved Hide resolved
@lukewarlow
Copy link
Member Author

cc @domenic just as an fyi this one should be ready to go. But no worries if you don't have review capacity for it :)

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excited to help finish the job!

source Show resolved Hide resolved
source Show resolved Hide resolved
source Show resolved Hide resolved
source Show resolved Hide resolved
source Outdated Show resolved Hide resolved
@lukewarlow lukewarlow requested a review from domenic April 16, 2024 10:30
@domenic
Copy link
Member

domenic commented Apr 17, 2024

I just realized I gave bad advice on creating the body element and appending it. Because appending the node will move it away from wherever it was originally. That's no good!

We may want to just revert to the fictitious node thing and fix it later. But I dug a bit deeper into how we could make this work. If you're up for it...

For HTML, we basically need step 5.2 "Element" case of #html-fragment-serialisation-algorithm extracted.

For XML, I think we use https://w3c.github.io/DOM-Parsing/#dfn-xml-serializing-an-element-node . Although I guess there's some state that is set up in https://w3c.github.io/DOM-Parsing/#dfn-xml-serialization and is normally implicitly passed, which would need to be passed through?

(Also I just realized that #serialising-xhtml-fragments seems to be a vague version of DOM-Parsing's algorithm with no references in the specification... ugh.)

@lukewarlow
Copy link
Member Author

lukewarlow commented Apr 17, 2024

I think our best bet here is to revert to the fictious node for now, and then once more of DOM Parsing is upstreamed (working on insertAdjacentHTML next) we can go through and see how much we can consolidate and abstract between the HTML algorithms and the DOM Parsing ones.

@lukewarlow
Copy link
Member Author

I just realized I gave bad advice on creating the body element and appending it. Because appending the node will move it away from wherever it was originally. That's no good!

We may want to just revert to the fictitious node thing and fix it later.

@domenic this should be done now. As I say I think once have more of the DOM Parsing spec in html we'll have a bigger picture on the best way to improve things.

@domenic domenic merged commit e63884f into whatwg:main Apr 18, 2024
2 checks passed
domenic pushed a commit to w3c/DOM-Parsing that referenced this pull request Apr 18, 2024
This has been moved to the HTML Standard in whatwg/html#10270.
@domenic domenic added addition/proposal New features or enhancements topic: parser labels Apr 18, 2024
@lukewarlow lukewarlow deleted the domparsing-outerhtml branch April 18, 2024 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements topic: parser
Development

Successfully merging this pull request may close these issues.

None yet

2 participants