Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: third_party/WebKit/Source/core/css/RuleSet.cpp

Issue 2755493004: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in core/css/ (Closed)
Patch Set: All windows error are Resolved now. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 } 427 }
427 428
428 #ifndef NDEBUG 429 #ifndef NDEBUG
429 void RuleSet::show() const { 430 void RuleSet::show() const {
430 for (const auto& rule : m_allRules) 431 for (const auto& rule : m_allRules)
431 rule.selector().show(); 432 rule.selector().show();
432 } 433 }
433 #endif 434 #endif
434 435
435 } // namespace blink 436 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleSet.h ('k') | third_party/WebKit/Source/core/css/SelectorChecker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698