Anonymous table cells - do they affect reflow / repaint performance?

A good old hack to clean micro clearfix is ​​based on the use of an empty table element to prevent collapse and clean floats. It mentions that this behavior creates anonymous table elements, since each HTML table needs those that exist by design, so as far as I know, the repaint loop has 6 new empty elements for each clearfixed element to process (table + anon row + anon cell * 2), Do they have any performance flaws during the reflow / repaint cycle? How would you test this?

.cf:before, .cf:after { content: " "; /* 1 */ display: table; /* 2 */ } .cf:after { clear: both; } 
+5
source share
1 answer

It does not pollute the DOM, but objects can be calculated for rendering purposes. Implementations may be able to optimize them.

But during the rendering process, all kinds of boxes are computed. There is no particular need to worry about this.

+2
source

Source: https://habr.com/ru/post/1202686/


All Articles