feat: solver consumes CSS contain:paint for clippedBy diagnostics
- Add Contain=5 to geometry world ClipKind enum (avoids collision with topology engine's CONTAIN=3 vs Mask=3) - Fix CDP isClippingElement() to detect contain:paint (style.contain) - CDP topology builder sets clipKind=5 for contain:paint, 1 for overflow - Enrich clippedByPredicate with clipKind metric: 1=contain:paint, 2=overflow (hidden/scroll/auto) - Reads world.clipping.clipKind of the reference's clip node
This commit is contained in:
@@ -687,7 +687,19 @@ export const clippedByPredicate: PredicateEvaluator = {
|
||||
// Simplified: check if subject's clipping root is the reference
|
||||
const clipRoot = world.topology.clippingRootOf[subjectId - 1] ?? 0;
|
||||
const pass = clipRoot === referenceId;
|
||||
return makePredicateResult(pass ? 'true' : 'false', {}, [subjectId, referenceId]);
|
||||
// Determine clip kind from the clipping table entry for the reference.
|
||||
// Encoding: 1=contain:paint, 2=overflow:hidden/scroll/auto
|
||||
const metrics: Record<string, number> = {};
|
||||
if (referenceId !== undefined) {
|
||||
const { clipping } = world;
|
||||
for (let i = 0; i < clipping.subjectId.length; i++) {
|
||||
if (clipping.subjectId[i] === referenceId) {
|
||||
metrics.clipKind = clipping.clipKind[i] === 5 /* Contain */ ? 1 : 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return makePredicateResult(pass ? 'true' : 'false', metrics, [subjectId, referenceId]);
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user