Don't invalidate style when adding classes that don't match rules

r133214 caused a regression by making us mark elements for style recalc
when adding new classes that don't match any rules due to a logic error
in checkSelectorForClassChange. This patch corrects the logic error so
that now adding and removing class names that don't match rules will
not trigger a style recalc.

To facilitate testing this patch I added a new Internals API:
updateStyleAndReturnAffectedElementCount(). It updates the style of the document
and returns the number of elements that had a style computed for them. This
will also allow writing future tests when we make things smarter to avoid
recalcs.

BUG=316500

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

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