Bug 216322

Summary: [WebIDL] Stop automatically applying the ImplementedBy extended attribute to all partial interfaces/dictionaries
Product: WebKit Reporter: Sam Weinig <sam>
Component: New BugsAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, beidson, benjamin, calvaris, cdumez, changseok, darin, dino, eric.carlson, esprehn+autocc, ews-watchlist, fmalita, glenn, gyuyoung.kim, hta, jer.noble, jiewen_tan, joepeck, jsbell, kangil.han, kondapallykalyan, macpherson, menard, mmaxfield, pdr, philipj, sabouhallawa, schenney, sergio, tommyw, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

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>