The probe's two text-rect helpers say which text they read

`__textLineRects` collected only the direct text once the line probe grew
its own deep walk, so its name promised lines it no longer produced: it is
`__directTextRects`, the list the union rect is built from. The snapshot's
union helper takes the rects rather than the node now, and its comment says
so. No behavior.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQBUunp8QttxZqihybNmtL
This commit is contained in:
Paul Bakaus
2026-09-20 20:03:28 -07:00
co-authored by Claude Fable 5.1
parent c97ed90df0
commit d3b58b02a3
4 changed files with 14 additions and 15 deletions
+3 -3
View File
@@ -70,8 +70,8 @@ function __collectTextRects(node, deep, out) {
return out;
}
// The element's own direct text, unmerged.
function __textLineRects(el) {
// The element's own direct text, unmerged: what the union rect is built from.
function __directTextRects(el) {
return __collectTextRects(__el(el), false, []);
}
@@ -210,7 +210,7 @@ const __impeccableDom = {
// getDirectTextRect(el) from the JS driver: union of the client rects of
// the element's non-blank direct text nodes.
direct_text_rect(el) {
const rects = __textLineRects(el);
const rects = __directTextRects(el);
if (rects.length === 0) return [];
const left = Math.min(...rects.map(r => r.left));
const top = Math.min(...rects.map(r => r.top));
+2 -2
View File
@@ -86,8 +86,8 @@ function __snapTextRects(node, out) {
return out;
}
// getDirectTextRect(el): union of the client rects of the element's
// non-blank direct text nodes (same measure as 10-probe.js).
// getDirectTextRect(el) over rects already collected: their union, as
// 10-probe.js#direct_text_rect builds it.
function __snapDirectTextRectOf(rects) {
if (rects.length === 0) return null;
const left = Math.min(...rects.map(r => r.left));
+4 -5
View File
@@ -45,11 +45,10 @@ re!(
);
// A design document's prose, cut where one statement stops and the next
// starts: punctuation, a line break, and the phrases that turn a sentence
// around. `instead of` / `rather than` open a
// clause about what the document is steering *away* from; the reversals
// (`outside`, `except`, ...) open one about what it is steering *toward*,
// which is what lets "no ALL CAPS outside the `.eyebrow` class" declare
// `.eyebrow`.
// around. `instead of` / `rather than` open a clause about what the document
// is steering *away* from; the reversals (`outside`, `except`, ...) open one
// about what it is steering *toward*, which is what lets "no ALL CAPS outside
// the `.eyebrow` class" declare `.eyebrow`.
re!(
DESIGN_CLAUSE_SPLIT,
r"(?i)[.!?;:,()\[\]\n]|\u{2014}|\u{2013}|\binstead of\b|\brather than\b|\bas opposed to\b|\boutside\b|\bexcept\b|\bother than\b|\bunless\b|\bbesides\b|\bapart from\b|\bbeyond\b".to_string()
@@ -83,8 +83,8 @@ function __collectTextRects(node, deep, out) {
return out;
}
// The element's own direct text, unmerged.
function __textLineRects(el) {
// The element's own direct text, unmerged: what the union rect is built from.
function __directTextRects(el) {
return __collectTextRects(__el(el), false, []);
}
@@ -223,7 +223,7 @@ const __impeccableDom = {
// getDirectTextRect(el) from the JS driver: union of the client rects of
// the element's non-blank direct text nodes.
direct_text_rect(el) {
const rects = __textLineRects(el);
const rects = __directTextRects(el);
if (rects.length === 0) return [];
const left = Math.min(...rects.map(r => r.left));
const top = Math.min(...rects.map(r => r.top));
@@ -331,8 +331,8 @@ function __snapTextRects(node, out) {
return out;
}
// getDirectTextRect(el): union of the client rects of the element's
// non-blank direct text nodes (same measure as 10-probe.js).
// getDirectTextRect(el) over rects already collected: their union, as
// 10-probe.js#direct_text_rect builds it.
function __snapDirectTextRectOf(rects) {
if (rects.length === 0) return null;
const left = Math.min(...rects.map(r => r.left));