Skip to content

fix(w3c): match CSS selectors used in base.css#5160

Open
daniel-montalvo wants to merge 3 commits intospeced:mainfrom
daniel-montalvo:fix-basecss-classes
Open

fix(w3c): match CSS selectors used in base.css#5160
daniel-montalvo wants to merge 3 commits intospeced:mainfrom
daniel-montalvo:fix-basecss-classes

Conversation

@daniel-montalvo
Copy link
Copy Markdown
Collaborator

@daniel-montalvo daniel-montalvo commented Mar 31, 2026

Hi @marcoscaceres @sideshowbarker can you take a look at this one?

It contains a couple more mismatched selectors for revised recommendations that I forgot about in #5149

@daniel-montalvo daniel-montalvo self-assigned this Mar 31, 2026
@daniel-montalvo daniel-montalvo changed the title Fix basecss classes fix(w3c/sotd and w3c/headers): match CSS selectors used in base.css Mar 31, 2026
@sidvishnoi sidvishnoi changed the title fix(w3c/sotd and w3c/headers): match CSS selectors used in base.css fix(w3c): match CSS selectors used in base.css Apr 1, 2026
@sidvishnoi sidvishnoi requested a review from marcoscaceres April 1, 2026 08:34
@marcoscaceres marcoscaceres requested a review from Copilot April 7, 2026 01:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns the W3C SoTD and header logic with the CSS class selectors used by W3C’s base.css for revised Recommendations, specifically around distinguishing candidate vs proposed additions/corrections.

Changes:

  • Update SoTD logic to detect candidate additions/corrections using .addition:not(.proposed) / .correction:not(.proposed).
  • Update W3C header validation logic to use .addition.proposed / .correction.proposed (and exclude .proposed when checking for non-proposed revisions).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/w3c/templates/sotd.js Fixes revision-detection selectors to distinguish proposed vs candidate changes.
src/w3c/headers.js Updates revision-related selectors for updatable REC validations to match the class conventions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +570 to +574
const hasCorrections =
document.querySelector(".correction:not(.proposed)") !== null;
const hasProposedCorrections =
document.querySelector(".proposed-correction") !== null;
const hasAdditions = document.querySelector(".addition") !== null;
document.querySelector(".correction.proposed") !== null;
const hasAdditions =
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

Because hasAdditions/hasCorrections are now explicitly excluding .proposed, the later validation if (!isUpdatableRec && (hasAdditions || hasCorrections)) will no longer fire for documents that only contain proposed additions/corrections. That looks like a behavioral regression vs the previous .addition/.correction selectors, and it also makes the error text about "proposed additions" inconsistent with the condition. Consider including hasProposedAdditions/hasProposedCorrections in that check (and/or adjusting the message to match what the condition is actually validating).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot, can you add tests to expose this issue?

Copy link
Copy Markdown
Contributor

@marcoscaceres marcoscaceres left a comment

Choose a reason for hiding this comment

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

See what co-pilot said

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