Closed Bug 1007135 Opened 11 years ago Closed 10 years ago

Extended attributes in partial interfaces are ignored

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: reuben, Assigned: bzbarsky)

References

Details

Attachments

(1 file, 1 obsolete file)

No code is generated to call Navigator::Foo for the following WebIDL: [Func="Navigator::Foo"] partial interface Navigator { // ... }
Assignee: nobody → reuben.bmo
Attachment #8418765 - Flags: review?(peterv)
Attachment #8418765 - Flags: review?(peterv) → review+
Wait, so... what semantics do we want here, exactly? Do we really want an annotation on a partial interface to affect the visibility of the interface object? I guess the spec allows some but not all extended attributes to appear on partial interfaces, and the ones that do appear are basically propagated to the main interface...
Which is to say, we should at a minimum implement the spec restrictions on things that can't appear here. Followup bug on that is fine.
Yeah, I was thinking about that over dinner :-). It's definitely a bug that we wipe out instead of adding to the extended attributes, but not all of them make sense on partial interfaces. Reuben, what's your actual usecase for this?
r=peterv
Attachment #8418765 - Attachment is obsolete: true
Attachment #8418873 - Flags: review+
Keywords: checkin-needed
Eek, I didn't see the last comments.
Keywords: checkin-needed
(In reply to Peter Van der Beken [:peterv] from comment #4) > Yeah, I was thinking about that over dinner :-). It's definitely a bug that > we wipe out instead of adding to the extended attributes, but not all of > them make sense on partial interfaces. Reuben, what's your actual usecase > for this? I tried doing eg.: [CheckPermissions="fmradio"] partial interface Navigator { readonly attribute FMRadio mozFMRadio; }; in bug 952486, but that didn't work. It looks to me like making only the members in the partial interface prefable would be a more complicated fix than this, given the way it's implemented (and probably the way it's specified, too). So for now I'm putting the prefable extended attrs on the members.
Flags: needinfo?(peterv)
People keep sticking [Pref] on partial interfaces and thinking it will apply to the members. I think we should just disallow extended attributes on partial interfaces (except for Exposed, once that is supported, and note that its meaning is NOT the same as just being copied to the main interface!), period. Any objections?
I've been thinking that it doesn't make sense for most attributes either and we should disallow it. But I don't see why Exposed would work and Pref not, what's the difference between those two?
Flags: needinfo?(peterv)
> But I don't see why Exposed would work and Pref not, what's the difference between those > two? The difference is that [Exposed] on an interface (not partial interface, just interface) controls the visibility of both the interface object _and_ of the members of that interface (by default; members can override). [Exposed] on a partial interface is specced to be a shorthand for setting [Exposed] on all the members of the partial interface, which is similar to what it does on a non-partial interface. For [Pref] though, setting it on an interface itself doesn't imply anything about members. So if we made it do so for partial interfaces, that would mean that [Pref] means very different things on an interface and a partial interface. I'm not sure we want that.
Flags: needinfo?(peterv)
(In reply to comment #10) > For [Pref] though, setting it on an interface itself doesn't imply anything > about members. So if we made it do so for partial interfaces, that would mean > that [Pref] means very different things on an interface and a partial > interface. I'm not sure we want that. Yeah, I agree. We should just disallow all extended attributes for partial interfaces for now.
I think we should still allow Constructor and NamedConstructor.
Flags: needinfo?(peterv)
(In reply to comment #12) > I think we should still allow Constructor and NamedConstructor. Yeah, Peter sort of convinced me on IRC. :-)
I believe that part 4 of bug 1017988 fixes this.
Depends on: 1017988
With the landing of bug 1017988, extended attributes on a partial interface either do something or fail parsing (depending on the extended attribute).
Assignee: reuben.bmo → bzbarsky
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: