FA-8816 / Viewport layout / Open access
Sticky element container constraints: Sticky limits stay in document coordinates · case 01
Sticky limits stay in document coordinates.
ROOT CAUSE
The container scroll operation uses `container_end - height` where the contract requires `container_end - scroll - height`.
VERIFIED REPAIR
Implement the container scroll operation as `container_end - scroll - height`.
Unsuccessful approach: Adding scroll moves the limit away as the container exits.
Case contract
Convert normal and container positions to viewport coordinates; pin at inset until the containing block bottom, accounting for element height; report whether position differs from natural flow.
Why this case matters
A deterministic model of sticky element container constraints; this isolates one interface invariant without requiring a browser.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(normal, scroll, inset, height, container_end):
natural = normal - scroll
sticky = max(natural, inset)
limit = container_end - height
position = min(sticky, limit)
return (position, position != natural)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('natural', solve(50, 10, 5, 20, 200), (40, False))
check('pinned', solve(50, 60, 5, 20, 200), (5, True))
check('container exits', solve(50, 180, 5, 20, 200), (0, True))
check('inset', solve(30, 40, 12, 10, 100), (12, True))
check('at natural', solve(50, 45, 5, 20, 200), (5, False))
check('parameterized sticky geometry', solve(5*N,6*N,N,2*N,20*N), (N,True))
for repetition in range(N):
check('repeat at natural', solve(50, 45, 5, 20, 200), (5, False))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| natural | [40, False] | [40, False] | Passed |
| pinned | [5, True] | [5, True] | Passed |
| container exits | [5, True] | [0, True] | Failed |
| inset | [12, True] | [12, True] | Passed |
| at natural | [5, False] | [5, False] | Passed |
| parameterized sticky geometry | [1, True] | [1, True] | Passed |
| repeat at natural | [5, False] | [5, False] | Passed |
SHA-256 / 136e6f34d554232a9c59555dc042c9a409ae56868867338e1f2b23d54bc1c0af
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(normal, scroll, inset, height, container_end):
natural = normal - scroll
sticky = max(natural, inset)
limit = container_end + scroll - height
position = min(sticky, limit)
return (position, position != natural)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('natural', solve(50, 10, 5, 20, 200), (40, False))
check('pinned', solve(50, 60, 5, 20, 200), (5, True))
check('container exits', solve(50, 180, 5, 20, 200), (0, True))
check('inset', solve(30, 40, 12, 10, 100), (12, True))
check('at natural', solve(50, 45, 5, 20, 200), (5, False))
check('parameterized sticky geometry', solve(5*N,6*N,N,2*N,20*N), (N,True))
for repetition in range(N):
check('repeat at natural', solve(50, 45, 5, 20, 200), (5, False))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| natural | [40, False] | [40, False] | Passed |
| pinned | [5, True] | [5, True] | Passed |
| container exits | [5, True] | [0, True] | Failed |
| inset | [12, True] | [12, True] | Passed |
| at natural | [5, False] | [5, False] | Passed |
| parameterized sticky geometry | [1, True] | [1, True] | Passed |
| repeat at natural | [5, False] | [5, False] | Passed |
SHA-256 / c76f2f0733463b6b512dd4baf29c94e9a2eb964515352d88507507f410fe6681
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(normal, scroll, inset, height, container_end):
natural = normal - scroll
sticky = max(natural, inset)
limit = container_end - scroll - height
position = min(sticky, limit)
return (position, position != natural)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('natural', solve(50, 10, 5, 20, 200), (40, False))
check('pinned', solve(50, 60, 5, 20, 200), (5, True))
check('container exits', solve(50, 180, 5, 20, 200), (0, True))
check('inset', solve(30, 40, 12, 10, 100), (12, True))
check('at natural', solve(50, 45, 5, 20, 200), (5, False))
check('parameterized sticky geometry', solve(5*N,6*N,N,2*N,20*N), (N,True))
for repetition in range(N):
check('repeat at natural', solve(50, 45, 5, 20, 200), (5, False))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| natural | [40, False] | [40, False] | Passed |
| pinned | [5, True] | [5, True] | Passed |
| container exits | [0, True] | [0, True] | Passed |
| inset | [12, True] | [12, True] | Passed |
| at natural | [5, False] | [5, False] | Passed |
| parameterized sticky geometry | [1, True] | [1, True] | Passed |
| repeat at natural | [5, False] | [5, False] | Passed |
SHA-256 / 7ac71cf6266177ce4adfbf00c16606201fd7822edec3c31c5cc9873a2742c8b5
Verification & scope
This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:38:24.651532+00:00.
Case digest / 59147275b17bf766829e8b8e1daf974b4076da65e53d83edf2390ce99112f2dd