X-Git-Url: https://git.webkit.org/?p=WebKit.git;a=blobdiff_plain;f=Source%2FWebCore%2Fcss%2FCSSStyleSelector.h;h=a89c080bf733c311093736b66da3a5d7492ccb9e;hp=cfde5d0e9d8c183e1c8a74d42df4995a4329a3cc;hb=e7457c485f22847ae0e53f2085889bd9a7ce7a35;hpb=4b97bd1fe03f970c7dfa32f00f6ccce1cd69eb53;ds=sidebyside diff --git a/Source/WebCore/css/CSSStyleSelector.h b/Source/WebCore/css/CSSStyleSelector.h index cfde5d0e9d8c..a89c080bf733 100644 --- a/Source/WebCore/css/CSSStyleSelector.h +++ b/Source/WebCore/css/CSSStyleSelector.h @@ -27,6 +27,7 @@ #include "LinkHash.h" #include "MediaQueryExp.h" #include "RenderStyle.h" +#include #include #include #include @@ -89,6 +90,10 @@ public: CSSStyleSheet* pageUserSheet, const Vector >* pageGroupUserSheets, bool strictParsing, bool matchAuthorAndUserStyles); ~CSSStyleSelector(); + + // Using these during tree walk will allow style selector to optimize child and descendant selector lookups. + void pushParent(Element* parent); + void popParent(Element* parent); PassRefPtr styleForElement(Element* e, RenderStyle* parentStyle = 0, bool allowSharing = true, bool resolveForRootDefault = false, bool matchVisitedPseudoClass = false); @@ -186,6 +191,7 @@ public: void matchRules(RuleSet*, int& firstRuleIndex, int& lastRuleIndex, bool includeEmptyRules); void matchRulesForList(const Vector*, int& firstRuleIndex, int& lastRuleIndex, bool includeEmptyRules); + bool fastRejectSelector(const RuleData&) const; void sortMatchedRules(unsigned start, unsigned end); template @@ -203,6 +209,17 @@ public: OwnPtr m_siblingRules; HashSet m_idsInRules; + + struct ParentStackFrame { + ParentStackFrame(Element* element) : element(element) {} + Element* element; + Vector identifierHashes; + }; + Vector m_parentStack; + + // With 100 unique strings in the filter, 2^12 slot table has false positive rate of ~0.2%. + static const unsigned bloomFilterKeyBits = 12; + OwnPtr > m_ancestorIdentifierFilter; bool m_hasUAAppearance; BorderData m_borderData;