Diff
Modified: trunk/Source/WebCore/ChangeLog (216070 => 216071)
--- trunk/Source/WebCore/ChangeLog 2017-05-02 14:33:57 UTC (rev 216070)
+++ trunk/Source/WebCore/ChangeLog 2017-05-02 16:22:53 UTC (rev 216071)
@@ -1,3 +1,15 @@
+2017-05-02 Ryan Haddad <ryanhad...@apple.com>
+
+ Unreviewed, rolling out r216069.
+
+ This change broke the build.
+
+ Reverted changeset:
+
+ "Document style resolvers should share user rulesets"
+ https://bugs.webkit.org/show_bug.cgi?id=171549
+ http://trac.webkit.org/changeset/216069
+
2017-05-02 Antti Koivisto <an...@apple.com>
Document style resolvers should share user rulesets
Modified: trunk/Source/WebCore/css/DocumentRuleSets.cpp (216070 => 216071)
--- trunk/Source/WebCore/css/DocumentRuleSets.cpp 2017-05-02 14:33:57 UTC (rev 216070)
+++ trunk/Source/WebCore/css/DocumentRuleSets.cpp 2017-05-02 16:22:53 UTC (rev 216071)
@@ -37,8 +37,7 @@
namespace WebCore {
-DocumentRuleSets::DocumentRuleSets(StyleResolver& styleResolver)
- : m_styleResolver(styleResolver)
+DocumentRuleSets::DocumentRuleSets()
{
m_authorStyle = std::make_unique<RuleSet>();
m_authorStyle->disableAutoShrinkToFit();
@@ -48,13 +47,6 @@
{
}
-RuleSet* DocumentRuleSets::userStyle() const
-{
- if (m_usesSharedUserStyle)
- return m_styleResolver.document().styleScope().resolver().ruleSets().userStyle();
- return m_userStyle.get();
-}
-
void DocumentRuleSets::initUserStyle(ExtensionStyleSheets& extensionStyleSheets, const MediaQueryEvaluator& medium, StyleResolver& resolver)
{
auto tempUserStyle = std::make_unique<RuleSet>();
@@ -120,8 +112,8 @@
if (m_authorStyle)
m_features.add(m_authorStyle->features());
- if (auto* userStyle = this->userStyle())
- m_features.add(userStyle->features());
+ if (m_userStyle)
+ m_features.add(m_userStyle->features());
m_siblingRuleSet = makeRuleSet(m_features.siblingRules);
m_uncommonAttributeRuleSet = makeRuleSet(m_features.uncommonAttributeRules);
Modified: trunk/Source/WebCore/css/DocumentRuleSets.h (216070 => 216071)
--- trunk/Source/WebCore/css/DocumentRuleSets.h 2017-05-02 14:33:57 UTC (rev 216070)
+++ trunk/Source/WebCore/css/DocumentRuleSets.h 2017-05-02 16:22:53 UTC (rev 216071)
@@ -40,12 +40,12 @@
class DocumentRuleSets {
public:
- DocumentRuleSets(StyleResolver&);
+ DocumentRuleSets();
~DocumentRuleSets();
-
+
bool isAuthorStyleDefined() const { return m_isAuthorStyleDefined; }
RuleSet& authorStyle() const { return *m_authorStyle.get(); }
- RuleSet* userStyle() const;
+ RuleSet* userStyle() const { return m_userStyle.get(); }
const RuleFeatureSet& features() const;
RuleSet* sibling() const { return m_siblingRuleSet.get(); }
RuleSet* uncommonAttribute() const { return m_uncommonAttributeRuleSet.get(); }
@@ -59,9 +59,7 @@
};
const AttributeRules* ancestorAttributeRulesForHTML(const AtomicString&) const;
- void setUsesSharedUserStyle(bool b) { m_usesSharedUserStyle = true; }
void initUserStyle(ExtensionStyleSheets&, const MediaQueryEvaluator&, StyleResolver&);
-
void resetAuthorStyle();
void appendAuthorStyleSheets(const Vector<RefPtr<CSSStyleSheet>>&, MediaQueryEvaluator*, InspectorCSSOMWrappers&, StyleResolver*);
@@ -74,9 +72,7 @@
bool m_isAuthorStyleDefined { false };
std::unique_ptr<RuleSet> m_authorStyle;
std::unique_ptr<RuleSet> m_userStyle;
- bool m_usesSharedUserStyle { false };
- StyleResolver& m_styleResolver;
mutable RuleFeatureSet m_features;
mutable unsigned m_defaultStyleVersionOnFeatureCollection { 0 };
mutable std::unique_ptr<RuleSet> m_siblingRuleSet;
Modified: trunk/Source/WebCore/css/StyleResolver.cpp (216070 => 216071)
--- trunk/Source/WebCore/css/StyleResolver.cpp 2017-05-02 14:33:57 UTC (rev 216070)
+++ trunk/Source/WebCore/css/StyleResolver.cpp 2017-05-02 16:22:53 UTC (rev 216071)
@@ -228,8 +228,7 @@
}
StyleResolver::StyleResolver(Document& document)
- : m_ruleSets(*this)
- , m_matchedPropertiesCacheAdditionsSinceLastSweep(0)
+ : m_matchedPropertiesCacheAdditionsSinceLastSweep(0)
, m_matchedPropertiesCacheSweepTimer(*this, &StyleResolver::sweepMatchedPropertiesCache)
, m_document(document)
, m_matchAuthorAndUserStyles(m_document.settings().authorAndUserStylesEnabled())
@@ -268,6 +267,8 @@
m_ruleSets.resetAuthorStyle();
+ m_ruleSets.initUserStyle(m_document.extensionStyleSheets(), m_mediaQueryEvaluator, *this);
+
#if ENABLE(SVG_FONTS)
if (m_document.svgExtensions()) {
const HashSet<SVGFontFaceElement*>& svgFontFaceElements = m_document.svgExtensions()->svgFontFaceElements();
@@ -277,11 +278,6 @@
#endif
}
-void StyleResolver::initializeUserStyle()
-{
- m_ruleSets.initUserStyle(m_document.extensionStyleSheets(), m_mediaQueryEvaluator, *this);
-}
-
void StyleResolver::appendAuthorStyleSheets(const Vector<RefPtr<CSSStyleSheet>>& styleSheets)
{
m_ruleSets.appendAuthorStyleSheets(styleSheets, &m_mediaQueryEvaluator, m_inspectorCSSOMWrappers, this);
Modified: trunk/Source/WebCore/css/StyleResolver.h (216070 => 216071)
--- trunk/Source/WebCore/css/StyleResolver.h 2017-05-02 14:33:57 UTC (rev 216070)
+++ trunk/Source/WebCore/css/StyleResolver.h 2017-05-02 16:22:53 UTC (rev 216071)
@@ -152,7 +152,6 @@
const Document& document() const { return m_document; }
const Settings& settings() const { return m_document.settings(); }
- void initializeUserStyle();
void appendAuthorStyleSheets(const Vector<RefPtr<CSSStyleSheet>>&);
DocumentRuleSets& ruleSets() { return m_ruleSets; }
Modified: trunk/Source/WebCore/style/StyleScope.cpp (216070 => 216071)
--- trunk/Source/WebCore/style/StyleScope.cpp 2017-05-02 14:33:57 UTC (rev 216070)
+++ trunk/Source/WebCore/style/StyleScope.cpp 2017-05-02 16:22:53 UTC (rev 216071)
@@ -96,12 +96,6 @@
if (!m_resolver) {
SetForScope<bool> isUpdatingStyleResolver { m_isUpdatingStyleResolver, true };
m_resolver = std::make_unique<StyleResolver>(m_document);
-
- if (!m_shadowRoot)
- m_resolver->initializeUserStyle();
- else if (m_shadowRoot->mode() != ShadowRootMode::UserAgent)
- m_resolver->ruleSets().setUsesSharedUserStyle();
-
m_resolver->appendAuthorStyleSheets(m_activeStyleSheets);
}
ASSERT(!m_shadowRoot || &m_document == &m_shadowRoot->document());