-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to represent changes/moves on the prototype chain #3463
Comments
There's another tricky case in #3475 (comment). The The |
We have XMLHttpRequestEventTarget in BCD and on MDN: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequestEventTarget#Browser_compatibility. I agree these prototypes aren't really that important to web developers, although this one is observable. I hope we could find a convention on how to deal with these situations for both BCD and MDN docs. Right now this is really confusing for both the compat data and web devs reading the docs, I suppose. Is there a way to determine from webidl which interfaces are just conveniences, which are mixins, which are observable, etc? If we could derive a convention from webidl that would be good rather that making an editorial call on "technical accuracy from specs" vs. "what web developers interact with" for each case. These subjective calls make our API reference docs (and compat data) rather unstructured and hard to read imo. If there is no way of determining this, we need to at least get more familiarity with WebIDL so that tech writers can make better calls here. |
Yes, the old style of using
Right now I don't think inherited members are represented at all in BCD, but if we do #3441 we would have the challenge of how to represent that the class (interface) hierarchy is different in some browsers. I see two options:
Either approach adds complexity. As with the original cases in this issue, I'd worry about any solution surfacing irrelevant information to users. This is especially true when |
We've run into this in #6789 too. At first there was just This might mean that there needs to be a wrinkle in the data: that |
In #7517 I've suggested how to resolve a subset of these issues. |
I've recently sorted out two cases where an abstract interface was introduced on the prototype and some members moved up: The solution was to treat the interface as The individual members may also need |
I think that |
Thanks.
Joe Medley | Technical Writer, Chrome DevRel | ***@***.*** |
816-678-7195
*If an API's not documented it doesn't exist.*
…On Mon, Mar 22, 2021 at 3:14 PM Philip Jägenstedt ***@***.***> wrote:
I think that AudioScheduledSourceNode
<#6656> can be handled
in the same way.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3463 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6S7C4XS3XI6PN72Y7J7ZDTE66MJANCNFSM4GXXOI3A>
.
|
* Add a guideline for APIs moved on the prototype chain Fixes #3463. * Split into principle+examples * Fix lint * + → and * Update docs/data-guidelines.md Co-authored-by: Joe Medley <jmedley@google.com> Co-authored-by: Joe Medley <jmedley@google.com>
In 5c29205 a few prototype chain changes were found:
prefix
is onNode.prototype
in Edge 12 and onAttr.prototype
+Element.prototype
in Edge 13. Attr inherits from Node, so it doesn't matter if you have anattr
and want to know if you can useattr.prefix
. (This happened because of Make Attr a Node again whatwg/dom#102.)className
is onHTMLElement
instead ofElement
in Edge 12. It usually doesn't matter, but it can.HTMLOptionsCollection
was added in Edge 13, but most of the code one could write would work just as well in Edge 12 where anHTMLCollection
was returned, because they hadadd
andremove
on that interfaces instead.In these cases there's a tradeoff between technical accuracy and providing the "will it work" answer that is the main use case for the data. Even with accuracy + notes, a web developer might have to read through an explanation of something that just doesn't matter, and possibly be left in doubt if they don't know the whole Node hierarchy.
@Elchi3 @jpmedley please advise.
The text was updated successfully, but these errors were encountered: