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

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleSheetCandidate.cpp

Issue 1854423002: ASSERT -> {DCHECK|DCHECK_XX}, ENABLE(ASSERT) -> DCHECK_IS_ON() in dom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mark svg/as-image/svg-nested.html crash on win Created 4 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 return m_type == HTMLLink && toHTMLLinkElement(node()).isImport(); 54 return m_type == HTMLLink && toHTMLLinkElement(node()).isImport();
55 } 55 }
56 56
57 bool StyleSheetCandidate::isCSSStyle() const 57 bool StyleSheetCandidate::isCSSStyle() const
58 { 58 {
59 return m_type == HTMLStyle || m_type == SVGStyle; 59 return m_type == HTMLStyle || m_type == SVGStyle;
60 } 60 }
61 61
62 Document* StyleSheetCandidate::importedDocument() const 62 Document* StyleSheetCandidate::importedDocument() const
63 { 63 {
64 ASSERT(isImport()); 64 DCHECK(isImport());
65 return toHTMLLinkElement(node()).import(); 65 return toHTMLLinkElement(node()).import();
66 } 66 }
67 67
68 bool StyleSheetCandidate::isAlternate() const 68 bool StyleSheetCandidate::isAlternate() const
69 { 69 {
70 if (!isElement()) 70 if (!isElement())
71 return false; 71 return false;
72 return toElement(node()).getAttribute(relAttr).contains("alternate"); 72 return toElement(node()).getAttribute(relAttr).contains("alternate");
73 } 73 }
74 74
75 bool StyleSheetCandidate::isEnabledViaScript() const 75 bool StyleSheetCandidate::isEnabledViaScript() const
76 { 76 {
77 return isHTMLLink() && toHTMLLinkElement(node()).isEnabledViaScript(); 77 return isHTMLLink() && toHTMLLinkElement(node()).isEnabledViaScript();
78 } 78 }
79 79
80 bool StyleSheetCandidate::isEnabledAndLoading() const 80 bool StyleSheetCandidate::isEnabledAndLoading() const
81 { 81 {
82 if (isHTMLLink()) 82 if (isHTMLLink())
83 return !toHTMLLinkElement(node()).isDisabled() && toHTMLLinkElement(node ()).styleSheetIsLoading(); 83 return !toHTMLLinkElement(node()).isDisabled() && toHTMLLinkElement(node ()).styleSheetIsLoading();
84 84
85 StyleSheet* sheet = this->sheet(); 85 StyleSheet* sheet = this->sheet();
86 return sheet && !sheet->disabled() && sheet->isLoading(); 86 return sheet && !sheet->disabled() && sheet->isLoading();
87 } 87 }
88 88
89 bool StyleSheetCandidate::hasPreferrableName() const 89 bool StyleSheetCandidate::hasPreferrableName() const
90 { 90 {
91 ASSERT(isEnabledAndLoading() || sheet()); 91 DCHECK(isEnabledAndLoading() || sheet());
92 return !isEnabledViaScript() && !title().isEmpty() && !isAlternate(); 92 return !isEnabledViaScript() && !title().isEmpty() && !isAlternate();
93 } 93 }
94 94
95 bool StyleSheetCandidate::canBeActivated(const String& currentPreferrableName) c onst 95 bool StyleSheetCandidate::canBeActivated(const String& currentPreferrableName) c onst
96 { 96 {
97 StyleSheet* sheet = this->sheet(); 97 StyleSheet* sheet = this->sheet();
98 if (!sheet || sheet->disabled() || !sheet->isCSSStyleSheet()) 98 if (!sheet || sheet->disabled() || !sheet->isCSSStyleSheet())
99 return false; 99 return false;
100 100
101 if (sheet->ownerNode() && sheet->ownerNode()->isInShadowTree()) 101 if (sheet->ownerNode() && sheet->ownerNode()->isInShadowTree())
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 return toSVGStyleElement(node()).sheet(); 143 return toSVGStyleElement(node()).sheet();
144 case Pi: 144 case Pi:
145 return toProcessingInstruction(node()).sheet(); 145 return toProcessingInstruction(node()).sheet();
146 } 146 }
147 147
148 ASSERT_NOT_REACHED(); 148 ASSERT_NOT_REACHED();
149 return 0; 149 return 0;
150 } 150 }
151 151
152 } // namespace blink 152 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.cpp ('k') | third_party/WebKit/Source/core/dom/StyleSheetCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698