WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
216336
[WebIDL] Split supplemental interfaces out of Document
https://bugs.webkit.org/show_bug.cgi?id=216336
Summary
[WebIDL] Split supplemental interfaces out of Document
Sam Weinig
Reported
2020-09-09 18:42:37 PDT
[WebIDL] Split supplemental interfaces out of Document
Attachments
Patch
(52.37 KB, patch)
2020-09-09 18:45 PDT
,
Sam Weinig
no flags
Details
Formatted Diff
Diff
Patch
(50.01 KB, patch)
2020-09-11 08:27 PDT
,
Sam Weinig
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Sam Weinig
Comment 1
2020-09-09 18:45:57 PDT
Created
attachment 408393
[details]
Patch
Darin Adler
Comment 2
2020-09-09 20:17:38 PDT
Comment on
attachment 408393
[details]
Patch Do these really all need to be separate source files?
Sam Weinig
Comment 3
2020-09-10 06:39:38 PDT
(In reply to Darin Adler from
comment #2
)
> Comment on
attachment 408393
[details]
> Patch > > Do these really all need to be separate source files?
That’s a great point. I’m not sure what the best thing to do here is. Currently we only support supplements that are in their own files, but that is easy to fix and shouldn’t affect the decision. It would be good to have an easy to follow rule for how we divide things up.
Konstantin Tokarev
Comment 4
2020-09-10 07:32:03 PDT
Speaking as one who often refers to idl files to determine if certain API is available, it would be more convenient to have all parts of Document in the same file. OTOH, if respective C++ implementations were located in separate files, it would make sense to have separate IDLs, though AFAICS it's not the case here.
Sam Weinig
Comment 5
2020-09-10 08:08:35 PDT
I think it might help me think about this more clearly if I break down the different types of supplemental interfaces we have: 1) 'partial interface' which uses Supplemental model An example of this is DocumentPictureInPicture.idl, which uses the class DocumentPictureInPicture (`class DocumentPictureInPicture : public Supplement<Document>...`) from DocumentPictureInPicture.h/cpp. 2) `partial interface` which is completely implemented in the main class. An example of this is DocumentAnimations.idl. It adds the timeline attribute to Document, which is completely implemented in Document.h/cpp. 3) `interface mixin` These, currently, all must be implemented by the interface they are included into. An example of this is FontFaceSource.idl which adds the fonts attribute to Document, which is completely implemented in Document.h/cpp. However, as this is a mixin that can also used by other interfaces, putting it in Document.idl would not make sense. 4) `partial interface mixin` These also, currently, all must be implemented by the interface they are included into. An example of this is DocumentOrShadowRootStyleSheets.idl, which adds the stylesheets attribute to Document and is completely implemented in Document.h/cpp. However, as this is an addition to a mixin that can also used by other interfaces, putting it in Document.idl would not make sense. It might make sense to put it in DocumentOrShadowRoot.idl though.
Sam Weinig
Comment 6
2020-09-10 08:12:58 PDT
(In reply to Konstantin Tokarev from
comment #4
)
> Speaking as one who often refers to idl files to determine if certain API is > available, it would be more convenient to have all parts of Document in the > same file. OTOH, if respective C++ implementations were located in separate > files, it would make sense to have separate IDLs, though AFAICS it's not the > case here.
One idea to make this easier would be to have a consistent naming of partial interface IDL files, perhaps one that is distinct from our normal naming conventions. For instance, perhaps we could take inspiration from some cocoa naming conventions for categories and do something like Document+WebAnimationAdditions.idl instead of DocumentAnimations.idl. Then, when looking for things in Document, one would search for "Document+".
EWS
Comment 7
2020-09-10 10:06:43 PDT
Tools/Scripts/svn-apply failed to apply
attachment 408393
[details]
to trunk. Please resolve the conflicts and upload a new patch.
Sam Weinig
Comment 8
2020-09-11 08:27:44 PDT
Created
attachment 408533
[details]
Patch
EWS
Comment 9
2020-09-11 09:08:38 PDT
Committed
r266926
: <
https://trac.webkit.org/changeset/266926
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 408533
[details]
.
Radar WebKit Bug Importer
Comment 10
2020-09-11 09:09:16 PDT
<
rdar://problem/68713612
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug