Don't schedule invalidations when attributes changed if not needed or incorrect.

In particular, don't do it  when attributes changed if there
is no style resolver or the style change type is subtree or
greater. In both of these cases, it will either have no
additional effect or the code is incorrect.

It could be incorrect if the element was not yet attached.
It could be not needed because if there is no style resolver,
re-making it will recalc the whole document's style. Also,
style invalidation cannot trigger a style that is greater than
subtree.

Also clear style invalidation bits unconditionally in Node::detach.

BUG=366788

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

git-svn-id: svn://svn.chromium.org/blink/trunk@173665 bbb929c8-8fbe-4397-9dbb-9b2b20218538