Changeset 216071 in webkit


Ignore:
Timestamp:
May 2, 2017 9:22:53 AM (7 years ago)
Author:
Ryan Haddad
Message:

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

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r216069 r216071  
     12017-05-02  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r216069.
     4
     5        This change broke the build.
     6
     7        Reverted changeset:
     8
     9        "Document style resolvers should share user rulesets"
     10        https://bugs.webkit.org/show_bug.cgi?id=171549
     11        http://trac.webkit.org/changeset/216069
     12
    1132017-05-02  Antti Koivisto  <antti@apple.com>
    214
  • trunk/Source/WebCore/css/DocumentRuleSets.cpp

    r216069 r216071  
    3838namespace WebCore {
    3939
    40 DocumentRuleSets::DocumentRuleSets(StyleResolver& styleResolver)
    41     : m_styleResolver(styleResolver)
     40DocumentRuleSets::DocumentRuleSets()
    4241{
    4342    m_authorStyle = std::make_unique<RuleSet>();
     
    4746DocumentRuleSets::~DocumentRuleSets()
    4847{
    49 }
    50 
    51 RuleSet* DocumentRuleSets::userStyle() const
    52 {
    53     if (m_usesSharedUserStyle)
    54         return m_styleResolver.document().styleScope().resolver().ruleSets().userStyle();
    55     return m_userStyle.get();
    5648}
    5749
     
    121113    if (m_authorStyle)
    122114        m_features.add(m_authorStyle->features());
    123     if (auto* userStyle = this->userStyle())
    124         m_features.add(userStyle->features());
     115    if (m_userStyle)
     116        m_features.add(m_userStyle->features());
    125117
    126118    m_siblingRuleSet = makeRuleSet(m_features.siblingRules);
  • trunk/Source/WebCore/css/DocumentRuleSets.h

    r216069 r216071  
    4141class DocumentRuleSets {
    4242public:
    43     DocumentRuleSets(StyleResolver&);
     43    DocumentRuleSets();
    4444    ~DocumentRuleSets();
    45 
     45   
    4646    bool isAuthorStyleDefined() const { return m_isAuthorStyleDefined; }
    4747    RuleSet& authorStyle() const { return *m_authorStyle.get(); }
    48     RuleSet* userStyle() const;
     48    RuleSet* userStyle() const { return m_userStyle.get(); }
    4949    const RuleFeatureSet& features() const;
    5050    RuleSet* sibling() const { return m_siblingRuleSet.get(); }
     
    6060    const AttributeRules* ancestorAttributeRulesForHTML(const AtomicString&) const;
    6161
    62     void setUsesSharedUserStyle(bool b) { m_usesSharedUserStyle = true; }
    6362    void initUserStyle(ExtensionStyleSheets&, const MediaQueryEvaluator&, StyleResolver&);
    64 
    6563    void resetAuthorStyle();
    6664    void appendAuthorStyleSheets(const Vector<RefPtr<CSSStyleSheet>>&, MediaQueryEvaluator*, InspectorCSSOMWrappers&, StyleResolver*);
     
    7573    std::unique_ptr<RuleSet> m_authorStyle;
    7674    std::unique_ptr<RuleSet> m_userStyle;
    77     bool m_usesSharedUserStyle { false };
    7875
    79     StyleResolver& m_styleResolver;
    8076    mutable RuleFeatureSet m_features;
    8177    mutable unsigned m_defaultStyleVersionOnFeatureCollection { 0 };
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r216069 r216071  
    229229
    230230StyleResolver::StyleResolver(Document& document)
    231     : m_ruleSets(*this)
    232     , m_matchedPropertiesCacheAdditionsSinceLastSweep(0)
     231    : m_matchedPropertiesCacheAdditionsSinceLastSweep(0)
    233232    , m_matchedPropertiesCacheSweepTimer(*this, &StyleResolver::sweepMatchedPropertiesCache)
    234233    , m_document(document)
     
    269268    m_ruleSets.resetAuthorStyle();
    270269
     270    m_ruleSets.initUserStyle(m_document.extensionStyleSheets(), m_mediaQueryEvaluator, *this);
     271
    271272#if ENABLE(SVG_FONTS)
    272273    if (m_document.svgExtensions()) {
     
    276277    }
    277278#endif
    278 }
    279 
    280 void StyleResolver::initializeUserStyle()
    281 {
    282     m_ruleSets.initUserStyle(m_document.extensionStyleSheets(), m_mediaQueryEvaluator, *this);
    283279}
    284280
  • trunk/Source/WebCore/css/StyleResolver.h

    r216069 r216071  
    153153    const Settings& settings() const { return m_document.settings(); }
    154154
    155     void initializeUserStyle();
    156155    void appendAuthorStyleSheets(const Vector<RefPtr<CSSStyleSheet>>&);
    157156
  • trunk/Source/WebCore/style/StyleScope.cpp

    r216069 r216071  
    9797        SetForScope<bool> isUpdatingStyleResolver { m_isUpdatingStyleResolver, true };
    9898        m_resolver = std::make_unique<StyleResolver>(m_document);
    99 
    100         if (!m_shadowRoot)
    101             m_resolver->initializeUserStyle();
    102         else if (m_shadowRoot->mode() != ShadowRootMode::UserAgent)
    103             m_resolver->ruleSets().setUsesSharedUserStyle();
    104 
    10599        m_resolver->appendAuthorStyleSheets(m_activeStyleSheets);
    106100    }
Note: See TracChangeset for help on using the changeset viewer.