Hold'em dealer: 55 polish rounds, one merge #101
+24
-7
@@ -368,8 +368,18 @@ const LayoutAudit = {
|
|||||||
: [...document.querySelectorAll("*")];
|
: [...document.querySelectorAll("*")];
|
||||||
|
|
||||||
nodes.forEach(el => {
|
nodes.forEach(el => {
|
||||||
if (el.children.length > 0) return; // leaf text only
|
// An element's *own* text, not its descendants' — they get measured on
|
||||||
const text = (el.textContent || "").trim();
|
// their own turn, against their own colour.
|
||||||
|
//
|
||||||
|
// This used to be "leaf elements only", which quietly stopped measuring
|
||||||
|
// anything the moment a child was added to it. The undo control went that
|
||||||
|
// way the day a <kbd> was appended to it: its label became invisible to
|
||||||
|
// this check, with no sign that anything had changed.
|
||||||
|
const text = [...el.childNodes]
|
||||||
|
.filter(node => node.nodeType === 3)
|
||||||
|
.map(node => node.textContent)
|
||||||
|
.join(" ")
|
||||||
|
.trim();
|
||||||
if (!text) return;
|
if (!text) return;
|
||||||
const rect = el.getBoundingClientRect();
|
const rect = el.getBoundingClientRect();
|
||||||
if (rect.width === 0 || rect.height === 0) return;
|
if (rect.width === 0 || rect.height === 0) return;
|
||||||
@@ -390,11 +400,18 @@ const LayoutAudit = {
|
|||||||
unmeasured.push(`${this.describe(el)} :: faded (opacity ${opacity}), contrast not checked`);
|
unmeasured.push(`${this.describe(el)} :: faded (opacity ${opacity}), contrast not checked`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Decoration is exempt by definition: the watermark on the felt is meant
|
// aria-hidden used to exempt text here, on the grounds that decoration
|
||||||
// to be barely there, and holding it to a reading threshold would mean
|
// marked for screen readers was decoration for everyone. Those are two
|
||||||
// making it not a watermark. Marked aria-hidden so screen readers skip it
|
// different questions and the answer differs: the bet chips on the felt are
|
||||||
// too, which is the same claim expressed where it also does some good.
|
// aria-hidden because their amounts are already announced by the seat and
|
||||||
if (el.closest("[aria-hidden='true']")) return;
|
// the action bar, and repeating them would be noise — but they are exactly
|
||||||
|
// what a sighted dealer reads the felt for, and this check had stopped
|
||||||
|
// looking at them. Hiding something from one audience is not a claim about
|
||||||
|
// whether the other audience can read it.
|
||||||
|
//
|
||||||
|
// Nothing is exempt now. If something genuinely decorative turns up, it
|
||||||
|
// should say so in its own words rather than borrowing an attribute that
|
||||||
|
// means something else.
|
||||||
|
|
||||||
const fgRaw = this.parseColour(style.color);
|
const fgRaw = this.parseColour(style.color);
|
||||||
if (!fgRaw) return;
|
if (!fgRaw) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user