Layout Thrashing Read/Write Interleave Warning
Observed operation trace potential forced-layout reads after caller confirmed invalidating writes; read assumed layout-dependent, no browser flush timing or elapsed cost inferred. Explicit supplied computed/layout context only; not a browser cascade/layout engine or cross-browser guarantee.
Description
A layout-dependent read after an invalidating write can require pending layout work.
A layout-dependent read after an invalidating write can require pending layout work.1
An annotated operation trace is a potential warning rather than a browser performance measurement. Use Layout Thrashing Read/Write Interleave Warning to evaluate the supplied inputs under the specific model below.
When to use Layout Thrashing Read/Write Interleave Warning
Use Layout Thrashing Read/Write Interleave Warning to evaluate the supplied inputs under the specific model below. Define the supplied layout, token or rendering scenario and establish the relevant units and browser context independently.
How to use Layout Thrashing Read/Write Interleave Warning and understand its results
- Define the supplied layout, token or rendering scenario and establish the relevant units and browser context independently.
- Enter Operation kinds, Caller layout invalidating flags using the field table and validation rules below, then run the tool.
- Read Potential forced layout read indices and interpret units, signs, ordering and placeholders as explained below.
- If the tool reports an input error, correct that field and rerun. A successful false result, empty match list or unknown-evidence placeholder has the specific meaning described here; check the limitations before applying the result.
| Input field | Meaning | Value type | Requirement |
|---|---|---|---|
| operationKinds | Operation kinds | array of string | Required; constraints below |
| callerLayoutInvalidatingFlags | Caller layout invalidating flags | array of number | Required; constraints below |
Enter aligned nonempty operation tokens write, read or other and binary layout-invalidating flags. Maintain a dirty flag, set only by a write with flag 1. A read while dirty is reported by its zero-based index and resets the flag; other operations leave it unchanged and read flags do not matter. The trace identifies modeled potential flushes rather than measuring actual forced reflow.
dirty write sets dirty; dirty read appends its index and clears dirty Field order, units and branch conditions follow the implementation explanation above.
| Output field | Meaning | Value type |
|---|---|---|
| potentialForcedLayoutReadIndices | Potential forced layout read indices | array of number |
{
"input": {
"operationKinds": [
"write",
"read",
"read",
"write",
"read"
],
"callerLayoutInvalidatingFlags": [
1,
0,
0,
1,
0
]
},
"output": {
"potentialForcedLayoutReadIndices": [
1,
4
]
}
} Limitations and assumptions
An annotated operation trace is a potential warning rather than a browser performance measurement. Apply the exact scope and assumptions described above.
All listed fields require explicit values. Unexpected fields, incorrect types, nonfinite numbers and sparse arrays fail validation. Domain-specific bounds, alignments and supported tokens are stated above; extremely large inputs or outputs can also be rejected. These errors differ from successful results such as false, no matches or unknown evidence.
Alternative or Complementary methods
Use Reflow vs Repaint Trigger Table for a related task: Property changes can invalidate different rendering stages.
Use content-visibility:auto Render Skip Note for a related task: Content visibility can allow a browser to skip eligible rendering work.
References
Similar or alternative tools
- Reflow vs Repaint Trigger Table
Property changes can invalidate different rendering stages.
- content-visibility:auto Render Skip Note
Content visibility can allow a browser to skip eligible rendering work.