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

Add crude dfns patching mechanism #1159

Merged
merged 2 commits into from
Dec 16, 2022
Merged

Add crude dfns patching mechanism #1159

merged 2 commits into from
Dec 16, 2022

Conversation

tidoust
Copy link
Member

@tidoust tidoust commented Dec 16, 2022

This completes dfns extraction rules to ignore IDL terms defined in "exclude" blocks (for Trusted Types), and introduces a post-processing module to patch problematic dfns. The post-processing module only patches two specs for the time being: orientation-event which redefines PermissionState and portals, which redefines MessageEventSource.

Goal is to only add dfn patches when the dfns create actual referencing issues, not to solve all dfns issues, as that would be hard to maintain on a day to day basis.

(Webref's crawling job will need to be updated to call the new module for this to affect Webref data)

For additional context, see w3c/webref#306 and speced/bikeshed#2426 (comment)

Trusted Types has this weird IDL block where it defines DOMParser but does not
seem to mean it:
https://w3c.github.io/trusted-types/dist/spec/#integration-with-dom-parsing

The IDL block has an `exclude` class and is thus ignored by the IDL extraction
logic. This update completes the dfns extraction logic to also ignore terms
defined in such an IDL block. This avoids ending up with duplicated terms.
This creates a crude patching mechanism to patch dfns directly after crawling a
spec. This can be used to drop some well-known duplicates that cause referencing
issues.

The module needs to be maintained over time, so goal is to only hardcode rules
when really needed, e.g. because the re-definition of a term causes actual
referencing issues.

The module runs at the spec level for simplicity. A more complete version could
run at the crawl level, detect duplicates and try to act on them. That would
require investing more energy into it :)
Copy link
Member

@dontcallmedom dontcallmedom left a comment

Choose a reason for hiding this comment

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

crude, but a reasonable first step :)

The kind of patching done here feels like it could be made declarative using an approach similar to what we're doing for events, if/when we're looking at a longer term patching solution.

@tidoust tidoust merged commit 8298a4b into main Dec 16, 2022
@tidoust tidoust deleted the drop-dupl-dfns branch December 16, 2022 16:28
tidoust added a commit that referenced this pull request Dec 16, 2022
New features:
- Add crude dfns patching mechanism (#1159)
- Document newValues field in css extract schema (#1160)

Dependencies bumped:
- Bump respec from 32.5.0 to 32.5.1 (#1157)
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.

2 participants