Accessibility (WCAG 2.2 AA), Core Web Vitals and Site Privacy
You can list the seven keyboard stops on the Tuesday desk page, compute a layout-shift score from an impact fraction and a distance fraction, place an LCP time and an INP time in the published bands, and keep a single essential cookie.
- Level
- Navigator
- Time
- 22 h
- Prerequisites
- R05-101

Jump to
After this course you can
The student can remediate a slow, inaccessible web application so that it passes 100% of axe-core WCAG 2.2 AA checks, full keyboard-only task completion, zero layout shift (CLS < 0.02), and zero third-party cookie writes.
Tab order, the ring, and 24px targets
The Tuesday page already has one header, one nav, one main, and one footer. The booking path has to work from the keyboard alone. WCAG 2.1.1 Keyboard asks for that, and WCAG 2.4.3 Focus Order asks the tab order to follow the visual order. This page uses no positive tabindex, so the browser walks the source from top to bottom. The stops are the skip link Skip to booking, the nav link Desks, the nav link Times, the nav link Help, the guest field, the time select, and the button Book desk 14. That is 7 stops. The skip link targets main, which has id booking and tabindex="-1". That value lets the skip link move focus onto main and adds no eighth stop. The next Tab then lands on the guest field, because the three nav links sit before main.
A card that is a div with an onclick and no tabindex sits outside those 7 stops. Enter and Space do nothing on it. A button element is already in the tab order and already runs on Enter and Space. The ring uses :focus-visible, the pseudo-class that matches keyboard focus: outline 3px solid #1A1A1A and outline-offset 2px. WCAG 2.4.7 Focus Visible asks for a mode where that keyboard indicator is visible. The sticky header is 72px tall. A focused nav link whose top is at 40px and whose height is 24px occupies y 40 through 64, and the header covers y 0 through 72, so the whole link is hidden. WCAG 2.4.11 Focus Not Obscured (Minimum) fails on a control that author content hides completely. scroll-margin-top: 80px places the link top at 80px. The header ends at 72, so 80 − 72 = 8px of paper sits above the link. The ring reaches 2px of offset plus 3px of outline, which is 5px. Then 8 − 5 = 3px of paper remains above the ring.
WCAG 2.5.8 Target Size (Minimum) asks for a target of at least 24 by 24 CSS pixels, unless a listed exception applies. The spacing exception draws a circle of diameter 24 centered on each undersized target, and those circles must stay apart. The book button is 44 by 44, so it clears 24 by 24 with no exception. Two icon buttons are 20 by 20 with a 2px gap. The center distance is 20 + 2 = 22. Circles of diameter 24 meet when the centers are under 24 apart, so 22 fails the exception. An 8px gap gives 20 + 8 = 28. The centers are more than 24 apart, the circles stay apart, and the exception passes.
Names, live text, and reduced motion
The accessible name is the string a screen reader speaks for a control. The guest field has a label element whose for attribute equals the input id guest, and the label text is Guest name. The name is Guest name. The page leaves the placeholder off. A placeholder is hint text inside an empty field, and it vanishes as soon as someone types, so the spoken name comes from the label that stays. An icon button whose only child is an svg has an empty name. A name check flags that button. The words Book desk 14 inside the button become the name. WCAG 2.5.3 Label in Name says the accessible name contains the visible text. A face that reads Book and an aria-label that reads Reserve leaves the visible word out of the name. This button shows Book desk 14 and uses that same string as its name.
After a successful hold, the page speaks a status without moving focus. WCAG 4.1.3 Status Messages is the criterion for that. An empty div with id note and role status sits in main from the first paint. role status implies aria-live polite and aria-atomic true: the reader waits for a pause, then speaks the whole text. On success the script sets the text to Desk 14 is held for 30 minutes. A missing time uses role alert on a second element. role alert implies aria-live assertive, and the text is Choose a time before you book. The elements are already in the page. Only the text changes. A node created in the same step as its text is a race some browsers drop.
The confirmation panel moves 24px with transform translateY over 400 ms. A transform leaves the start position of every box alone, so the slide adds 0 to the shift score. prefers-reduced-motion is the media feature a visitor sets when they want less motion. Inside @media (prefers-reduced-motion: reduce) the panel uses animation none and transition none, and the same sentence is simply present. WCAG 2.2.2 Pause, Stop, Hide covers motion that starts by itself and lasts more than 5 seconds. 400 ms is a shorter run. The query still removes the 24px travel on this page. WCAG 2.3.3 Animation from Interactions is AAA, and the same query is how the page meets it.
LCP, INP, and a shift you can multiply
LCP, largest contentful paint, is the time from navigation start until the largest text block or image in the viewport has painted. The score uses the rendered area that is actually visible. On this trace the heading Tuesday desks paints at 1100 ms. Its box is 280 by 53, fully in view, so the area is 280 × 53 = 14840. The desk photo is an img of 640 by 360, also fully in view, so its area is 640 × 360 = 230400. It paints at 3100 ms. The photo is the larger area, so it becomes the LCP element and the LCP time is 3100 ms. The published bands are: good at or under 2500 ms, needs improvement over 2500 ms and at or under 4000 ms, poor over 4000 ms. 3100 ms needs improvement. A link rel preload as image in the head, on this second trace, brings the same photo to 1400 ms. 1400 is at or under 2500, so the band is good. width and height on the img reserve the box. They do that job. The earlier paint on this trace comes from the preload.
INP, interaction to next paint, is the latency from an input to the next paint. The inputs that count are a click, a tap, and a key press. Scrolling stays out of the count. With fewer than 50 interactions, INP is the slowest one. This visit has three: typing in the guest field takes 48 ms, opening the time list takes 90 ms, and the book click takes 320 ms. INP is 320 ms. The published bands are: good at or under 200 ms, needs improvement over 200 ms and at or under 500 ms, poor over 500 ms. 320 ms needs improvement. The worked split of that 320 ms is an input delay of 30 ms, processing of 250 ms, and a presentation delay of 40 ms, and 30 + 250 + 40 = 320. The repaired click writes the hold sentence into the status region and paints that first, so that interaction falls to 64 ms. The three latencies are then 48, 90, and 64. The slowest is 90 ms. 90 is at or under 200, so the band is good.
CLS, cumulative layout shift, is the largest session window of unexpected shifts. A window groups shifts that follow with a gap under 1 second, and the window lasts at most 5 seconds. A shift within 500 ms of a click, a tap, or a key press is flagged and left out. A shift during scroll still counts. One shift scores as impact fraction times distance fraction. The impact fraction is the viewport share of the union of the old and new boxes of the elements that moved. A brand-new photo is unstable only when some other visible box changes its start position. The distance fraction is the greatest move divided by the larger of viewport width and height. The diagram viewport is 400 by 800. Its area is 400 × 800 = 320000, and the larger side is 800. A block of 400 by 400 moves down 200 px. The move is smaller than the block height, so the union height is 400 + 200 = 600 and the union area is 400 × 600 = 240000. The impact fraction is 240000 / 320000 = 0.75. The distance fraction is 200 / 800 = 0.25. The score is 0.75 × 0.25 = 0.1875. One shift means the window, and the CLS, is 0.1875. Good is at or under 0.10, needs improvement is over 0.10 and at or under 0.25, and poor is over 0.25. 0.1875 needs improvement. This page is also held to a score under 0.02, and 0.1875 is over that line. With the box reserved, the leftover diagram shift is a 400 by 80 block moving 16 px. The union height is 80 + 16 = 96, the union area is 400 × 96 = 38400, and the impact fraction is 38400 / 320000 = 0.12. The distance fraction is 16 / 800 = 0.02. The score is 0.12 × 0.02 = 0.0024, which is under 0.02 and under 0.10.
JSON-LD and one cookie
The title element and the single h1 both read Tuesday desks. The first sentence in main still reads: Four desks are free on Tuesday. Each booking holds the desk for 30 minutes. The meta description repeats that first sentence, so a snippet that uses the description quotes the page. The JSON-LD block is a script with type application/ld+json. It has six top-level keys: @context is https://schema.org, @type is Reservation, reservationId is TUE-14, reservationStatus is https://schema.org/ReservationConfirmed, bookingTime is 2026-11-17T09:00:00+01:00, and reservationFor. That calendar date is a Tuesday. reservationFor has two keys, @type Place and name Desk 14. That is 8 keys. The block has no trailing comma after Desk 14, so a strict parser accepts it. The button, the status sentence, and the Place name all say Desk 14.
The page writes a cookie only for the hold the visitor just asked for. The response from desks.example sends Set-Cookie: session=7f3a; Path=/; SameSite=Lax; Max-Age=1800; Secure; HttpOnly. Max-Age 1800 seconds is 1800 / 60 = 30 minutes, the same length as the hold. The next request loses the hold without that cookie, so the cookie is essential, and the setting host is the page host, so the write is first-party. SameSite=Lax sends it when the visitor navigates to desks.example and holds it back on a cross-site POST. Secure sends it only on HTTPS. HttpOnly keeps page script from reading it through document.cookie. A pixel response from stats.example sends Set-Cookie: a_id=991. The visitor asked for a desk, and the pixel only counts the visit. That write is non-essential, and the setting host differs from the page, so it is third-party. Remove the pixel. One write remains. Non-essential writes: 0. Third-party writes: 0. A script that runs on the page and assigns document.cookie stores its cookie on desks.example. That cookie is first-party, and it is essential only when the hold fails without it. A visit counter fails that test, so it stays off the page too.
The Tuesday booking, counted through
Keyboard: 7 stops, in source order, with tabindex="-1" on main and no positive tabindex. The div card with only an onclick adds 0 stops. The header is 72px. scroll-margin-top 80px leaves 8px of paper, and the 5px ring still has 3px of paper above it. The two 20 by 20 icons need an 8px gap so the centers sit 28px apart. The guest name comes from the label. The hold sentence lives in role status. The 24px, 400 ms transform is removed when prefers-reduced-motion is reduce, and that transform contributed 0 to CLS.
Paint: the heading area 14840 at 1100 ms loses to the photo area 230400. Without a preload, LCP is 3100 ms and needs improvement. With the preload, LCP is 1400 ms and the band is good. The three repaired input latencies are 48, 90, and 64 ms, so INP is 90 ms and the band is good. The open diagram shift is 0.1875. The reserved-box diagram shift is 0.0024.
The JSON-LD object has 8 keys, bookingTime falls on a Tuesday, and the Place name is Desk 14. The session cookie lasts 30 minutes. The stats.example pixel is gone, so third-party writes are 0 and non-essential writes are 0.
Check it on paper
Write the seven stops in order, and write how many stops a div with only an onclick adds. For two targets of 22 by 22 CSS pixels with a 0px gap, write the center distance and say whether the 24px circles stay apart. On the 400 by 800 diagram, a block of 400 by 200 moves down 40 px. The move is smaller than the block height. Write the union height, the impact fraction, the distance fraction, and the score. Then say whether 0.1875 and your new score each sit under 0.02. From the repaired traces, write the LCP time when the photo paints at 1400 ms, and write the INP of the latencies 48, 90, and 64. Last, write 1800 seconds in minutes, and write the number of third-party cookie writes after the stats.example pixel is removed.
The stops are Skip to booking, Desks, Times, Help, the guest field, the time select, and Book desk 14. The div adds 0. The center distance is 22 + 0 = 22, which is under 24, so the circles meet and the spacing exception fails. The union height is 200 + 40 = 240, the union area is 400 × 240 = 96000, and the impact fraction is 96000 / 320000 = 0.3. The distance fraction is 40 / 800 = 0.05. The score is 0.3 × 0.05 = 0.015. Then 0.1875 is over 0.02, and 0.015 is under 0.02. LCP is 1400 ms, in the good band. INP is 90 ms, in the good band. 1800 seconds is 30 minutes. Third-party writes: 0.
Check questions
On the 400 by 800 diagram, what is the layout-shift score when the impact fraction is 0.75 and the distance fraction is 0.25, and which published band is that score in?
0.1875. It is over 0.10 and at or under 0.25, so the band is needs improvement. The same score is also over this page's line of 0.02.
How many tab stops does the booking page list, and how many does a div with only an onclick add?
7, and 0. The seven are the skip link, Desks, Times, Help, the guest field, the time select, and Book desk 14.
The heading area is 14840 at 1100 ms and the photo area is 230400 at 3100 ms. What is the LCP time, and which published band is it in?
3100 ms. The photo is the larger area, and 3100 is over 2500 and at or under 4000, so the band is needs improvement.
What accessible name does the guest field get from its label, and which role announces Desk 14 is held for 30 minutes without moving focus?
Guest name. role status, which implies aria-live polite, speaks that sentence.
The Tuesday page is ready for a keyboard pass when the seven stops show a ring, the guest field has the name Guest name, the hold sentence sits in a status region, LCP and INP sit in the good band, the shift score is under 0.02, the JSON-LD names Desk 14, and the only cookie is the 30-minute session.
Final task
Submit the remediated web app; the automated Playwright + Lighthouse/axe runner verifies 0 WCAG violations, complete keyboard-only form flow, valid JSON-LD, zero non-essential cookies, and CLS < 0.02 on fixture hardware.
Terms in this course
This course has no terms of its own in the glossary yet. Terms from earlier courses are used here too.
The first lesson is open to read. The rest of the course is being written, and tests and diplomas come later. Join the waitlist