w3c / w3c/csswg-drafts

[css-view-transitions-1][cssom] Clarify how `getComputedStyle` should be have with view-transition pseudo-elements

Open
#9,880 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

css-view-transitions-1 cssom-1
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

The current specified behavior in CSSOM re pseudo-elements is a bit vague: https://drafts.csswg.org/cssom/#extensions-to-the-window-interface

If pseudoElt is provided, is not the empty string, and starts with a colon, then:

  1. Parse pseudoElt as a <pseudo-element-selector>, and let type be the result.
  2. If type is failure, or is an ::slotted() or ::part() pseudo-element, let obj be null.
  3. Otherwise let obj be the given pseudo-element of elt.

We should clarify what this mean for view-transition pseudo-elements?

  • what happens when there is no active transition
  • what happens with wildcards/classes

Current chromium implementation gives an actual value for pseudos with names but no *, and regardless of whether the transition is active. This seems a bit coincidental.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CSSOM extensions to the Window interface linked in the issue, then compare its pseudo-element rules with the listed view-transition cases. Resolve behavior for inactive transitions, wildcards, and classes, including whether the current Chromium behavior is intended. Done means the specification clearly defines these cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend, web-dev
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.