Skip to content
New issue

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

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

Already on GitHub? # to your account

Specify [LegacyWindowAlias=HTMLDocument] on Document #551

Closed
wants to merge 1 commit into from

Conversation

TimothyGu
Copy link
Member

@TimothyGu TimothyGu commented Dec 25, 2017

In https://html.spec.whatwg.org/multipage/window-object.html#the-window-object there is:

For historical reasons, Window objects must also have a writable, configurable, non-enumerable property named HTMLDocument whose value is the Document interface object.

I'd like to get rid of that using the still relatively new [LegacyWindowAlias] extended attribute. However, Web IDL forbids that extended attribute from being used on partial interface definitions, and thus I had to open the PR here rather than as HTML. As much as I hate putting more HTML-specific things in DOM, I think this is minor enough to be okay.

As soon as this gets merged I'll open a PR to HTML removing that paragraph.

/cc @tobie


Preview | Diff

@tobie
Copy link
Contributor

tobie commented Dec 25, 2017

LGTM

@annevk
Copy link
Member

annevk commented Jan 3, 2018

So #221 and #278 are not resolved yet. It's unclear if any engine actually implements this, so I'm not sure it's a good idea to make this change as it might lead folks to think we made some kind of decision here.

@domenic
Copy link
Member

domenic commented Jan 22, 2018

I think it'd still be a good idea to add this here as it's a non-normative change that makes things easier to understand while reading the spec. (And also easier for any implementations like Servo or jsdom that implement it exactly.)

We could separately add a warning about #221 and #278, but I'd like to see this merged if possible.

@annevk
Copy link
Member

annevk commented Jan 22, 2018

When I talked it through with @foolip it sounds like the solution will be that we have HTMLDocument as a distinct empty interface (similar to XMLDocument) and HTML will need to carefully define when it gets allocated. Document will still define all the joint members. And I guess we get to keep SVGDocument too?

@foolip
Copy link
Member

foolip commented Jan 26, 2018

Only Safari has SVGDocument (as an alias of XMLDocument) so we don't need that.

@ExE-Boss
Copy link

Unfortunately, it looks like whatwg/html#4792 might throw a spanner into this.

@annevk
Copy link
Member

annevk commented Aug 15, 2019

Closing as it seems even more unlikely we'll end up using this at this point.

@annevk annevk closed this Aug 15, 2019
@TimothyGu TimothyGu deleted the legacywindowalias branch September 27, 2019 19:08
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants