Repository navigation
Decide whether an element is drawn without checkVisibility - #248
Conversation
Safari before 17.4 has no Element.checkVisibility(), and the kit supports Safari 16.5, so the anchored overlay, the popover trigger, the site header's menu and the virtual list threw there. ElementVisibility.isDrawn reads the element's boxes, and its computed visibility when asked, and the browser APIs check in npm test fails on a part that calls checkVisibility again. Agent: DEV5 (developer) Agent-Model: Anthropic Opus 5.5, Medium
|
Ready at bdfd140, #233. Agent: DEV5 (developer) |
… drawn The browser APIs check now fails on any whole-word checkVisibility, so an optional call, an indexed call and a borrowed .call are refused too, and a Node.js test runs it over each form. ElementVisibility.isDrawn answers false under an ancestor that skips its content, one with content-visibility: hidden or a closed details element, as checkVisibility does. Agent: DEV5 (developer) Agent-Model: Anthropic Opus 5.5, Medium
The kit's coverage gate found no spec reaching the shadow root step of ElementVisibility's ancestor walk; a paragraph in an open shadow root under a host with content-visibility: hidden now answers false, as checkVisibility does, and one under a plain host true. Agent: DEV5 (developer) Agent-Model: Anthropic Opus 5.5, Medium
|
Ready at a4911c2, #233, after REVIEW1's round. Agent: DEV5 (developer) |
ElementVisibility's ancestor walk ends on Object.isNull, as the kit's code does, and the browser APIs check's Node.js test runs the check through BrowserApiCheckResult, a class with a named result, in place of a free function with an anonymous return type. Agent: DEV5 (developer) Agent-Model: Anthropic Opus 5.5, Medium
rostislavrotaru
left a comment
There was a problem hiding this comment.
Reviewed: #248 at 285ec5f
Verdict: Approve
Findings: 0 Should fix, 0 Low, as line comments
Why it's right: isDrawn answers as checkVisibility does in each Chromium case, including content-visibility, closed details and shadow roots, using only APIs Safari 16.5 has; the check fails on any whole-word checkVisibility, in every call form its Node.js test covers.
Agent: LEAD (lead)
Agent-Model: Anthropic Opus 5.5, High
Closes #286 Moves the kit to 0.0.48, with what has merged since 0.0.47, so apps can take the binary file note and the path tooltip from #282, and the tab marker's tone, close place and dot from #299. ## What changes - `version.json` is at 0.0.48. - `CHANGELOG.md` has the 0.0.48 section, one entry per change a consumer or docs-site reader sees, from #303 (#299), #291 (#280), #281 (#275), #285 (#282), #263 (#151), #250 (#245), #262 (#138, #223), #260 (#16), #248 (#233), #258 (#18), #268 (#28), #255 (#234), #254 (#239), #256 (#236), #253 (#238), #252 (#160), #249 (#244), #242 (#231), #269 (#261) and #259 (#26). - Left out, as changing nothing the package or the docs site shows: #251 (the header's phone-bar rules written once, the same look), #247 (workflow pins), #264 and #277 (build scripts), #266 (example names and their check), #267, #271, #272, #273, #274, #276, #289 and #290 (tests and their tools), #279 and #295 (workflow pins). ## Checks No test covers these two files. The product names check reads the new section in CI; it names no product. Agent: DEV2 (developer) Agent-Model: Anthropic Opus 5.5, Medium
Closes #233.
What changed
ElementVisibility.isDrawn(element, isVisibilityAsked), insrc/app/models/element-visibility.ts, answers whether an element is drawn from what Safari 16.5 has. It checks:getClientRects().length > 0;content-visibility: hidden, such ashidden="until-found", or a closed<details>, whose summary is still drawn;visibilityofvisible. That matchescheckVisibility()andcheckVisibility({ visibilityProperty: true }).checkVisibility()call it instead:getClientRects, the call it now makes.scripts/checks/browser-api-check.ts, runs innpm testbeside the nativeElement assertions check. It fails on each line under the kit's and the docs site'ssrcthat namescheckVisibilityas a whole word, naming the file and line. That covers a call,?.(),["checkVisibility"]()and.call(t).tests/node/browser-api-check.test.tsruns it over each form. The README documents it.checkVisibility(); they run in Chromium only.Checks
origin.checkVisibility()again, the check fails, naminganchored-overlay.ts:148;isDrawnignoringvisibility, both ofelement-visibility.spec.ts's tests fail (on Linux);isDrawncallingcheckVisibility, its "calls no checkVisibility" test fails.\.checkVisibility(pattern fails the Node.js test;content-visibilityfails the comparison spec;<details>as open fails it too.Not checked
The parts were not run in Safari 16.5–17.3; no test machine runs it.
Agent: DEV5 (developer)
Agent-Model: Anthropic Opus 5.5, Medium