Files
pbakaus_impeccable/tests/fixtures/antipatterns/linked-url-patterns.css
T
Paul BakausandGitHub fa44839f72 Fix detector URL scans and advisory handling (#709)
* Fix detector URL and advisory handling

Recover joined URL arguments without splitting local paths, derive advisory behavior from registry severity across consumers, inspect readable linked CSS in URL scans, and report only the dominant primary font.

AI assistance disclosure: Implemented and verified with Codex under maintainer direction.

* Filter linked CSS to rendered selectors

Flatten linked stylesheet grouping rules and collect only selector rules that target the live DOM, preventing unused grouped and selector-less patterns from leaking into URL findings.

AI assistance disclosure: Implemented and verified with Codex under maintainer direction.

* Fix detector review edge cases

AI assistance disclosure: Codex implemented and verified these fixes under maintainer direction.

* Preserve unresolved linked CSS selectors

AI assistance disclosure: Codex implemented and verified this fix under maintainer direction.

* Fix linked CSS selector filtering

Resolve pseudo-element selectors to live hosts, reject unresolvable linked CSS findings, and make the regression assertions independent. Also ignore comment delimiters when recovering CSS rule selectors.

AI assistance disclosure: This commit was prepared with Codex under maintainer direction.

* Skip unresolved container query CSS

Exclude linked container-query groups when their current applicability cannot be resolved, with a browser regression proving inactive styles do not leak.

AI assistance disclosure: This commit was prepared with Codex under maintainer direction.

* Detect active container query CSS

Use a temporary custom-property probe so the browser decides whether a nested style rule actually applies in the current container layout.

AI assistance disclosure: Codex helped implement and test this fix under maintainer direction.

* Filter inactive linked CSS states

Keep valid empty pseudo-class matches authoritative and omit selector-less linked at-rules that cannot be tied to rendered nodes.

AI assistance disclosure: Codex helped implement and test this fix under maintainer direction.

* Parse pseudo-elements without rewriting literals

Preserve quoted attribute values and escaped identifiers while resolving real pseudo-elements to live hosts.

AI assistance disclosure: Codex helped implement and test this fix under maintainer direction.

* Restore live linked keyframes

AI assistance disclosure: Codex helped implement and verify this fix under maintainer direction.

* Handle grouped linked keyframes

AI assistance disclosure: Codex helped implement and verify this fix under maintainer direction.

* Respect keyframe definition order

AI assistance disclosure: Codex helped implement and verify this fix under maintainer direction.

* Resolve effective linked keyframes

AI assistance disclosure: Codex helped implement and verify this fix under maintainer direction.

* Fix keyframe easing detection

Serialize effective per-keyframe easing back into the linked stylesheet corpus so overshoot motion is detected. Add a browser regression with a neutral animation name.\n\nAI assistance disclosure: Codex helped implement and test this fix under maintainer direction.
2026-09-02 15:45:34 -04:00

193 lines
5.1 KiB
CSS

@media (min-width: 1px) {
[data-token="::before"] {
width: 160px;
height: 80px;
background: linear-gradient(90deg, #d9d9d9 1px, transparent 1px), linear-gradient(180deg, #d9d9d9 1px, transparent 1px);
background-size: 72px 72px;
}
}
body {
background: #111;
color: #fff;
}
/* Literal pseudo-element text inside an attribute value is data, not selector
syntax. This rule has no live match even though an empty-value decoy does. */
[data-decoy="::before"] {
color: #7c3aed;
}
/* Escaped colons are identifier data, not a legacy pseudo-element. */
.\:\:before {
width: 240px;
height: 160px;
clip-path: polygon(2% 4%, 17% 1%, 31% 7%, 47% 3%, 62% 9%, 79% 2%, 96% 13%, 91% 31%, 98% 49%, 89% 68%, 95% 87%, 74% 96%, 51% 91%, 29% 98%, 8% 84%, 3% 61%);
}
/* A valid hostless pseudo-element selector cannot be queried through the DOM
selector API. It must remain in the corpus rather than count as unused. */
main > ::before {
content: "Rendered pseudo-element text";
display: block;
width: 160px;
animation: bounce-linked-pseudo 1s ease-in-out infinite;
}
@keyframes bounce-linked-pseudo {
50% { transform: translateY(2px); }
}
.linked-marquee {
animation: linked-horizontal-loop 8s linear infinite;
}
@keyframes linked-horizontal-loop {
from { transform: translateX(0); }
to { transform: translateX(-50%); }
}
.linked-keyframe-overshoot {
animation: linked-keyframe-curve 2s linear infinite;
}
@keyframes linked-keyframe-curve {
from {
transform: translateY(0);
animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}
to { transform: translateY(2px); }
}
.overridden-keyframes-animation {
animation: overridden-horizontal-loop 2s linear infinite;
}
@keyframes overridden-horizontal-loop {
from { transform: translateX(0); }
to { transform: translateX(-50%); }
}
/* The later same-name definition is the one Chromium renders. */
@keyframes overridden-horizontal-loop {
50% { opacity: 0.4; }
}
@layer linked-keyframes-low, linked-keyframes-high;
.layered-keyframes-animation {
animation: layered-horizontal-loop 2s linear infinite;
}
@layer linked-keyframes-high {
@keyframes layered-horizontal-loop {
from { transform: translateX(0); }
to { transform: translateX(-50%); }
}
}
/* Lower layer appears later in source, but does not override the high layer. */
@layer linked-keyframes-low {
@keyframes layered-horizontal-loop {
50% { opacity: 0.4; }
}
}
.linked-pulse-dot {
width: 8px;
height: 8px;
border-radius: 50%;
animation: linked-signal-cycle 1.5s ease-in-out infinite;
}
@keyframes linked-signal-cycle {
50% { opacity: 0.35; }
}
/* Chromium makes nested keyframes globally available even while the enclosing
container condition is false, so this live reference must still scan. */
.inactive-container-animation-reference {
animation: inactive-container-horizontal-loop 8s linear infinite;
}
@container (width > 2000px) {
@keyframes inactive-container-horizontal-loop {
from { transform: translateX(0); }
to { transform: translateX(-50%); }
}
}
.active-container-animation-reference {
animation: active-container-horizontal-loop 8s linear infinite;
}
/* The declaration is intentionally outside the container group. */
@container (width > 900px) {
@keyframes active-container-horizontal-loop {
from { transform: translateX(0); }
to { transform: translateX(-50%); }
}
}
/* A pseudo-element whose originating element is absent must remain outside
live URL findings instead of being retained as an unresolvable selector. */
.absent > ::before {
background: repeating-linear-gradient(45deg, #eee, #eee 10px, #fafafa 10px, #fafafa 20px);
}
/* These selectors exist in the live DOM, but their conditions are inactive.
URL scans must not treat their declarations as rendered page styles. */
@media (max-width: 1px) {
.inactive-media-stripes {
background: repeating-linear-gradient(45deg, #eee, #eee 10px, #fafafa 10px, #fafafa 20px);
}
}
@supports (display: imaginary-layout) {
.inactive-supports-stripes {
background: repeating-linear-gradient(45deg, #eee, #eee 10px, #fafafa 10px, #fafafa 20px);
}
}
/* The host exists, but the complete pseudo-class selector is inactive. */
.inactive-pseudo-stripes:not(.active) {
background: repeating-linear-gradient(45deg, #eee, #eee 10px, #fafafa 10px, #fafafa 20px);
}
.container-query-host {
container-type: inline-size;
width: 240px;
}
.container-query-host-active {
width: 960px;
}
@container (width > 900px) {
.inactive-container-stripes {
background: repeating-linear-gradient(45deg, #eee, #eee 10px, #fafafa 10px, #fafafa 20px);
}
.active-container-halo {
width: 640px;
height: 400px;
background: radial-gradient(circle, rgba(80, 111, 255, 0.85), transparent 70%);
}
}
/* Non-selector at-rules in an inactive container must not enter page-level
pattern scans just because their CSSOM text is readable. */
@container (width > 2000px) {
@keyframes inactive-container-gradient-text {
from {
background: linear-gradient(90deg, #111, #999);
background-clip: text;
}
to { background: none; }
}
}
.unused-linked-transition {
transition: width 200ms ease;
}