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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLFontElement.cpp

Issue 2258033002: Replace ASSERT()s with DCHECK*() in core/html/*.{cpp,h}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace ASSERT()s with DCHECK*() in core/html/*.{cpp,h}. Created 4 years, 4 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) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Simon Hausmann <hausmann@kde.org> 4 * (C) 2000 Simon Hausmann <hausmann@kde.org>
5 * Copyright (C) 2003, 2006, 2008, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2006, 2008, 2010 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // Step 3 59 // Step 3
60 while (position < end) { 60 while (position < end) {
61 if (!isHTMLSpace<CharacterType>(*position)) 61 if (!isHTMLSpace<CharacterType>(*position))
62 break; 62 break;
63 ++position; 63 ++position;
64 } 64 }
65 65
66 // Step 4 66 // Step 4
67 if (position == end) 67 if (position == end)
68 return false; 68 return false;
69 ASSERT(position < end); 69 DCHECK_LT(position, end);
70 70
71 // Step 5 71 // Step 5
72 enum { 72 enum {
73 RelativePlus, 73 RelativePlus,
74 RelativeMinus, 74 RelativeMinus,
75 Absolute 75 Absolute
76 } mode; 76 } mode;
77 77
78 switch (*position) { 78 switch (*position) {
79 case '+': 79 case '+':
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 case 5: 173 case 5:
174 size = CSSValueXLarge; 174 size = CSSValueXLarge;
175 break; 175 break;
176 case 6: 176 case 6:
177 size = CSSValueXxLarge; 177 size = CSSValueXxLarge;
178 break; 178 break;
179 case 7: 179 case 7:
180 size = CSSValueWebkitXxxLarge; 180 size = CSSValueWebkitXxxLarge;
181 break; 181 break;
182 default: 182 default:
183 ASSERT_NOT_REACHED(); 183 NOTREACHED();
184 } 184 }
185 return true; 185 return true;
186 } 186 }
187 187
188 bool HTMLFontElement::isPresentationAttribute(const QualifiedName& name) const 188 bool HTMLFontElement::isPresentationAttribute(const QualifiedName& name) const
189 { 189 {
190 if (name == sizeAttr || name == colorAttr || name == faceAttr) 190 if (name == sizeAttr || name == colorAttr || name == faceAttr)
191 return true; 191 return true;
192 return HTMLElement::isPresentationAttribute(name); 192 return HTMLElement::isPresentationAttribute(name);
193 } 193 }
194 194
195 void HTMLFontElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style) 195 void HTMLFontElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
196 { 196 {
197 if (name == sizeAttr) { 197 if (name == sizeAttr) {
198 CSSValueID size = CSSValueInvalid; 198 CSSValueID size = CSSValueInvalid;
199 if (cssValueFromFontSizeNumber(value, size)) 199 if (cssValueFromFontSizeNumber(value, size))
200 addPropertyToPresentationAttributeStyle(style, CSSPropertyFontSize, size); 200 addPropertyToPresentationAttributeStyle(style, CSSPropertyFontSize, size);
201 } else if (name == colorAttr) { 201 } else if (name == colorAttr) {
202 addHTMLColorToStyle(style, CSSPropertyColor, value); 202 addHTMLColorToStyle(style, CSSPropertyColor, value);
203 } else if (name == faceAttr && !value.isEmpty()) { 203 } else if (name == faceAttr && !value.isEmpty()) {
204 if (const CSSValueList* fontFaceValue = createFontFaceValueWithPool(valu e)) 204 if (const CSSValueList* fontFaceValue = createFontFaceValueWithPool(valu e))
205 style->setProperty(CSSProperty(CSSPropertyFontFamily, *fontFaceValue )); 205 style->setProperty(CSSProperty(CSSPropertyFontFamily, *fontFaceValue ));
206 } else { 206 } else {
207 HTMLElement::collectStyleForPresentationAttribute(name, value, style); 207 HTMLElement::collectStyleForPresentationAttribute(name, value, style);
208 } 208 }
209 } 209 }
210 210
211 } // namespace blink 211 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698