Introduce Node::containingTreeScope(), which asserts that the node's root is a tree scope

The difference between Node::containingTreeScope() and Node::treeScope() is that
Node::containingTreeScope() asserts that the node is in a treeScope.
Node::treeScope() does not.

Replace some of the current usage of Node::treeScope() with
Node::containingTreeScope() if containingTreeScope() is better to express their
intention.

This CL also introduces Element::adjustedFocusedElementInTreeScope() to optimize
some code path where we can early exit if the element is not in a tree scope.

BUG=602556

Review-Url: https://codereview.chromium.org/1883083002
Cr-Commit-Position: refs/heads/master@{#397065}
12 files changed