Bug 216322 - [WebIDL] Stop automatically applying the ImplementedBy extended attribute to all partial interfaces/dictionaries
Summary: [WebIDL] Stop automatically applying the ImplementedBy extended attribute to ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-09 13:19 PDT by Sam Weinig
Modified: 2020-09-09 15:12 PDT (History)
31 users (show)

See Also:


Attachments
Patch (33.72 KB, patch)
2020-09-09 13:42 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (33.72 KB, patch)
2020-09-09 14:14 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2020-09-09 13:19:00 PDT
[WebIDL] Stop automatically applying the ImplementedBy extended attribute to all partial interfaces/dictionaries
Comment 1 Sam Weinig 2020-09-09 13:42:15 PDT
Created attachment 408363 [details]
Patch
Comment 2 Darin Adler 2020-09-09 13:57:11 PDT
Comment on attachment 408363 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=408363&action=review

> Source/WebCore/ChangeLog:13
> +        behavior mush opt in, using the extended attribute "ImplementedBy", which is what the code

typo: "must"

> Source/WebCore/ChangeLog:25
> +        Remove special casing of partial interfaces / dictionaries automatically getting "ImplementedBy"
> +        applied to all members. Maintain the behavior that "ImplementedBy" should not be used when
> +        an attribute has been marked as "Reflect".

When we say "should not be used" we mean "should be silently ignored"? Is that right? That seems to be new. It’s one thing to not implicitly add ImplementedBy when Reflect is specified. Not sure it’s right to ignore it rather than emitting an error message.
Comment 3 Sam Weinig 2020-09-09 14:11:28 PDT
(In reply to Darin Adler from comment #2)
> Comment on attachment 408363 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=408363&action=review
> 
> > Source/WebCore/ChangeLog:13
> > +        behavior mush opt in, using the extended attribute "ImplementedBy", which is what the code
> 
> typo: "must"
> 
> > Source/WebCore/ChangeLog:25
> > +        Remove special casing of partial interfaces / dictionaries automatically getting "ImplementedBy"
> > +        applied to all members. Maintain the behavior that "ImplementedBy" should not be used when
> > +        an attribute has been marked as "Reflect".
> 
> When we say "should not be used" we mean "should be silently ignored"? Is
> that right? 

Yeah, that is more clear.

> That seems to be new. It’s one thing to not implicitly add
> ImplementedBy when Reflect is specified. Not sure it’s right to ignore it
> rather than emitting an error message.

The old behavior was that we would skip adding ImplementedBy (and therefore using the MyClass::staticFunction(...) syntax) if an attribute in partial interface had [Reflect]:

-                 if ($interface->isPartial && !$interface->isMixin) {
-                     $attribute->extendedAttributes->{"ImplementedBy"} = $interfaceName if !$attribute->extendedAttributes->{Reflect};
-                 }

I don't think this ends up being that confusing as [Reflect] really means "there is not attribute getter/setter for this, instead call the right hasAttributeWithoutSynchronization (or whatever the appropriate one is for the type) and pass in the appropriate qualified name). If we remove this special case, it would mean instead of specifying ImplementedBy on the partial interface itself, we would have to do it on each member. I think I am ok with keeping this little bit of weirdness.
Comment 4 Sam Weinig 2020-09-09 14:14:17 PDT
Created attachment 408367 [details]
Patch
Comment 5 EWS 2020-09-09 15:11:36 PDT
Committed r266800: <https://trac.webkit.org/changeset/266800>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 408367 [details].
Comment 6 Radar WebKit Bug Importer 2020-09-09 15:12:17 PDT
<rdar://problem/68598852>