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

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

Issue 330043003: Add support for case-insensitive attribute value selectors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: legacyCaseSensitive->legacyCaseInsensitive; Extend tests. Created 6 years, 5 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 | Annotate | Revision Log
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 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 1117
1118 // can't use { because tokenizer state switches from mediaquery to initial s tate when it sees { token. 1118 // can't use { because tokenizer state switches from mediaquery to initial s tate when it sees { token.
1119 // instead insert one " " (which is caught by maybe_space in CSSGrammar.y) 1119 // instead insert one " " (which is caught by maybe_space in CSSGrammar.y)
1120 setupParser("@-internal-medialist ", string, ""); 1120 setupParser("@-internal-medialist ", string, "");
1121 cssyyparse(this); 1121 cssyyparse(this);
1122 1122
1123 ASSERT(m_mediaList); 1123 ASSERT(m_mediaList);
1124 return m_mediaList.release(); 1124 return m_mediaList.release();
1125 } 1125 }
1126 1126
1127 bool BisonCSSParser::parseAttributeFlags(unsigned& flags, const String& string)
1128 {
1129 if (!RuntimeEnabledFeatures::cssAttributeCaseSensitivityEnabled() && !isUASh eetBehavior(m_context.mode()))
1130 return false;
1131 if (string == "i") {
1132 flags = CSSSelector::CaseInsensitive;
1133 return true;
1134 }
1135 return false;
1136 }
1137
1127 static inline void filterProperties(bool important, const WillBeHeapVector<CSSPr operty, 256>& input, WillBeHeapVector<CSSProperty, 256>& output, size_t& unusedE ntries, BitArray<numCSSProperties>& seenProperties) 1138 static inline void filterProperties(bool important, const WillBeHeapVector<CSSPr operty, 256>& input, WillBeHeapVector<CSSProperty, 256>& output, size_t& unusedE ntries, BitArray<numCSSProperties>& seenProperties)
1128 { 1139 {
1129 // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found. 1140 // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found.
1130 for (int i = input.size() - 1; i >= 0; --i) { 1141 for (int i = input.size() - 1; i >= 0; --i) {
1131 const CSSProperty& property = input[i]; 1142 const CSSProperty& property = input[i];
1132 if (property.isImportant() != important) 1143 if (property.isImportant() != important)
1133 continue; 1144 continue;
1134 const unsigned propertyIDIndex = property.id() - firstCSSProperty; 1145 const unsigned propertyIDIndex = property.id() - firstCSSProperty;
1135 if (seenProperties.get(propertyIDIndex)) 1146 if (seenProperties.get(propertyIDIndex))
1136 continue; 1147 continue;
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
2108 rule->setProperties(createStylePropertySet()); 2119 rule->setProperties(createStylePropertySet());
2109 clearProperties(); 2120 clearProperties();
2110 2121
2111 StyleRuleViewport* result = rule.get(); 2122 StyleRuleViewport* result = rule.get();
2112 m_parsedRules.append(rule.release()); 2123 m_parsedRules.append(rule.release());
2113 2124
2114 return result; 2125 return result;
2115 } 2126 }
2116 2127
2117 } 2128 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698