From 173e7df91ba5bcd5311851187cdaea90f600abf3 Mon Sep 17 00:00:00 2001 From: Tab Atkins-Bittner Date: Tue, 20 Aug 2024 15:41:43 -0700 Subject: [PATCH] A few more little fixes, and rebase tests --- bikeshed/Spec.py | 4 + bikeshed/doctypes/manager.py | 2 +- bikeshed/doctypes/utils.py | 8 +- bikeshed/headings.py | 6 +- bikeshed/metadata.py | 4 +- .../readonly/boilerplate/doctypes.kdl | 8 +- .../github/WICG/container-queries/index.html | 2 +- .../WICG/content-index/spec/index.console.txt | 2 +- .../github/WICG/cq-usecases/index.console.txt | 2 +- .../WICG/css-parser-api/index.console.txt | 1 + .../WICG/keyboard-lock/index.console.txt | 1 + .../lighting-estimation/index.html | 2 +- .../webxrmeshing-1.console.txt | 2 +- .../real-world-geometry/webxrmeshing-1.html | 1715 +---------------- .../webvr/spec/1.1/index.console.txt | 1 + .../immersive-web/webvr/spec/1.1/index.html | 2 +- tests/github/w3c/PFE/Overview.html | 2 +- .../index.console.txt | 2 - .../index.console.txt | 2 - tests/github/w3c/clipboard-apis/index.html | 2 +- .../box-tree-api/Overview.console.txt | 2 +- .../box-tree-api/Overview.html | 1554 +-------------- .../css-parser-api/Overview.console.txt | 1 + .../css-typed-om-2/Overview.console.txt | 2 +- .../css-typed-om-2/Overview.html | 1558 +-------------- .../font-metrics-api/Overview.console.txt | 2 +- .../font-metrics-api/Overview.html | 1546 +-------------- .../worklets/Overview.console.txt | 2 - .../css-2015/Overview.console.txt | 1 + .../css-2017/Overview.console.txt | 1 + .../css-2018/Overview.console.txt | 1 + .../css-2020/Overview.console.txt | 3 +- .../w3c/csswg-drafts/css-2020/Overview.html | 4 +- .../css-color-adjust-1/Overview.console.txt | 1 + .../css-device-adapt-1/Overview.console.txt | 1 + .../css-env-1/Overview.console.txt | 1 + .../css-extensions-1/Overview.console.txt | 1 + .../css-fonts-3/Overview-wip.console.txt | 1 + .../css-fonts-4/Overview.console.txt | 1 + .../css-fonts-5/Overview.console.txt | 1 + .../css-lists-3/Overview.console.txt | 1 + .../css-multicol-1/Overview.console.txt | 1 + .../css-multicol-2/Overview.console.txt | 1 + .../css-nesting-1/Overview.console.txt | 1 + .../css-overscroll-1/Overview.console.txt | 1 + .../css-rhythm-1/Overview.console.txt | 1 + .../css-scoping-1/Overview.console.txt | 1 + .../css-shadow-parts-1/Overview.console.txt | 1 + .../css-text-decor-3/Overview.console.txt | 2 +- .../css-ui-3/Overview.console.txt | 2 +- .../css-values-3/Overview.console.txt | 1 + .../css-values-4/Overview.console.txt | 1 + .../css-will-change-1/Overview.console.txt | 1 + .../csswg-drafts/cssom-1/Overview.console.txt | 1 + .../cssom-view-1/Overview.console.txt | 1 + .../csswg-drafts/indexes/Overview.console.txt | 1 + .../resize-observer-1/Overview.console.txt | 1 + .../scroll-animations-1/Overview.console.txt | 1 + .../selectors-4/Overview.console.txt | 1 + .../Overview.console.txt | 2 +- .../selectors-nonelement-1/Overview.html | 4 +- .../w3c/dpub-pagination/Overview.console.txt | 7 +- .../fill-stroke/Overview.console.txt | 2 - .../w3c/fxtf-drafts/fill-stroke/Overview.html | 4 +- .../fxtf-drafts/matrix/Overview.console.txt | 4 +- .../w3c/fxtf-drafts/matrix/Overview.html | 4 +- .../releases/NOTE/NOTE.console.txt | 3 - .../releases/NOTE2/index.console.txt | 2 - .../github/w3c/openscreenprotocol/index.html | 2 +- .../releases/FPWD.console.txt | 3 +- .../w3c/orientation-sensor/releases/FPWD.html | 4 +- tests/github/w3c/sensors/usecases.console.txt | 2 - .../svgwg/specs/svg-native/index.console.txt | 1 + .../w3c/wcag-act/act-fr-reqs.console.txt | 1 + .../github/w3c/wcag-act/act-rules-format.html | 2 +- .../change-password-url.console.txt | 1 + .../response-code-reliability.console.txt | 1 + .../webappsec-csp/cookies/index.console.txt | 2 - .../webappsec-csp/pinning/index.console.txt | 2 - .../index.console.txt | 2 - .../index.console.txt | 1 + .../index.console.txt | 1 + .../webappsec-uisecurity/index.console.txt | 3 +- .../index.console.txt | 1 + tests/github/w3c/webtransport/index.html | 2 +- .../client-certificates/index.console.txt | 5 +- .../w3ctag/evergreen-web/index.console.txt | 2 + tests/github/w3ctag/evergreen-web/index.html | 1659 +--------------- tests/github/w3ctag/promises-guide/index.html | 1675 +--------------- tests/github/w3ctag/url/url.console.txt | 2 - 90 files changed, 376 insertions(+), 9505 deletions(-) diff --git a/bikeshed/Spec.py b/bikeshed/Spec.py index 74e798cb26..7ce609e39f 100644 --- a/bikeshed/Spec.py +++ b/bikeshed/Spec.py @@ -146,6 +146,7 @@ def initMetadata(self, inputContent: InputSource.InputContent) -> None: # Combine the data so far, and compute the doctype # (the other md sources need the doctype in order to be found) self.md = metadata.join(self.mdBaseline, self.mdDocument, self.mdCommandLine) + rawDoctype = (self.md.rawOrg, self.md.rawGroup, self.md.rawStatus) self.doctype = self.doctypes.getDoctype(self.md.rawOrg, self.md.rawGroup, self.md.rawStatus) self.mdDefaults = metadata.fromJson( @@ -153,6 +154,9 @@ def initMetadata(self, inputContent: InputSource.InputContent) -> None: source="defaults", ) self.md = metadata.join(self.mdBaseline, self.mdDefaults, self.mdDocument, self.mdCommandLine) + if rawDoctype != (self.md.rawOrg, self.md.rawGroup, self.md.rawStatus): + # recompute doctype + self.doctype = self.doctypes.getDoctype(self.md.rawOrg, self.md.rawGroup, self.md.rawStatus) # Using all of that, load up the text macros so I can sub them into the computed-metadata file. self.md.fillTextMacros(self.macros, doc=self) diff --git a/bikeshed/doctypes/manager.py b/bikeshed/doctypes/manager.py index f9ecc73d59..1c7d522362 100644 --- a/bikeshed/doctypes/manager.py +++ b/bikeshed/doctypes/manager.py @@ -166,7 +166,7 @@ def looselyMatch(self, rawStatus: str) -> bool: orgName, statusName = utils.splitOrg(rawStatus) if statusName and self.name.upper() != statusName.upper(): return False - if orgName and self.org.name != orgName.lower(): + if orgName and self.org.name != orgName.upper(): return False return True diff --git a/bikeshed/doctypes/utils.py b/bikeshed/doctypes/utils.py index a02f2f06d4..00e40b0d4f 100644 --- a/bikeshed/doctypes/utils.py +++ b/bikeshed/doctypes/utils.py @@ -102,7 +102,7 @@ def canonicalize( f"Your Group ({group.name}) is in the '{group.org.name}' Org, but your Status ({status.name}) is only usable in the '{status.org.name}' Org. Allowed Status values for '{group.org.name}' are {config.englishFromList(sorted(possibleStatusNames))}", ) - if group and group.type is not None and status and status.groupTypes and group.type not in status.groupTypes: + if group and group.type is not None and status and status.groupTypes and group.type not in status.groupTypes: allowedStatuses = [s.name for s in group.org.statuses.values() if group.type in s.groupTypes] if allowedStatuses: m.warn( @@ -115,7 +115,7 @@ def canonicalize( if group and status and group.org.name == "W3C": # Apply the special w3c rules - validateW3CStatus(group, status) + validateW3CStatus(status) # Reconciliation done, return everything if Status exists. if status: @@ -200,7 +200,7 @@ def reconcileOrgs(fromRaw: str | None, fromStatus: str | None, fromGroup: str | return orgName -def validateW3CStatus(group: Group, status: Status) -> None: +def validateW3CStatus(status: Status) -> None: if status.name == "DREAM": m.warn("You used Status:DREAM for a W3C document. Consider Status:UD instead.") @@ -208,5 +208,3 @@ def validateW3CStatus(group: Group, status: Status) -> None: m.die( f"Under Process2021, {status.name} is no longer a valid status. Use NOTE (or one of its variants NOTE-ED, NOTE-FPWD, NOTE-WD) instead.", ) - - diff --git a/bikeshed/headings.py b/bikeshed/headings.py index 3e75d4eac9..1cd7f3300b 100644 --- a/bikeshed/headings.py +++ b/bikeshed/headings.py @@ -23,7 +23,7 @@ def processHeadings(doc: t.SpecT, scope: str = "doc") -> None: for el in headings: h.addClass(doc, el, "settled") if scope == "all" and doc.doctype.group.privSec: - checkPrivacySecurityHeadings(h.findAll(".heading", doc)) + checkPrivacySecurityHeadings(doc, h.findAll(".heading", doc)) def resetHeadings(headings: list[t.ElementT]) -> None: @@ -56,7 +56,7 @@ def addHeadingIds(doc: t.SpecT, headings: list[t.ElementT]) -> None: ) -def checkPrivacySecurityHeadings(headings: list[t.ElementT]) -> None: +def checkPrivacySecurityHeadings(doc: t.SpecT, headings: list[t.ElementT]) -> None: security = False privacy = False for header in headings: @@ -66,7 +66,7 @@ def checkPrivacySecurityHeadings(headings: list[t.ElementT]) -> None: security = True if "privacy" in text and "considerations" in text: privacy = True - if "security" in text and "privacy" in text and "considerations" in text: + if "security" in text and "privacy" in text and "considerations" in text and doc.doctype.org.name == "W3C": m.warn( "W3C policy requires Privacy Considerations and Security Considerations to be separate sections, but you appear to have them combined into one.", el=header, diff --git a/bikeshed/metadata.py b/bikeshed/metadata.py index f5da5cbdd2..539eda7621 100644 --- a/bikeshed/metadata.py +++ b/bikeshed/metadata.py @@ -279,8 +279,10 @@ def fillTextMacros(self, macros: t.DefaultDict[str, str], doc: t.SpecT) -> None: macros["level"] = str(self.level) if self.displayVshortname: macros["vshortname"] = self.displayVshortname - if doc.doctype.status.fullName() == "FINDING" and doc.doctype.group: + if doc.doctype.status.name == "FINDING" and doc.doctype.group: macros["longstatus"] = f"Finding of the {doc.doctype.group.name}" + elif doc.doctype.status.name == "DRAFT-FINDING" and doc.doctype.group: + macros["longstatus"] = f"Draft Finding of the {doc.doctype.group.name}" elif doc.doctype.status: macros["longstatus"] = doc.doctype.status.longName else: diff --git a/bikeshed/spec-data/readonly/boilerplate/doctypes.kdl b/bikeshed/spec-data/readonly/boilerplate/doctypes.kdl index 3e9f705f72..0b475de73a 100644 --- a/bikeshed/spec-data/readonly/boilerplate/doctypes.kdl +++ b/bikeshed/spec-data/readonly/boilerplate/doctypes.kdl @@ -49,9 +49,11 @@ status "LS-COMMIT" "Commit Snapshot" status "LS-BRANCH" "Branch Snapshot" status "LS-PR" "PR Preview" status "LD" "Living Document" +status "DRAFT-FINDING" "Draft Finding" +status "FINDING" "Finding" org "whatwg" { - group "whatwg" priv-sec=true + group "whatwg" priv-sec=false status "RD" "Review Draft" { requires "Date" } @@ -126,7 +128,7 @@ org "w3c" { group "webml" type="cg" group "webmlwg" type="wg" group "webperf" type="wg" - group "webplatform" type="cg" priv-sec=true + group "webplatform" type="wg" priv-sec=true group "webrtc" type="wg" group "webspecs" type="wg" priv-sec=true group "webtransport" type="wg" @@ -162,7 +164,7 @@ org "w3c" { group-types "wg" } status "CR" "W3C Candidate Recommendation Snapshot" { - requires "Level" "ED" "TR" "Issue Tracking" "Date" "Implentation Report" + requires "Level" "ED" "TR" "Issue Tracking" "Date" "Implementation Report" group-types "wg" } status "CRD" "W3C Candidate Recommendation Draft" { diff --git a/tests/github/WICG/container-queries/index.html b/tests/github/WICG/container-queries/index.html index 0679d356d4..8a6463c850 100644 --- a/tests/github/WICG/container-queries/index.html +++ b/tests/github/WICG/container-queries/index.html @@ -3,7 +3,7 @@ Container Queries - + diff --git a/tests/github/WICG/content-index/spec/index.console.txt b/tests/github/WICG/content-index/spec/index.console.txt index 7433e54ac9..1e4817e6cb 100644 --- a/tests/github/WICG/content-index/spec/index.console.txt +++ b/tests/github/WICG/content-index/spec/index.console.txt @@ -1,4 +1,4 @@ -WARNING: You used Status: ED, but W3C Community and Business Groups are limited to these statuses: CG-DRAFT, CG-FINAL, UD. +WARNING: You used Status ED, but your Group (WICG) is limited to the statuses CG-DRAFT, CG-FINAL, or UD. LINE ~76: Multiple possible 'service worker' dfn refs. Arbitrarily chose https://w3c.github.io/ServiceWorker/#dfn-service-worker To auto-select one of the following refs, insert one of these lines into a