diff --git a/packages/alfa-style/src/node/predicate/is-visible.ts b/packages/alfa-style/src/node/predicate/is-visible.ts index b7e1dbfa75..d983e43bd6 100644 --- a/packages/alfa-style/src/node/predicate/is-visible.ts +++ b/packages/alfa-style/src/node/predicate/is-visible.ts @@ -1,8 +1,7 @@ import { Cache } from "@siteimprove/alfa-cache"; import { Numeric } from "@siteimprove/alfa-css"; import { Device } from "@siteimprove/alfa-device"; -import { Element, Text, Node } from "@siteimprove/alfa-dom"; -import { Option } from "@siteimprove/alfa-option"; +import { Element, Node, Text } from "@siteimprove/alfa-dom"; import { Predicate } from "@siteimprove/alfa-predicate"; import { Refinement } from "@siteimprove/alfa-refinement"; import { Context } from "@siteimprove/alfa-selector"; @@ -30,16 +29,16 @@ export function isVisible(device: Device, context?: Context): Predicate { return not(isInvisible(device, context)); } -const cache = Cache.empty< - Device, - Cache, Cache> ->(); +const cache = Cache.empty>>(); -function isInvisible(device: Device, context?: Context): Predicate { +function isInvisible( + device: Device, + context: Context = Context.empty(), +): Predicate { return (node) => cache .get(device, Cache.empty) - .get(Option.from(context), Cache.empty) + .get(context, Cache.empty) .get(node, () => test( or(