Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

WebKit 3 min read Announcement mediumAdept

An HTML Switch Control

Safari 17.4 adds a native HTML switch control via `<input type=checkbox switch>`, which falls back to a plain checkbox in browsers without support. It mirrors the checkbox API (`:indeterminate` never matches), uses the ARIA switch role with On/Off announcements and OS accessibility indicators, and supports vertical writing modes. It also honors `accent-color` on the track, and `appearance: none` resets all properties to initial values for full custom styling. Use a switch for on/off settings and a checkbox for selection. Experimental `::thumb` and `::track` pseudo-elements sit behind a feature flag pending standardization.

Assumes: HTML form controlsCSS appearance property

Related posts

  • The golden rule of Customizable Select

    WebKit mediumAdept

    Customizable select, arriving in Safari 27, lets developers fully style `<select>` elements with custom arrows, icons and swatches while keeping native keyboard navigation and accessibility semantics. The one essential rule is to always give each `<option>` text content or an accessible text attribute. Icon-only options are harder for everyone to scan, unusable with screen readers and braille displays, and render as empty options in browsers without support or when CSS fails to load. Use visually hidden text or `alt` attributes where needed, mark decorative images with `alt=""`, and wrap enhancements in `@supports (appearance: base-select)` so plain text stays the baseline.

  • Implementing Vertical Form Controls

    WebKit mediumAdept

    Safari 17.4 supports vertical writing modes (`writing-mode: vertical-rl` / `vertical-lr`) on button, textarea, progress, meter, input and select elements, part of the Interop 2023 effort for CJK and Mongolian text. Inside WebKit, the user-agent stylesheet moved from physical to logical properties, custom layout code was fixed to compute logical widths, and baseline alignment now uses the central baseline in vertical modes. On macOS, which has no native vertical controls, some system-drawn controls like progress are rotated, while select uses custom fallback painting because its shadows prevent rotation. Custom-painted controls now use logical coordinates, glyph-like checkboxes and radios needed no changes, and popup UIs such as select menus and color pickers remain horizontal.

  • WebKit Features for Safari 27.2

    WebKit mediumAdept

    Safari 27.2 refines Customizable Select with a new `::field-content` pseudo-element for styling the displayed selected option without `<selectedcontent>`, adjusts `appearance: base-select` UA styles (flex-based button spacing, inherited `text-overflow`, simpler `::picker-icon`), and uses `safe` alignment so large pickers stay within the viewport. Grid Lanes renames `flow-tolerance` to `fit-tolerance` (old name kept as a deprecated alias); the property sets how close column heights must be to count as tied, and raising it well above the 1em default keeps item order steadier for keyboard users. The release also ships 20 bug fixes spanning accessibility, media/WebCodecs, cookies under CNAME, WebGPU indirect draws, and WebRTC.

  • WebKit Features in Safari 17.4

    WebKit mediumAdept

    Safari 17.4 ships 46 web platform features and 146 bug fixes, alongside completion of WebKit's multi-year rewrite of its inline layout engine. The rewrite retires the 21-year-old legacy line layout code, finishing with a reimplementation of Ruby, and is the starting point for rewriting other formatting contexts, beginning with Flexbox. Headline features include a native HTML switch (`<input type="checkbox" switch>`) that falls back to a checkbox, vertical writing-mode form controls, `align-content` in block and table layout, and the `@scope` rule. The release also adds web app manifest `shortcuts` and `categories` on macOS. `@scope` changes specificity tie-breaking so the rule whose scope root is closest in the DOM wins, so it should be adopted with care.

  • Bringing Back Horizontal Rules in Select Elements

    WebKit mediumAdept

    Safari 17.0 on macOS again renders `<hr>` elements placed between `<option>`s in a `<select>` as horizontal separator lines. Originally added to WebKit in 2006, the feature was silently lost for a decade when WebKit adopted its HTML5-based parser, and was restored by changing the HTML Standard's parsing rules so it is now standardized and covered by cross-browser tests. Caveats: separators are visual only and not announced by assistive technologies such as VoiceOver, `<hr>` is only supported as a direct child of `<select>` (not `<optgroup>`), and with `size` > 1 they render as blank space.

The quest for software engineering knowledge.

Look:
Layout: