Add version number for default stylesheet
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 Feb 2016 22:45:34 +0000 (22:45 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 Feb 2016 22:45:34 +0000 (22:45 +0000)
commit7259717c8d4830d12618feba68ebc0ccf179c262
tree237dececd1aad1afae62b19714d6cad2e09cb87f
parente97eea3ff84a39466a7a1de997b949ef6994796e
Add version number for default stylesheet
https://bugs.webkit.org/show_bug.cgi?id=154220

Reviewed by Ryosuke Niwa.

We currently fail to update RuleFeatureSets for shadow trees when the default stylesheet grows
(for example when media controls stylesheet is initialized).

No test since this is not causing known bugs. It is blocking optimizations in shadow trees that
rely on rule features being up-to-date.

* css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::loadSimpleDefaultStyle):
(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):

    Increment version number when the default stylesheet changes.

* css/CSSDefaultStyleSheets.h:
* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::appendAuthorStyleSheets):
(WebCore::DocumentRuleSets::collectFeatures):

    Store the current default stylesheet version number.

* css/DocumentRuleSets.h:
(WebCore::DocumentRuleSets::features):

    Collect features again if the default stylesheet has changed.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/CSSDefaultStyleSheets.cpp
Source/WebCore/css/CSSDefaultStyleSheets.h
Source/WebCore/css/DocumentRuleSets.cpp
Source/WebCore/css/DocumentRuleSets.h
Source/WebCore/css/StyleResolver.cpp