1

I read that it is sometimes a good idea to append DOM elements to a Document Fragment first in order to avoid reflow (https://developer.mozilla.org/de/docs/Web/API/Document/createDocumentFragment).

Working with SVG I am wondering whether there is a (performance) difference between appending all SVG elements before appending to the DOM tree to

  1. a Document Fragment
  2. a SVG group element (not yet appended to the DOM tree)

Maybe someone has a clue.

ekad
  • 14,436
  • 26
  • 44
  • 46
Daniel
  • 3,383
  • 4
  • 30
  • 61
  • My guess is that the question is answered by the more general question about appending to Document Fragment vs. parent element (not yet appended). – Daniel Jan 02 '16 at 09:15
  • SVG elements don't reflow. The article is talking about html elements. – Robert Longson Jan 02 '16 at 17:52
  • Thanks. That sounds sensible. So reflow is no worry. I guess one worry left might be (non-reflow) recalculations from the rendering of SVG elements. But my guess in that case a not yet appended group is as good as it gets. – Daniel Jan 02 '16 at 20:00

0 Answers0