The DOM has two behaviors called reflow and repaint that will force its elements to be redrawn (colors, sizes). These behaviors are triggered whenever the “input information used to build the rendering tree” changes in the DOM (there is a nice description of all this: rendering: repaint, reflow / relayout, restyle )
For your question, when this is called, browsers will also try to extract src links, including javascript; therefore, we can dynamically embed scripts / link styles, and the DOM will execute it.
. , CSS , , . DOM , . src .