Fix unhandled case in DSR computation + fixed couple unrelated bugs

* Unrelated: Don't clear TSR when dumping DOM for debugging.

* The DSR computation assumed that mw:Placeholder types are only
  added to meta-tags without any children. However, now that we
  are adding mw:Placeholder <span>s for bug workarounds, this can
  occasionally miss DSR computation when the <span> tag has
  child content.

  This can happen because of different conditions coming together
  when parsing es/Wikipedia:Taller_idiomático/Inglés (all of which
  are necessary for this bug to manifest).

  - a buggy template es:Template:purgar that has an unclosed
    span-tag
  - enclosing the transclusion of the above template in brackets
    that triggers the link handler "[{{purgar|Purgar esta página}}]"
  - unhandled case in the link handler that resorts to the workaround
    of wrapping the span with a mw:Placeholder.
  - a block tag on the same line as above content that prevents the
    span-tag from being enclosed in a p-tag and thus auto-closed
    "{{Wikipedia:Taller idiomático/Tabs}}[{{purgar|Purgar esta página}}]"

  This then leaves the unclosed <span> swallowing the content of the
  rest of the page into the span with the mw:Placeholder type.
  The rest of the page has several templates and code in tpl-encap
  that adds data-mw now bombs when it tries to access dsr info on
  the templates it encounters.

* This patch eliminates the crasher on the above page, but the RTing
  is buggy because of the unclosed span and DSR/encapsulation not
  handling that scenario correctly.  The correct fix would be to fix
  the source of the template rather than add workarounds in Parsoid.

* No change in parser test results.

Change-Id: I9750b7d139312081fa512c67ab3b96694574dd33
Merge "Fix unhandled case in DSR computation + fixed couple unrelated bugs"