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

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

Issue 1306823004: Split out String, URI and CustomIdent from CSSPrimitiveValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@split_out_attr_values
Patch Set: Rebase Created 5 years, 2 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 if (token.valueEqualsIgnoringCase("url")) { 50 if (token.valueEqualsIgnoringCase("url")) {
51 range.consume(); 51 range.consume();
52 const CSSParserToken& next = range.consumeIncludingWhitespace(); 52 const CSSParserToken& next = range.consumeIncludingWhitespace();
53 if (next.type() == BadStringToken || range.consume().type() != R ightParenthesisToken) { 53 if (next.type() == BadStringToken || range.consume().type() != R ightParenthesisToken) {
54 destroyAndClear(); 54 destroyAndClear();
55 return; 55 return;
56 } 56 }
57 ASSERT(next.type() == StringToken); 57 ASSERT(next.type() == StringToken);
58 value.id = CSSValueInvalid; 58 value.id = CSSValueInvalid;
59 value.isInt = false; 59 value.isInt = false;
60 value.setUnit(CSSPrimitiveValue::UnitType::URI); 60 value.m_unit = CSSParserValue::URI;
61 value.string = next.value(); 61 value.string = next.value();
62 break; 62 break;
63 } 63 }
64 64
65 value.id = CSSValueInvalid; 65 value.id = CSSValueInvalid;
66 value.isInt = false; 66 value.isInt = false;
67 67
68 CSSValueID id = token.functionId(); 68 CSSValueID id = token.functionId();
69 if (id == CSSValueCalc || id == CSSValueWebkitCalc) { 69 if (id == CSSValueCalc || id == CSSValueWebkitCalc) {
70 value.m_unit = CSSParserValue::CalcFunction; 70 value.m_unit = CSSParserValue::CalcFunction;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 break; 157 break;
158 } 158 }
159 case HashToken: 159 case HashToken:
160 case StringToken: 160 case StringToken:
161 case UrlToken: { 161 case UrlToken: {
162 value.id = CSSValueInvalid; 162 value.id = CSSValueInvalid;
163 value.isInt = false; 163 value.isInt = false;
164 if (token.type() == HashToken) 164 if (token.type() == HashToken)
165 value.m_unit = CSSParserValue::HexColor; 165 value.m_unit = CSSParserValue::HexColor;
166 else if (token.type() == StringToken) 166 else if (token.type() == StringToken)
167 value.setUnit(CSSPrimitiveValue::UnitType::String); 167 value.m_unit = CSSParserValue::String;
168 else 168 else
169 value.setUnit(CSSPrimitiveValue::UnitType::URI); 169 value.m_unit = CSSParserValue::URI;
170 value.string = token.value(); 170 value.string = token.value();
171 break; 171 break;
172 } 172 }
173 case DelimiterToken: 173 case DelimiterToken:
174 value.setFromOperator(token.delimiter()); 174 value.setFromOperator(token.delimiter());
175 break; 175 break;
176 case CommaToken: 176 case CommaToken:
177 value.setFromOperator(','); 177 value.setFromOperator(',');
178 break; 178 break;
179 case LeftBracketToken: 179 case LeftBracketToken:
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 { 248 {
249 destroy(m_values); 249 destroy(m_values);
250 } 250 }
251 251
252 void CSSParserValueList::addValue(const CSSParserValue& v) 252 void CSSParserValueList::addValue(const CSSParserValue& v)
253 { 253 {
254 m_values.append(v); 254 m_values.append(v);
255 } 255 }
256 256
257 } // namespace blink 257 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698