Avoid unnecessary style recalc for subtree of focused element.

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 a 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.

BUG=315923

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

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