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

Side by Side Diff: third_party/WebKit/Source/core/css/FontSize.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, 2013 Apple Inc. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
6 * All rights reserved. 6 * All 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 mediumSize = isMonospace ? settings->getDefaultFixedFontSize() 134 mediumSize = isMonospace ? settings->getDefaultFixedFontSize()
135 : settings->getDefaultFontSize(); 135 : settings->getDefaultFontSize();
136 if (mediumSize >= fontSizeTableMin && mediumSize <= fontSizeTableMax) 136 if (mediumSize >= fontSizeTableMin && mediumSize <= fontSizeTableMax)
137 return mediumSize - fontSizeTableMin; 137 return mediumSize - fontSizeTableMin;
138 return -1; 138 return -1;
139 } 139 }
140 140
141 float FontSize::fontSizeForKeyword(const Document* document, 141 float FontSize::fontSizeForKeyword(const Document* document,
142 unsigned keyword, 142 unsigned keyword,
143 bool isMonospace) { 143 bool isMonospace) {
144 ASSERT(keyword >= 1 && keyword <= 8); 144 DCHECK_GE(keyword, 1u);
145 DCHECK_LE(keyword, 8u);
145 const Settings* settings = document->settings(); 146 const Settings* settings = document->settings();
146 if (!settings) 147 if (!settings)
147 return 1.0f; 148 return 1.0f;
148 149
149 bool quirksMode = document->inQuirksMode(); 150 bool quirksMode = document->inQuirksMode();
150 int mediumSize = 0; 151 int mediumSize = 0;
151 int row = rowFromMediumFontSizeInRange(settings, quirksMode, isMonospace, 152 int row = rowFromMediumFontSizeInRange(settings, quirksMode, isMonospace,
152 mediumSize); 153 mediumSize);
153 if (row >= 0) { 154 if (row >= 0) {
154 int col = (keyword - 1); 155 int col = (keyword - 1);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 if (row >= 0) 189 if (row >= 0)
189 return findNearestLegacyFontSize<int>( 190 return findNearestLegacyFontSize<int>(
190 pixelFontSize, 191 pixelFontSize,
191 quirksMode ? quirksFontSizeTable[row] : strictFontSizeTable[row], 1); 192 quirksMode ? quirksFontSizeTable[row] : strictFontSizeTable[row], 1);
192 193
193 return findNearestLegacyFontSize<float>(pixelFontSize, fontSizeFactors, 194 return findNearestLegacyFontSize<float>(pixelFontSize, fontSizeFactors,
194 mediumSize); 195 mediumSize);
195 } 196 }
196 197
197 } // namespace blink 198 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/FontSize.h ('k') | third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698