You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
content/hidden-text misses display:none when a CSS comment precedes the property #896
content/hidden-text reads <style> rules and inline styles with parseDeclarations in packages/rules/src/content/hidden-text.ts. A CSS comment in front of a property stays in the property name, so the declaration is never recognised:
So <style>.promo { /* hide */ display: none }</style> hides .promo in a browser, but the rule does not see the display: none, and text or links hidden that way are not reported. The same applies to a comment between a property and its colon, and to inline style attributes.
Found while reviewing mobile/input-zoom (#708), which reads declarations with its own reader that treats a comment as a space.
Acceptance Criteria
parseDeclarations("/* hide */ display:none") returns display mapped to none
A comment between a property name and its colon (display/* x */: none) is read the same way
A comment inside a value separates tokens rather than joining them (1/**/2px is not read as 12px)
Fixture: <style>.x { /* hide */ display: none }</style> with text in .x gets the same content/hidden-text finding as the same rule without the comment
Note from pub#897: mobile/input-zoom has its own readDeclarations (comments read as a space, per-declaration !important, order kept) and splitSelectorList. When this is fixed, consider moving one shared declaration reader into packages/rules/src/shared/ and pointing both rules at it.
Activity
nc9 commentedon Oct 17, 2026
Note from pub#897:
mobile/input-zoomhas its ownreadDeclarations(comments read as a space, per-declaration!important, order kept) andsplitSelectorList. When this is fixed, consider moving one shared declaration reader intopackages/rules/src/shared/and pointing both rules at it.