Four buttons can appear in exactly the order a product team requested after a flexbox change while Tab still visits them in a different sequence. That observation is useful, but it is not yet a verdict. The release question is narrower and more operational: what sequence did the component contract require, which sequence did the source encode, which sequence did flex layout render, and which sequence did the browser actually traverse with keyboard input?
This laboratory treats those as four independent values: intended sequence, DOM sequence, geometric sequence, and keyboard sequence. It deliberately avoids inferring product meaning from the left edge of a rectangle, inferring keyboard behavior from CSS, or treating a visual/Tab mismatch as an automatic WCAG failure. W3C’s informative explanation of Focus Order says an acceptable focus order must preserve meaning and operability where order matters, and more than one logical order can sometimes be valid.
The profile is intentionally small: standalone HTML/CSS/JavaScript, LTR, horizontal-tb, one unwrapped flex row, ordinary enabled native buttons, no tabindex overrides, and reading-flow: normal. MDN documents that non-normal reading-flow values can modify sequential navigation, so any such configuration is outside this laboratory rather than evidence against the classic flex-order model.
All F01–F10 outcomes below are EXPECTED / NOT EXECUTED as of the research date, November 27, 2026. No browser or assistive-technology run is being represented as completed.
Define the intended sequence before inspecting the page
Start by making the component owner declare the intended order without looking at the current DOM, computed order values, rectangles, or Tab trace. The fixture contains four synthetic actions with stable IDs A, B, C, and D. They have no remote business effect, no persistence, and no state-changing reordering operation. Their only purpose is to make ordering evidence finite.
For every case, maintain four independently named values.
Value | Meaning | Who or what supplies it |
Intended sequence | The order that preserves the chosen product meaning and operation | Product/accessibility contract, authored before execution |
DOM sequence | The element identities in source/tree order | Document inspection |
Geometric sequence | Left-to-right order of measured rectangles in this one-row fixture | getBoundingClientRect() evidence |
Keyboard sequence | IDs reached by actual Tab or Shift+Tab input | Browser interaction evidence |
This distinction is essential because none of the measurement layers can choose product meaning. A DOM sequence of A B C D is not correct merely because it is the DOM. A geometric sequence of C D A B is not correct merely because CSS placed those buttons from left to right. Likewise, a keyboard sequence of A B C D is not correct merely because the browser produced it.
The WCAG 2.2 Understanding page for Focus Order explicitly notes that several logical orders may sometimes preserve meaning and operation; it does not require focus to match visual layout in every case. The relevant question is whether the order being qualified preserves the interaction’s meaning and operability.
Use three operational dispositions throughout the laboratory:
ACCEPT_DECLARED_SEQUENCE means the admitted profile was tested and the evidence supports the predeclared product sequence.
REPAIR_SOURCE_OR_POLICY means the measurements are sufficiently complete to show that either the implementation does not satisfy the declared sequence or the declared product policy itself needs reconsideration.
HOLD_EVIDENCE means the test cannot support either conclusion because the environment, boundaries, fixture, or observations are incomplete or contradictory.
A fourth status, UNTESTED, remains mandatory for any case that has not actually been run. Reproducing an expected table, validating syntax, or loading the fixture without exercising keyboard input does not turn an expectation into observed evidence.
Pin the flexbox and keyboard environment
The fixture intentionally removes enough degrees of freedom that differences can be interpreted rather than merely noticed. It uses one standalone HTML document with dir="ltr", writing-mode: horizontal-tb, display: flex, flex-wrap: nowrap, and a horizontal main axis. Individual cases may switch flex-direction from row to row-reverse, but no case changes writing mode or direction.
Each flex item is an ordinary enabled <button type="button">. There are no forms, positive or negative tabindex values, custom keyboard handlers, hidden states, inert, disabled, popovers, dialogs, shadow trees, transitions, transforms, virtualization, or focus-management libraries. Before and After are ordinary buttons outside the flex container and occur before and after it in DOM order.
The laboratory buttons are 88 CSS pixels wide and 40 CSS pixels high with a 12-pixel flex gap. The two specified test viewports are 900 and 640 CSS pixels wide; four 88-pixel items plus three 12-pixel gaps require 388 pixels, so the fixture has ample horizontal room for its single row. Those dimensions are experimental controls, not accessibility thresholds.
For introductory material on the structural relationship between markup and styling, Refonte Learning’s HTML and CSS foundations are the appropriate prerequisite. The laboratory here does not repeat an HTML/CSS tutorial.
The W3C Flexbox Candidate Recommendation Draft dated October 14, 2025 describes classic flex reordering as changing visual arrangement while leaving source-based sequential navigation intact, and warns against using order or reverse flex directions as substitutes for correct source ordering. That statement must be read with the profile qualification used here because newer CSS reading-order mechanisms can alter navigation under other configurations.
Record the real runtime rather than writing a browser name from memory. A usable record includes browser build/version, engine family, operating system, relevant OS/browser keyboard-navigation settings, viewport, zoom, fixture revision, and the installed Playwright version when automation is used. This article supplies no browser support matrix because none was executed.
Build a fixture that does not move focus for the test
Save the following as flex-order-lab.html. Case definitions are literal authored data. Observation functions read the resulting document but do not construct expected sequences from those observations.
<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Flex order keyboard laboratory</title>
<style>
:root {
font-family: system-ui, sans-serif;
}
* {
box-sizing: border-box;
}
html {
writing-mode: horizontal-tb;
}
body {
margin: 24px;
}
#lab {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
gap: 12px;
reading-flow: normal;
margin: 24px 0;
width: max-content;
}
#lab > button {
flex: 0 0 88px;
width: 88px;
height: 40px;
}
#before,
#after {
width: 88px;
height: 40px;
}
@media (max-width: 700px) {
body[data-case="F09"] #C,
body[data-case="F09"] #D {
order: -1;
}
}
</style>
</head>
<body>
<p id="case-label"></p>
<button id="before" type="button">Before</button>
<div id="lab" aria-label="Synthetic action row"></div>
<button id="after" type="button">After</button>
<script>
"use strict";
const CASES = {
F01: {
revision: "flex-order-lab-v1",
dom: ["A", "B", "C", "D"],
direction: "row",
orders: { A: 0, B: 0, C: 0, D: 0 },
intended: ["A", "B", "C", "D"],
expectedGeometry: ["A", "B", "C", "D"],
expectedKeyboard: ["A", "B", "C", "D"]
},
F02: {
revision: "flex-order-lab-v1",
dom: ["A", "B", "C", "D"],
direction: "row",
orders: { A: 0, B: 0, C: 0, D: -1 },
intended: ["D", "A", "B", "C"],
expectedGeometry: ["D", "A", "B", "C"],
expectedKeyboard: ["A", "B", "C", "D"]
},
F03: {
revision: "flex-order-lab-v1",
dom: ["A", "B", "C", "D"],
direction: "row",
orders: { A: 2, B: 3, C: 0, D: 1 },
intended: ["C", "D", "A", "B"],
expectedGeometry: ["C", "D", "A", "B"],
expectedKeyboard: ["A", "B", "C", "D"]
},
F04: {
revision: "flex-order-lab-v1",
dom: ["A", "B", "C", "D"],
direction: "row",
orders: { A: 1, B: 1, C: 0, D: 0 },
intended: ["C", "D", "A", "B"],
expectedGeometry: ["C", "D", "A", "B"],
expectedKeyboard: ["A", "B", "C", "D"]
},
F05: {
revision: "flex-order-lab-v1",
dom: ["A", "B", "C", "D"],
direction: "row-reverse",
orders: { A: 0, B: 0, C: 0, D: 0 },
intended: ["D", "C", "B", "A"],
expectedGeometry: ["D", "C", "B", "A"],
expectedKeyboard: ["A", "B", "C", "D"]
},
F06: {
revision: "flex-order-lab-v1",
dom: ["A", "B", "C", "D"],
direction: "row-reverse",
orders: { A: 2, B: 3, C: 0, D: 1 },
intended: ["B", "A", "D", "C"],
expectedGeometry: ["B", "A", "D", "C"],
expectedKeyboard: ["A", "B", "C", "D"]
},
F07: {
revision: "flex-order-lab-v1",
dom: ["C", "D", "A", "B"],
direction: "row",
orders: { A: 0, B: 0, C: 0, D: 0 },
intended: ["C", "D", "A", "B"],
expectedGeometry: ["C", "D", "A", "B"],
expectedKeyboard: ["C", "D", "A", "B"]
},
F08: {
revision: "flex-order-lab-v1",
dom: ["A", "B", "C", "D"],
direction: "row",
orders: { A: 0, B: 0, C: 0, D: 0 },
intended: ["C", "D", "A", "B"],
expectedGeometry: ["A", "B", "C", "D"],
expectedKeyboard: ["A", "B", "C", "D"]
},
F09: {
revision: "flex-order-lab-v1",
dom: ["A", "B", "C", "D"],
direction: "row",
orders: { A: 0, B: 0, C: 0, D: 0 },
intendedWide: ["A", "B", "C", "D"],
intendedNarrow: ["C", "D", "A", "B"],
expectedGeometryWide: ["A", "B", "C", "D"],
expectedGeometryNarrow: ["C", "D", "A", "B"],
expectedKeyboardWide: ["A", "B", "C", "D"],
expectedKeyboardNarrow: ["A", "B", "C", "D"]
},
F10: {
revision: "flex-order-lab-v1",
dom: ["C", "D", "A", "B"],
direction: "row",
orders: { A: 0, B: 0, C: 0, D: 0 },
intended: ["C", "D", "A", "B"],
expectedGeometry: ["C", "D", "A", "B"],
expectedReverseKeyboard: ["B", "A", "D", "C"]
}
};
const params = new URLSearchParams(location.search);
const caseId = params.get("case") || "F01";
if (!CASES[caseId]) {
throw new ErrorUnknown case: ${caseId});
}
const config = structuredClone(CASES[caseId]);
const lab = document.getElementById("lab");
const eventTrace = [];
document.body.dataset.case = caseId;
document.getElementById("case-label").textContent = Case ${caseId};
lab.style.flexDirection = config.direction;
for (const id of config.dom) {
const button = document.createElement("button");
button.type = "button";
button.id = id;
button.textContent = id;
button.style.order = String(config.orders[id] ?? 0);
lab.append(button);
}
document.addEventListener("focusin", event => {
eventTrace.push({
type: "focusin",
target: event.target.id || event.target.tagName,
time: performance.now()
});
}, true);
document.addEventListener("keydown", event => {
eventTrace.push({
type: "keydown",
key: event.key,
shiftKey: event.shiftKey,
target: event.target.id || event.target.tagName,
time: performance.now()
});
}, true);
document.addEventListener("keyup", event => {
eventTrace.push({
type: "keyup",
key: event.key,
shiftKey: event.shiftKey,
target: event.target.id || event.target.tagName,
time: performance.now()
});
}, true);
function idsInDom() {
return [...lab.querySelectorAll(":scope > button")].map(el => el.id);
}
function collectRects() {
return [...lab.querySelectorAll(":scope > button")].map(el => {
const r = el.getBoundingClientRect();
return {
id: el.id,
left: r.left,
right: r.right,
top: r.top,
bottom: r.bottom,
width: r.width,
height: r.height
};
});
}
function geometricSequence() {
return collectRects()
.slice()
.sort((a, b) => a.left - b.left)
.map(item => item.id);
}
function computedOrders() {
return Object.fromEntries(
[...lab.querySelectorAll(":scope > button")].map(el => [
el.id,
Number.parseInt(getComputedStyle(el).order, 10)
])
);
}
function readingFlowRecord() {
const supported = CSS.supports("reading-flow", "normal");
return {
authored: "normal",
supported,
computed: supported ? getComputedStyle(lab).readingFlow : null
};
}
function mediaRecord() {
return {
query: "(max-width: 700px)",
matches: matchMedia("(max-width: 700px)").matches
};
}
window.flexOrderLab = {
caseId,
config,
idsInDom,
collectRects,
geometricSequence,
computedOrders,
readingFlowRecord,
mediaRecord,
getTrace: () => structuredClone(eventTrace),
activeId: () => document.activeElement?.id || document.activeElement?.tagName
};
</script>
</body>
</html>The event listeners are deliberately passive in the behavioral sense that matters here: they record focusin, keydown, and keyup; they never call preventDefault(), change focus, alter tabIndex, or synthesize navigation.
Admit only the declared reading-flow profile
The authored declaration is always reading-flow: normal. MDN documents normal as the default source-based reading order and documents non-normal values that can modify reading or sequential navigation for flex, grid, or block containers.
The runner must therefore record CSS.supports("reading-flow", "normal"). If support is reported, also record the computed value. If a supported computed value is anything other than normal, classify the trial OUT_OF_SCOPE. If the property is unsupported, record supported: false, preserve the authored declaration, and classify the trial OUT_OF_SCOPE for this laboratory rather than inventing a computed value.
That rule is intentionally conservative. It prevents the article from claiming that classic CSS reordering never influences sequential navigation. Under another reading-flow profile, that premise would be false. This laboratory qualifies only reading-flow: normal.
Author ten independent case expectations
Freeze expected outcomes before the browser renders the cases. The expected geometric arrays below come from the authored fixture design and documented flex arrangement rules, not from sorting the eventual measurements. The expected keyboard arrays are likewise literal test-oracle data, not copied from a captured route.
This is not the same operation as moving a task or card and persisting its new state. Refonte Learning treats accessible reordering as a separate product operation, including destination choice, persistence, cancellation, recovery, and focus consequences. This experiment keeps identities and business state fixed so that layout and navigation can be isolated.
Freeze the DOM, geometric and navigation manifests
All rows: EXPECTED / NOT EXECUTED.
Case | Controlled change | Expected geometric order | Expected keyboard order / policy |
F01 | Natural baseline | A B C D | Tab A B C D; intended A B C D |
F02 | D order:-1 | D A B C | Tab A B C D; intended D A B C |
F03 | A=2, B=3, C=0, D=1 | C D A B | Tab A B C D; intended C D A B |
F04 | A=B=1, C=D=0 | C D A B | Tab A B C D; ties keep source order; intended C D A B |
F05 | row-reverse; all order:0 | D C B A | Tab A B C D; intended D C B A |
F06 | row-reverse with F03 values | B A D C | Tab A B C D; intended B A D C |
F07 | DOM becomes C D A B; row; neutral order | C D A B | Tab C D A B; intended C D A B |
F08 | Neutral CSS; unrepaired DOM A B C D | A B C D | Tab A B C D; intended remains C D A B |
F09 | Below 700px, C and D get order:-1 | 900px: A B C D; 640px: C D A B | Tab A B C D at both; policy A B C D wide, C D A B narrow |
F10 | F07 repair; reverse navigation | C D A B | Shift+Tab from After visits B A D C, then Before |
MDN specifies that flex items are sorted first by ascending integer order, then by source order for equal values, with a default value of zero.
F09 contains two independent fresh-document trials, not one page resized halfway through an evidence record. Its viewport-dependent intended sequence is a synthetic product requirement created for this test. It is not advice that responsive interfaces should generally change their meaningful sequence at a breakpoint.
F10’s reverse array is also authored independently. Do not generate B A D C by reversing whatever a forward F07 execution happened to capture; doing that would make an erroneous forward observation contaminate the reverse oracle.
Establish the ordinary-button baseline
Run F01 before treating any other case as meaningful evidence. The purpose is not merely to see that the page loaded. F01 proves that the chosen browser/OS/profile can traverse the finite fixture and that the recorder can observe a complete route.
A valid forward baseline begins by focusing Before once. Boundary initialization is setup, not part of the navigation behavior being tested. After that initialization, every transition must come from keyboard input: press Tab, capture document.activeElement, preserve the accumulated event trace, and repeat until After becomes active.
The HTML Standard distinguishes focusability from sequential focusability and allows user-agent behavior to reflect platform or user preferences. Its sequential-focus model is based on focus-navigation scopes and tabindex processing rather than a blanket rule that every focusable element must always be reached by Tab in every user configuration.
For this fixture, admission requires the following observed boundary:
Before → A → B → C → D → AfterEach of A, B, C, and D must occur exactly once. If one is skipped, duplicated, or focus escapes the document before the After boundary, stop classification. Preserve the trace and environment, then use HOLD_EVIDENCE. Do not compensate by calling .focus() on the omitted control.
Manual execution is valid when automation is unavailable. The operator should record the same facts: focused starting boundary, every Tab press, active element after each press, final boundary, viewport, zoom, browser/build, operating system, keyboard-navigation settings, DOM identities, computed styles, and rectangles. A handwritten or screen-recorded route is still bounded evidence if its environment and observations are explicit; it simply should not be presented as an automated result.
The baseline also separates collector health from behavioral disagreement. If F02 later produces an unexpected route, the team can compare that result against a known functioning F01 collector instead of wondering whether the recorder itself never captured focus reliably.
Inspect what order and row-reverse actually rearrange
F02 through F06 isolate the visual effects of order and row-reverse while keeping the source sequence A B C D. Under this admitted profile, the W3C Flexbox Candidate Recommendation Draft describes flex reordering as visual: source order remains the basis for default sequential navigation.
F02 gives D an ordinal group of -1; with A, B, and C at zero, the expected rendered sequence is D A B C. F03 assigns four different groups, producing C D A B. F04 tests ties: C and D share zero and remain in their source-relative order, then A and B share one and likewise remain source-relative. MDN describes precisely this integer-then-source ordering model.
F05 isolates main-axis reversal. With all ordinal groups neutral, a row-reverse container is expected to render the items from left to right as D C B A in this LTR horizontal fixture.
F06 is the case that catches an easy mental-model error. First determine the order-modified item sequence from ordinal groups: C(0), D(1), A(2), B(3). Then account for the reversed main-axis direction. In the left-to-right viewport coordinates used by this specific fixture, that produces B A D C. Do not “reverse first, then sort” as though order were applied after physical placement.
None of those calculations is allowed to stand in for captured evidence. The ledger should still store the per-item computed order, flex-direction, rectangles, observed geometric sequence, and actual Tab transitions independently.
Measure geometry without turning it into a reading-order oracle
Element.getBoundingClientRect() returns an element’s rectangle relative to the viewport, including positional fields such as left, right, top, and bottom and dimensions such as width and height.
For this laboratory only, sort the four rectangles by left to derive the geometric sequence. That shortcut is valid because the fixture has already constrained itself to LTR, horizontal-tb, exactly one non-wrapping horizontal row, no transforms, and four non-overlapping items.
Declare a fixture tolerance, for example 1 CSS pixel, and treat it only as a laboratory comparison tolerance. It is not a CSS or accessibility requirement. Before accepting the geometric sequence, verify that every rectangle has finite numeric coordinates, positive width and height, tops agree within the tolerance, left coordinates are distinct by more than the tolerance, and adjacent rectangles do not overlap.
If any two items tie in left, appear on different rows, overlap unexpectedly, or return non-finite values, geometry is inadmissible and the case becomes HOLD_EVIDENCE. Do not invent a second sorting key to rescue the test.
Most importantly, the geometric array answers “where are these four boxes?” It does not answer “what order is meaningful?”, “what order did sequential focus use?”, or “what sequence would a screen reader expose?” The laboratory does not make assistive-technology claims from viewport rectangles.
Capture Tab transitions as a separate observation
The automated route should be short enough to audit line by line. Save the following as run_flex_order.py beside the HTML file.
from future import annotations
import argparse
import importlib.metadata
import json
import platform
from pathlib import Path
from playwright.sync_api import sync_playwright
CASE_TRIALS = [
("F01", 900, "forward"),
("F02", 900, "forward"),
("F03", 900, "forward"),
("F04", 900, "forward"),
("F05", 900, "forward"),
("F06", 900, "forward"),
("F07", 900, "forward"),
("F08", 900, "forward"),
("F09-wide", 900, "forward"),
("F09-narrow", 640, "forward"),
("F10", 900, "reverse"),
]
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"--browser",
choices=("chromium", "firefox", "webkit"),
default="chromium",
)
parser.add_argument(
"--keyboard-settings",
required=True,
help="Record the actual OS/browser keyboard navigation setting.",
)
parser.add_argument(
"--zoom",
required=True,
help='Record the actual zoom, for example "100%".',
)
parser.add_argument(
"--output",
default="flex-order-evidence.json",
)
return parser.parse_args()
def page_case_id(trial_id: str) -> str:
if trial_id.startswith("F09"):
return "F09"
return trial_id
def active_id(page):
return page.evaluate("window.flexOrderLab.activeId()")
def press_and_capture(page, key: str):
page.keyboard.press(key)
page.wait_for_timeout(0)
return active_id(page)
def run_trial(browser, fixture_uri, trial_id, width, direction, environment):
page = browser.new_page(viewport={"width": width, "height": 500})
console_errors = []
page_errors = []
page.on(
"console",
lambda msg: console_errors.append(msg.text)
if msg.type == "error"
else None,
)
page.on("pageerror", lambda exc: page_errors.append(str(exc)))
case_id = page_case_id(trial_id)
page.goto(f"{fixture_uri}?case={case_id}", wait_until="load")
snapshot = page.evaluate(
"""() => ({
caseId: window.flexOrderLab.caseId,
config: window.flexOrderLab.config,
dom: window.flexOrderLab.idsInDom(),
rects: window.flexOrderLab.collectRects(),
geometry: window.flexOrderLab.geometricSequence(),
computedOrders: window.flexOrderLab.computedOrders(),
readingFlow: window.flexOrderLab.readingFlowRecord(),
media: window.flexOrderLab.mediaRecord(),
flexDirection: getComputedStyle(
document.getElementById("lab")
).flexDirection,
writingMode: getComputedStyle(document.documentElement).writingMode,
direction: getComputedStyle(document.documentElement).direction
})"""
)
route = []
boundary_before = None
boundary_after = None
if direction == "forward":
page.locator("#before").focus()
boundary_before = active_id(page)
for in range(5):
route.append(pressand_capture(page, "Tab"))
boundary_after = route[-1]
else:
page.locator("#after").focus()
boundary_before = active_id(page)
for in range(5):
route.append(pressand_capture(page, "Shift+Tab"))
boundary_after = route[-1]
trace = page.evaluate("window.flexOrderLab.getTrace()")
record = {
"trialId": trial_id,
"executionStatus": "EXECUTED",
"inputDirection": direction,
"viewport": {"width": width, "height": 500},
"environment": environment,
"snapshot": snapshot,
"startingBoundary": boundary_before,
"activeElementAfterEachInput": route,
"endingBoundary": boundary_after,
"eventTrace": trace,
"consoleErrors": console_errors,
"pageErrors": page_errors,
}
page.close()
return record
def main():
args = parse_args()
fixture = Path("flex-order-lab.html").resolve()
if not fixture.exists():
raise SystemExit("flex-order-lab.html not found")
fixture_uri = fixture.as_uri()
playwright_version = importlib.metadata.version("playwright")
with sync_playwright() as pw:
browser_type = getattr(pw, args.browser)
browser = browser_type.launch(headless=False)
environment = {
"browserEngine": args.browser,
"browserBuild": browser.version,
"operatingSystem": platform.platform(),
"keyboardNavigationSettings": args.keyboard_settings,
"zoom": args.zoom,
"playwrightVersion": playwright_version,
"fixtureRevision": "flex-order-lab-v1",
}
records = [
run_trial(
browser,
fixture_uri,
trial_id,
width,
direction,
environment,
)
for trial_id, width, direction in CASE_TRIALS
]
browser.close()
Path(args.output).write_text(
json.dumps(
{
"researchDate": "2026-11-27",
"records": records,
},
indent=2,
),
encoding="utf-8",
)
print(f"Wrote {args.output}")
if name == "__main__":
main()Install and execute it in a fresh Python environment:
python -m venv .venv# macOS/Linux
source .venv/bin/activate# Windows PowerShell
.venv\Scripts\Activate.ps1python -m pip install playwright
python -m playwright install chromium
python run_flex_order.py \
--browser chromium \
--zoom "RECORD_ACTUAL_VALUE" \
--keyboard-settings "RECORD_ACTUAL_SETTING"Playwright’s Python Keyboard API documents keyboard.press() and accepts keys including Tab plus modifier combinations. That makes page.keyboard.press("Tab") and page.keyboard.press("Shift+Tab") appropriate input operations for this bounded test.
Do not replace them with keyboard.insert_text(). Do not implement navigation by looping through element.focus(). Boundary focus is allowed once for setup; after that, the browser must resolve each sequential navigation step.
A broad automated accessibility result is not the evidence unit here. Refonte Learning’s article on the limits of an axe-core result addresses broader automation-versus-verification concerns; this laboratory’s contribution is narrower: literal flex permutations, independent geometry, and actual active-element transitions.
No JSON output from this runner is included here because it has not been executed for this laboratory.
Reject focusability and environment confounders
Before classifying any discrepancy as a flex-order issue, admit the trial against the profile. The checklist should be explicit enough that a reviewer can see why an observation belongs in this experiment.
Confirm exactly four flex children with unique IDs A, B, C, and D, and confirm that the case-specific DOM array matches the authored manifest.
Confirm every item is a native button with type="button", enabled and rendered, with no hidden, disabled, inert, or unexpected ancestor state.
Confirm no item has a tabindex attribute and no script mutates tabIndex.
Confirm direction: ltr and writing-mode: horizontal-tb.
Confirm display:flex, flex-wrap:nowrap, and only the declared row or row-reverse direction.
Confirm no transforms, transitions, shadow tree, dialog, popover, virtualization, custom key handling, or focus trap has entered the fixture.
Confirm reading-flow admission exactly as specified above.
Confirm Before precedes the flex container and After follows it, with both available for sequential focus.
Confirm viewport and zoom are recorded and the row does not wrap.
Confirm the OS/browser keyboard-navigation setting is recorded rather than inferred.
The HTML Standard makes user-agent and user-preference participation in sequential focusability explicit, so a platform setting that changes which controls Tab reaches changes the tested environment.
This fixture intentionally excludes inert. Refonte Learning’s separate discussion of focus eligibility when a subtree is inert belongs to a different problem: whether an element participates in interaction at all. This laboratory assumes all four controls are eligible and tests their sequence. Primary HTML documentation, not that neighboring article, remains the authority for focus behavior.
Hold incomplete or contradictory observations
Use HOLD_EVIDENCE whenever the collector cannot establish the promised facts. Examples include a missing focusin trace where one was expected, duplicate action IDs, a JavaScript exception, an unrecorded starting or ending boundary, a missing viewport value, unsupported/off-profile reading-flow, a non-finite rectangle, unexpected wrapping, or a stale locator that captures an old element.
A known skipped control and a missing observation are different findings. Suppose the event trace and active-element snapshots both show Before → A → C → D → After; that is evidence of a skipped B under the admitted profile. By contrast, if the logging script crashes after A, nothing establishes what happened next. The second result is incomplete evidence, not a confirmed skip.
Always preserve the raw route, console errors, event trace, environment, source identities, and rectangles before reloading. A fresh document is required for the next attempt.
Also keep authored expectations isolated from observation code. If a test computes “expected keyboard sequence” from querySelectorAll() after rendering, it can only confirm itself. If it computes “expected geometry” by sorting measured rectangles, it has erased the distinction between expectation and evidence. The entire value of F08 depends on preventing that circularity.
Repair the source order required by the component contract
F07 is the deliberate source repair. Its independently declared product sequence is C D A B. The implementation changes the DOM to C D A B, resets all order values to zero, and uses flex-direction: row.
The expected four layers are therefore:
Layer | F07 expectation |
Intended | C D A B |
DOM | C D A B |
Geometry | C D A B |
Forward keyboard | C D A B |
The W3C Flexbox document warns authors not to use order or reverse flex directions as substitutes for correct source ordering when the source itself should carry the logical sequence.
That warning does not mean every decorative visual rearrangement requires moving DOM nodes. F07 changes source because the synthetic component contract specifically declares C D A B to be meaningful. Another component could have two equally valid logical orders or a visual embellishment that does not alter meaning. Product/accessibility ownership must choose the contract first.
Positive tabindex is excluded as a repair. The HTML Standard gives positive values a role in relative ordering within tabindex-ordered focus-navigation scopes and advises caution with values other than zero or minus one.
Assigning tabindex="1", "2", and so forth merely to make keyboard focus imitate current pixel positions would introduce a new navigation policy. It would not establish that the semantic source has the intended meaning, and it would enlarge this fixture into a different experiment. Therefore no tabindex variant belongs in the case matrix.
F07 passes only after a real run establishes the complete boundaries and all four observed layers. A source-code diff showing C D A B is implementation evidence, not keyboard evidence.
Expose a partial fix and a responsive regression
F08 is the most important negative control because everything measurable can agree and the component can still be wrong.
Its DOM remains A B C D. CSS is neutral. Expected geometry is A B C D, and expected Tab order is A B C D. Yet the independently declared product contract remains C D A B.
If F08 eventually executes exactly as expected, the case demonstrates why “DOM equals pixels equals Tab” is not a sufficient acceptance criterion. Measurements can agree perfectly while all implementing the wrong product sequence. The appropriate disposition is REPAIR_SOURCE_OR_POLICY: either restore the source to the declared policy or reopen the policy decision with product/accessibility owners.
F09 demonstrates a different failure mode: state-specific layout requirements. At 900 pixels the media query does not match, so intended, DOM, geometry, and expected classic keyboard route are all A B C D. At 640 pixels the query matches and gives C and D order:-1. Based on the specified source order and equal-value tie behavior, expected geometry becomes C D A B, while the authored narrow product policy also says C D A B.
Under the admitted classic profile, the expected Tab route remains A B C D. This is therefore expected to be a narrow-state product mismatch while the wide state remains coherent.
Revalidate the exact layout state after a breakpoint change
Treat F09-wide and F09-narrow as separate page loads. At 900 pixels, record that (max-width: 700px) is false and capture all computed order values as zero. At 640 pixels, record that the media query matches and that C and D compute to -1.
The width, media-query state, computed orders, rectangles, route, and intended sequence belong in the same subtrial record. Do not combine wide geometry from one load with narrow navigation from another.
The two widths are sampling points, not coverage of the entire responsive space. They establish behavior at exactly 900 and 640 CSS pixels under the recorded zoom and environment. They do not establish every intermediate width, every device viewport, every zoom configuration, or every responsive branch in a production design system.
That limitation matters when investigating a responsive flex order regression. A production component should enumerate the states that materially change its ordering contract and requalify those states when source markup, breakpoint logic, focusability, or reading-flow policy changes. Sampling two fixture widths is evidence about two fixture states, not a universal responsive-accessibility claim.
Validate reverse navigation after the source repair
F10 starts from a fresh F07-style document with DOM and geometry C D A B. Initialize After once, then send real Shift+Tab input.
The literal expected sequence is:
After → B → A → D → C → Before
The four-item reverse array is therefore B A D C.
This is not derived from a captured F07 forward route. Keeping the reverse oracle independent prevents a forward-only recorder bug from automatically producing a supposedly correct reverse expectation.
Capture document.activeElement after every Shift+Tab, retain keydown, focusin, and keyup events, and verify that the final boundary is Before. If focus reaches browser chrome or another document target before completing the finite route, retain the route and classify the case rather than pressing extra keys until it happens to return.
F10 is useful because a script that manually focuses A, B, C, and D could superficially produce a forward “coverage” trace without having tested sequential navigation at all. A separate reverse traversal adds another finite boundary check through the browser’s own navigation mechanism.
A passing F07 is not an observed F10. Each trial needs its own record, environment, route, and outcome.
The scope remains ordinary sequential navigation only. F10 says nothing about arrow-key composite widgets, roving tabindex, modal focus traps, screen-reader browse commands, or virtualized interfaces. Those mechanisms were intentionally removed from the laboratory and must not be smuggled back into its conclusions.
Reconcile the evidence and choose an operational disposition
Maintain one evidence ledger for F01 through F10, with distinct F09 wide and narrow rows. A useful record schema contains case/trial ID, fixture revision, intended sequence, literal expected DOM/geometry/keyboard arrays, observed DOM, computed CSS, rectangles, geometric sequence, active-element transitions, event trace, starting/ending boundaries, console/page errors, reading-flow admission, viewport, zoom, browser build/engine, OS, keyboard settings, and Playwright version where applicable.
Also separate two judgment fields:
documentaryBehaviorMatched asks whether the observation agrees with the documented mechanism being tested.
productContractSatisfied asks whether the resulting sequence satisfies the independently authored product requirement.
That separation prevents F02–F06 from being misclassified. A future execution could match documented flex behavior perfectly while still showing that the product’s intended sequence is not represented by the classic keyboard route. Conversely, F08 could show complete agreement among DOM, geometry, and keyboard observations while failing product policy.
An acceptance matrix makes those distinctions explicit.
Evidence state | Product contract | Documentary behavior | Disposition |
Complete; route and geometry match literal expectations | Satisfied | Matched | ACCEPT_DECLARED_SEQUENCE |
Complete; CSS/Tab behavior matches documentation | Not satisfied | Matched | REPAIR_SOURCE_OR_POLICY |
Complete; implementation layers agree with each other | Independently declared intent still violated | May match | REPAIR_SOURCE_OR_POLICY |
Complete; observed runtime differs materially from primary documentation | Undetermined or violated | Not matched | Preserve discrepancy; review exact environment; HOLD_EVIDENCE pending diagnosis |
Intended sequence is disputed by product/accessibility owners | Undetermined | Any | Review policy before repair |
Missing boundary, exception, invalid geometry, unsupported/off-profile reading-flow, missing environment | Undetermined | Undetermined | HOLD_EVIDENCE |
Case never executed | Unknown | Unknown | UNTESTED |
A compact review flow is:
|
Distinguish a fixture decision from accessibility conformity
The W3C Understanding page for SC 2.4.3 is informative guidance. It says focus order should preserve meaning and operability where sequence affects them and acknowledges that more than one logical order may be valid.
Therefore, “visual order differs from Tab order” is not, by itself, a complete conformance finding. A reviewer needs the meaning and operation of the actual component. This fixture supplies a way to make that review concrete; it does not turn pixel sorting into a WCAG oracle.
Likewise, browser focus is not a screen-reader test. No assistive technology was executed for this laboratory. Geometry is not reading-order evidence. A successful Playwright command is not a conformance certificate. And an absent console error is not proof that the intended keyboard contract was satisfied.
If an actual runtime contradicts the primary documentation, preserve the contradiction. Record the exact browser build, engine, OS settings, authored CSS, computed values, and route. Do not edit the expected manifest after seeing the output merely to obtain a green result.
Assign sequence ownership and regression triggers
Sequence ownership should be explicit because this laboratory intentionally separates product meaning from implementation behavior.
Product and accessibility owners approve which sequences preserve meaning and operation for the component. Frontend engineers maintain semantic source order, flex rules, responsive branches, and the declared reading-flow profile. QA owns the literal test manifest, admission checks, actual browser record, and the distinction between expected and observed evidence.
Requalify the relevant cases when source markup changes; an order value changes; flex-direction changes; focusability changes; a positive or negative tabindex appears; reading-flow changes; a breakpoint changes; a button is replaced by another interactive primitive; or a browser/OS keyboard-navigation setting materially changes the profile.
A targeted production review is preferable to indiscriminately expanding this fixture into a full-site accessibility suite. Identify the real component variants whose ordering semantics can change, map each variant to its declared sequence, and run the smallest case set that qualifies those states.
Lifecycle-driven focus transfers belong elsewhere. For example, Refonte Learning’s dialog lifecycle focus ownership tests opening, cancellation, validation recovery, asynchronous state, and post-close destinations. Those are deliberately absent here because a modal lifecycle changes the focus problem from “what is the sequential order in one flat document state?” to “who owns focus across state transitions?”
Rollback should also remain bounded. If a flex-related release produces an unacceptable sequence, restore the known component source/CSS revision and rerun that revision’s declared cases. Do not say the old implementation is “automatically accessible” merely because it predates the regression. The old revision still earns only the evidence actually collected for it.
Keep sample-size language precise. F01–F10 are eleven execution trials because F09 has two viewport subtrials. They exercise four native buttons under one reading-flow profile and two exact viewport widths. That sample is deliberately sufficient for the mechanism-specific questions in this fixture and deliberately insufficient for browser-wide, device-wide, assistive-technology-wide, or site-wide conclusions.
Build frontend validation skills with Refonte Learning
The engineering skill behind this laboratory is not memorizing that flexbox has an order property. It is learning to separate semantic intent, CSS arrangement, browser geometry, and observed keyboard behavior, and to preserve evidence when those layers disagree.
Refonte Learning’s FrontEnd Developer Program currently lists a four-month period at 10–12 hours per week. Its published competencies include HTML5 and CSS3, JavaScript ES6+, responsive web design, React.js and component architecture, Redux, APIs and AJAX, Git, and accessibility and performance optimization; the page also lists a capstone project. It states that basic programming concepts are expected and familiarity with HTML/CSS is a plus, with a separate prerequisite of working toward a bachelor’s or higher-level degree. The page names Educational Mentors/“Seasoned Guidance,” labels the internship element as a potential internship, and says successful completion can lead to a Training Certificate and Certificate of Internship. It lists FrontEnd Developer, UI Developer, and Web Developer as career directions without establishing a guaranteed placement.
Those confirmed foundations align with the discipline used here: semantic source structure, responsive CSS, JavaScript inspection, and accessibility-aware validation. The public page does not establish that Playwright, reading-flow, or this exact flex-order laboratory is taught, so no such claim is made.

