| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1551 | 1551 |
| 1552 for (unsigned i = 0, size = ruleList->length(); i < size; ++i) { | 1552 for (unsigned i = 0, size = ruleList->length(); i < size; ++i) { |
| 1553 CSSStyleRule* rule = asCSSStyleRule(ruleList->item(i)); | 1553 CSSStyleRule* rule = asCSSStyleRule(ruleList->item(i)); |
| 1554 RefPtr<TypeBuilder::CSS::CSSRule> ruleObject = buildObjectForRule(rule,
styleResolver); | 1554 RefPtr<TypeBuilder::CSS::CSSRule> ruleObject = buildObjectForRule(rule,
styleResolver); |
| 1555 if (!ruleObject) | 1555 if (!ruleObject) |
| 1556 continue; | 1556 continue; |
| 1557 RefPtr<TypeBuilder::Array<int> > matchingSelectors = TypeBuilder::Array<
int>::create(); | 1557 RefPtr<TypeBuilder::Array<int> > matchingSelectors = TypeBuilder::Array<
int>::create(); |
| 1558 const CSSSelectorList& selectorList = rule->styleRule()->selectorList(); | 1558 const CSSSelectorList& selectorList = rule->styleRule()->selectorList(); |
| 1559 long index = 0; | 1559 long index = 0; |
| 1560 for (const CSSSelector* selector = selectorList.first(); selector; selec
tor = CSSSelectorList::next(selector)) { | 1560 for (const CSSSelector* selector = selectorList.first(); selector; selec
tor = CSSSelectorList::next(selector)) { |
| 1561 bool matched = element->webkitMatchesSelector(selector->selectorText
(), IGNORE_EXCEPTION_STATE); | 1561 bool matched = element->webkitMatchesSelector(selector->selectorText
(), IGNORE_EXCEPTION); |
| 1562 if (matched) | 1562 if (matched) |
| 1563 matchingSelectors->addItem(index); | 1563 matchingSelectors->addItem(index); |
| 1564 ++index; | 1564 ++index; |
| 1565 } | 1565 } |
| 1566 RefPtr<TypeBuilder::CSS::RuleMatch> match = TypeBuilder::CSS::RuleMatch:
:create() | 1566 RefPtr<TypeBuilder::CSS::RuleMatch> match = TypeBuilder::CSS::RuleMatch:
:create() |
| 1567 .setRule(ruleObject) | 1567 .setRule(ruleObject) |
| 1568 .setMatchingSelectors(matchingSelectors); | 1568 .setMatchingSelectors(matchingSelectors); |
| 1569 result->addItem(match); | 1569 result->addItem(match); |
| 1570 } | 1570 } |
| 1571 | 1571 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1706 documentsToChange.add(element->ownerDocument()); | 1706 documentsToChange.add(element->ownerDocument()); |
| 1707 } | 1707 } |
| 1708 | 1708 |
| 1709 m_nodeIdToForcedPseudoState.clear(); | 1709 m_nodeIdToForcedPseudoState.clear(); |
| 1710 for (HashSet<Document*>::iterator it = documentsToChange.begin(), end = docu
mentsToChange.end(); it != end; ++it) | 1710 for (HashSet<Document*>::iterator it = documentsToChange.begin(), end = docu
mentsToChange.end(); it != end; ++it) |
| 1711 (*it)->setNeedsStyleRecalc(); | 1711 (*it)->setNeedsStyleRecalc(); |
| 1712 } | 1712 } |
| 1713 | 1713 |
| 1714 } // namespace WebCore | 1714 } // namespace WebCore |
| 1715 | 1715 |
| OLD | NEW |