Skip to content
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

Fix spec_url for api.Document.execCommand #24909

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix spec_url for api.Document.execCommand #24909

wants to merge 2 commits into from

Conversation

SamB
Copy link
Contributor

@SamB SamB commented Nov 2, 2024

The only mentions of execCommand I saw in Trusted Types were in the names of tests.

According to https://respec.org/xref/?term=execCommand%28%29, this API is defined in just one spec, so use that one.

The only mentions of execCommand I saw in Trusted Types were in the names of tests.

According to <https://respec.org/xref/?term=execCommand%28%29>, this API is defined in just one spec, so use that one.
@github-actions github-actions bot added the data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Nov 2, 2024
@SamB
Copy link
Contributor Author

SamB commented Nov 2, 2024

It is true that the spec doesn't exactly have good standing, but it is the only one we appear to have, and the api is implemented ~everywhere.

@queengooborg
Copy link
Collaborator

It looks like the spec URL you had tried to use is an unofficial draft, which Webref does not consider as a valid standard. Upon further research, it appears that the feature was originally defined in the First Public Working Draft of the trusted types spec, but was then removed in the following Working Draft.

As such, I think that it's actually better to mark this as non-standard and remove the spec URL.

@SamB
Copy link
Contributor Author

SamB commented Nov 2, 2024

Note that html appears to make quite a few normative references to execCommand. The Editing APIs section, in particular, appears to incorporate by reference all of the following:

{
  "https://w3c.github.io/editing/docs/execCommand/": {
    "anchors": [
      "execcommand%28%29",
      "querycommandenabled%28%29",
      "querycommandindeterm%28%29",
      "querycommandstate%28%29",
      "querycommandsupported%28%29",
      "querycommandvalue%28%29",
      "editable",
      "active-range",
      "editing-host-of",
      "delete-the-selection"
    ]
  }
}

(that's every anchor it references from execComman, as listed at https://github.com/w3c/webref/blob/48fcf5576be961ce5bc6cd2a134301b572c5952d/ed/links/html.json#L2807) as well as some user interface requirements. (It also apparently attempts to include a definition of text selection, which presumably should now refer to https://w3c.github.io/selection-api/#dfn-selection instead.)

Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should link to a normative reference that doesn't specify the feature, and since there is no official spec for this (deprecated) feature, the right thing to do here is to remove the spec_url:

@@ -2941,7 +2941,7 @@
"execCommand": {
"__compat": {
"mdn_url": "https://developer.mozilla.org/docs/Web/API/Document/execCommand",
"spec_url": "https://w3c.github.io/trusted-types/dist/spec/#dom-document-execcommand",
"spec_url": "https://w3c.github.io/editing/docs/execCommand/#dom-document-execcommand",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"spec_url": "https://w3c.github.io/editing/docs/execCommand/#dom-document-execcommand",

@github-actions github-actions bot added the size:xs [PR only] 0-6 LoC changed label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API size:xs [PR only] 0-6 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants