Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-TOOLBAR-001

The toolbar has four rows of four titled buttons that float over the page

When a preview page is built, the extension SHALL render the toolbar, named Preview controls with the role toolbar, as four rows of four titled buttons in a fixed order (Refresh, Edit, Export and the collapse button; Anchor, Theme, Back and Next; Width, Fold, Zoom out and Zoom in; Table of contents, Side-by-side, Diff and Comments), give every button a data-tooltip equal to its title, show that tooltip with a readable contrast on hover and on keyboard focus, and fix the toolbar at the top right of the pane above the page content, inside the pane and without overlap between its rows.

Step 1 of path 1 in StRS-MDOKFSTUDIO-TOOLBAR-001: from “A preview page is built” to “The toolbar is expanded”.

Scenarios 7

The situations the tests check; open one to read it.

nominalWritable preview
Givena preview
Whenthe toolbar markup is rendered
Thenit holds 16 buttons in the rows main, navigation, view and review, in that order, four buttons in each row, and rows navigation, view and review sit together in one group that follows the main row
nominalVisual order
Givena 900 px pane in any theme
Whenthe page is rendered
Thenthe toolbar has exactly four rows named main, navigation, view and review with 4 buttons each, the Tab order follows the rows (the main row is Refresh, Edit, Export to HTML, then the collapse button; row 2 starts with Anchor, row 3 with Width, row 4 with Table of contents), and the expanded toolbar is as wide as its first row (four buttons, 134 px, never wider than 134 px)
nominalEvery button has a tooltip equal to its title
Giventhe rendered toolbar
Whenits buttons are counted
the attributes of the Theme and Edit buttons are read
Then16 buttons carry data-tooltip, each equal to its title
the aria-label differs from the title (Preview theme: Current theme, Toggle edit mode) while data-tooltip equals the title
nominalTooltip on hover and on keyboard focus
Givena toolbar button
Whenthe pointer rests on it for 200 ms
the same button is reached with Tab and has the focus ring
Thenits tooltip box appears below it with the button's text, the box has content, is not transparent and its text has a contrast ratio of at least 4.5 against its background
the same tooltip appears with the same colours

The tooltip stays right-aligned with its button, 8 px below it, without translating horizontally on hover or focus. Disabled Back, Next and zoom controls dim only their icons: their tooltip background and text remain fully opaque, like enabled controls. Long theme labels keep the same anchor rather than moving left by half the label width.

boundaryRows stay inside the pane
InputOutcome
360 px pane, each of the light, dark, white and cream themes, collapsed and expandedeach row ends above the next one, the left edge is not negative and the right edge is not past the pane
900 px pane, each theme, collapsed and expandedsame outcome
zoom buttons pressed until 70 percentthe zoom button is disabled, the toolbar stays inside the viewport and does not overlap the sticky heading text
zoom buttons pressed until 200 percentsame outcome
nominalScrolling
Givena long document
Whenthe reader scrolls
Thenthe toolbar keeps its place at the top right and the text scrolls under it
boundaryNothing else makes room
Giventext scrolled to the toolbar's place
Whenthe text passes the toolbar
Thenthe text is covered by the toolbar; only the first element of the document gets clearance (layout-width scope)

Implemented in 2

Tested by 5

Known limits (1)