Rework pseudoStyleCacheIsInvalid to be simpler and more efficient

Simplify this function using iterators and passing the cache instead of
the style (which required sanity ASSERTs). Passing the cache also makes
the call site more clear.

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

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