Skip to content

Conversation

ExE-Boss
Copy link

@ExE-Boss ExE-Boss commented Nov 22, 2019

See issue #4792, whatwg/dom#221 and whatwg/dom#278

This is already implemented in all major browsers (Firefox, Chrome and Safari).

WPT tests: web-platform-tests/wpt#20403, web-platform-tests/wpt#20676

(See WHATWG Working Mode: Changes for more details.)


review?(@annevk, @domenic)


💥 Error: Wattsi server error 💥

PR Preview failed to build. (Last tried on Jan 15, 2021, 7:59 AM UTC).

More

PR Preview relies on a number of web services to run. There seems to be an issue with the following one:

🚨 Wattsi Server - Wattsi Server is the web service used to build the WHATWG HTML spec.

🔗 Related URL

Parsing MDN data...
Parsing...



If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.

@ExE-Boss ExE-Boss force-pushed the fix/revert-html-document-removal branch from 7a61c49 to 15966b3 Compare November 22, 2019 11:21
@annevk
Copy link
Member

annevk commented Nov 22, 2019

Are there tests that show that the getter is only implemented on HTMLDocument? whatwg/dom#221 suggests there are no differences between the document classes.

Where is it defined what ends up creating which type of document?

@ExE-Boss
Copy link
Author

I’ve now created the test for this at web-platform-tests/wpt#20403.

@annevk
Copy link
Member

annevk commented Nov 25, 2019

To be clear, we need many more tests for this. E.g., web-platform-tests/wpt#20432 cannot use assert_class_string because browsers are quite different in what kind of Document object they use for .svg web-platform-tests resources. Firefox uses XMLDocument, Safari uses HTMLDocument.

And also, the specification side for all those things needs to be crystal clear. A lot of this is "Page load processing model ..." but there's also various other algorithms that end up creating Document objects.

@ExE-Boss
Copy link
Author

Well, this is just step 1 that reinstates the interface.

@domenic
Copy link
Member

domenic commented Nov 25, 2019

We don't generally do changes that leave the specification in an inconsistent state, so I don't think it would make sense to reinstate the interface without those other changes included.

@ExE-Boss
Copy link
Author

ExE-Boss commented Nov 28, 2019

Well, I looked through git history all the way back to 2009, and “new HTMLDocument” wasn’t really ever used, it was always “new Document, whose type is "html"”, or “Create a new Document node, and mark it as being an HTML document”, both of which are equivalent.

This means that a Document instance’s inheritance is tied to its type.


I don’t really know how to specify that in a sane manner.

@ExE-Boss ExE-Boss force-pushed the fix/revert-html-document-removal branch 3 times, most recently from d35283f to d62bbf0 Compare November 28, 2019 03:38
@annevk
Copy link
Member

annevk commented Dec 2, 2019

I think the ambition was always to have these classes merged as having them separate does not make a whole lot of sense. So now that they're somewhat separate we'll have to say which document creator creates which class.

@ExE-Boss ExE-Boss force-pushed the fix/revert-html-document-removal branch from cbc0ca6 to d62bbf0 Compare December 2, 2019 11:32
@ExE-Boss ExE-Boss force-pushed the fix/revert-html-document-removal branch from b968f89 to 3370bad Compare December 2, 2019 11:39
<li><p>If <var>doc</var> is an <span data-x="HTML documents">HTML document</span>, mark
<var>new doc</var> as an <span data-x="HTML documents">HTML document</span>
also.</p></li>
<li><p>Otherwise, let <var>new doc</var> be a new <code>XMLDocument</code>.</p></li>
Copy link
Author

Choose a reason for hiding this comment

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

Previously, this would’ve resulted in a Document with a default type.

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

Successfully merging this pull request may close these issues.

3 participants