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

Side by Side Diff: Source/core/css/parser/BisonCSSParser-in.cpp

Issue 213743018: Fix for CSS identifier related assert (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added explanation in a comment. Created 6 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
« no previous file with comments | « Source/core/css/parser/BisonCSSParser.h ('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 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after
1776 if (charactersAreAllASCII(input, length)) { 1776 if (charactersAreAllASCII(input, length)) {
1777 // Fast case for all-ASCII. 1777 // Fast case for all-ASCII.
1778 for (unsigned i = 0; i < length; i++) 1778 for (unsigned i = 0; i < length; i++)
1779 output[i] = toASCIILower(input[i]); 1779 output[i] = toASCIILower(input[i]);
1780 } else { 1780 } else {
1781 for (unsigned i = 0; i < length; i++) 1781 for (unsigned i = 0; i < length; i++)
1782 output[i] = Unicode::toLower(input[i]); 1782 output[i] = Unicode::toLower(input[i]);
1783 } 1783 }
1784 } 1784 }
1785 1785
1786 void BisonCSSParser::tokenToLowerCase(const CSSParserString& token) 1786 void BisonCSSParser::tokenToLowerCase(CSSParserString& token)
1787 { 1787 {
1788 // Since it's our internal token, we know that we created it out
1789 // of our writable work buffers. Therefore the const_cast is just
1790 // ugly and not a potential crash.
1788 size_t length = token.length(); 1791 size_t length = token.length();
1789 if (m_tokenizer.is8BitSource()) { 1792 if (token.is8Bit()) {
eseidel 2014/04/04 06:54:30 when is the token bits different from the source?
eseidel 2014/04/04 06:55:21 i see, only for escape chars.
1790 size_t offset = token.characters8() - m_tokenizer.m_dataStart8.get(); 1793 makeLower(token.characters8(), const_cast<LChar*>(token.characters8()), length);
1791 makeLower(token.characters8(), m_tokenizer.m_dataStart8.get() + offset, length);
1792 } else { 1794 } else {
1793 size_t offset = token.characters16() - m_tokenizer.m_dataStart16.get(); 1795 makeLower(token.characters16(), const_cast<UChar*>(token.characters16()) , length);
1794 makeLower(token.characters16(), m_tokenizer.m_dataStart16.get() + offset , length);
1795 } 1796 }
1796 } 1797 }
1797 1798
1798 void BisonCSSParser::endInvalidRuleHeader() 1799 void BisonCSSParser::endInvalidRuleHeader()
1799 { 1800 {
1800 if (m_ruleHeaderType == CSSRuleSourceData::UNKNOWN_RULE) 1801 if (m_ruleHeaderType == CSSRuleSourceData::UNKNOWN_RULE)
1801 return; 1802 return;
1802 1803
1803 CSSParserLocation location; 1804 CSSParserLocation location;
1804 location.lineNumber = m_tokenizer.m_lineNumber; 1805 location.lineNumber = m_tokenizer.m_lineNumber;
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
2184 rule->setProperties(createStylePropertySet()); 2185 rule->setProperties(createStylePropertySet());
2185 clearProperties(); 2186 clearProperties();
2186 2187
2187 StyleRuleViewport* result = rule.get(); 2188 StyleRuleViewport* result = rule.get();
2188 m_parsedRules.append(rule.release()); 2189 m_parsedRules.append(rule.release());
2189 2190
2190 return result; 2191 return result;
2191 } 2192 }
2192 2193
2193 } 2194 }
OLDNEW
« no previous file with comments | « Source/core/css/parser/BisonCSSParser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698