Skip to content

Specify [LegacyWindowAlias=HTMLDocument] on Document#551

Closed
TimothyGu wants to merge 1 commit intowhatwg:masterfrom
TimothyGu:legacywindowalias
Closed

Specify [LegacyWindowAlias=HTMLDocument] on Document#551
TimothyGu wants to merge 1 commit intowhatwg:masterfrom
TimothyGu:legacywindowalias

Conversation

@TimothyGu
Copy link
Copy Markdown
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
Copy Markdown
Contributor

tobie commented Dec 25, 2017

LGTM

@annevk
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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

@annevk
Copy link
Copy Markdown
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
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.

6 participants