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

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: Flags -> enum. add accessors for nth. Created 6 years, 4 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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 1103
1104 // can't use { because tokenizer state switches from mediaquery to initial s tate when it sees { token. 1104 // can't use { because tokenizer state switches from mediaquery to initial s tate when it sees { token.
1105 // instead insert one " " (which is caught by maybe_space in CSSGrammar.y) 1105 // instead insert one " " (which is caught by maybe_space in CSSGrammar.y)
1106 setupParser("@-internal-medialist ", string, ""); 1106 setupParser("@-internal-medialist ", string, "");
1107 cssyyparse(this); 1107 cssyyparse(this);
1108 1108
1109 ASSERT(m_mediaList); 1109 ASSERT(m_mediaList);
1110 return m_mediaList.release(); 1110 return m_mediaList.release();
1111 } 1111 }
1112 1112
1113 bool BisonCSSParser::parseAttributeMatchType(CSSSelector::AttributeMatchType& ma tchType, const String& string)
1114 {
1115 if (!RuntimeEnabledFeatures::cssAttributeCaseSensitivityEnabled() && !isUASh eetBehavior(m_context.mode()))
1116 return false;
1117 if (string == "i") {
eseidel 2014/07/30 20:12:41 Why are we going through a string type here?
fs 2014/07/31 09:27:15 Because of one of the following I suppose: 1) ther
1118 matchType = CSSSelector::CaseInsensitive;
1119 return true;
1120 }
1121 return false;
1122 }
1123
1113 static inline void filterProperties(bool important, const WillBeHeapVector<CSSPr operty, 256>& input, WillBeHeapVector<CSSProperty, 256>& output, size_t& unusedE ntries, BitArray<numCSSProperties>& seenProperties) 1124 static inline void filterProperties(bool important, const WillBeHeapVector<CSSPr operty, 256>& input, WillBeHeapVector<CSSProperty, 256>& output, size_t& unusedE ntries, BitArray<numCSSProperties>& seenProperties)
1114 { 1125 {
1115 // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found. 1126 // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found.
1116 for (int i = input.size() - 1; i >= 0; --i) { 1127 for (int i = input.size() - 1; i >= 0; --i) {
1117 const CSSProperty& property = input[i]; 1128 const CSSProperty& property = input[i];
1118 if (property.isImportant() != important) 1129 if (property.isImportant() != important)
1119 continue; 1130 continue;
1120 const unsigned propertyIDIndex = property.id() - firstCSSProperty; 1131 const unsigned propertyIDIndex = property.id() - firstCSSProperty;
1121 if (seenProperties.get(propertyIDIndex)) 1132 if (seenProperties.get(propertyIDIndex))
1122 continue; 1133 continue;
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
2094 rule->setProperties(createStylePropertySet()); 2105 rule->setProperties(createStylePropertySet());
2095 clearProperties(); 2106 clearProperties();
2096 2107
2097 StyleRuleViewport* result = rule.get(); 2108 StyleRuleViewport* result = rule.get();
2098 m_parsedRules.append(rule.release()); 2109 m_parsedRules.append(rule.release());
2099 2110
2100 return result; 2111 return result;
2101 } 2112 }
2102 2113
2103 } 2114 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698