• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/WebCore-7600.1.25/css/

Lines Matching defs:selector

161 // * SelectorMatches          - the selector matches the element e
162 // * SelectorFailsLocally - the selector fails for the element e
163 // * SelectorFailsAllSiblings - the selector fails for e and any sibling of e
164 // * SelectorFailsCompletely - the selector fails for e and any sibling or ancestor of e
167 // The first selector has to match.
171 if (context.selector->m_match == CSSSelector::PseudoElement) {
172 if (context.selector->isCustomPseudoElement()) {
174 if (context.element->shadowPseudoId() != context.selector->value())
177 if (context.selector->pseudoElementType() == CSSSelector::PseudoElementWebKitCustom && root->type() != ShadowRoot::UserAgentShadowRoot)
186 PseudoId pseudoId = m_mode == Mode::StyleInvalidation ? NOPSEUDO : CSSSelector::pseudoId(context.selector->pseudoElementType());
193 CSSSelector::Relation relation = context.selector->relation();
195 // Prepare next selector
196 const CSSSelector* historySelector = context.selector->tagHistory();
201 nextContext.selector = historySelector;
205 // Bail-out if this selector is irrelevant for the pseudoId
219 nextContext.firstSelectorOfTheFragment = nextContext.selector;
233 nextContext.firstSelectorOfTheFragment = nextContext.selector;
249 nextContext.firstSelectorOfTheFragment = nextContext.selector;
259 nextContext.firstSelectorOfTheFragment = nextContext.selector;
269 // a selector is invalid if something follows a pseudo-element
276 && !(nextContext.hasScrollbarPseudo && nextContext.selector->m_match == CSSSelector::PseudoClass))
286 nextContext.firstSelectorOfTheFragment = nextContext.selector;
359 static bool anyAttributeMatches(Element* element, const CSSSelector* selector, const QualifiedName& selectorAttr, bool caseSensitive)
363 if (!attribute.matches(selectorAttr.prefix(), element->isHTMLElement() ? selector->attributeCanonicalLocalName() : selectorAttr.localName(), selectorAttr.namespaceURI()))
366 if (attributeValueMatches(attribute, static_cast<CSSSelector::Match>(selector->m_match), selector->value(), caseSensitive))
376 // In quirks mode, a compound selector 'selector' that matches the following conditions must not match elements that would not also match the ':any-link' selector.
378 // selector uses the ':active' or ':hover' pseudo-classes.
379 // selector does not use a type selector.
380 // selector does not use an attribute selector.
381 // selector does not use an ID selector.
382 // selector does not use a class selector.
383 // selector does not use a pseudo-class selector other than ':active' and ':hover'.
384 // selector does not use a pseudo-element selector.
385 // selector is not part of an argument to a functional pseudo-class or pseudo-element.
389 for (const CSSSelector* selector = context.firstSelectorOfTheFragment; selector; selector = selector->tagHistory()) {
390 switch (selector->m_match) {
392 if (selector->tagQName() != anyQName())
396 CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType();
418 CSSSelector::Relation relation = selector->relation();
431 const CSSSelector* const & selector = context.selector;
433 ASSERT(selector);
435 if (selector->m_match == CSSSelector::Tag)
436 return SelectorChecker::tagMatches(element, selector->tagQName());
438 if (selector->m_match == CSSSelector::Class)
439 return element->hasClass() && element->classNames().contains(selector->value());
441 if (selector->m_match == CSSSelector::Id)
442 return element->hasID() && element->idForStyleResolution() == selector->value();
444 if (selector->isAttributeSelector()) {
448 const QualifiedName& attr = selector->attribute();
451 if (!anyAttributeMatches(element, selector, attr, caseSensitive))
455 if (selector->m_match == CSSSelector::PseudoClass) {
457 if (selector->pseudoClassType() == CSSSelector::PseudoClassNot) {
458 const CSSSelectorList* selectorList = selector->selectorList();
460 // FIXME: We probably should fix the parser and make it never produce :not rules with missing selector list.
467 for (subContext.selector = selectorList->first(); subContext.selector; subContext.selector = subContext.selector->tagHistory()) {
468 if (subContext.selector->m_match == CSSSelector::PseudoClass) {
472 ASSERT(subContext.selector->pseudoClassType() != CSSSelector::PseudoClassNot);
474 if (subContext.selector->pseudoClassType() == CSSSelector::PseudoClassVisited || (subContext.selector->pseudoClassType() == CSSSelector::PseudoClassLink && subContext.visitedMatchType == VisitedMatchEnabled))
483 return checkScrollbarPseudoClass(context, &element->document(), selector);
485 if (selector->pseudoClassType() == CSSSelector::PseudoClassWindowInactive)
490 switch (selector->pseudoClassType()) {
581 // FIXME: This selector is very slow.
593 if (!selector->parseNth())
605 if (selector->matchNth(count))
610 if (!selector->parseNth())
617 if (selector->matchNth(count))
622 if (!selector->parseNth())
630 if (selector->matchNth(count))
635 if (!selector->parseNth())
644 if (selector->matchNth(count))
657 for (subContext.selector = selector->selectorList()->first(); subContext.selector; subContext.selector = CSSSelectorList::next(subContext.selector)) {
658 subContext.firstSelectorOfTheFragment = subContext.selector;
739 const AtomicString& argument = selector->argument();
799 else if (selector->m_match == CSSSelector::PseudoElement && selector->pseudoElementType() == CSSSelector::PseudoElementCue) {
803 const CSSSelector* const & selector = context.selector;
804 for (subContext.selector = selector->selectorList()->first(); subContext.selector; subContext.selector = CSSSelectorList::next(subContext.selector)) {
805 subContext.firstSelectorOfTheFragment = subContext.selector;
817 bool SelectorChecker::checkScrollbarPseudoClass(const SelectorCheckingContext& context, Document* document, const CSSSelector* selector) const
819 ASSERT(selector->m_match == CSSSelector::PseudoClass);
826 if (selector->pseudoClassType() == CSSSelector::PseudoClassWindowInactive)
832 switch (selector->pseudoClassType()) {
899 unsigned SelectorChecker::determineLinkMatchType(const CSSSelector* selector)
903 // Statically determine if this selector will match a link in visited, unvisited or any state, or never.
905 for (; selector; selector = selector->tagHistory()) {
906 if (selector->m_match == CSSSelector::PseudoClass) {
907 switch (selector->pseudoClassType()) {
911 const CSSSelectorList* selectorList = selector->selectorList();
937 CSSSelector::Relation relation = selector->relation();