Skip to content

Update ReSpec usage#286

Merged
twiss merged 2 commits intomainfrom
update-respec
Oct 11, 2021
Merged

Update ReSpec usage#286
twiss merged 2 commits intomainfrom
update-respec

Conversation

@twiss
Copy link
Member

@twiss twiss commented Oct 6, 2021

This updates the usage of ReSpec from respec-w3c-common to respec-w3c, as per these guidelines, and then fixes all the things it complained about, most notably properly marking the internal slots of CryptoKey objects as belonging to CryptoKey in WebIDL.

The most non-mechanical change here is that the [[supportedAlgorithms]] internal object, which is sort of "free-floating" and not connected to any object (which respec-w3c complains about, which is fair enough), is now an internal slot of the SubtleCrypto interface. (This is purely an internal WebIDL change, it's not mentioned in the text.) Hopefully this makes sense to people.

And finally, it marks the spec as belonging to the webappsec group.

@twiss twiss requested review from annevk and sideshowbarker October 6, 2021 10:55
@twiss twiss mentioned this pull request Oct 6, 2021
@annevk
Copy link
Member

annevk commented Oct 6, 2021

I'm not familiar with ReSpec. @marcoscaceres would be great for this if he has time.

@twiss
Copy link
Member Author

twiss commented Oct 6, 2021

👍 Thanks! I was mostly wondering whether it seemed reasonable to you to assign the [[supportedAlgorithms]] internal slot to the SubtleCrypto interface in WebIDL? And/or is there someone else I should ask about WebIDL stuff?

@annevk
Copy link
Member

annevk commented Oct 6, 2021

Yeah that's fine. Looking at the patch it is somewhat weird that when accessing the slot it's not made clear what instance it's being accessed on. Usually you'd see something like "this's [[slot]]" or "instance's [[slot]]".

@twiss
Copy link
Member Author

twiss commented Oct 6, 2021

Yeah, that's true. As originally envisioned, [[supportedAlgorithms]] was a free-standing internal object, so there was only one instance. By making it a property of SubtleCrypto, my intention was to keep that the same, but come to think of it, that doesn't actually really work, since there's one per Window (and implementations would technically have to run the steps to register an algorithm once per window, which seems unreasonable), so maybe this patch is not correct. Do you know of a reasonable way to declare a "global internal object"?

(Or perhaps this concept should be reworked entirely. I believe the original intention was to make the spec extensible by other specs, which could register additional algorithms on this object, but it's not actually necessary to have an object that can be extended at runtime, say. So perhaps there's a better way to express this spec-level / implementation-level "registry". But ok, if so that should probably be a separate PR.)

@annevk
Copy link
Member

annevk commented Oct 6, 2021

My general approach to registries is to "just say no" and require a PR with the appropriate sign-offs when an extension is needed.

It does seem good to work out what the scope of this is first, before tying it to a specific object.

Also, make it a free-standing object again.
@twiss
Copy link
Member Author

twiss commented Oct 7, 2021

OK, yeah. I tend to agree, I can get rid of it in a separate PR.

For now, I've made it a free-standing object again and renamed it from [[supportedAlgorithms]] to supportedAlgorithms, to make ReSpec happy, and also make it look less like it should be an internal slot of some other object. Hopefully this seems reasonable.

@marcoscaceres
Copy link
Member

Happy to help, but give me day or two... better next week - but this is a good start.

@marcoscaceres marcoscaceres self-requested a review October 7, 2021 12:45
@marcoscaceres
Copy link
Member

This all seems good.

As a followup, we might want to add a .pr_preview.json file too.

@twiss
Copy link
Member Author

twiss commented Oct 11, 2021

👍 Thanks, will do!

@twiss twiss merged commit 5cd9452 into main Oct 11, 2021
@twiss twiss deleted the update-respec branch October 11, 2021 12:18
github-actions bot added a commit that referenced this pull request Oct 11, 2021
SHA: 5cd9452
Reason: push, by @twiss

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants