Repository navigation
fix(rules): a page past the style reader's limits reads elements as unknown, not shown #1015 - #1020
Conversation
…nknown, not shown #1015 Signed-off-by: Nik Cubrilovic <[email protected]>
|
Reviewed the diff and the code that reads
|
…ive-up result per page #1015 Signed-off-by: Nik Cubrilovic <[email protected]>
|
Reviewed the diff for #1020. I found no blocking problems.
|
readPageStylesreturned an empty result when it gave up at a limit, so an element the dropped rules hid read asshown(an unnamed control inside it failed) while the same page one rule under the cap readhidden. An incomplete read is nowunknownfor every element, nevershown.packages/rules/src/shared/page-styles.ts: the give-up result carries one rule that may apply to any element (display and visibility) and no step budget, so the cascade answersunknown. No new work: the result is a shared constant, and the over-cap page is read no slower than before (timed in the test).<style>, over-long selector, entry cap, and a rule nested inside another (the last one is also a11y style reader: a nested CSS rule that hides an element reads as shown, not unknown #1013's shape; that PR adds the Chromium rows).static-hiddenbound tests assertedshownafter the cap; they now assertunknown.Tests:
page-styles-rule-cap-1015.test.ts(4; 3 fail without the change): 4,900 / 5,000 / 5,100 flat hiding rules give hidden / unknown / unknown, a descendant and an unrelated element are unknown over the cap, an unnamed button in the hidden element isbutton-name-unconfirmed(not a fail) over the cap, and the timing check. Also pass: static-hidden (343), the width-media, show-only, where-is, attr-operators, vendor-display, naming-rules-hidden, select-name-hidden, button-name-hidden, aria-hidden-focus and hidden-text suites.tsgoclean in packages/rules;tangly check --strictclean.Tradeoff: a page past a limit now has all its naming checks unconfirmed instead of failing, because the reader cannot say which elements the dropped rules reach.
Agent skill (
squirrelscan/skills): not needed.Closes #1015