WICG / layout-instability

A proposal for a Layout Instability specification
https://wicg.github.io/layout-instability/
Other
159 stars 27 forks source link

Clarify Input Exclusion and interactions across iframes #118

Open mmocny opened 1 year ago

mmocny commented 1 year ago

Context: a webpage which uses cross-frame communication (e.g. postMessage) to make changes to an another iframe in direct response to interactions.

Visually, this looks exactly as if the shift happened as a direct consequence of the interaction, and if it were all in one frame, we would have excluded it from CLS calculation (via hadRecentInput)


Today the spec states: "An excluding input is any event from an input device which signals a user’s active interaction with the document"

I think the key question for discussion is: Should an interaction from another iframe "signal" this document?

Perhaps for same-origin frames, we could default to signalling all frames.

But for cross-origin, we cannot. Perhaps we could check for the use inter-frame-communication (i.e. postMessage) that happen as a direct consequence of an interaction (either via timer, or task attribution). But, I do not expect we will do this.