Don't clear FontFaceCache if no @font-face were removed.

AnalyzedStyleUpdate will end up with a Reconstruct for the StyleResolver
and a if we remove stylesheets which do not contain @font-face rules and
don't contain any other rules that will cause dirtiesAllStyle() to be
true. Skip clearing the font cache in those cases.

As part of understanding how the AnalyzedStyleUpdate works, I wrote a few
unit tests for compareStyleSheets. This method looks fragile and doesn't
seem to work well when stylesheets are added and removed at the same time.
I haven't found a way to trigger a real bug yet, as we don't seem to be
using AnalyzedStyleUpdate for a case where the active stylesheet list
changes in a way that triggers this bug.

BUG=471079,475858

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

git-svn-id: svn://svn.chromium.org/blink/trunk@193625 bbb929c8-8fbe-4397-9dbb-9b2b20218538
6 files changed
tree: 56c4bb0c8b05b54bc7e90e109ba03626cb2b9e1d
  1. third_party/