OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All |
6 * rights reserved. | 6 * rights reserved. |
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 } | 196 } |
197 if (!className.isEmpty()) { | 197 if (!className.isEmpty()) { |
198 addToRuleSet(className, ensurePendingRules()->classRules, ruleData); | 198 addToRuleSet(className, ensurePendingRules()->classRules, ruleData); |
199 return true; | 199 return true; |
200 } | 200 } |
201 if (!customPseudoElementName.isEmpty()) { | 201 if (!customPseudoElementName.isEmpty()) { |
202 // Custom pseudos come before ids and classes in the order of tagHistory, | 202 // Custom pseudos come before ids and classes in the order of tagHistory, |
203 // and have a relation of ShadowPseudo between them. Therefore we should | 203 // and have a relation of ShadowPseudo between them. Therefore we should |
204 // never be a situation where extractValuesforSelector finsd id and | 204 // never be a situation where extractValuesforSelector finsd id and |
205 // className in addition to custom pseudo. | 205 // className in addition to custom pseudo. |
206 ASSERT(id.isEmpty() && className.isEmpty()); | 206 DCHECK(id.isEmpty()); |
| 207 DCHECK(className.isEmpty()); |
207 addToRuleSet(customPseudoElementName, | 208 addToRuleSet(customPseudoElementName, |
208 ensurePendingRules()->shadowPseudoElementRules, ruleData); | 209 ensurePendingRules()->shadowPseudoElementRules, ruleData); |
209 return true; | 210 return true; |
210 } | 211 } |
211 | 212 |
212 switch (component.getPseudoType()) { | 213 switch (component.getPseudoType()) { |
213 case CSSSelector::PseudoCue: | 214 case CSSSelector::PseudoCue: |
214 m_cuePseudoRules.push_back(ruleData); | 215 m_cuePseudoRules.push_back(ruleData); |
215 return true; | 216 return true; |
216 case CSSSelector::PseudoLink: | 217 case CSSSelector::PseudoLink: |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 addRuleFlags); | 317 addRuleFlags); |
317 } | 318 } |
318 } | 319 } |
319 } | 320 } |
320 | 321 |
321 void RuleSet::addRulesFromSheet(StyleSheetContents* sheet, | 322 void RuleSet::addRulesFromSheet(StyleSheetContents* sheet, |
322 const MediaQueryEvaluator& medium, | 323 const MediaQueryEvaluator& medium, |
323 AddRuleFlags addRuleFlags) { | 324 AddRuleFlags addRuleFlags) { |
324 TRACE_EVENT0("blink", "RuleSet::addRulesFromSheet"); | 325 TRACE_EVENT0("blink", "RuleSet::addRulesFromSheet"); |
325 | 326 |
326 ASSERT(sheet); | 327 DCHECK(sheet); |
327 | 328 |
328 const HeapVector<Member<StyleRuleImport>>& importRules = sheet->importRules(); | 329 const HeapVector<Member<StyleRuleImport>>& importRules = sheet->importRules(); |
329 for (unsigned i = 0; i < importRules.size(); ++i) { | 330 for (unsigned i = 0; i < importRules.size(); ++i) { |
330 StyleRuleImport* importRule = importRules[i].get(); | 331 StyleRuleImport* importRule = importRules[i].get(); |
331 if (importRule->styleSheet() && | 332 if (importRule->styleSheet() && |
332 (!importRule->mediaQueries() || | 333 (!importRule->mediaQueries() || |
333 medium.eval(importRule->mediaQueries(), | 334 medium.eval(importRule->mediaQueries(), |
334 &m_features.viewportDependentMediaQueryResults(), | 335 &m_features.viewportDependentMediaQueryResults(), |
335 &m_features.deviceDependentMediaQueryResults()))) | 336 &m_features.deviceDependentMediaQueryResults()))) |
336 addRulesFromSheet(importRule->styleSheet(), medium, addRuleFlags); | 337 addRulesFromSheet(importRule->styleSheet(), medium, addRuleFlags); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 } | 433 } |
433 | 434 |
434 #ifndef NDEBUG | 435 #ifndef NDEBUG |
435 void RuleSet::show() const { | 436 void RuleSet::show() const { |
436 for (const auto& rule : m_allRules) | 437 for (const auto& rule : m_allRules) |
437 rule.selector().show(); | 438 rule.selector().show(); |
438 } | 439 } |
439 #endif | 440 #endif |
440 | 441 |
441 } // namespace blink | 442 } // namespace blink |
OLD | NEW |