Behaviour SwRS-MDOKFSTUDIO-TOOLBAR-045
The column marks the section being read and jumps on click
When the reading line passes a heading, the extension SHALL mark the entry of the last heading at or above the reading line (one pixel tolerance) with aria-current location and a tint with a bar, keep that entry visible by scrolling the column, and scroll the heading of a clicked entry to the reading line below the sticky band without navigating.
Step 3 of path 1 in StRS-MDOKFSTUDIO-TOOLBAR-006: from “The headings are listed” to “The reader is at the heading they chose”.
Scenarios 7
The situations the tests check; open one to read it.
nominalReading
Givenan open column and a reading line inside the second section
Whenthe page scrolls
Thenexactly one entry, the second, has aria-current location (and data-sphinx-preview-toc-current), and the mark is removed from the previous entry
boundaryFractional top
Givena heading revealed at the reading line with a fractional top
Whenthe column tracks the reading line
Thenthat heading is the current entry
boundaryFolded parent
| Input | Outcome |
|---|---|
| A folded parent whose child is the current section | The parent entry carries the mark (a hidden entry is represented by its nearest shown ancestor) |
| The same parent unfolded | The child carries the mark |
nominalThe column scrolls itself
| Input | Outcome |
|---|---|
| A current entry below the visible part of the column | The column scrolls down so the entry bottom is inside it and the page scroll does not change |
| A current entry above the visible part | The column scrolls up |
nominalThe current entry is readable
Givenscenarios in a light 900 px and a dark 1600 px pane
Whenthe current entry is measured
Thenit has square corners (border radius 0), a 3 px bar on its start edge, and its text against the tinted background has a contrast of at least 4.5 to 1; exactly one entry carries the mark while the page is scrolled
nominalClick
Givenan open column and a heading far below
Whenthe reader clicks its entry
Thenthe page scrolls so the heading is at the reading line below the sticky band, the default action of the click is cancelled and no navigation message (previewLink) is posted
boundaryClick right after a content update
| Input | Outcome |
|---|---|
| An entry built before a content update, clicked right after the update | The page scrolls to the live heading element found again by its key, not the replaced one |
| The heading no longer exists | The heading captured at build time is used |