Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion scripts/docs-site/docs-layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,14 @@
/* Patch lists keep their detail control in the sentence's inline flow. */
.docs-layout .doc li:has(> .release-source-inline) > p:first-child { display: inline; margin: 0; }
.docs-layout .doc .release-source-inline { display: inline; }
.docs-layout .doc .release-source-inline > summary { display: inline-flex; vertical-align: baseline; margin-inline-start: .35em; }
.docs-layout .doc .release-source-inline > summary { display: inline-flex; vertical-align: middle; min-block-size: 0; inline-size: 20px; block-size: 20px; justify-content: center; margin-inline-start: .2em; padding: 0; border-radius: 4px; color: var(--muted); font-size: 0; line-height: 0; position: relative; }
/* Inline patch-release details: a small chevron only; the label stays for assistive tech. */
.docs-layout .doc .release-source-inline > summary::before { flex-basis: 11px; inline-size: 11px; block-size: 11px; opacity: .55; }
.docs-layout .doc .release-source-inline > summary::after { content: ""; position: absolute; inset: -12px; }
.docs-layout .doc .release-source-inline[open] > summary::before { opacity: .9; }
.docs-layout .doc .release-source-inline > .release-source-content,
.docs-layout .doc .release-source-inline > :not(summary) { display: block; margin: .3em 0 .2em; font-size: .86em; line-height: 1.55; color: var(--muted); }
.docs-layout .doc .release-source-inline > :not(summary) a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
@media (hover:hover) and (pointer:fine) {
.docs-layout .doc .release-source-toggle > summary:hover::before { color: var(--ink); }}
.docs-layout .doc > :is(p,ul,ol,blockquote) { max-inline-size: var(--docs-prose-measure); margin-block: 0 var(--docs-paragraph-gap); }
Expand Down
10 changes: 8 additions & 2 deletions scripts/docs-site/release-inline-details.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,16 @@ test("patch details follow the fix inline and retain native keyboard access", as
range.setEnd(paragraph.lastChild, paragraph.lastChild.textContent.length);
const end = range.getBoundingClientRect();
const control = element.getBoundingClientRect();
return { end: { left: end.left, right: end.right, top: end.top, bottom: end.bottom }, control: { left: control.left, top: control.top, bottom: control.bottom, height: control.height }, overflow: document.documentElement.scrollWidth > innerWidth, paragraphDisplay: getComputedStyle(paragraph).display };
// The visible chevron is compact; its pointer area extends past the box.
const centerX = control.left + control.width / 2;
const centerY = control.top + control.height / 2;
const hits = (x, y) => element.contains(document.elementFromPoint(x, y));
const pointerArea = [-21, 21].every((dy) => hits(centerX, centerY + dy)) && [-21, 21].every((dx) => hits(centerX + dx, centerY));
return { end: { left: end.left, right: end.right, top: end.top, bottom: end.bottom }, control: { left: control.left, top: control.top, bottom: control.bottom, height: control.height }, pointerArea, lineHeight: paragraph.getBoundingClientRect().height, overflow: document.documentElement.scrollWidth > innerWidth, paragraphDisplay: getComputedStyle(paragraph).display };
});
assert.equal(layout.paragraphDisplay, "inline");
assert.ok(layout.control.height >= 44, "retain the existing touch target");
assert.ok(layout.control.height <= 24, "keep the visible control compact");
assert.equal(layout.pointerArea, true, "retain a 44px pointer target around the control");
assert.equal(layout.overflow, false, "narrow view must not scroll horizontally");
if (width === 1200) {
assert.ok(layout.control.left >= layout.end.right, "control follows the final character");
Expand Down
Loading