@reqvire-org/ads 0.5.14 → 0.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ads-errors.mjs +7 -0
- package/dist/analysis/owner-source.mjs +3 -0
- package/dist/construction-spec.d.mts +2 -0
- package/dist/construction-spec.mjs +4 -2
- package/dist/region-lowering.mjs +15 -4
- package/dist/render-audit/layout-overflow.page.mjs +26 -1
- package/dist/render-audit.mjs +5 -1
- package/docs/CHANGELOG.md +65 -0
- package/docs/GUIDE.md +8 -1
- package/docs/LANGUAGE.md +1 -1
- package/docs/RULES.md +3 -2
- package/package.json +1 -1
package/dist/ads-errors.mjs
CHANGED
|
@@ -873,6 +873,13 @@ export const choiceErrors = {
|
|
|
873
873
|
message: (failure) => `The ${failure.scheme} image of part "${failure.part}" is not always loading="lazy"; the default theme is ${failure.defaultScheme}, so this file would be downloaded while hidden.`,
|
|
874
874
|
repair: 'Write `loading="lazy"` on that image as a literal and apply any priority (eager loading, `fetchPriority`) to the default scheme\'s image only.'
|
|
875
875
|
},
|
|
876
|
+
"root-margin-unreset": {
|
|
877
|
+
group: "structure-mismatch",
|
|
878
|
+
rule: "A recipe root rendered as an element the browser gives a margin (`figure`, `p`, a list, a heading, `blockquote`, `pre`, `fieldset`) states its margin: its parts are reset by their construction, but a root keeps the browser's (a figure's 40 px sides make it 80 px narrower than its column).",
|
|
879
|
+
guides: [RECIPES],
|
|
880
|
+
message: (failure) => `This recipe root is a <${failure.element}>, which keeps the browser's margin: nothing states its own.`,
|
|
881
|
+
repair: "Add `normalize: { margin: 0 }` to the recipe (its parent's space still applies), or render the root as a <div>."
|
|
882
|
+
},
|
|
876
883
|
"invalid-nesting": {
|
|
877
884
|
group: "accessibility-semantics",
|
|
878
885
|
rule: "An owner's markup follows HTML's content model: an element that takes phrasing content only (a span, a paragraph, a button, a label, a heading) holds no flow content (a div, a list, a paragraph, a heading); a link or a button holds no other link, button or form control; a list item sits in a list, a table row in a table, a cell in a row. A transparent element (a link) takes its parent's model. Browsers repair such markup differently, and assistive technology reads what they repaired.",
|
|
@@ -942,6 +942,9 @@ async function analyzeOwner(root, emitted, name, program, options, rowsOf, fail)
|
|
|
942
942
|
if (rootless !== void 0)
|
|
943
943
|
return fail(opening, { kind: "pseudo-host-unsupported", part: "&", pseudo: rootless.pseudo, element: rootTag });
|
|
944
944
|
await nativeElement(opening, region.element, "&", null, context, resolve);
|
|
945
|
+
const UA_MARGIN_TAGS = ["figure", "p", "ul", "ol", "dl", "dd", "blockquote", "h1", "h2", "h3", "h4", "h5", "h6", "pre", "menu", "fieldset"], statesMargin = region.normalize.some(([property]) => property.startsWith("margin")) || region.element?.kind === "list" || region.layer !== null;
|
|
946
|
+
if (UA_MARGIN_TAGS.includes(rootTag) && !statesMargin)
|
|
947
|
+
return fail(opening, { kind: "root-margin-unreset", element: rootTag });
|
|
945
948
|
if (region.normalize.some(([property, value]) => property === "pointer-events" && value === "none"))
|
|
946
949
|
await pointerTransparent(opening, "&", context, resolve);
|
|
947
950
|
if (region.overflow.kind === "scroll")
|
|
@@ -866,6 +866,8 @@ export interface RegionPart {
|
|
|
866
866
|
/** `frame: { profile, rules, corners }`: the box's one-sided rules and rounded corners, as a root frame's. */
|
|
867
867
|
readonly boxBorder: FrameBorder;
|
|
868
868
|
readonly boxCorners: readonly FrameCorner[] | null;
|
|
869
|
+
/** `frame: { profile, ratio }`: the box's ratio, one its spatial profile permits. */
|
|
870
|
+
readonly boxRatio?: string | null;
|
|
869
871
|
/** A declared, human-approved boundary of this text-entry control (`frame` is a control frame). */
|
|
870
872
|
readonly accessibility: AccessibilityDeclaration | null;
|
|
871
873
|
readonly when: readonly StateTreatment[];
|
|
@@ -1226,9 +1226,10 @@ function regionPart(name, value, read, path, nested) {
|
|
|
1226
1226
|
if (bound.length > 0 && (content.kind !== "visual" || visualBinding(part) === null))
|
|
1227
1227
|
read.reject({ kind: "field-unsupported", construction: "region", path: `${path}.${bound[0] ?? ""}` });
|
|
1228
1228
|
const declaredFrame = part.frame;
|
|
1229
|
-
let boxed = null, safeArea = [], boxBorder = { kind: "profile" }, boxCorners = null;
|
|
1229
|
+
let boxed = null, safeArea = [], boxBorder = { kind: "profile" }, boxCorners = null, boxRatio = null;
|
|
1230
1230
|
if (isRecord(declaredFrame) && declaredFrame.profile !== void 0) {
|
|
1231
|
-
read.only(declaredFrame, `${path}.frame`, ["profile", "safeArea", "rules", "corners"]);
|
|
1231
|
+
read.only(declaredFrame, `${path}.frame`, ["profile", "safeArea", "rules", "corners", "ratio"]);
|
|
1232
|
+
boxRatio = read.optionalString(declaredFrame.ratio, `${path}.frame.ratio`);
|
|
1232
1233
|
boxed = read.string(declaredFrame.profile, `${path}.frame.profile`);
|
|
1233
1234
|
safeArea = safeAreaSides(declaredFrame.safeArea, `${path}.frame.safeArea`, read);
|
|
1234
1235
|
boxBorder = frameBorder(declaredFrame.rules, `${path}.frame.rules`, read);
|
|
@@ -1267,6 +1268,7 @@ function regionPart(name, value, read, path, nested) {
|
|
|
1267
1268
|
safeArea,
|
|
1268
1269
|
boxBorder,
|
|
1269
1270
|
boxCorners,
|
|
1271
|
+
boxRatio,
|
|
1270
1272
|
accessibility: accessibilityDeclaration(part.accessibility, part.frame !== void 0 && boxed === null, `${path}.accessibility`, read),
|
|
1271
1273
|
when: states.treatments,
|
|
1272
1274
|
textWhen: states.texts,
|
package/dist/region-lowering.mjs
CHANGED
|
@@ -217,7 +217,7 @@ function permittedRatio(ratio, slots, profile, reject) {
|
|
|
217
217
|
const ratios = profile.field(Object.fromEntries(profile.select(spatial).fields), spatial, "ratios").split(",").map((item) => item.trim().replace(/\s*\/\s*/, " / ")), normal = ratio.trim().replace(/\s*[/:]\s*/, " / ");
|
|
218
218
|
return ratios.includes(normal) ? normal : reject({ kind: "profile-field-unsupported", profile: spatial, field: "ratio", value: ratio });
|
|
219
219
|
}
|
|
220
|
-
function regionFrameValues(frame, slots, surface, profile, reject) {
|
|
220
|
+
function regionFrameValues(frame, slots, surface, profile, reject, clips = !1) {
|
|
221
221
|
const values = {}, frameReference = slots["frame-profile"];
|
|
222
222
|
let fields = {};
|
|
223
223
|
if (frame.kind === "container") {
|
|
@@ -229,6 +229,8 @@ function regionFrameValues(frame, slots, surface, profile, reject) {
|
|
|
229
229
|
fields = profile.of(frameReference, "frame");
|
|
230
230
|
if (frame.ratio !== null)
|
|
231
231
|
values["aspect-ratio"] = permittedRatio(frame.ratio, slots, profile, reject);
|
|
232
|
+
if (frame.ratio !== null && clips && fields["min-block-size"] === void 0)
|
|
233
|
+
values["min-block-size"] = "0";
|
|
232
234
|
}
|
|
233
235
|
Object.assign(values, frameValues(fields, profile, reject, frame.border));
|
|
234
236
|
if (frame.border.kind === "rules") {
|
|
@@ -592,6 +594,15 @@ function pseudoFill(treatment, surface, profile, reject) {
|
|
|
592
594
|
return reject({ kind: "pseudo-surface-unsupported", pseudo: treatment.pseudo, surface, field: other });
|
|
593
595
|
return fields.background ?? reject({ kind: "pseudo-surface-unsupported", pseudo: treatment.pseudo, surface, field: null });
|
|
594
596
|
}
|
|
597
|
+
function yields(part) {
|
|
598
|
+
if (part.content.kind === "text" || part.extent.kind !== "content" || part.overflow.kind !== "visible")
|
|
599
|
+
return !0;
|
|
600
|
+
if (part.arrangement?.wrap === !0)
|
|
601
|
+
return !0;
|
|
602
|
+
if (part.parts.length === 0)
|
|
603
|
+
return !1;
|
|
604
|
+
return part.parts.some(yields);
|
|
605
|
+
}
|
|
595
606
|
const covers = (visual) => visual.fit === "cover", COVER_FILL = { display: "block", "inline-size": "100%", "block-size": "100%", "min-block-size": "0", "object-fit": "cover" };
|
|
596
607
|
function normalizeElement(spec, name, path, values, provided, context) {
|
|
597
608
|
if (spec.element === null)
|
|
@@ -959,7 +970,7 @@ function lowerPart(part, parent, parentLayout, context, parentGrows, overlapping
|
|
|
959
970
|
], moved = part.effects === null ? [] : [...new Set(part.effects.when.flatMap(([, names]) => names.map((name) => PART_EFFECTS[name].channel)))], entering = writeEnter(out, profile, path, part.enter, partSurface, stateSurfaces(path, part.when, profile), slots, [...transitioned(part.paintTransition, partGroups), ...moved], reject);
|
|
960
971
|
transitionRules(path, part.paintTransition, part.surface === null ? null : { name: part.surface, fields: partSurface }, part.when, context, entering === null ? partGroups : [...partGroups, entering.group]);
|
|
961
972
|
writePlays(out, profile, context.foundation, part.name, part.plays, path, [...transitioned(part.paintTransition, entering === null ? [] : [entering.group]), ...moved], reject, { scope: context.input.scope, values: context.measured ?? [] });
|
|
962
|
-
const values = part.arrangement === null ? {} : { "box-sizing": "border-box", "min-inline-size": "0", ...arrangementValues(part.arrangement, slots, profile, part.overflow) };
|
|
973
|
+
const values = part.arrangement === null ? {} : { "box-sizing": "border-box", ...yields(part) ? { "min-inline-size": "0" } : {}, ...arrangementValues(part.arrangement, slots, profile, part.overflow) };
|
|
963
974
|
if (parentLayout === "native" && part.arrangement?.layout === "inline" && (Object.keys(flowSpace(part, context)).length > 0 || part.extent.kind === "fill")) {
|
|
964
975
|
values.display = "flex";
|
|
965
976
|
if (part.extent.kind !== "fill")
|
|
@@ -987,7 +998,7 @@ function lowerPart(part, parent, parentLayout, context, parentGrows, overlapping
|
|
|
987
998
|
if (part.surface !== null)
|
|
988
999
|
Object.assign(values, settled(partSurface, entering?.blurred ?? !1));
|
|
989
1000
|
Object.assign(values, stickyValues(part.sticky, context), anchorClearValues(part.anchorClear, context));
|
|
990
|
-
const [partCondition] = part.at, boxChange = partCondition?.frame ?? null, boxFrame = (border, corners) => part.box === null ? {} : regionFrameValues({ kind: "fields", container: !1, ratio: null, border, corners, safeArea: [] }, { ...slots, "frame-profile": part.box }, part.surface, profile, reject).values, restCorners = boxChange?.corners === null || boxChange === null ? part.boxCorners : part.boxCorners ?? FRAME_CORNERS, boxFields = boxFrame(part.boxBorder, restCorners);
|
|
1001
|
+
const [partCondition] = part.at, boxChange = partCondition?.frame ?? null, boxFrame = (border, corners) => part.box === null ? {} : regionFrameValues({ kind: "fields", container: !1, ratio: part.boxRatio ?? null, border, corners, safeArea: [] }, { ...slots, "frame-profile": part.box }, part.surface, profile, reject, part.overflow.kind !== "visible").values, restCorners = boxChange?.corners === null || boxChange === null ? part.boxCorners : part.boxCorners ?? FRAME_CORNERS, boxFields = boxFrame(part.boxBorder, restCorners);
|
|
991
1002
|
if (part.box !== null && boxChange !== null && partCondition !== void 0) {
|
|
992
1003
|
const spatial = slots["spatial-profile"], bound = spatial === void 0 ? null : conditionBound(context.foundation, spatial, partCondition.condition, profile, reject);
|
|
993
1004
|
if (bound === null)
|
|
@@ -1328,7 +1339,7 @@ export function lowerRegion(spec, foundation, input) {
|
|
|
1328
1339
|
checked(checkLayers("&", spec.parts.length), reject);
|
|
1329
1340
|
if (slots["surface-profile"] !== void 0)
|
|
1330
1341
|
Object.assign(values, profile.of(slots["surface-profile"], "surface"));
|
|
1331
|
-
const framed = spec.frame === null || spec.frameAt === null || spec.frameAt.corners === null ? spec.frame : { ...spec.frame, corners: spec.frame.corners ?? FRAME_CORNERS }, rootFrame = framed === null ? null : regionFrameValues(framed, slots, surface, profile, reject);
|
|
1342
|
+
const framed = spec.frame === null || spec.frameAt === null || spec.frameAt.corners === null ? spec.frame : { ...spec.frame, corners: spec.frame.corners ?? FRAME_CORNERS }, rootFrame = framed === null ? null : regionFrameValues(framed, slots, surface, profile, reject, spec.overflow.kind !== "visible");
|
|
1332
1343
|
if (rootFrame !== null)
|
|
1333
1344
|
Object.assign(values, rootFrame.values);
|
|
1334
1345
|
if (spec.frameAt !== null) {
|
|
@@ -44,7 +44,7 @@ export async function layoutOverflow({ nodeLimit, width: expected, container, sm
|
|
|
44
44
|
}
|
|
45
45
|
return found;
|
|
46
46
|
function measure() {
|
|
47
|
-
const width = document.documentElement.clientWidth, issues = [], counts = { document: 0, viewport: 0, container: 0, clipped: 0, "broken-word": 0, "collapsed-scroller": 0, "block-clipped": 0, spilled: 0, overlap: 0, "focus-clipped": 0 }, pane = container ? scope.getBoundingClientRect() : { left: 0, right: width }, edge = container ? "container" : "viewport", selector = (element) => {
|
|
47
|
+
const width = document.documentElement.clientWidth, issues = [], counts = { document: 0, viewport: 0, container: 0, clipped: 0, "broken-word": 0, "collapsed-scroller": 0, escaped: 0, "block-clipped": 0, spilled: 0, overlap: 0, "focus-clipped": 0 }, pane = container ? scope.getBoundingClientRect() : { left: 0, right: width }, edge = container ? "container" : "viewport", selector = (element) => {
|
|
48
48
|
const parts = [];
|
|
49
49
|
for (let node = element;node !== scope; ) {
|
|
50
50
|
const parent = node.parentElement;
|
|
@@ -214,9 +214,34 @@ export async function layoutOverflow({ nodeLimit, width: expected, container, sm
|
|
|
214
214
|
report("clipped", element, { overflow: Math.round(cut.reach), cut: cut.cut });
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
+
measureEscapes();
|
|
217
218
|
if (fit)
|
|
218
219
|
measureFit();
|
|
219
220
|
return { issues, counts };
|
|
221
|
+
function measureEscapes() {
|
|
222
|
+
const paints = (style) => ["Left", "Right"].some((side) => Number.parseFloat(style.getPropertyValue(`border-${side.toLowerCase()}-width`)) > 0 && style.getPropertyValue(`border-${side.toLowerCase()}-style`) !== "none") || style.backgroundColor !== "transparent" && !/rgba\([^)]*,\s*0\)$/.test(style.backgroundColor) || style.backgroundImage !== "none", control = (element) => /^(?:button|select|textarea|input)$/.test(element.localName) || element.localName === "a" && element.hasAttribute("href") || element.hasAttribute("tabindex"), text = (element) => [...element.childNodes].some((node) => node.nodeType === Node.TEXT_NODE && (node.textContent ?? "").trim() !== "");
|
|
223
|
+
for (const { element, box } of measured) {
|
|
224
|
+
if (!control(element) && !text(element))
|
|
225
|
+
continue;
|
|
226
|
+
if (element.closest("[inert], [aria-hidden='true']"))
|
|
227
|
+
continue;
|
|
228
|
+
let reach = 0;
|
|
229
|
+
for (let node = element.parentElement;node && node !== scope; node = node.parentElement) {
|
|
230
|
+
const style = getComputedStyle(node);
|
|
231
|
+
if (/^(?:absolute|fixed)$/.test(getComputedStyle(element).position) || /^(?:absolute|fixed)$/.test(style.position))
|
|
232
|
+
break;
|
|
233
|
+
if (style.overflowX !== "visible")
|
|
234
|
+
break;
|
|
235
|
+
if (!paints(style))
|
|
236
|
+
continue;
|
|
237
|
+
const edge = node.getBoundingClientRect();
|
|
238
|
+
reach = Math.max(box.right - edge.right, edge.left - box.left);
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
if (reach > 2)
|
|
242
|
+
report("escaped", element, { overflow: Math.round(reach) });
|
|
243
|
+
}
|
|
244
|
+
}
|
|
220
245
|
function measureFit() {
|
|
221
246
|
const native = (element) => /^(?:input|textarea|select)$/.test(element.localName), intended = (element, style) => native(element) || style.textOverflow === "ellipsis" || style.getPropertyValue("-webkit-line-clamp") !== "none" || style.clip !== "auto" || style.clipPath !== "none" || !!element.closest('[aria-roledescription="carousel"], [role="application"]'), held = (element) => {
|
|
222
247
|
if (!element.computedStyleMap)
|
package/dist/render-audit.mjs
CHANGED
|
@@ -263,6 +263,10 @@ const skipReasons = {
|
|
|
263
263
|
what: "text, a control, or a box's painted edge (a card's border and corners) is cut off by overflow hidden or clip (cropped images, artwork and decorative layers do not count)",
|
|
264
264
|
fix: "Make the content fit, truncate it with text-overflow: ellipsis, or use overflow-x: auto if it should scroll."
|
|
265
265
|
},
|
|
266
|
+
escaped: {
|
|
267
|
+
what: "a control or text reaches past the edge of the painted box around it (a card's border or fill), which does not clip it",
|
|
268
|
+
fix: `Let the box hold it: keep a row of controls from shrinking below its buttons (give the text beside it the room to give way, extent: "fill" or truncation), or let the row wrap; do not let content spill over a card's edge.`
|
|
269
|
+
},
|
|
266
270
|
"collapsed-scroller": {
|
|
267
271
|
what: "a scroll area that holds content is collapsed to nothing: everything in it is out of sight",
|
|
268
272
|
fix: 'Give the scroll area a size: let it fill a parent that has a height (extent: "fill" in a stack given a height), or a minimum block size; check its parents for a height of 0.'
|
|
@@ -321,7 +325,7 @@ export function layoutOverflowFindings(runs, scenarios) {
|
|
|
321
325
|
const { scenario, tag: rule, kind, widths, themes, brands, nodes, nodeCount } = group, container = rule === NARROW_RULE, sorted = [...widths].sort((a, b) => a - b);
|
|
322
326
|
return {
|
|
323
327
|
rule,
|
|
324
|
-
severity: findingSeverity(rule),
|
|
328
|
+
severity: kind === "escaped" ? "review" : findingSeverity(rule),
|
|
325
329
|
file: files.get(scenario) ?? scenario,
|
|
326
330
|
line: 1,
|
|
327
331
|
column: 1,
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,70 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.15
|
|
4
|
+
|
|
5
|
+
<!-- ads-local-tests:start -->
|
|
6
|
+
Hot patch: the unit and integration groups; the browser group was not run.
|
|
7
|
+
Quick hot patch (urgent, on the owner's instruction): the unit group and 11 integration files related to the fixes (ratio-parts.test.mjs, end-alignment.test.mjs, block-flow-space.test.mjs, starter-check.test.ts, design-system-rejections.test.ts, lowering-parity.test.ts, measured-geometry.test.ts, modal-card.test.mjs, invalid-nesting.test.mjs, local-alias-emission.test.mjs, owner-emission.test.ts), not the whole integration group.
|
|
8
|
+
Local verification: **963/963 passed** (unit 851, integration 112).
|
|
9
|
+
Tested commit: `54c9ff208ea8dfe18fb0442ede8d23aa57213a06`; Bun 1.4.4.
|
|
10
|
+
Completed 2026-11-26T11:27:50.737Z (268 seconds).
|
|
11
|
+
|
|
12
|
+
<!-- ads-local-test-proof
|
|
13
|
+
{
|
|
14
|
+
"schema": 3,
|
|
15
|
+
"version": "0.5.15",
|
|
16
|
+
"commit": "54c9ff208ea8dfe18fb0442ede8d23aa57213a06",
|
|
17
|
+
"sourceSha256": "aa763ec745a61124d65d80deac969f309dea614e98fd9174f954ff462bbde254",
|
|
18
|
+
"command": "bun run test:hotpatch",
|
|
19
|
+
"scope": "hotpatch",
|
|
20
|
+
"result": "pass",
|
|
21
|
+
"tests": 963,
|
|
22
|
+
"pass": 963,
|
|
23
|
+
"fail": 0,
|
|
24
|
+
"skipped": 0,
|
|
25
|
+
"groups": [
|
|
26
|
+
{
|
|
27
|
+
"name": "unit",
|
|
28
|
+
"tests": 851,
|
|
29
|
+
"pass": 851,
|
|
30
|
+
"fail": 0,
|
|
31
|
+
"skipped": 0,
|
|
32
|
+
"reportSha256": "60d9a70350e6799ee8b902524b32e3c8d20e104c8ded1cbabba8c60c4d918ae2"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "integration",
|
|
36
|
+
"tests": 112,
|
|
37
|
+
"pass": 112,
|
|
38
|
+
"fail": 0,
|
|
39
|
+
"skipped": 0,
|
|
40
|
+
"reportSha256": "c0ccbf18492cb9c47992b2341a638480ffdd8f69356d5f8f9c28be16eded3559"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"testOverrides": {},
|
|
44
|
+
"bun": "1.4.4",
|
|
45
|
+
"completedAt": "2026-11-26T11:27:50.737Z",
|
|
46
|
+
"durationMs": 267877,
|
|
47
|
+
"logSha256": "e56e29cada96e54bf3ccc533a607b8effa8994f615c120d730a97d6cec26fde3"
|
|
48
|
+
}
|
|
49
|
+
-->
|
|
50
|
+
<!-- ads-local-tests:end -->
|
|
51
|
+
|
|
52
|
+
- *Fixed: a row of buttons spilled out of its card* (neezler's attachment): a
|
|
53
|
+
part with its own arrangement shrinks to nothing only when something in it
|
|
54
|
+
gives way (text, a filling or growing part, a wrapping row, a clip or scroll);
|
|
55
|
+
a row of buttons keeps its natural minimum, so a long name beside it
|
|
56
|
+
truncates instead.
|
|
57
|
+
- *Render audit: content escaping its box*: a `layout-overflow` finding of kind
|
|
58
|
+
`escaped` for a control or text reaching past the edge of the painted box
|
|
59
|
+
around it; a review for now.
|
|
60
|
+
- *A part's ratio* (#74): `frame: { profile, ratio }` on a part, so a card's
|
|
61
|
+
picture folds into the card.
|
|
62
|
+
- *Fixed: a cropping ratio box grew with a taller image* (#72): a ratio box that
|
|
63
|
+
clips or scrolls keeps its ratio (`min-block-size: 0`).
|
|
64
|
+
- *A root's browser margin* (#73): `source/root-margin-unreset` for a recipe
|
|
65
|
+
root rendered as a `figure`, `p`, list, heading, `blockquote`, `pre` or
|
|
66
|
+
`fieldset` that states no margin of its own.
|
|
67
|
+
|
|
3
68
|
## 0.5.14
|
|
4
69
|
|
|
5
70
|
<!-- ads-local-tests:start -->
|
package/docs/GUIDE.md
CHANGED
|
@@ -631,7 +631,10 @@ capture shows the page as the showcase does.
|
|
|
631
631
|
|
|
632
632
|
- Each `a11y-axe`, `a11y-non-text-contrast`, `a11y-text-scale`,
|
|
633
633
|
`a11y-text-spacing-override`, `a11y-reflow`, `layout-overflow`, `layout-shift`
|
|
634
|
-
and `img-shape` finding is an error that fails the gate
|
|
634
|
+
and `img-shape` finding is an error that fails the gate, except a
|
|
635
|
+
`layout-overflow` finding of kind `escaped` (a control or text reaching past
|
|
636
|
+
the edge of the painted box around it, such as a button spilling over a
|
|
637
|
+
card's border), which is a review while designs are read with it.
|
|
635
638
|
- Each `a11y-incomplete` finding is an info item that fails nothing: axe could
|
|
636
639
|
not decide that rule on those elements, so check it by hand.
|
|
637
640
|
- An audit that cannot run fails the gate with a `render-audit-unavailable`
|
|
@@ -1281,6 +1284,10 @@ an owner-analysis finding with its fine-grained code, reported under its
|
|
|
1281
1284
|
- `a11y-image-alt` (error, at the image): every `<img>` that an owner renders
|
|
1282
1285
|
has `alt`: artwork (`source/intrinsic-alt-missing`), content media and any
|
|
1283
1286
|
other image (`source/image-alt-missing`). `alt=""` marks a decorative one.
|
|
1287
|
+
- `root-margin-unreset` (error, at the root): a recipe root rendered as an
|
|
1288
|
+
element the browser gives a margin (`figure`, `p`, a list, a heading,
|
|
1289
|
+
`blockquote`, `pre`, `fieldset`) states its own (`normalize: { margin: 0 }`);
|
|
1290
|
+
parts are reset by their construction, a root is not.
|
|
1284
1291
|
- `a11y-nesting` (error, at the element): an owner's markup follows HTML's
|
|
1285
1292
|
content model (`source/invalid-nesting`): no flow content (a `div`, a list, a
|
|
1286
1293
|
paragraph, a heading) inside an element that takes phrasing content only (a
|
package/docs/LANGUAGE.md
CHANGED
|
@@ -234,7 +234,7 @@ them all.
|
|
|
234
234
|
| --- | --- | --- | --- |
|
|
235
235
|
| frame profile `paddingInline` / `paddingBlock` | frame | logical insets per axis | the profile also sets `padding` (`construction/frame-field-conflict`) |
|
|
236
236
|
| frame profile `paddingInlineStart` / `paddingInlineEnd` / `paddingBlockStart` / `paddingBlockEnd` | container frame, control frame | one side's inset, where the two sides of an axis differ (a tag padded more before its remove button). On a control frame a block side's inset is its least inset, and `minimumBlockInset` is the block axis's field | the profile also sets that side's axis or `padding`; on a control frame, a block inset beside `minimumBlockInset` (`construction/frame-field-conflict`) |
|
|
237
|
-
| `frame: { profile: "<frame profile>" }` | part (not a control, not a vector) | the profile's insets, border, radius and sizes as the part's own box (`box-sizing: border-box`); on a visual part bound to artwork the profile's `inlineSize`/`blockSize` are the box (a disc behind a mark) and the drawing keeps its visual profile's size, centred in it | another field beside `profile`; a frame field the profile misuses, as on a root |
|
|
237
|
+
| `frame: { profile: "<frame profile>", ratio? }` | part (not a control, not a vector) | the profile's insets, border, radius and sizes as the part's own box (with `ratio`, a ratio its spatial profile permits, as a root frame's; a ratio box that clips or scrolls keeps its ratio whatever it holds) (`box-sizing: border-box`); on a visual part bound to artwork the profile's `inlineSize`/`blockSize` are the box (a disc behind a mark) and the drawing keeps its visual profile's size, centred in it | another field beside `profile`; a frame field the profile misuses, as on a root |
|
|
238
238
|
| `frame: { rules: ["block-end", …] }` (root), `frame: { kind: "control", rules: [...] }` (control part) | region root, control part | the profile's `border-width`, solid, on the named logical sides only, painted by the element's surface `border-color` (mirrors in RTL); on a control part an unruled side keeps the border's space as inset, so the box and its text do not move (a soft field's underline) | empty or repeated sides; no profile width (`rule-width-missing`); no surface border colour (`rule-paint-missing`); on a grid |
|
|
239
239
|
| `frame: { corners: ["end-start", "end-end"] }` | region root | the frame profile's `radius` (or the corner's own, below) on the named corners (block edge, then inline edge), `0` on the others, as `border-<corner>-radius`; every corner without it | a named corner with no radius in the frame profile (`profile-field-missing`) |
|
|
240
240
|
| frame profile `startStartRadius` / `startEndRadius` / `endStartRadius` / `endEndRadius` | region root, part box | that corner's radius in place of the profile's `radius` (a chat bubble's small tail corner), all four as `border-<corner>-radius`; a corner with neither is square | a control frame (`profile-field-unsupported`) |
|
package/docs/RULES.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- Generated by scripts/sync-rule-reference.mjs from src/ads-errors.mts and src/finding-rules.mts. Do not edit: run `bun run sync:rule-reference`. -->
|
|
4
4
|
|
|
5
|
-
Every rule ADS reports, under its rule group:
|
|
5
|
+
Every rule ADS reports, under its rule group: 465 rules in 18 groups. A finding names its rule as a code,
|
|
6
6
|
`<domain>/<kind>`; the `check/<rule>` codes are the rules `ads check`, `ads validate`, the render audit and acceptance
|
|
7
7
|
report by their plain name (`check/a11y-reflow` is the finding `a11y-reflow`).
|
|
8
8
|
|
|
@@ -19,7 +19,7 @@ Fix findings in group order: earlier groups are often the cause of later ones. T
|
|
|
19
19
|
| 2 | [unresolved-reference](#unresolved-reference) | 39 | violated | The source names something that does not exist in this revision. | Correct the name from the existing candidates. Declare a new one only when it is genuinely new design. |
|
|
20
20
|
| 3 | [boundary](#boundary) | 30 | violated | Code reaches across an ownership or production/development boundary. | Move the code to its owner or pass the value through public props. Do not add an exception or widen the boundary. |
|
|
21
21
|
| 4 | [design-bypass](#design-bypass) | 20 | violated | Styling or design values are supplied outside the design language. | Take the value from a profile, token or recipe instead of writing it in place. |
|
|
22
|
-
| 5 | [structure-mismatch](#structure-mismatch) |
|
|
22
|
+
| 5 | [structure-mismatch](#structure-mismatch) | 57 | violated | Rendered markup does not match what its declaration promises. | Make the markup match the declaration: each declared part, cell and binding exactly once, in the declared order. Change the declaration only if it is wrong. |
|
|
23
23
|
| 6 | [accessibility-semantics](#accessibility-semantics) | 49 | violated | Owned markup or motion lacks required accessible semantics: a text alternative, an accessible name, keyboard access or reduced motion. | Add the missing semantics in the owning component (alt, aria-label, a native control, a reduced-motion value); do not suppress the check. |
|
|
24
24
|
| 7 | [project-files](#project-files) | 6 | violated | A required project file or declaration is missing, empty, undocumented or unused. | Add or complete the file the rule names (README, license, theme or brand values), or remove what nothing uses. |
|
|
25
25
|
| 8 | [wrong-value](#wrong-value) | 74 | violated | A value has the wrong kind, role or range for where it is used. | Choose one of the allowed values the error lists. |
|
|
@@ -222,6 +222,7 @@ Rendered markup does not match what its declaration promises. Make the markup ma
|
|
|
222
222
|
| `source/placement-without-root` | error | A placement positions a styled root; an element with a placement also carries its own recipe styling. | Add the element's recipe output beside its placement, or move the placement to the styled root. | `ads://guides/layout` |
|
|
223
223
|
| `source/pseudo-host-unsupported` | error | A part treats only pseudo-elements its element has: `::placeholder` belongs to `<input>` and `<textarea>`. | Move the pseudo treatment to the part that renders the input or textarea, or render that element for this part. | `ads://guides/recipes` |
|
|
224
224
|
| `source/resize-not-textarea` | error | `normalize.resize` states how the user may resize a multi-line text field: it belongs on a part rendered as `<textarea>`. No other element has a resize handle in this language; a region's size comes from its recipe. | Declare `resize` on the part rendered as `<textarea>`, or remove it. | `ads://guides/recipes` |
|
|
225
|
+
| `source/root-margin-unreset` | error | A recipe root rendered as an element the browser gives a margin (`figure`, `p`, a list, a heading, `blockquote`, `pre`, `fieldset`) states its margin: its parts are reset by their construction, but a root keeps the browser's (a figure's 40 px sides make it 80 px narrower than its column). | Add `normalize: { margin: 0 }` to the recipe (its parent's space still applies), or render the root as a <div>. | `ads://guides/recipes` |
|
|
225
226
|
| `source/scheme-image-element` | error | A part that declares `scheme` is one drawing of a light and dark pair: a content `<img>` without an artwork binding, or declared artwork bound for a theme of that scheme (a logo black on light, white on dark). | Render a content pair as plain `<img>` elements whose `src` the application supplies; bind declared artwork for a theme of the part's scheme (`recipe({ theme: "dark", … })` on the dark part); or remove `scheme`. | `ads://guides/recipes`, `ads://guides/branding` |
|
|
226
227
|
| `source/scheme-image-not-lazy` | error | In a light and dark image pair, the image of the scheme the default theme (the first declared) does not have is `loading="lazy"` in every choice: a hidden lazy image is not downloaded, an eager one is. Only the default scheme's image may load eagerly. | Write `loading="lazy"` on that image as a literal and apply any priority (eager loading, `fetchPriority`) to the default scheme's image only. | `ads://guides/recipes` |
|
|
227
228
|
| `source/scheme-image-size-missing` | error | Both images of a light and dark pair state `width` and `height`: each file's own pixel size, so the box is reserved before either loads and the page does not move when the theme changes. | Set `width` and `height` on both images from each file's own pixel size. | `ads://guides/recipes` |
|