New text for guidance on exposing interfaces everywhere#510
Merged
LeaVerou merged 1 commit intow3ctag:mainfrom Dec 3, 2024
Merged
New text for guidance on exposing interfaces everywhere#510LeaVerou merged 1 commit intow3ctag:mainfrom
LeaVerou merged 1 commit intow3ctag:mainfrom
Conversation
This was referenced Sep 12, 2024
ptomato
added a commit
to ptomato/urlpattern
that referenced
this pull request
Sep 13, 2024
I've drafted a set of criteria for which interfaces to expose universally on all globals, at w3ctag/design-principles#510. URLPattern looks like it fits those criteria and is useful to have in any environment.
5 tasks
|
this is great, thanks @ptomato for putting the time on this |
jyasskin
approved these changes
Sep 30, 2024
Member
jyasskin
left a comment
There was a problem hiding this comment.
We should think some about the [SecureContext] question, but otherwise this looks ready to go in.
Member
|
@zcorpan Intuitively I disagree with your argument in whatwg/webidl#1119 (comment), at least given the guidance in this PR. The downside of requiring review for every new kind of realm is that when we add a new realm type, there's going to be a long string of paper-cuts as developers reach for various utility functions and notice that they haven't yet been added to this particular realm. |
This was referenced Oct 1, 2024
e7d70ad to
0777bc0
Compare
ptomato
added a commit
to ptomato/WebKit
that referenced
this pull request
Nov 14, 2024
Need the bug URL (OOPS!). Reviewed by NOBODY (OOPS!). As per the current state of whatwg/html#9893, and the design principles in w3ctag/design-principles#510, the global object in a ShadowRealm should be an EventTarget. This makes ShadowRealmGlobalScope inherit EventTarget. * Source/WebCore/bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::deriveShadowRealmGlobalObject): Set the prototype of the global wrapper object to be EventTarget.prototype. * Source/WebCore/bindings/js/JSEventTargetCustom.cpp: Handle ShadowRealm global objects in casts to and from EventTarget. (WebCore::JSEventTarget::toWrapped): (WebCore::jsEventTargetCast): * Source/WebCore/dom/EventTargetFactory.in: Add ShadowRealmGlobalScope as an EventTarget. * Source/WebCore/page/ShadowRealmGlobalScope.h: Make WebCore::ShadowRealmGlobalScope inherit WebCore::EventTarget and implement its pure virtual methods. * Source/WebCore/page/ShadowRealmGlobalScope.idl: Make ShadowRealmGlobalScope inherit EventTarget.
Contributor
Author
|
What should be the next steps here? As far as I'm concerned, the secure context question no longer needs to be part of this PR. |
martinthomson
approved these changes
Dec 3, 2024
martinthomson
pushed a commit
that referenced
this pull request
Dec 4, 2024
andreubotella
added a commit
to andreubotella/webidl
that referenced
this pull request
Mar 3, 2025
In w3ctag/design-principles#510, the TAG's Design Principles document added a section on considerations for exposing an interface everywhere (`[Exposed=*]`). This patch links to that section in the definition of `[Exposed=*]`. Additionally, the paragraph where that link is added used to have `class="advisement"`, which has no styles or any apparent special meaning. This patch changes it to `class="note"`, which was probably the intention.
andreubotella
added a commit
to andreubotella/webidl
that referenced
this pull request
Mar 3, 2025
In w3ctag/design-principles#510, the TAG's Design Principles document added a section on considerations for exposing an interface everywhere (`[Exposed=*]`). This patch links to that section in the definition of `[Exposed=*]`. Additionally, the paragraph where that link is added used to have `class="advisement"`, which has no styles or any apparent special meaning. This patch changes it to `class="note"`, which was probably the intention.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here's an initial draft for text on exposing interfaces everywhere. It's similar to the text I wrote in #509 and the examples I gave there.
Closes: #509
Preview | Diff