-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Move the DOMParser class to HTML #5190
Conversation
This moves the DOMParser class from https://w3c.github.io/DOM-Parsing/ into HTML, per various offline discussions. Along the way, it improves the spec in several minor ways and a couple notable ways: * It precisely defines the URL of the resulting document, in a way that matches the majority of browsers. As such, this closes w3c/DOM-Parsing#46. * It more clearly states how the parser error documents are created, namely that they also get their content type and URL set.
data-x="concept-document-content-type">content type</span> is <var>type</var> and <span | ||
data-x="concept-document-URL">url</span> is this's <span>relevant global object</span>'s <span | ||
data-x="concept-document-window">associated <code>Document</code></span>'s <span | ||
data-x="concept-document-URL">URL</span>.</p></li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This choice matches Chromium and WebKit. Gecko seems to use the relevant global object's API base URL, i.e. the relevant global object's associated Document's base URL.
Gecko's choice is more consistent with many other APIs in the spec. However, for an old API like this, I think we should just go with the majority.
@whatwg/documentation after this is merged, the Specifications table in https://developer.mozilla.org/en-US/docs/Web/API/DOMParser will need to be updated (at least — maybe the body of the article should also get some updates based on the spec refinements…) |
Forgot to add, thanks for starting this! |
Ready for another round of review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, happy with this either way to be clear.
Would anyone be up for reviewing web-platform-tests/wpt#21041? Maybe we have to wait until the web platform tests repo gets un-broken so it gets re-opened? |
Follows whatwg/html#5190. Co-Authored-By: Michael[tm] Smith <mike@w3.org>
This moves the DOMParser class from https://w3c.github.io/DOM-Parsing/
into HTML, per various offline discussions. Along the way, it improves
the spec in several minor ways and a couple notable ways:
matches the majority of browsers. As such, this closes
Improve definition of URL for Documents created by DOMParser w3c/DOM-Parsing#46.
namely that they also get their content type and URL set.
This also closes w3c/DOM-Parsing#51 and
w3c/DOM-Parsing#34 by adding explanatory
notes for points that confused people enough to file an issue.
(See WHATWG Working Mode: Changes for more details.)
/comms.html ( diff )
/dynamic-markup-insertion.html ( diff )
/imagebitmap-and-animations.html ( diff )
/index.html ( diff )
/infrastructure.html ( diff )
/scripting.html ( diff )
/system-state.html ( diff )
/timers-and-user-prompts.html ( diff )