예제 #1
0
void ElementRuleCollector::sortAndTransferMatchedRules() {
  if (m_matchedRules.isEmpty())
    return;

  sortMatchedRules();

  if (m_mode == SelectorChecker::CollectingStyleRules) {
    for (unsigned i = 0; i < m_matchedRules.size(); ++i)
      ensureStyleRuleList()->append(m_matchedRules[i].ruleData()->rule());
    return;
  }

  if (m_mode == SelectorChecker::CollectingCSSRules) {
    for (unsigned i = 0; i < m_matchedRules.size(); ++i)
      appendCSSOMWrapperForRule(
          const_cast<CSSStyleSheet*>(m_matchedRules[i].parentStyleSheet()),
          m_matchedRules[i].ruleData()->rule());
    return;
  }

  // Now transfer the set of matched rules over to our list of declarations.
  for (unsigned i = 0; i < m_matchedRules.size(); i++) {
    const RuleData* ruleData = m_matchedRules[i].ruleData();
    m_result.addMatchedProperties(
        &ruleData->rule()->properties(), ruleData->linkMatchType(),
        ruleData->propertyWhitelist(m_matchingUARules));
  }
}
void ElementRuleCollector::sortAndTransferMatchedRules()
{
    if (!m_matchedRules || m_matchedRules->isEmpty())
        return;

    sortMatchedRules();

    Vector<MatchedRule, 32>& matchedRules = *m_matchedRules;
    if (m_mode == SelectorChecker::CollectingStyleRules) {
        for (unsigned i = 0; i < matchedRules.size(); ++i)
            ensureStyleRuleList()->m_list.append(matchedRules[i].ruleData()->rule());
        return;
    }

    if (m_mode == SelectorChecker::CollectingCSSRules) {
        for (unsigned i = 0; i < matchedRules.size(); ++i)
            appendCSSOMWrapperForRule(matchedRules[i].ruleData()->rule());
        return;
    }

    // Now transfer the set of matched rules over to our list of declarations.
    for (unsigned i = 0; i < matchedRules.size(); i++) {
        // FIXME: Matching should not modify the style directly.
        const RuleData* ruleData = matchedRules[i].ruleData();
        if (m_style && ruleData->containsUncommonAttributeSelector())
            m_style->setUnique();
        m_result.addMatchedProperties(ruleData->rule()->properties(), ruleData->rule(), ruleData->linkMatchType(), ruleData->propertyWhitelistType(m_matchingUARules));
    }
}
예제 #3
0
void ElementRuleCollector::sortAndTransferMatchedRules()
{
    if (!m_matchedRules || m_matchedRules->isEmpty())
        return;

    sortMatchedRules();

    Vector<MatchedRule, 32>& matchedRules = *m_matchedRules;

    // Now transfer the set of matched rules over to our list of declarations.
    for (unsigned i = 0; i < matchedRules.size(); i++) {
        const RuleData* ruleData = matchedRules[i].ruleData();
        m_result.addMatchedProperties(&ruleData->rule()->properties());
    }
}
예제 #4
0
void ElementRuleCollector::sortAndTransferMatchedRules()
{
    if (m_matchedRules.isEmpty())
        return;

    sortMatchedRules();

    if (m_mode == SelectorChecker::Mode::CollectingRules) {
        for (const MatchedRule& matchedRule : m_matchedRules)
            m_matchedRuleList.append(matchedRule.ruleData->rule());
        return;
    }

    for (const MatchedRule& matchedRule : m_matchedRules) {
        m_result.addMatchedProperties(matchedRule.ruleData->rule()->properties(), matchedRule.ruleData->rule(), matchedRule.ruleData->linkMatchType(), matchedRule.ruleData->propertyWhitelistType(), matchedRule.treeContextOrdinal);
    }
}
예제 #5
0
void ElementRuleCollector::sortAndTransferMatchedRules()
{
    if (m_matchedRules.isEmpty())
        return;

    sortMatchedRules();

    if (m_mode == SelectorChecker::Mode::CollectingRules) {
        for (const MatchedRule& matchedRule : m_matchedRules)
            m_matchedRuleList.append(matchedRule.ruleData->rule());
        return;
    }

    // Now transfer the set of matched rules over to our list of declarations.
    for (const MatchedRule& matchedRule : m_matchedRules) {
        if (m_style && matchedRule.ruleData->containsUncommonAttributeSelector())
            m_style->setUnique();
        m_result.addMatchedProperties(matchedRule.ruleData->rule()->properties(), matchedRule.ruleData->rule(), matchedRule.ruleData->linkMatchType(), matchedRule.ruleData->propertyWhitelistType());
    }
}
예제 #6
0
void ElementRuleCollector::sortAndTransferMatchedRules()
{
    if (!m_matchedRules || m_matchedRules->isEmpty())
        return;

    sortMatchedRules();

    Vector<const RuleData*, 32>& matchedRules = *m_matchedRules;
    if (m_mode == SelectorChecker::CollectingRules) {
        for (unsigned i = 0; i < matchedRules.size(); ++i)
            m_matchedRuleList.append(matchedRules[i]->rule());
        return;
    }

    // Now transfer the set of matched rules over to our list of declarations.
    for (unsigned i = 0; i < matchedRules.size(); i++) {
        if (m_style && matchedRules[i]->containsUncommonAttributeSelector())
            m_style->setUnique();
        m_result.addMatchedProperties(matchedRules[i]->rule()->properties(), matchedRules[i]->rule(), matchedRules[i]->linkMatchType(), matchedRules[i]->propertyWhitelistType(MatchingUARulesScope::isMatchingUARules()));
    }
}