Open souders opened 5 years ago
These are good questions that the explainer could have been clearer on.
The "score" is deliberately unitless to give us flexibility to iterate on the algorithm. In principle it is only a number with some correspondence to the overall severity of the layout instability.
In the current algorithm its value is the impact fraction (fraction of viewport covered by impact region), but we are experimenting with a version of the LS score that multiplies this fraction by a different fraction based on the maximum distance that any element moved during the animation frame.
If a div whose size is 10% of the viewport moves such that its new visual rect has no overlap with its previous visual rect, and is at all times fully within the viewport, the LS Score will be 0.2. I intended to imply this by referring to a "geometric union", but I agree that an example would help.
The impact region is calculated only within the viewport. If a div occupying 10% of the viewport moves fully out of the viewport, then only the previous visual rect will contribute to the impact region, and the LS Score will be 0.1.
In reading the explainer I wondered about the units of LS Score. Is it just "fraction of viewport"? Might be nice to clarify that.
I would also have appreciated more examples. Two specifics: