# Supported Selectors ## Support * (\*) parsing supported, not implemented * \(X\) fully supported, implemented * (/) No support planned ## Selectors | Name | Support | Test Case | Section | Test File | |-|-|-|-| - | | Type | X | testSelector | testSelector can match a element given it's tagName | tests/css_selector.cc | | Attribute | X | testSelector | testSelector can match a element by it's attributes only | tests/css_selector.cc | | ID | X | testSelector | testSelector can match a element by it's id only | tests/css_selector.cc | | Class | X | testSelector | testSelector can match a element by it's class and not match on a non class | tests/css_selector.cc | | Universal | X | testSelector | testSelector can match a universal selector | tests/css_selector.cc | | Nesting | X | parseCSS can parse a CSS sheet, parseCSS can parse multiple selectors nested | parseCSS can parse a nested CSS rule without a &, parseCSS can parse a the parent of a nested CSS rule, parseCSS can parse a nested CSS rule with a pseudo element, parseCSS can parse a parent CSS rule with a property in between sub-classes, multi selector test | tests/css_parser.cc | | & Nesting | X | parseCSS can parse a CSS sheet, parseCSS can parse multiple selectors nested | parseCSS can parse a nested CSS rule without a &, parseCSS can parse a the parent of a nested CSS rule, parseCSS can parse a nested CSS rule with a pseudo element, parseCSS can parse a double nested CSS rule with a pseudo element and &, parseCSS can parse a nested CSS rule with a &, parseCSS can parse a parent CSS rule with a property in between sub-classes, multi selector test | tests/css_parser.cc | ## Combined | Name | Support | Test Case | Section | Test File | |-|-|-|-| - | | Child Combined | X | testSelector | testSelector can match a child combined | tests/css_selector.cc | | Next-Sibling Combined | X | testSelector | testSelector can match a next sibling combined | tests/css_selector.cc | | Descendant Combinator | X | testSelector | testSelector can match a descendant combinator | tests/css_selector.cc | | Subsequent-Sibling Combinator | X | testSelector | testSelector can match a subsequent-sibling combinator | tests/css_selector.cc | ## Pseudo Classes | Name | Support | Test Case | Section | Test File | Note | |-|-|-|-| - | - | | :active | | | | | Will be added when links are| | :any-link | | | | | Will be added when links are| | :autofill | | | | | Will be added when inputs are added | | :buffering | | | | | Videos are not currently supported | | :checked | X | testSelector | testSelector can match a element with a pseudo class | tests/css_selector.cc | | | :default | | | | | Will be added when inputs are added | | :defined | | | | | | | :dir() | | | | | | | :disabled | X | testSelector | testSelector can match a element with a pseudo class | tests/css_selector.cc | | | :empty | | | | | Will be added when inputs are added | | :enabled | X | testSelector | testSelector can match a element with a pseudo class | tests/css_selector.cc | | | :first | / | | | | Will not be supported, currently there are no plans to support printing | | :first-child | X | testSelector | testSelector can match a element with first-child | tests/css_selector.cc | | | :first-of-type | X | testSelector | testSelector can match a element with first-of-type | tests/css_selector.cc | | | :focus | | | | | | | :focus-visible | | | | | | | :focus-within | | | | | | | :fullscreen | | | | | Videos are not currently supported | | :future | | | | | | | :has-slotted | | | | | | | :has() | X | testSelector | testSelector can match a :has() selector with a child combinator, testSelector can match a :has() selector with a next-sibling combinator, testSelector can match a :has() selector with a subsequent-sibling combinator, testSelector can match a :has() selector with a decendent combinator | tests/css_selector.cc | | | :host | | | | | | | :host-context() | | | | | | | :host() | | | | | | | :hover | | | | | | | :in-range | | | | | Will be added when inputs are added | | :indeterminate | | | | | Will be added when inputs are added | | :invalid | | | | | Will be added when inputs are added | | :is() | X | testSelector | testSelector can match :is() selectors | tests/css_selector.cc | | | :lang() | | | | | | | :last-child | X | testSelector | testSelector can match a element with last-child | tests/css_selector.cc | | | :last-of-type | X | testSelector | testSelector can match a element with last-of-type | tests/css_selector.cc | | | :left | / | | | | Will not be supported, currently there are no plans to support printing | | :local-link | / | | | | Doesn't make sense to add because all links will be local | | :modal | | | | | | | :muted | | | | | Videos are not currently supported | | :not() | X | testSelector | testSelector can match :not() selectors | tests/css_selector.cc | | | :nth-child() | X | testSelector | testSelector can match a :nth-child(even\|odd), testSelector can match a :nth-child(A), testSelector can match a :nth-child(An), testSelector can match a :nth-child(An+B), testSelector can match a :nth-child(An+B of type), testSelector can match a :nth-child(n+B), testSelector can match a :nth-child(A of type), testSelector can match a :nth-child(An of type), testSelector can match a :nth-child(n+B of type) | tests/css_selector.cc | when A is 0 it is changed to a 1, the only case this will cause breaking behavior is if you are trying :nth-child(0n+B) which is the same as calling :nth-child(B). This behavior applies to all nth-*| | :nth-last-child() | X | testSelector | testSelector can match a :nth-last-child(even\|odd), testSelector can match a :nth-last-child(A), testSelector can match a :nth-last-child(An), testSelector can match a :nth-last-child(An+B), testSelector can match a :nth-last-child(n+B), testSelector can match a :nth-last-child(An+B of type), testSelector can match a :nth-last-child(A of type), testSelector can match a :nth-last-child(An of type), testSelector can match a :nth-last-child(n+B of type) | tests/css_selector.cc | | | :nth-last-of-type() | X | testSelector | testSelector can match a :nth-last-of-type(even\|odd), testSelector can match a :nth-last-of-type(A), testSelector can match a :nth-last-of-type(An), testSelector can match a :nth-last-of-type(An+B), testSelector can match a :nth-last-of-type(n+B), | tests/css_selector.cc | | | :nth-of-type() | X | testSelector | testSelector can match a :nth-of-type(even\|odd), testSelector can match a :nth-of-type(A), testSelector can match a :nth-of-type(An), testSelector can match a :nth-of-type(An+B), testSelector can match a :nth-of-type(n+B), | tests/css_selector.cc | | | :only-child | X | testSelector | testSelector can match :only-child | tests/css_selector.cc | | | :only-of-type | X | testSelector | testSelector can match :only-of-type | tests/css_selector.cc | | | :open | | | | | | | :optional | | | | | | | :out-of-range | | | | | Will be added when inputs are added | | :past | | | | | | | :paused | | | | | Videos are not currently supported | | :picture-in-picture | | | | | Videos are not currently supported | | :placeholder-shown | | | | | Will be added when inputs are added | | :playing | | | | | Videos are not currently supported | | :popover-open | | | | | | | :read-only | X | testSelector | testSelector can match :read-only normal element, testSelector can match :read-only on a radio input, testSelector can match :read-only on a readonly text input, testSelector can match :read-only on a disabled text input, testSelector can match :read-only on a readonly textarea, testSelector can match :read-only on a disabled textarea | tests/css_selector.cc | | | :read-write | X | testSelector | testSelector can match :read-write on a text input, testSelector can match :read-write on a textarea, testSelector can match :read-write on a contenteditable div | tests/css_selector.cc | | | :required | X | testSelector | testSelector can match a element with a pseudo class | tests/css_selector.cc | | | :right | / | | | | Will not be supported, currently there are no plans to support printing | | :root | X | testSelector | testSelector can match :root | tests/css_selector.cc | | | :scope | | | | | | | :seeking | | | | | Videos are not currently supported | | :stalled | | | | | Video and Audio are not currently supported | | :state() | | | | | Shadow DOM | | :target | | | | | | | :target-current | | | | | | | :target-within | | | | | | | :user-invalid | | | | | | | :user-valid | | | | | | | :valid | | | | | | | :visited | | | | | | | :volume-locked | | | | | Video and Audio are not currently supported | | :where() | X | testSelector |testSelector can match :where() selectors | tests/css_selector.cc | | ## Pseudo Elements ## At-rules | Name | Support | Test Case | Section | Test File | Note | |-|-|-|-|-|-| | @charset | / |||| UTF-8/ASCII are the only encodings supported | | @color-profile | / |||| Too new to support | | @container |||||| | @counter-style |||||| | @font-face |||||| | @font-feature-values |||||| | @swash | / |||| Subset of @font-feature-values | | @annotation | / |||| Subset of @font-feature-values | | @ornaments | / |||| Subset of @font-feature-values | | @stylistic | / |||| Subset of @font-feature-values | | @styleset | / |||| Subset of @font-feature-values | | @character-varient | / |||| Subset of @font-feature-values | | @font-palette-values |||||| | @import ||||| Parsed where the first argument after @import is the url and the last non parenthesized value if present is the layer name. Inbetween the url and the layer is the media queries. | | @keyframes |||||| | @layer ||||| Currently setting the layer order via @layer l1, l2; is not supported | | @media |||||| | @namespace |||||| | @page | / |||| Will not be supported, currently there are no plans to support printing | | @position-try ||||| Use this document to check support of features | | @property |||||| | @scope ||||| Implementing this would cause some overhead | | @starting-style |||||| | @supports | / |||| Use this document to check support of features | | @view-transition ||||| This is useful but will not be implemented until later | ## Functions ## Types | Name | Support | Values | Note | |-|-|-|-| | AnyHover | X | None, Hover | | | AnyPointer | X | None, Fine, Coarse | | | Orientation | X | Landscape, Portrait | | | ColorScheme | X | Light, Dark | | | Contrast | X | NoPreference, More, Less | | | ReducedMotion | X | NoPreference, Reduce | | | ReducedTranparency | X | NoPreference, Reduce | | | Update | X | Fast, Slow | | ### Media Queries | Name | Support | Usage | Note | |-|-|-|-| | any-hover | X | window.setMouse(AnyPointer::Fine) | Will be set to AnyHover::Hover if AnyPointer is not AnyPointer::None, default AnyHover::Hover | | any-pointer | X | window.setMouse(AnyPointer::Coarse) | Default AnyPointer::Fine | | aspect-ratio | X | window.getAspectRatio() | Derived from width and height, returned as a double | | color | * | | All colors are stored as RGBA values | | color-gamut | * | | Only matches on "srgb" | | color-index | * | | Only matches on 0 | | device-posture | * | | Only matches on "continuous" | | display-mode | * | | All applications will be "standalone" | | dynamic-range | * | | Only matches on "standard" | | forced-colors | * | | Only matches on "none" | | grid | * | | Only matches on 0 | | height | X | window.setHeight(int) | Supports height, min-height, max-height | | hover | X | window.setMouse(AnyPointer::Fine) | Will match any-hover | | inverted-colors | * | | Only matches on "none" | | monochrome | * | | Only matches on 0 | | orientation | X | window.setOrientation(Orientation::Portrait) | Defaults to Orientation::Landscape | | overflow-block | * | | Only matches on "scroll" | | overflow-inline | * | | Only matches on "scroll" | | pointer | X | window.setMouse(AnyPointer) | Will match any-pointer | | prefers-color-scheme | X | window.setColorScheme(ColorScheme::Dark) | Defaults to ColorScheme::Light | | prefers-contrast | X | window.setContrast(Contrast::Less) | Defaults to ColorScheme::NoPreference | | prefers-reduced-motion | X | window.setReducedMotion(ReducedMotion::Reduce) | Defaults to ReducedMotion::NoPreference | | prefers-reduced-transparency | X | window.setReducedTransparency(ReducedTransparency::Reduce) | Defaults to ReducedTransparency::NoPreference | | resolution | X | window.setResolution(int) | Defaults to 72dpi, accepts a int in dpi | | scripting | / | | Not needed | | update | X | window.setUpdate(Update::Slow) | Defaults to Update::Fast | | video-dynamic-range | * | | Only matches on "standard" | | width | X | window.setWidth(int) | Supports width, min-width, max-width |