Re:On Layout and Web Performance
by kevin_rubyhouse on Monday January 28, 2013 @03:35PM
(#5130488)
Why does Element.innerText cause the browser to "layout?" The author said he might explain this in another article.
[ Parent
| on HN ]
You are going to make me give away my future punchline. ;-) The short story is that innerText will include the line breaks that are introduced by text layout. A lot of people call innerText when what they actually want is textContent (which doesn't layout because is just a concatenation of the descendent text nodes)