Re: [device-posture] Clarify that `null` is never exposed to the page (#152)

I think different concepts are being mixed up here:
- The API (i.e. [`DevicePosture.type`](https://w3c.github.io/device-posture/#dom-deviceposture-type)) always returns either "continuous" or "folded". These are the only members of the [`DevicePostureType`](https://w3c.github.io/device-posture/#dom-deviceposturetype) enum. The value is tracked internally in the [`[[CurrentPosture]]`](https://w3c.github.io/device-posture/#dfn-currentposture) internal slot of the Document interface.
- Top-level traversables (not the Document interface) have an additional [`[[PostureOverride]]`](https://w3c.github.io/device-posture/#dfn-postureoverride) internal slot whose type would be, in Web IDL terms, `DevicePostureType?` (i.e. a nullable `DevicePostureType`). `null` is used to indicate that the internal slot has a value, but the `[[PostureOverride]]` internal slot is never returned directly to script, nor is that stated anywhere in the spec.
- Specifically, `[[PostureOverride]]` is used in [Calculating the device posture information](https://w3c.github.io/device-posture/#calculating-the-device-posture-information), which always returns a `DevicePostureType` -- there's a check there that returns `[[PostureOverride]]`'s value when it is not `null`.

We could add a note to the table defining `[[PostureOverride]]` stating that `null` is never exposed to script, but I thought that was already clear given `DevicePosture.type`'s IDL type.

(cc @JuhaVainio)

-- 
GitHub Notification of comment by rakuco
Please view or discuss this issue at https://github.com/w3c/device-posture/issues/152#issuecomment-2242387320 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 22 July 2024 08:30:32 UTC