Implement IDL [Unscopable]

RESOLVED FIXED in Firefox 48

Status

()

Core
DOM
RESOLVED FIXED
3 years ago
2 years ago

People

(Reporter: annevk, Assigned: bz)

Tracking

({dev-doc-needed})

unspecified
mozilla48
x86
Mac OS X
dev-doc-needed
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox48 fixed)

Details

(URL)

Attachments

(3 attachments, 3 obsolete attachments)

(Reporter)

Description

3 years ago
If we implement @@unscopables and [Unscopable] we can implement some new features in DOM and improve existing features.
Bug 1054759 needs to happen first, obviously.
Depends on: 1054759
Blocks: 911477
Blocks: 1218972
No longer blocks: 1218972
Created attachment 8734853 [details] [diff] [review]
part 1.  Add parsing for [Unscopeable] in IDL
Attachment #8734853 - Flags: review?(khuey)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Created attachment 8734855 [details] [diff] [review]
part 2.  Make codegen output a list of unscopable names that we can then pass to CreateInterfaceObjects

Note that this does not take into account the exposed/enabled state of the
relevant properties.  This should be OK, I hope.  Taking that state into account
would be rather annoying, unfortunately.  We could make codegen fail if
something is conditionally exposed and unscopable, if desired...

Also note that I'm using the ES6 spelling of "unscopable", which seems more
correct to me in terms the way "able" is usually added to words than the IDL
"unscopeable".
Attachment #8734855 - Flags: review?(khuey)
Created attachment 8734856 [details] [diff] [review]
part 3.  Pass our unscopable names to CreateInterfaceObjects and have it define the right thing on the prototype
Attachment #8734856 - Flags: review?(khuey)
Spec is changing in terms spelling (note comment 3 for comparison), so going to update the relevant bits of these patches.
Summary: Implement IDL [Unscopeable] → Implement IDL [Unscopable]
Created attachment 8735146 [details] [diff] [review]
part 1.  Add parsing for [Unscopeable] in IDL
Attachment #8735146 - Flags: review?(khuey)
Attachment #8734853 - Attachment is obsolete: true
Attachment #8734853 - Flags: review?(khuey)
Created attachment 8735147 [details] [diff] [review]
part 2.  Make codegen output a list of unscopable names that we can then pass to CreateInterfaceObjects

Note that this does not take into account the exposed/enabled state of the
relevant properties.  This should be OK, I hope.  Taking that state into account
would be rather annoying, unfortunately.  We could make codegen fail if
something is conditionally exposed and unscopable, if desired...
Attachment #8735147 - Flags: review?(khuey)
Attachment #8734855 - Attachment is obsolete: true
Attachment #8734855 - Flags: review?(khuey)
Created attachment 8735156 [details] [diff] [review]
part 3.  Pass our unscopable names to CreateInterfaceObjects and have it define the right thing on the prototype
Attachment #8735156 - Flags: review?(khuey)
Attachment #8734856 - Attachment is obsolete: true
Attachment #8734856 - Flags: review?(khuey)
Comment on attachment 8735146 [details] [diff] [review]
part 1.  Add parsing for [Unscopeable] in IDL

Review of attachment 8735146 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/bindings/parser/WebIDL.py
@@ +4110,5 @@
>                                    [attr.location, self.location])
> +        elif identifier == "Unscopable":
> +            if not attr.noArguments():
> +                raise WebIDLError("[Unscopable] must take no arguments",
> +                                  [attr.location])            

nit: whitespace at EOL

@@ +4818,5 @@
>                                    [attr.location, self.location])
> +        elif identifier == "Unscopable":
> +            if not attr.noArguments():
> +                raise WebIDLError("[Unscopable] must take no arguments",
> +                                  [attr.location])            

and here
Attachment #8735146 - Flags: review?(khuey) → review+
Attachment #8735147 - Flags: review?(khuey) → review+
Attachment #8735156 - Flags: review?(khuey) → review+

Comment 10

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/483533fede8d
https://hg.mozilla.org/integration/mozilla-inbound/rev/75898c3d4bb2
https://hg.mozilla.org/integration/mozilla-inbound/rev/2fde05270e25

Comment 11

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/483533fede8d
https://hg.mozilla.org/mozilla-central/rev/75898c3d4bb2
https://hg.mozilla.org/mozilla-central/rev/2fde05270e25
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox48: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Added ddn so that we update our guide on what info is available in the webidl of an interface, and how to translate it in the docs.
Keywords: dev-doc-needed
You need to log in before you can comment on or make changes to this bug.