diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-09 09:42:44 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-09 09:42:44 +0100 |
commit | a59391482883479a9b28a6f1ace6d1ebd08a7ecd (patch) | |
tree | fa539db054a20a67bff2fc891c33b0f4ec632916 /Source/WebCore/css/RuleFeature.cpp | |
parent | cfd86b747d32ac22246a1aa908eaa720c63a88c1 (diff) | |
download | qtwebkit-a59391482883479a9b28a6f1ace6d1ebd08a7ecd.tar.gz |
Imported WebKit commit 7bcdfab9a40db7d16b4b95bb77d78b8a59c9e701 (http://svn.webkit.org/repository/webkit/trunk@134025)
New snapshot with numerious build fixes, including MSVC 2012 and ARM Thumb-2.
Diffstat (limited to 'Source/WebCore/css/RuleFeature.cpp')
-rw-r--r-- | Source/WebCore/css/RuleFeature.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/WebCore/css/RuleFeature.cpp b/Source/WebCore/css/RuleFeature.cpp index b1f929687..1b11c8fae 100644 --- a/Source/WebCore/css/RuleFeature.cpp +++ b/Source/WebCore/css/RuleFeature.cpp @@ -29,6 +29,7 @@ #include "config.h" #include "RuleFeature.h" +#include "CSSSelector.h" #include "WebCoreMemoryInstrumentation.h" #include <wtf/MemoryInstrumentationHashMap.h> #include <wtf/MemoryInstrumentationHashSet.h> @@ -36,6 +37,27 @@ namespace WebCore { +void RuleFeatureSet::collectFeaturesFromSelector(const CSSSelector* selector) +{ + if (selector->m_match == CSSSelector::Id) + idsInRules.add(selector->value().impl()); + else if (selector->m_match == CSSSelector::Class) + classesInRules.add(selector->value().impl()); + else if (selector->isAttributeSelector()) + attrsInRules.add(selector->attribute().localName().impl()); + switch (selector->pseudoType()) { + case CSSSelector::PseudoFirstLine: + usesFirstLineRules = true; + break; + case CSSSelector::PseudoBefore: + case CSSSelector::PseudoAfter: + usesBeforeAfterRules = true; + break; + default: + break; + } +} + void RuleFeatureSet::add(const RuleFeatureSet& other) { HashSet<AtomicStringImpl*>::const_iterator end = other.idsInRules.end(); |