Changeset 198553 in webkit


Ignore:
Timestamp:
Mar 22, 2016 2:31:16 PM (8 years ago)
Author:
Antti Koivisto
Message:

Non-const DocumentRuleSets::features() does not check default style version
https://bugs.webkit.org/show_bug.cgi?id=155766

Reviewed by Andreas Kling.

This may leave it out of date when the default stylesheet expands.

No test, don't know how to hit this with current codebase. With some further optimizations
it starts affecting some tests involving UA media control stylesheets.

  • css/DocumentRuleSets.h:

(WebCore::DocumentRuleSets::mutableFeatures):

Check the default style version number in non-const case too.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r198551 r198553  
     12016-03-22  Antti Koivisto  <antti@apple.com>
     2
     3        Non-const DocumentRuleSets::features() does not check default style version
     4        https://bugs.webkit.org/show_bug.cgi?id=155766
     5
     6        Reviewed by Andreas Kling.
     7
     8        This may leave it out of date when the default stylesheet expands.
     9
     10        No test, don't know how to hit this with current codebase. With some further optimizations
     11        it starts affecting some tests involving UA media control stylesheets.
     12
     13        * css/DocumentRuleSets.h:
     14        (WebCore::DocumentRuleSets::mutableFeatures):
     15
     16            Check the default style version number in non-const case too.
     17
    1182016-03-22  Daniel Bates  <dabates@apple.com>
    219
  • trunk/Source/WebCore/css/DocumentRuleSets.h

    r196629 r198553  
    4747    RuleSet* authorStyle() const { return m_authorStyle.get(); }
    4848    RuleSet* userStyle() const { return m_userStyle.get(); }
    49     RuleFeatureSet& features() { return m_features; }
    5049    const RuleFeatureSet& features() const;
    5150    RuleSet* sibling() const { return m_siblingRuleSet.get(); }
     
    6261    void resetAuthorStyle();
    6362    void appendAuthorStyleSheets(const Vector<RefPtr<CSSStyleSheet>>&, MediaQueryEvaluator*, InspectorCSSOMWrappers&, StyleResolver*);
     63
     64    RuleFeatureSet& mutableFeatures();
    6465
    6566private:
     
    8586}
    8687
     88// FIXME: There should be just the const version.
     89inline RuleFeatureSet& DocumentRuleSets::mutableFeatures()
     90{
     91    if (m_defaultStyleVersionOnFeatureCollection < CSSDefaultStyleSheets::defaultStyleVersion)
     92        collectFeatures();
     93    return m_features;
     94}
     95
    8796} // namespace WebCore
    8897
  • trunk/Source/WebCore/css/StyleBuilderCustom.h

    r196991 r198553  
    13461346            didSet = true;
    13471347            // Register the fact that the attribute value affects the style.
    1348             styleResolver.ruleSets().features().attributeCanonicalLocalNamesInRules.add(attr.localName().impl());
    1349             styleResolver.ruleSets().features().attributeLocalNamesInRules.add(attr.localName().impl());
     1348            styleResolver.ruleSets().mutableFeatures().attributeCanonicalLocalNamesInRules.add(attr.localName().impl());
     1349            styleResolver.ruleSets().mutableFeatures().attributeLocalNamesInRules.add(attr.localName().impl());
    13501350        } else if (contentValue.isCounter()) {
    13511351            Counter* counterValue = contentValue.getCounterValue();
     
    17161716
    17171717        // Register the fact that the attribute value affects the style.
    1718         styleResolver.ruleSets().features().attributeCanonicalLocalNamesInRules.add(attr.localName().impl());
    1719         styleResolver.ruleSets().features().attributeLocalNamesInRules.add(attr.localName().impl());
     1718        styleResolver.ruleSets().mutableFeatures().attributeCanonicalLocalNamesInRules.add(attr.localName().impl());
     1719        styleResolver.ruleSets().mutableFeatures().attributeLocalNamesInRules.add(attr.localName().impl());
    17201720    } else
    17211721        styleResolver.style()->setContentAltText(emptyAtom);
Note: See TracChangeset for help on using the changeset viewer.