At what point in the parsing/rendering process is an HTML element assigned a box model?
P粉547420474
P粉547420474 2024-02-26 09:24:23
0
1
389

Is it during the build process of CSSOM (default padding/border/margin may be applied to all nodes)?

P粉547420474
P粉547420474

reply all(1)
P粉983021177

The

element's box is (re)computed in the so-called "Update Layout" phase, which is currently specified* to occur (at least) in the next "Update Rendering" event loop step, in substep 14:

But it can also be enforced synchronously when calling some getters.

*While this is a recent addition to the specification, not all browsers strictly adhere to it, for example, I know from experience that Safari does not wait for the next "paint frame" to perform this layout update , but just some free time.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template