From 394f36eb50a287531c1399fe528c9341023fdfcc Mon Sep 17 00:00:00 2001 From: "Daniel D. Beck" Date: Tue, 16 Sep 2025 16:20:49 +0200 Subject: [PATCH] Mark `target-within` as discouraged --- features/target-within.yml | 14 ++++++++++---- scripts/specs.ts | 4 ++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/features/target-within.yml b/features/target-within.yml index e577b352d7c..2f08725be64 100644 --- a/features/target-within.yml +++ b/features/target-within.yml @@ -1,7 +1,13 @@ name: :target-within description: The `:target-within` CSS pseudo-class matches the element with an ID matching the URL fragment and its ancestors. -spec: https://drafts.csswg.org/selectors-4/#the-target-within-pseudo +spec: https://www.w3.org/TR/2022/WD-selectors-4-20220507/#the-target-within-pseudo group: selectors -# BCD key removed due to no implementation. See https://github.com/web-platform-dx/web-features/issues/2339 -# compat_features: -# - css.selectors.target-within +discouraged: + # reason: The `:target-within` pseudo-class was dropped from the specification in favor of `:has(:target)`. + # removal_date: 2023-08-16 + according_to: + - https://drafts.csswg.org/selectors-4/#the-target-pseudo + - https://github.com/w3c/csswg-drafts/issues/8357 + alternatives: + - has + - target diff --git a/scripts/specs.ts b/scripts/specs.ts index a2372fc5e9e..6760ce61e17 100644 --- a/scripts/specs.ts +++ b/scripts/specs.ts @@ -136,6 +136,10 @@ const defaultAllowlist: allowlistItem[] = [ [ "https://github.com/whatwg/html/pull/11426", "This is where speculation rules' prefetch is in the process of being spec'd. Once the PR merges, change the spec url in `speculation-rules`, and remove this exception." + ], + [ + "https://www.w3.org/TR/2022/WD-selectors-4-20220507/#the-target-within-pseudo", + "Allowed because this is where the feature last appeared in the spec before removal." ] ];