Avoid calling markAncestorsWithChildNeedsStyleRecalc() constantly in childrenChanged

This shows up in the Shadow DOM benchmark where childrenChanged is 2% of
the profile because we're calling into inActiveDocument() which is not
inline and then doing markAncestorsWithChildNeedsStyleRecalc() which is
also not inline without checking if the ancestor marking is actually needed.

markAncestorsWithChildNeedsStyleRecalc() also blindly calls
document().scheduleRenderTreeUpdate() which is not inline and does a bunch
of work.

This patch fixes the checks in ::childrenChanged to check the childNeedsStyleRecalc()
bit before calling markAncestorsWithChildNeedsStyleRecalc. This is equivalent to
checking inActiveDocument() as well since all nodes not in the tree have this bit set,
and all nodes in an inactive document will also have this bit set, so we'd never call
into markAncestorsWithChildNeedsStyleRecalc() in those trees.

It also adds an early  out so we don't call into scheduleRenderTreeUpdate() so often
when invalidating  style.

R=eseidel@chromium.org,abarth@chromium.org
BUG=357087

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

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