Avoid unnecessary invalidation scheduling.

This is a reland of https://codereview.chromium.org/1514733002 without
the removal of an assumed-to-be SubtreeStyleChange for attribute changes
when you have a null style resolver, which turned out to cause asserts.

We skip scheduling invalidation sets for an element when:

* StyleResolver is null
* Element is not inActiveDocument()
* Element does not have a parent
* Element parent has SubtreeStyleChange or ReattachStyleChange

Additionally we skip descendant invalidations when:

* Element has SubtreeStyleChange or ReattachStyleChange

and sibling invalidations when:

* Element.nextSibling is null

R=ruuda@google.com
BUG=557440

Review URL: https://codereview.chromium.org/1560693002

Cr-Commit-Position: refs/heads/master@{#367617}
5 files changed