StyleEngine should clear FontSelector before dying

CSSFontSelector can outlive Document and StyleEngine, so StyleEngine
should clean-up the FontSelector on destruction. Otherwise, FontSelector
can have a stale Document pointer.

This is a regression introduced by
https://src.chromium.org/viewvc/blink?view=rev&revision=163369.

BUG=336921

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165824 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Clear m_imageElements when it gets dirty.

Keeping out-of-date information is risky.

BUG=none
TEST=none; no behavior changes

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165825 bbb929c8-8fbe-4397-9dbb-9b2b20218538
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