You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0199c6e
Browse filesBrowse the repository at this point in the historyBrowse files
test(agentic): clip text along its containing block and by real clip areas
Codex review round 4: a fixed or absolute box escapes the overflow of
ancestors outside its containing block, a clip-path inset or a
zero-height clip can hide a whole box, and two guard cases passed even
with clipping removed. Clip only along the containing-block chain,
compute clip and inset areas, and rebuild every case so its text
crosses the screen edge before clipping. Removing clipping fails 7
cases; removing the containing-block rule fails the fixed-escape case.
Text cut short inside the screen stays out of scope: the judge checks it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
// The rules of the fixtures' text-past-the-edge guard, on injected layouts:
5
5
// text that shows up to the screen edge and continues fails; text clipped
6
6
// away, cut short inside the screen, or in a sideways scroller does not.
7
+
// Each layout puts text across the screen edge before clipping, so a case
8
+
// passes only through the rule it names.
9
+
constLONG="Long words past the edge ".repeat(30);
7
10
constCASES: [string,string,boolean][]=[
8
-
["nowrap text clipped by an overflow-hidden box at the edge",`<div style="overflow:hidden;width:100vw"><p style="white-space:nowrap;width:100%">${"Clipped words ".repeat(40)}</p></div>`,true],
9
-
["text overflowing the page with no clip",`<p style="white-space:nowrap;position:relative;left:200px">${"Overflowing words ".repeat(20)}</p>`,true],
11
+
["nowrap text clipped by an overflow-hidden box at the edge",`<div style="overflow:hidden;width:100vw"><p style="white-space:nowrap;width:100%">${LONG}</p></div>`,true],
12
+
["text overflowing the page with no clip",`<p style="white-space:nowrap;position:relative;left:200px">${LONG}</p>`,true],
10
13
["hero column wider than the screen",`<div style="overflow-x:hidden"><div style="width:calc(100vw + 120px);margin-left:16px"><p>${"A paragraph of wrapping words ".repeat(20)}</p></div></div>`,true],
11
14
["clip-path box wider than the screen",`<div style="width:calc(100vw + 200px);clip-path:inset(0)"><h2 style="white-space:nowrap;margin-left:calc(100vw - 30px)">A heading past the edge</h2></div>`,true],
12
15
["one-axis clip leaves the other axis visible",`<div style="width:100px;overflow-x:visible;overflow-y:clip"><h2 style="white-space:nowrap;margin-left:calc(100vw - 30px)">A heading past the edge</h2></div>`,true],
13
-
["ellipsis inside a header",`<header style="display:flex;width:100%"><span style="margin-left:152px;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">This House would replace school exams with continuous assessment</span></header>`,false],
14
-
["wide box holding short text",`<div style="overflow:hidden"><p style="width:600px">Hello</p></div>`,false],
15
-
["node panned fully outside a clipped canvas",`<div style="overflow:hidden;width:200px;height:200px;position:relative"><div style="position:absolute;left:900px;top:10px">Panned node</div></div>`,false],
16
-
["drawer translated off canvas",`<div style="position:fixed;top:0;left:0;transform:translateX(-100%);width:300px">Drawer link</div>`,false],
17
-
["sr-only label",`<span style="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap">Screen reader text that is long</span>`,false],
18
-
["table that scrolls sideways",`<div style="overflow-x:auto;width:300px"><p style="white-space:nowrap">${"Wide table cell ".repeat(40)}</p></div>`,false],
16
+
["fixed text escapes a clipping ancestor outside its containing block",`<div style="overflow:hidden;width:200px"><h2 style="position:fixed;top:0;left:calc(100vw - 30px);white-space:nowrap">A fixed heading past the edge</h2></div>`,true],
17
+
["fixed text inside a transformed clipping ancestor",`<div style="overflow:hidden;width:200px;height:100px;transform:translateZ(0)"><h2 style="position:fixed;top:0;left:calc(100vw - 30px);white-space:nowrap">A fixed heading past the edge</h2></div>`,false],
18
+
["ellipsis inside a header",`<header style="display:flex;width:100%"><span style="margin-left:152px;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${LONG}</span></header>`,false],
19
+
["wide box holding short text",`<div style="overflow:hidden"><p style="width:calc(100vw + 200px)">Hello</p></div>`,false],
20
+
["node panned out of a clipped canvas",`<div style="overflow:hidden;width:200px;height:200px;position:relative"><div style="position:absolute;left:calc(100vw - 30px);top:10px;white-space:nowrap">${LONG}</div></div>`,false],
21
+
["drawer translated off canvas",`<div style="position:fixed;top:0;left:0;transform:translateX(-100%);width:300px;overflow:hidden;white-space:nowrap">${LONG}</div>`,false],
["zero-height clip with a width",`<span style="position:absolute;left:calc(100vw - 30px);clip:rect(0px,100px,0px,0px);white-space:nowrap">${LONG}</span>`,false],
24
+
["clip-path that hides the whole box",`<p style="white-space:nowrap;margin-left:calc(100vw - 30px);clip-path:inset(0 100% 0 0)">${LONG}</p>`,false],
25
+
["table that scrolls sideways",`<div style="overflow-x:auto;width:300px"><p style="white-space:nowrap">${LONG}</p></div>`,false],
"summary": "Paused “Plastic bag levy study” by turning off its library switch. The source is no longer checked, Active sources is 0, and the page shows Grounding Disabled.",
28
+
"startPath": "/app/library",
29
+
"endPath": "/app/library",
30
+
"endAnchors": [
31
+
{
32
+
"role": "heading",
33
+
"name": "Grounding Disabled"
34
+
},
35
+
{
36
+
"text": "AI responses are not grounded"
37
+
},
38
+
{
39
+
"role": "switch",
40
+
"name": "Toggle Plastic bag levy study"
41
+
}
42
+
],
43
+
"goneAnchors": [
44
+
{
45
+
"role": "button",
46
+
"name": "Close"
47
+
},
48
+
{
49
+
"text": "Source Added"
50
+
},
51
+
{
52
+
"text": "Your source is now available for grounding."
53
+
},
54
+
{
55
+
"role": "heading",
56
+
"name": "Grounding Active"
57
+
},
58
+
{
59
+
"text": "AI responses use your sources"
60
+
},
61
+
{
62
+
"role": "listitem",
63
+
"name": "Close Source Added Your source is now available for grounding."
0 commit comments