HTML isn’t done

A presentation at Chrome Developer Summit in November 2019 in San Francisco, CA, USA by Greg Whitworth

Slide 1

Slide 1

Slide 2

Slide 2

HTML isn’t done Nicole Sullivan PM for Google Chrome @stubbornella Greg Whitworth PM for Microsoft Edge @gregwhitworth

Slide 3

Slide 3

Slide 4

Slide 4

Edge & Chrome form control collaboration 1. Accessibility, Touch, & Visual Refresh 2. Stylability 3. Extending functionality 4. New components! Buh-bye 1990s gradients!

Slide 5

Slide 5

Visual Refresh & Accessibility upgrade A starting point for deeper changes!

Slide 6

Slide 6

The <progress> element was already fairly modern

Slide 7

Slide 7

The <meter> before & after

Slide 8

Slide 8

You are going to want to check these out. Enable the Web Platform Controls update UI flag. about://flags

Slide 9

Slide 9

The <range> also needed some love.

Slide 10

Slide 10

<checkbox> and <radio> are the workhorses of the web

Slide 11

Slide 11

Date

Slide 12

Slide 12

Time

Slide 13

Slide 13

Using inclusive design from the start

Slide 14

Slide 14

Color picker & keyboard navigation

Slide 15

Slide 15

High contrast mode on Windows

Slide 16

Slide 16

@media (forced-colors: active)

Slide 17

Slide 17

forced-color-adjust: auto | none

Slide 18

Slide 18

36 a11y commits to improve form controls 🎉

Slide 19

Slide 19

Edge & Chrome form control collaboration 1. Accessibility, Touch, & Visual Refresh 2. Stylability 3. Extending functionality 4. New components!

Slide 20

Slide 20

We want to build things web developers will use Currently form elements are not used as much as they could be. We wanted to understand why?

Slide 21

Slide 21

“Right now it is often easier to build form components from scratch…than it is to modify the style of the form controls themselves” – Web Developer

Slide 22

Slide 22

Why not just create form elements from scratch? • Duplication of effort • Effort it takes to build your own • Cross browser compat - even if you make it perfect on one browser, it’ll be weird on another. • Accessibility often suffers

Slide 23

Slide 23

Why not just create form elements from scratch? • Duplication of effort • Effort it takes to build your own • Cross browser compat - even if you make it perfect on one browser, it’ll be weird on another. • Accessibility often suffers

Slide 24

Slide 24

Why not just create form elements from scratch? • Duplication of effort • Effort it takes to build your own • Cross browser compat - even if you make it perfect on one browser, it’ll be weird on another. • Accessibility often suffers

Slide 25

Slide 25

We wanted to understand why form elements are recreated?

Slide 26

Slide 26

Top 10 form controls re-created by web developers

Slide 27

Slide 27

Why do web developers recreate form controls?

Slide 28

Slide 28

We heard you. This is why we’ll focus on stylabilty next select checkbox radio

Slide 29

Slide 29

Edge & Chrome form control collaboration 1. Accessibility, Touch, & Visual Refresh 2. Stylability 3. Extending functionality 4. New components!

Slide 30

Slide 30

Normalized values are painful for frameworks. We got a bunch of codepens from the React DOM team 3. != 3

Slide 31

Slide 31

Which form elements give you the most frustration?

Slide 32

Slide 32

You kinda hate the select element

Slide 33

Slide 33

And the date picker

Slide 34

Slide 34

And file

Slide 35

Slide 35

And the checkbox and radio elements

Slide 36

Slide 36

What really gets your goat about select? Styling Behavior & Extensibility Content Adjustments

Slide 37

Slide 37

Next generation <select>

Slide 38

Slide 38

Edge & Chrome form control collaboration 1. Accessibility, Touch, & Visual Refresh 2. Stylability 3. Extending functionality 4. New components!

Slide 39

Slide 39

Most requested native controls: <virtual-list> & <toggle-switch>

Slide 40

Slide 40

Virtual scrollers The most requested new component

Slide 41

Slide 41

Pete Hunt reminds us to build a virtual list… every year… since 2015

Slide 42

Slide 42

Virtual Scrolling Primitive: Display Locking Available in Origin Trial ● Batched rendering updates ● Find-in-page works ● Better a11y

Slide 43

Slide 43

Virtual Scrolling Primitive: Display Locking Available in Origin Trial • Batched rendering updates • Find-in-page works • Better a11y

Slide 44

Slide 44

Toggle Switch Allows developers to semantically express the off/on state.

Slide 45

Slide 45

Toggle Switch Updating Chromium’s default controls • We started with a ton of research into how other design systems handle toggle behavior. • We coded a prototype. Please try it! • And we used it to drive out new low level APIs and better a11y.

Slide 46

Slide 46

Three low level APIs & improvements • Form-associated custom elements • Custom element a11y • Focusable custom elements

Slide 47

Slide 47

Edge & Chrome form control collaboration 1. Accessibility, Touch, & Visual Refresh 2. Stylability 3. Extending functionality 4. New components!

Slide 48

Slide 48

Please help, we’d love for you to get involved.

Slide 49

Slide 49

Please help, we’d love for you to get involved.

Slide 50

Slide 50

Slide 51

Slide 51

URL #HTMLisNotDone

Slide 52

Slide 52

wicg.io

Slide 53

Slide 53

open-ui.org

Slide 54

Slide 54

https://bugs.chromium.org

Slide 55

Slide 55

Thank you! Nicole Sullivan Greg Whitworth @stubbornella @gregwhitworth

Slide 56

Slide 56

Slide 57

Slide 57

Controls Refresh Updating Chromium’s default controls • Modern Appearance • Touch friendly • Accessible

Slide 58

Slide 58

Collaborating

Slide 59

Slide 59

Slide 60

Slide 60

Slide 61

Slide 61

Opportunities found

Slide 62

Slide 62

Is this worth it? Is improving the controls & components story worth the investment? • • • • Appearance Frequency of bringing/building your own Effort it takes to build your own Cross browser

Slide 63

Slide 63

New components. Huzzah! 🎁 Proprietary + Confidential

Slide 64

Slide 64

Current Radio Checkbox Meter Range Upcoming

Slide 65

Slide 65

TRY OUT display-lock and std-switch CTA

Slide 66

Slide 66

We want your help

Slide 67

Slide 67

Proprietary + Confidential Fast Slow

Slide 68

Slide 68

While building virtual scrolling we realized we had a missing platform primitive: Display locking Folks couldn’t use find in page with regular virtual scrollers because the content isn’t really in the DOM.

Slide 69

Slide 69

Off-screen content can be locked - Locked DOM can be manipulated by JavaScript and the browser knows it doesn’t have to render it this frame. - More content in the DOM means user agent features like find in page can work.

Slide 70

Slide 70

Off-screen content can be locked • Motivate Locked DOM can be manipulated by JavaScript and the browser knows it doesn’t have to render it this frame. • More content in the DOM means user agent features like find in page can work.

Slide 71

Slide 71

Toggle Switch Updating Chromium’s default controls • We started with a ton of research into how other design systems handle toggle behavior. • We coded a prototype. Please try it! • And we used it to drive out new low level APIs and better a11y.

Slide 72

Slide 72

Three low level APIs • Form-associated custom elements • Custom element a11y • Focusable custom elements

Slide 73

Slide 73

Custom element a11y • Motivate adding this API

Slide 74

Slide 74

Custom element a11y • Motivate adding this API

Slide 75

Slide 75

Focusable custom elements • Motivate adding this API