Re-attach whitespace children when removing DOM nodes.

When the display type changes for an element in the DOM tree, the
WhitespaceAttacher would re-attach whitespace siblings appropriately
when traversing the re-attached element.

When a DOM node is removed from the tree, there will be no layout tree
rebuild. Or, at least, the removed node will not be encountered by the
traversal to trigger a re-attachment of any following whitespace nodes.

In order to fix that, introduce a hash set which contains elements
which had one of their layout tree children removed since the last
layout tree update. In the next UpdateStyle mark these elements for
layout tree rebuild and let the WhitespaceAttacher check if any of its
whitespace children needs to be re-attached.

Bug: 763291, 762833, 364817
Change-Id: I4d1b3df10d07f549abfea17df0184beca0623ef7
Reviewed-on: https://chromium-review.googlesource.com/661957
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: nainar <nainar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502803}
72 files changed