Avoid unnecessary style recalc for subtree of focused element.

*** Relanding https://codereview.chromium.org/135183002/

Updating the styles for an element that changes its focus state only needs to
force a recalc of the subtree if the subtree contains an element that could
match a selector which contains a :focus pseudo class left of child or
descendant combinator. At the same time, that :focus pseudo must match the
element we are updating focus state for. This is indicated by the return value
of Element::childrenAffectedByFocus.

This change does a LocalStyleChange when updating the focus state of an
element which returns false for childrenAffectedByFocus, and
SubtreeStyleChange otherwise.

TBR=eseidel
BUG=315923

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167598 bbb929c8-8fbe-4397-9dbb-9b2b20218538
3 files changed
tree: b350207420084ff32ff05577eb1d4419a6379aea
  1. third_party/