Refactor to share code for determining whether style recalc is needed.

Fixed bug in which computed style would be incorrect after a change in shadow distribution.

BUG=335247

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

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