Vixen
dd8b0a81
csharp
public enum PointerCapability

What a pointing device can do, as CSS's pointer and any-pointer ask.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ Flags, and the reason is any-pointer rather than pointer. Media Queries 5 § 9.2 says pointer describes the primary mechanism and takes one value, while any-pointer is true of every value some attached device satisfies — a tablet with a stylus and a finger is coarse and fine at once. One type serves both, because a single value is a one-bit set.

⚠ NoDevice is a bit rather than the zero, and that is the whole design of this enum. CSS's none is the empty capability set, and the empty set is also what a field nobody assigned holds — so if zero meant "no pointing device" then default(MediaContext) would assert a machine with no mouse and pointer-none: would be the rule that always applies. Zero therefore means Unspecified, which MediaContext resolves to Fine; NoDevice is the stated empty set and carries a bit so that it can be told from the unstated one. Both read as "no pointing device" to a query, since the test is for the absence of Coarse and Fine.

Fields and properties (4)

  • Unspecified

    Nothing has been said about the pointing devices. Read as Fine.

  • Coarse

    A device with limited accuracy — a finger.

  • Fine

    A device that can point accurately — a mouse or a stylus.

  • NoDevice

    Stated: there is no pointing device at all, which is CSS's none.

Used by (3)

  • MediaPreferencesVixen.Ui.Styling
  • MediaQueryVixen.Ui.Styling
  • VariantCoverageTestsVixen.Ui.Styling.Utilities.Tests