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

Side by Side Diff: sky/engine/core/css/parser/CSSTokenizer-in.cpp

Issue 836383004: Remove all attribute selectors that are not Set or Exact. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « sky/engine/core/css/parser/CSSGrammar.y ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012 Intel Corporation. All rights reserved.
10 * 10 *
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 currentCharacter<SrcCharacterType>() += 2; 1172 currentCharacter<SrcCharacterType>() += 2;
1173 if (m_parser.m_observer) { 1173 if (m_parser.m_observer) {
1174 unsigned endOffset = currentCharacter<SrcCharacterType>() - data Start<SrcCharacterType>(); 1174 unsigned endOffset = currentCharacter<SrcCharacterType>() - data Start<SrcCharacterType>();
1175 unsigned userTextEndOffset = static_cast<unsigned>(m_length - 1 - m_parsedTextSuffixLength); 1175 unsigned userTextEndOffset = static_cast<unsigned>(m_length - 1 - m_parsedTextSuffixLength);
1176 m_parser.m_observer->endComment(std::min(endOffset, userTextEndO ffset) - m_parsedTextPrefixLength); 1176 m_parser.m_observer->endComment(std::min(endOffset, userTextEndO ffset) - m_parsedTextPrefixLength);
1177 } 1177 }
1178 goto restartAfterComment; 1178 goto restartAfterComment;
1179 } 1179 }
1180 break; 1180 break;
1181 1181
1182 case CharacterDollar:
1183 if (*currentCharacter<SrcCharacterType>() == '=') {
1184 ++currentCharacter<SrcCharacterType>();
1185 m_token = ENDSWITH;
1186 }
1187 break;
1188
1189 case CharacterAsterisk:
1190 if (*currentCharacter<SrcCharacterType>() == '=') {
1191 ++currentCharacter<SrcCharacterType>();
1192 m_token = CONTAINS;
1193 }
1194 break;
1195
1196 case CharacterPlus:
1197 break;
1198
1199 case CharacterLess: 1182 case CharacterLess:
1200 if (currentCharacter<SrcCharacterType>()[0] == '!' && currentCharacter<S rcCharacterType>()[1] == '-' && currentCharacter<SrcCharacterType>()[2] == '-') { 1183 if (currentCharacter<SrcCharacterType>()[0] == '!' && currentCharacter<S rcCharacterType>()[1] == '-' && currentCharacter<SrcCharacterType>()[2] == '-') {
1201 currentCharacter<SrcCharacterType>() += 3; 1184 currentCharacter<SrcCharacterType>() += 3;
1202 m_token = SGML_CD; 1185 m_token = SGML_CD;
1203 } 1186 }
1204 break; 1187 break;
1205 1188
1206 case CharacterAt: 1189 case CharacterAt:
1207 if (isIdentifierStart<SrcCharacterType>()) { 1190 if (isIdentifierStart<SrcCharacterType>()) {
1208 m_token = ATKEYWORD; 1191 m_token = ATKEYWORD;
1209 ++result; 1192 ++result;
1210 parseIdentifier(result, resultString, hasEscape); 1193 parseIdentifier(result, resultString, hasEscape);
1211 // The standard enables unicode escapes in at-rules. In this case on ly the resultString will contain the 1194 // The standard enables unicode escapes in at-rules. In this case on ly the resultString will contain the
1212 // correct identifier, hence we have to use it to determine its leng th instead of the usual pointer arithmetic. 1195 // correct identifier, hence we have to use it to determine its leng th instead of the usual pointer arithmetic.
1213 detectAtToken<SrcCharacterType>(resultString.length() + 1, hasEscape ); 1196 detectAtToken<SrcCharacterType>(resultString.length() + 1, hasEscape );
1214 } 1197 }
1215 break; 1198 break;
1216 1199
1217 case CharacterBackSlash: 1200 case CharacterBackSlash:
1218 if (isCSSEscape(*currentCharacter<SrcCharacterType>())) { 1201 if (isCSSEscape(*currentCharacter<SrcCharacterType>())) {
1219 --currentCharacter<SrcCharacterType>(); 1202 --currentCharacter<SrcCharacterType>();
1220 parseIdentifier(result, yylval->string, hasEscape); 1203 parseIdentifier(result, yylval->string, hasEscape);
1221 m_token = IDENT; 1204 m_token = IDENT;
1222 } 1205 }
1223 break; 1206 break;
1224 1207
1208 case CharacterDollar:
ojan 2015/01/10 02:07:39 Add a TODO to get rid of these?
ojan 2015/01/10 02:07:39 Add a TODO to get rid of these?
1209 case CharacterAsterisk:
1210 case CharacterPlus:
1225 case CharacterXor: 1211 case CharacterXor:
1226 if (*currentCharacter<SrcCharacterType>() == '=') {
1227 ++currentCharacter<SrcCharacterType>();
1228 m_token = BEGINSWITH;
1229 }
1230 break;
1231
1232 case CharacterVerticalBar: 1212 case CharacterVerticalBar:
1233 if (*currentCharacter<SrcCharacterType>() == '=') {
1234 ++currentCharacter<SrcCharacterType>();
1235 m_token = DASHMATCH;
1236 }
1237 break;
1238
1239 case CharacterTilde: 1213 case CharacterTilde:
1240 if (*currentCharacter<SrcCharacterType>() == '=') {
1241 ++currentCharacter<SrcCharacterType>();
1242 m_token = INCLUDES;
1243 }
1244 break; 1214 break;
1245 1215
1246 default: 1216 default:
1247 ASSERT_NOT_REACHED(); 1217 ASSERT_NOT_REACHED();
1248 break; 1218 break;
1249 } 1219 }
1250 1220
1251 return m_token; 1221 return m_token;
1252 } 1222 }
1253 1223
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 m_dataStart16[length - 1] = 0; 1279 m_dataStart16[length - 1] = 0;
1310 1280
1311 m_is8BitSource = false; 1281 m_is8BitSource = false;
1312 m_currentCharacter8 = 0; 1282 m_currentCharacter8 = 0;
1313 m_currentCharacter16 = m_dataStart16.get(); 1283 m_currentCharacter16 = m_dataStart16.get();
1314 setTokenStart<UChar>(m_currentCharacter16); 1284 setTokenStart<UChar>(m_currentCharacter16);
1315 m_lexFunc = &CSSTokenizer::realLex<UChar>; 1285 m_lexFunc = &CSSTokenizer::realLex<UChar>;
1316 } 1286 }
1317 1287
1318 } // namespace blink 1288 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/css/parser/CSSGrammar.y ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698