Clear need for animation style for forced styleForElement.

When style recalc for an element is triggered by a StyleRecalcChange from
the ancestors, we need to clear the m_animationStyleChange flag on
ElementAnimations if set since the baseLayoutStyle cannot be used. This
is normally done from Element::recalcStyle just before recalcOwnStyle is
called.

Document::inheritHtmlAndBodyElementStyles does styleForElement outside of
the recalcStyle machinery and didn't clear this flag which caused an
assert for baseLayoutStyle comparison.

In particular, the case was that while an animation was running on body,
attempting to load an @font-face would trigger a version increase in the
font cache and a SubtreeStyleChange for the document, while we still tried
to use the baseLayoutStyle for the animating body because we ignored the
Force passed to inheritHtmlAndBodyElementStyles.

Comparing the baseLayoutStyle with the LayoutStyle created from scratch
would cause comparison to fail, due to a Font comparison fail because of
the increased font cache version number, which in turn caused the assert
to trigger.

R=esprehn@chromium.org,dstockwell@chromium.org
BUG=459661

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

git-svn-id: svn://svn.chromium.org/blink/trunk@192241 bbb929c8-8fbe-4397-9dbb-9b2b20218538
5 files changed
tree: 71098d0bc6114ff524ef97262ecc4cd0c82be9a2
  1. third_party/