| OLD | NEW |
| 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 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1159 break; | 1159 break; |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 m_token = FUNCTION; | 1162 m_token = FUNCTION; |
| 1163 if (!hasEscape) | 1163 if (!hasEscape) |
| 1164 detectFunctionTypeToken<SrcCharacterType>(result - tokenStart<Sr
cCharacterType>()); | 1164 detectFunctionTypeToken<SrcCharacterType>(result - tokenStart<Sr
cCharacterType>()); |
| 1165 | 1165 |
| 1166 // Skip parenthesis | 1166 // Skip parenthesis |
| 1167 ++currentCharacter<SrcCharacterType>(); | 1167 ++currentCharacter<SrcCharacterType>(); |
| 1168 ++result; | 1168 ++result; |
| 1169 ++yylval->string.m_length; | |
| 1170 | 1169 |
| 1171 if (m_token == URI) { | 1170 if (m_token == URI) { |
| 1172 m_token = FUNCTION; | 1171 m_token = FUNCTION; |
| 1173 // Check whether it is really an URI. | 1172 // Check whether it is really an URI. |
| 1174 if (yylval->string.is8Bit()) | 1173 if (yylval->string.is8Bit()) |
| 1175 parseURI<LChar>(yylval->string); | 1174 parseURI<LChar>(yylval->string); |
| 1176 else | 1175 else |
| 1177 parseURI<UChar>(yylval->string); | 1176 parseURI<UChar>(yylval->string); |
| 1178 } | 1177 } |
| 1179 } else if (UNLIKELY(m_parsingMode != NormalMode) && !hasEscape) { | 1178 } else if (UNLIKELY(m_parsingMode != NormalMode) && !hasEscape) { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1303 SrcCharacterType* nextCharacter = result; | 1302 SrcCharacterType* nextCharacter = result; |
| 1304 currentCharacter<SrcCharacterType>() = tokenStart<SrcCharact
erType>() + 2; | 1303 currentCharacter<SrcCharacterType>() = tokenStart<SrcCharact
erType>() + 2; |
| 1305 if (parseNthChildExtra<SrcCharacterType>()) { | 1304 if (parseNthChildExtra<SrcCharacterType>()) { |
| 1306 m_token = NTH; | 1305 m_token = NTH; |
| 1307 result = currentCharacter<SrcCharacterType>(); | 1306 result = currentCharacter<SrcCharacterType>(); |
| 1308 } else { | 1307 } else { |
| 1309 // Revert the change to currentCharacter if unsuccessful
. | 1308 // Revert the change to currentCharacter if unsuccessful
. |
| 1310 currentCharacter<SrcCharacterType>() = nextCharacter; | 1309 currentCharacter<SrcCharacterType>() = nextCharacter; |
| 1311 } | 1310 } |
| 1312 } | 1311 } |
| 1312 resultString.setLength(result - tokenStart<SrcCharacterType>()); |
| 1313 } | 1313 } |
| 1314 resultString.setLength(result - tokenStart<SrcCharacterType>()); | |
| 1315 yylval->string = resultString; | 1314 yylval->string = resultString; |
| 1316 } else if (currentCharacter<SrcCharacterType>()[0] == '-' && currentChar
acter<SrcCharacterType>()[1] == '>') { | 1315 } else if (currentCharacter<SrcCharacterType>()[0] == '-' && currentChar
acter<SrcCharacterType>()[1] == '>') { |
| 1317 currentCharacter<SrcCharacterType>() += 2; | 1316 currentCharacter<SrcCharacterType>() += 2; |
| 1318 m_token = SGML_CD; | 1317 m_token = SGML_CD; |
| 1319 } else if (UNLIKELY(m_parsingMode == NthChildMode)) { | 1318 } else if (UNLIKELY(m_parsingMode == NthChildMode)) { |
| 1320 // "-[0-9]+n" is always an NthChild. | 1319 // "-[0-9]+n" is always an NthChild. |
| 1321 if (parseNthChild<SrcCharacterType>()) { | 1320 if (parseNthChild<SrcCharacterType>()) { |
| 1322 parseNthChildExtra<SrcCharacterType>(); | 1321 parseNthChildExtra<SrcCharacterType>(); |
| 1323 m_token = NTH; | 1322 m_token = NTH; |
| 1324 yylval->string.init(tokenStart<SrcCharacterType>(), currentChara
cter<SrcCharacterType>() - tokenStart<SrcCharacterType>()); | 1323 yylval->string.init(tokenStart<SrcCharacterType>(), currentChara
cter<SrcCharacterType>() - tokenStart<SrcCharacterType>()); |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1571 m_dataStart16[length - 1] = 0; | 1570 m_dataStart16[length - 1] = 0; |
| 1572 | 1571 |
| 1573 m_is8BitSource = false; | 1572 m_is8BitSource = false; |
| 1574 m_currentCharacter8 = 0; | 1573 m_currentCharacter8 = 0; |
| 1575 m_currentCharacter16 = m_dataStart16.get(); | 1574 m_currentCharacter16 = m_dataStart16.get(); |
| 1576 setTokenStart<UChar>(m_currentCharacter16); | 1575 setTokenStart<UChar>(m_currentCharacter16); |
| 1577 m_lexFunc = &CSSTokenizer::realLex<UChar>; | 1576 m_lexFunc = &CSSTokenizer::realLex<UChar>; |
| 1578 } | 1577 } |
| 1579 | 1578 |
| 1580 } // namespace blink | 1579 } // namespace blink |
| OLD | NEW |