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

Add [LegacyWindowAlias] extended attribute for WebKitCSSMatrix et al #364

Merged
merged 5 commits into from
May 18, 2017

Conversation

zcorpan
Copy link
Member

@zcorpan zcorpan commented May 16, 2017

Fixes #362.


Preview | Diff

@tobie
Copy link
Collaborator

tobie commented May 16, 2017

First of all, thanks for doing the work!

A couple of high-level nits:

  • Would be great to have an example.
  • Extended attributes are sorted by alphabetical order, so this should go between [LegacyUnenumerableNamedProperties] and [LenientSetter].
  • The weird line break you'll see around the spec is the result of the XML -> Bikeshed conversion, not something to emulate. Because we can't agree on what to use, however, feel free to use semantic line-breaks or wrap at 100 chars.

Seems it would be useful to include this in §3.6 Interfaces too, no?

@zcorpan
Copy link
Member Author

zcorpan commented May 17, 2017

Thanks! Will fix.

Some more todos:

  • Ban [LegacyWindowAlias] for interfaces that do not include the primary interface object in its exposure set.
  • Ban [LegacyWindowAlias] for callback interfaces.
  • Ban >1 [LegacyWindowAlias] for an interface.

@zcorpan
Copy link
Member Author

zcorpan commented May 17, 2017

OK, please take another look.

index.bs Outdated
@@ -10202,6 +10269,21 @@ the <code>typeof</code> operator will return "function" when applied to an inter
</div>


<h4 id="legacy-window-alias">Legacy window alias</h4>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd move that whole section up in to the introductory section of §3.6 either as second or third ¶ and turn it into something like this:

If the [{{LegacyWindowAlias}}] extended attribute was specified on an interface,
then for each [=identifier=] mentioned in the extended attribute,
there must be a corresponding property on the [=primary global interface=],
known as the <dfn id="dfn-legacy-window-alias" export>legacy window alias</dfn>.
The name of the property is the [=legacy window alias=]'s [=identifier=],
and its value is a reference to the [=interface object=] for the [=interface=].
The property has attributes
{ \[[Writable]]: <emu-val>true</emu-val>, \[[Enumerable]]: <emu-val>false</emu-val>, \[[Configurable]]: <emu-val>true</emu-val> }.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Only changed "The property has attributes" to "The property has the attributes" for consistency with the surrounding paragraphs.

Copy link
Collaborator

@tobie tobie left a comment

Choose a reason for hiding this comment

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

Once these latests issues are addressed, this LGTM. Would want to hear back from @bzbarsky and FF strategy before merging, however.

@@ -8725,6 +8727,71 @@ for the specific requirements that the use of
entails.


<h4 id="LegacyWindowAlias" extended-attribute lt="LegacyWindowAlias">[LegacyWindowAlias]</h4>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you also need to add a number of restrictions around the identifiers and also amend the NamedConstructor description accordingly:

  1. [LegacyWindowAlias] identifiers can't be the same as that of an interface that has an interface object.
  2. [LegacyWindowAlias] identifiers can't be the same as that of a [NamedConstructor].
  3. [LegacyWindowAlias] identifiers can't be the same as that of a [LegacyWindowAlias] used on another interface.
  4. [LegacyWindowAlias] identifiers must not be one of the reserved identifiers.

index.bs Outdated

If the [{{LegacyWindowAlias}}] [=extended attribute=] appears on an [=interface=],
it indicates that the [=primary global interface=] will have a property
for each identifier mentioned in the extended attribute,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Eventually, link identifier.

index.bs Outdated
If the [{{LegacyWindowAlias}}] extended attribute was specified on an interface,
then for each [=identifier=] mentioned in the extended attribute,
there must be a corresponding property on the [=primary global interface=],
known as the <dfn id="dfn-legacy-window-alias" export>legacy window alias</dfn>.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know I wrote that, but this reads poorly: "known as the legacy window alias". It's not super clear whether we're naming the property or the object it references, which already has another name. Maybe not a useful concept to export?

index.bs Outdated
then for each [=identifier=] mentioned in the extended attribute,
there must be a corresponding property on the [=primary global interface=],
known as the <dfn id="dfn-legacy-window-alias" export>legacy window alias</dfn>.
The name of the property is the [=legacy window alias=]'s [=identifier=],
Copy link
Collaborator

Choose a reason for hiding this comment

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

What we did for NamedConstructor is define a "NamedConstructor identifier" in the [NamedConstructor] section above. Maybe you'd want something similar here, especially if we get rid of defining the [=legacy window alias=]?

index.bs Outdated
@@ -10119,6 +10186,15 @@ and its value is an object called the <dfn id="dfn-interface-object" export>inte
The property has the attributes { \[[Writable]]: <emu-val>true</emu-val>, \[[Enumerable]]: <emu-val>false</emu-val>, \[[Configurable]]: <emu-val>true</emu-val> }.
The characteristics of an interface object are described in [[#interface-object]].

If the [{{LegacyWindowAlias}}] extended attribute was specified on an interface,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Right now this doesn't specify clearly whether the LegacyWindowAlias should be exposed if its related interface isn't (e.g. because of SecureContext). NamedConstructor is more explicit here: "for every [{{NamedConstructor}}] extended attribute on an [=exposed=] interface, […]". Maybe copy that text?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can't copy it directly (since here it's a just single extended attribute), but certainly makes sense to add [=exposed=].

@zcorpan
Copy link
Member Author

zcorpan commented May 18, 2017

OK addressed latest round of feedback.

* Turn "LegacyWindowAlias identifiers" dfn from a list to an identifier.
* Fix a forgotten "must not".
* Reference identifiers according to their extended attribute.
@tobie tobie requested a review from domenic May 18, 2017 17:01
@tobie
Copy link
Collaborator

tobie commented May 18, 2017

@domenic think you could kindly take a quick look at this? I tuned the language a bit and I'm not sure it's to the pull request's advantage. :(

Outside of that, we're good to go per #362, so I'll just merge it once you give it the thumbs up.

Copy link
Member Author

@zcorpan zcorpan left a comment

Choose a reason for hiding this comment

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

LGTM

@tobie
Copy link
Collaborator

tobie commented May 18, 2017

Sounds like @zcorpan's fine with the changes. Merging.

@tobie tobie merged commit d732f98 into whatwg:master May 18, 2017
@zcorpan zcorpan deleted the zcorpan/legacywindowalias branch May 18, 2017 20:04
zcorpan added a commit to web-platform-tests/wpt that referenced this pull request May 18, 2017
@tobie tobie mentioned this pull request Jun 23, 2017
12 tasks
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.

2 participants