-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Prevent attachInternals() use before custom element constructor #5909
Conversation
Per the discussion at [1], the intention of this change is to prevent calls to attachInternals() prior to the constructor of the custom element having a chance to do so. The spec PR is at [2]. This change is gated behind the DeclarativeShadowDOM flag. With the flag disabled (the default), a use counter is added for checking on the web compatibility of this change. The use counter will measure the cases where attachInternals() is being called in a to-be-outlawed way. [1] WICG/webcomponents#871 (comment) [2] whatwg/html#5909 Bug: 1042130 Change-Id: Iacf97a49133b5f7f44710e5c0287f01cfebe4c44
I agree with @rniwa that it would be preferable to split this up. You'll also need to make your membership of the googlers organization public. You cannot sign the agreement as an individual. |
Ok, I'll split it up. I'll leave this one for the protection of attachInternals() and create a new one for ElementInternals.shadowRoot. Thanks for the pointer about joining the Googlers organization. I thought I had already done that, but apparently not. It is done now. |
Per the discussion at [1], the intention of this change is to prevent calls to attachInternals() prior to the constructor of the custom element having a chance to do so. The spec PR is at [2]. This change is gated behind the DeclarativeShadowDOM flag. With the flag disabled (the default), a use counter is added for checking on the web compatibility of this change. The use counter will measure the cases where attachInternals() is being called in a to-be-outlawed way. [1] WICG/webcomponents#871 (comment) [2] whatwg/html#5909 Bug: 1042130 Change-Id: Iacf97a49133b5f7f44710e5c0287f01cfebe4c44
Per the discussion at [1], the intention of this change is to prevent calls to attachInternals() prior to the constructor of the custom element having a chance to do so. The spec PR is at [2]. This change is gated behind the DeclarativeShadowDOM flag. With the flag disabled (the default), a use counter is added for checking on the web compatibility of this change. The use counter will measure the cases where attachInternals() is being called in a to-be-outlawed way. [1] WICG/webcomponents#871 (comment) [2] whatwg/html#5909 Bug: 1042130 Change-Id: Iacf97a49133b5f7f44710e5c0287f01cfebe4c44 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392975 Reviewed-by: Alexei Svitkine <asvitkine@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Mason Freed <masonfreed@chromium.org> Auto-Submit: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#806830}
Per the discussion at [1], the intention of this change is to prevent calls to attachInternals() prior to the constructor of the custom element having a chance to do so. The spec PR is at [2]. This change is gated behind the DeclarativeShadowDOM flag. With the flag disabled (the default), a use counter is added for checking on the web compatibility of this change. The use counter will measure the cases where attachInternals() is being called in a to-be-outlawed way. [1] WICG/webcomponents#871 (comment) [2] whatwg/html#5909 Bug: 1042130 Change-Id: Iacf97a49133b5f7f44710e5c0287f01cfebe4c44 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392975 Reviewed-by: Alexei Svitkine <asvitkine@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Mason Freed <masonfreed@chromium.org> Auto-Submit: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#806830}
Per the discussion at [1], the intention of this change is to prevent calls to attachInternals() prior to the constructor of the custom element having a chance to do so. The spec PR is at [2]. This change is gated behind the DeclarativeShadowDOM flag. With the flag disabled (the default), a use counter is added for checking on the web compatibility of this change. The use counter will measure the cases where attachInternals() is being called in a to-be-outlawed way. [1] WICG/webcomponents#871 (comment) [2] whatwg/html#5909 Bug: 1042130 Change-Id: Iacf97a49133b5f7f44710e5c0287f01cfebe4c44 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392975 Reviewed-by: Alexei Svitkine <asvitkine@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Mason Freed <masonfreed@chromium.org> Auto-Submit: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#806830}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This needs a corresponding PR to DOM to document the additional enum value.
Thanks for the comments @annevk, all are done. And I added a DOM PR, here: whatwg/dom#894 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll let @domenic merge this just in case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but can we test that precustomized elements match :defined
per whatwg/dom#894?
Also, we should merge this after or at the same time as whatwg/dom#894.
You mean that "precustomized" elements don't match |
@rniwa the current PR suggests otherwise. Note that "uncustomized" counts as being defined too. |
That doesn't sound right. If the constructor of an element being upgraded calls some helper function before |
…ide or after the constructor, a=testonly Automatic update from web-platform-tests Restrict attachInternals() to be run inside or after the constructor Per the discussion at [1], the intention of this change is to prevent calls to attachInternals() prior to the constructor of the custom element having a chance to do so. The spec PR is at [2]. This change is gated behind the DeclarativeShadowDOM flag. With the flag disabled (the default), a use counter is added for checking on the web compatibility of this change. The use counter will measure the cases where attachInternals() is being called in a to-be-outlawed way. [1] WICG/webcomponents#871 (comment) [2] whatwg/html#5909 Bug: 1042130 Change-Id: Iacf97a49133b5f7f44710e5c0287f01cfebe4c44 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392975 Reviewed-by: Alexei Svitkine <asvitkine@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Mason Freed <masonfreed@chromium.org> Auto-Submit: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#806830} -- wpt-commits: df5b354d012f3bb0db1524bfaf8a4e16b4b01cc2 wpt-pr: 25402
…ide or after the constructor, a=testonly Automatic update from web-platform-tests Restrict attachInternals() to be run inside or after the constructor Per the discussion at [1], the intention of this change is to prevent calls to attachInternals() prior to the constructor of the custom element having a chance to do so. The spec PR is at [2]. This change is gated behind the DeclarativeShadowDOM flag. With the flag disabled (the default), a use counter is added for checking on the web compatibility of this change. The use counter will measure the cases where attachInternals() is being called in a to-be-outlawed way. [1] WICG/webcomponents#871 (comment) [2] whatwg/html#5909 Bug: 1042130 Change-Id: Iacf97a49133b5f7f44710e5c0287f01cfebe4c44 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392975 Reviewed-by: Alexei Svitkine <asvitkine@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Mason Freed <masonfreed@chromium.org> Auto-Submit: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#806830} -- wpt-commits: df5b354d012f3bb0db1524bfaf8a4e16b4b01cc2 wpt-pr: 25402
Thanks for catching this. I agree, and I've removed this part of the change in the DOM PR. I don't think anything needs to change here, and I don't think there is more |
d158259
to
ee0e6b3
Compare
ee0e6b3
to
e6f10e0
Compare
LGTM, but should be merged after the DOM PR is, which is currently blocked on Bikeshed being down I guess :-/. |
Thanks! Any idea what's wrong with bikeshed? It seems to work when I build locally (with remote server) - I would have assumed that was the same remote server. |
For whatwg/html#5909. Tests: web-platform-tests/wpt#25794. Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
It seems to have been fixed. I merged both PRs. |
…ide or after the constructor, a=testonly Automatic update from web-platform-tests Restrict attachInternals() to be run inside or after the constructor Per the discussion at [1], the intention of this change is to prevent calls to attachInternals() prior to the constructor of the custom element having a chance to do so. The spec PR is at [2]. This change is gated behind the DeclarativeShadowDOM flag. With the flag disabled (the default), a use counter is added for checking on the web compatibility of this change. The use counter will measure the cases where attachInternals() is being called in a to-be-outlawed way. [1] WICG/webcomponents#871 (comment) [2] whatwg/html#5909 Bug: 1042130 Change-Id: Iacf97a49133b5f7f44710e5c0287f01cfebe4c44 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392975 Reviewed-by: Alexei Svitkine <asvitkinechromium.org> Reviewed-by: Kouhei Ueno <kouheichromium.org> Commit-Queue: Mason Freed <masonfreedchromium.org> Auto-Submit: Mason Freed <masonfreedchromium.org> Cr-Commit-Position: refs/heads/master{#806830} -- wpt-commits: df5b354d012f3bb0db1524bfaf8a4e16b4b01cc2 wpt-pr: 25402 UltraBlame original commit: 56afece076c057fd659c3c180e1673c5a409a614
…ide or after the constructor, a=testonly Automatic update from web-platform-tests Restrict attachInternals() to be run inside or after the constructor Per the discussion at [1], the intention of this change is to prevent calls to attachInternals() prior to the constructor of the custom element having a chance to do so. The spec PR is at [2]. This change is gated behind the DeclarativeShadowDOM flag. With the flag disabled (the default), a use counter is added for checking on the web compatibility of this change. The use counter will measure the cases where attachInternals() is being called in a to-be-outlawed way. [1] WICG/webcomponents#871 (comment) [2] whatwg/html#5909 Bug: 1042130 Change-Id: Iacf97a49133b5f7f44710e5c0287f01cfebe4c44 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392975 Reviewed-by: Alexei Svitkine <asvitkinechromium.org> Reviewed-by: Kouhei Ueno <kouheichromium.org> Commit-Queue: Mason Freed <masonfreedchromium.org> Auto-Submit: Mason Freed <masonfreedchromium.org> Cr-Commit-Position: refs/heads/master{#806830} -- wpt-commits: df5b354d012f3bb0db1524bfaf8a4e16b4b01cc2 wpt-pr: 25402 UltraBlame original commit: 56afece076c057fd659c3c180e1673c5a409a614
…ide or after the constructor, a=testonly Automatic update from web-platform-tests Restrict attachInternals() to be run inside or after the constructor Per the discussion at [1], the intention of this change is to prevent calls to attachInternals() prior to the constructor of the custom element having a chance to do so. The spec PR is at [2]. This change is gated behind the DeclarativeShadowDOM flag. With the flag disabled (the default), a use counter is added for checking on the web compatibility of this change. The use counter will measure the cases where attachInternals() is being called in a to-be-outlawed way. [1] WICG/webcomponents#871 (comment) [2] whatwg/html#5909 Bug: 1042130 Change-Id: Iacf97a49133b5f7f44710e5c0287f01cfebe4c44 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392975 Reviewed-by: Alexei Svitkine <asvitkinechromium.org> Reviewed-by: Kouhei Ueno <kouheichromium.org> Commit-Queue: Mason Freed <masonfreedchromium.org> Auto-Submit: Mason Freed <masonfreedchromium.org> Cr-Commit-Position: refs/heads/master{#806830} -- wpt-commits: df5b354d012f3bb0db1524bfaf8a4e16b4b01cc2 wpt-pr: 25402 UltraBlame original commit: 56afece076c057fd659c3c180e1673c5a409a614
Per the discussion at [1], the intention of this change is to prevent calls to attachInternals() prior to the constructor of the custom element having a chance to do so. The spec PR is at [2]. This change is gated behind the DeclarativeShadowDOM flag. With the flag disabled (the default), a use counter is added for checking on the web compatibility of this change. The use counter will measure the cases where attachInternals() is being called in a to-be-outlawed way. [1] WICG/webcomponents#871 (comment) [2] whatwg/html#5909 Bug: 1042130 Change-Id: Iacf97a49133b5f7f44710e5c0287f01cfebe4c44 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392975 Reviewed-by: Alexei Svitkine <asvitkine@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Mason Freed <masonfreed@chromium.org> Auto-Submit: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#806830} GitOrigin-RevId: 8f4d32caa68b363efdb4cd27821f3d893ff6f464
Changes the
attachInternals()
function to only be callable during or after the custom element constructor.💥 Error: Wattsi server error 💥
PR Preview failed to build. (Last tried on Sep 16, 2020, 4:57 PM UTC).
More
PR Preview relies on a number of web services to run. There seems to be an issue with the following one:
🚨 Wattsi Server - Wattsi Server is the web service used to build the WHATWG HTML spec.
🔗 Related URL
If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.