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

Side by Side Diff: Source/core/css/parser/CSSParserValues.cpp

Issue 1151593003: Remove hexDigit check in CSSParserValueList (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove ASSERT and add subtest Created 5 years, 7 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) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 start.isInt = true; 172 start.isInt = true;
173 list->addValue(start); 173 list->addValue(start);
174 174
175 CSSParserValue end; 175 CSSParserValue end;
176 end.setFromNumber(token.unicodeRangeEnd()); 176 end.setFromNumber(token.unicodeRangeEnd());
177 end.isInt = true; 177 end.isInt = true;
178 list->addValue(end); 178 list->addValue(end);
179 break; 179 break;
180 } 180 }
181 case HashToken: 181 case HashToken:
182 // FIXME: Move this logic to the property parser
183 // This check prevents us from allowing #red and similar
184 for (size_t i = 0; i < token.value().length(); ++i) {
185 if (!isASCIIHexDigit(token.value()[i])) {
186 destroyAndClear();
187 return;
188 }
189 }
190 // fallthrough
191 case StringToken: 182 case StringToken:
192 case UrlToken: { 183 case UrlToken: {
193 value.id = CSSValueInvalid; 184 value.id = CSSValueInvalid;
194 value.isInt = false; 185 value.isInt = false;
195 if (token.type() == HashToken) 186 if (token.type() == HashToken)
196 value.unit = CSSParserValue::HexColor; 187 value.unit = CSSParserValue::HexColor;
197 else if (token.type() == StringToken) 188 else if (token.type() == StringToken)
198 value.unit = CSSPrimitiveValue::CSS_STRING; 189 value.unit = CSSPrimitiveValue::CSS_STRING;
199 else 190 else
200 value.unit = CSSPrimitiveValue::CSS_URI; 191 value.unit = CSSPrimitiveValue::CSS_URI;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 bool CSSParserSelector::hasHostPseudoSelector() const 366 bool CSSParserSelector::hasHostPseudoSelector() const
376 { 367 {
377 for (CSSParserSelector* selector = const_cast<CSSParserSelector*>(this); sel ector; selector = selector->tagHistory()) { 368 for (CSSParserSelector* selector = const_cast<CSSParserSelector*>(this); sel ector; selector = selector->tagHistory()) {
378 if (selector->pseudoType() == CSSSelector::PseudoHost || selector->pseud oType() == CSSSelector::PseudoHostContext) 369 if (selector->pseudoType() == CSSSelector::PseudoHost || selector->pseud oType() == CSSSelector::PseudoHostContext)
379 return true; 370 return true;
380 } 371 }
381 return false; 372 return false;
382 } 373 }
383 374
384 } // namespace blink 375 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/script-tests/invalid-predefined-color.js ('k') | Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698