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

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: Make union w/ m_attributeFlags and nth-state; Return enum type. Created 6 years, 6 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 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 1122
1123 // can't use { because tokenizer state switches from mediaquery to initial s tate when it sees { token. 1123 // can't use { because tokenizer state switches from mediaquery to initial s tate when it sees { token.
1124 // instead insert one " " (which is caught by maybe_space in CSSGrammar.y) 1124 // instead insert one " " (which is caught by maybe_space in CSSGrammar.y)
1125 setupParser("@-internal-medialist ", string, ""); 1125 setupParser("@-internal-medialist ", string, "");
1126 cssyyparse(this); 1126 cssyyparse(this);
1127 1127
1128 ASSERT(m_mediaList); 1128 ASSERT(m_mediaList);
1129 return m_mediaList.release(); 1129 return m_mediaList.release();
1130 } 1130 }
1131 1131
1132 bool BisonCSSParser::parseAttributeFlags(unsigned& flags, const String& string)
1133 {
1134 if (!RuntimeEnabledFeatures::cssAttributeCaseSensitivityEnabled() && !isUASh eetBehavior(m_context.mode()))
1135 return false;
1136 if (string == "i") {
1137 flags = CSSSelector::CaseInsensitive;
1138 return true;
1139 }
1140 return false;
1141 }
1142
1132 static inline void filterProperties(bool important, const WillBeHeapVector<CSSPr operty, 256>& input, WillBeHeapVector<CSSProperty, 256>& output, size_t& unusedE ntries, BitArray<numCSSProperties>& seenProperties) 1143 static inline void filterProperties(bool important, const WillBeHeapVector<CSSPr operty, 256>& input, WillBeHeapVector<CSSProperty, 256>& output, size_t& unusedE ntries, BitArray<numCSSProperties>& seenProperties)
1133 { 1144 {
1134 // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found. 1145 // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found.
1135 for (int i = input.size() - 1; i >= 0; --i) { 1146 for (int i = input.size() - 1; i >= 0; --i) {
1136 const CSSProperty& property = input[i]; 1147 const CSSProperty& property = input[i];
1137 if (property.isImportant() != important) 1148 if (property.isImportant() != important)
1138 continue; 1149 continue;
1139 const unsigned propertyIDIndex = property.id() - firstCSSProperty; 1150 const unsigned propertyIDIndex = property.id() - firstCSSProperty;
1140 if (seenProperties.get(propertyIDIndex)) 1151 if (seenProperties.get(propertyIDIndex))
1141 continue; 1152 continue;
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
2075 rule->setProperties(createStylePropertySet()); 2086 rule->setProperties(createStylePropertySet());
2076 clearProperties(); 2087 clearProperties();
2077 2088
2078 StyleRuleViewport* result = rule.get(); 2089 StyleRuleViewport* result = rule.get();
2079 m_parsedRules.append(rule.release()); 2090 m_parsedRules.append(rule.release());
2080 2091
2081 return result; 2092 return result;
2082 } 2093 }
2083 2094
2084 } 2095 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698