Lines Matching refs:element

120 static bool rulesApplicableInCurrentTreeScope(const Element* element, const ContainerNode* scopingNode, SelectorChecker::BehaviorAtBoundary behaviorAtBoundary, bool elementApplyAuthorStyles)
122 TreeScope& treeScope = element->treeScope();
125 // b) element is allowed to apply author rules
131 // d) the rules comes from a scoped style sheet within an active shadow root whose host is the given element
132 if (element->isInShadowTree() && (behaviorAtBoundary & SelectorChecker::ScopeIsShadowHost) && scopingNode == element->containingShadowRoot()->host())
143 ASSERT(m_context.element());
145 Element& element = *m_context.element();
146 const AtomicString& pseudoId = element.shadowPseudoId();
148 ASSERT(element.isStyledElement());
152 if (element.isVTTElement())
158 // d) the rules comes from a scoped style sheet within an active shadow root whose host is the given element
161 if (!m_matchingUARules && !rulesApplicableInCurrentTreeScope(&element, matchRequest.scope, behaviorAtBoundary, matchRequest.elementApplyAuthorStyles))
166 if (element.hasID())
167 collectMatchingRulesForList(matchRequest.ruleSet->idRules(element.idForStyleResolution().impl()), behaviorAtBoundary, cascadeScope, cascadeOrder, matchRequest, ruleRange);
168 if (element.isStyledElement() && element.hasClass()) {
169 for (size_t i = 0; i < element.classNames().size(); ++i)
170 collectMatchingRulesForList(matchRequest.ruleSet->classRules(element.classNames()[i].impl()), behaviorAtBoundary, cascadeScope, cascadeOrder, matchRequest, ruleRange);
173 if (element.isLink())
175 if (SelectorChecker::matchesFocusPseudoClass(element))
177 collectMatchingRulesForList(matchRequest.ruleSet->tagRules(element.localName().impl()), behaviorAtBoundary, cascadeScope, cascadeOrder, matchRequest, ruleRange);
222 CSSStyleSheet* sheet = m_includeStyleSheet == IncludeStyleSheetInCSSOMWrapper ? findStyleSheet(m_context.element()->document().styleEngine(), rule) : 0;
269 ASSERT(m_context.element());
270 if (ruleData.hasRightmostSelectorMatchingHTMLBasedOnRuleHash() && m_context.element()->isHTMLElement()) {
274 if (ruleData.selector()->m_match == CSSSelector::Tag && !SelectorChecker::tagMatches(*m_context.element(), ruleData.selector()->tagQName()))
276 SelectorCheckerFastPath selectorCheckerFastPath(ruleData.selector(), *m_context.element());
284 SelectorChecker selectorChecker(m_context.element()->document(), m_mode);
285 SelectorChecker::SelectorCheckingContext context(ruleData.selector(), m_context.element(), SelectorChecker::VisitedMatchEnabled);
318 // we really just matched a pseudo-element.
383 // To check whether a given RuleSet has any rule matching a given element,
384 // should not see the element's treescope. Because RuleSet has no