Restrictions on which properties may be set by declarations using specific pseudo-classes and -elements are not accounted for
For the ::cue pseudo-element: https://developer.mozilla.org/en-US/docs/Web/CSS/::cue#permitted_properties
For the :visited pseudo-class: https://developer.mozilla.org/en-US/docs/Web/CSS/:visited#privacy_restrictions
As an example, this currently means that Style#computed() applies the text-decoration property set by the following declaration, which affects SIA-R62:
a:visited {
text-decoration: none;
}
- [x] Follow up on DEV-11251.
As discussed at check-in, the easiest solution to this seems to be to drop illegal declarations from rule.style if part contains a :visited selector here:
https://github.com/Siteimprove/alfa/blob/578fb689cf50b783b46e3412e0b7c5906bfdb77f/packages/alfa-cascade/src/selector-map.ts#L220
Chromium uses entirely separate property definitions for style properties that are allowed in :visited declarations: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/css/properties/css_property.h;l=120-124;drc=9680e17185f4d0a48a7047d0070ef26d1df282d6
And Servo seems to use a flag during matching: https://github.com/servo/servo/blob/e13a04627c40df476566bcec3339cd89ec380afb/components/selectors/context.rs#L36-L49
Yep, and properties that are allowed to depend on :visited are handled here: https://github.com/servo/servo/blob/b196bfeeeb90e87769700b52202e898da999f8da/components/style/properties/properties.mako.rs#L1309-L1334
Parking this for now. Will need more refinement.
Many pseudo-elements also restrict the list of properties that are allowed to be set on them.
Even if we do not intend to implement actual matching of the pseudo-elements, we might want to keep that in mind when designing a solution for :visited since a large part might be shareable.
The bit about pretending that some links are not visited (e.g. in sibling selectors) is specific to :visited, however.