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

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

Issue 603443002: Don't add '(' to FUNCTION token names (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@internalsetshadowunused
Patch Set: Created 6 years, 3 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/CSSSelector.cpp ('k') | Source/core/css/parser/CSSPropertyParser.cpp » ('j') | 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 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 public: 1140 public:
1141 TransformOperationInfo(const CSSParserString& name) 1141 TransformOperationInfo(const CSSParserString& name)
1142 : m_type(CSSTransformValue::UnknownTransformOperation) 1142 : m_type(CSSTransformValue::UnknownTransformOperation)
1143 , m_argCount(1) 1143 , m_argCount(1)
1144 , m_allowSingleArgument(false) 1144 , m_allowSingleArgument(false)
1145 , m_unit(CSSPropertyParser::FUnknown) 1145 , m_unit(CSSPropertyParser::FUnknown)
1146 { 1146 {
1147 const UChar* characters; 1147 const UChar* characters;
1148 unsigned nameLength = name.length(); 1148 unsigned nameLength = name.length();
1149 1149
1150 const unsigned longestNameLength = 12; 1150 const unsigned longestNameLength = 11;
1151 UChar characterBuffer[longestNameLength]; 1151 UChar characterBuffer[longestNameLength];
1152 if (name.is8Bit()) { 1152 if (name.is8Bit()) {
1153 unsigned length = std::min(longestNameLength, nameLength); 1153 unsigned length = std::min(longestNameLength, nameLength);
1154 const LChar* characters8 = name.characters8(); 1154 const LChar* characters8 = name.characters8();
1155 for (unsigned i = 0; i < length; ++i) 1155 for (unsigned i = 0; i < length; ++i)
1156 characterBuffer[i] = characters8[i]; 1156 characterBuffer[i] = characters8[i];
1157 characters = characterBuffer; 1157 characters = characterBuffer;
1158 } else 1158 } else
1159 characters = name.characters16(); 1159 characters = name.characters16();
1160 1160
1161 SWITCH(characters, nameLength) { 1161 SWITCH(characters, nameLength) {
1162 CASE("skew(") { 1162 CASE("skew") {
1163 m_unit = CSSPropertyParser::FAngle; 1163 m_unit = CSSPropertyParser::FAngle;
1164 m_type = CSSTransformValue::SkewTransformOperation; 1164 m_type = CSSTransformValue::SkewTransformOperation;
1165 m_allowSingleArgument = true; 1165 m_allowSingleArgument = true;
1166 m_argCount = 3; 1166 m_argCount = 3;
1167 } 1167 }
1168 CASE("scale(") { 1168 CASE("scale") {
1169 m_unit = CSSPropertyParser::FNumber; 1169 m_unit = CSSPropertyParser::FNumber;
1170 m_type = CSSTransformValue::ScaleTransformOperation; 1170 m_type = CSSTransformValue::ScaleTransformOperation;
1171 m_allowSingleArgument = true; 1171 m_allowSingleArgument = true;
1172 m_argCount = 3; 1172 m_argCount = 3;
1173 } 1173 }
1174 CASE("skewx(") { 1174 CASE("skewx") {
1175 m_unit = CSSPropertyParser::FAngle; 1175 m_unit = CSSPropertyParser::FAngle;
1176 m_type = CSSTransformValue::SkewXTransformOperation; 1176 m_type = CSSTransformValue::SkewXTransformOperation;
1177 } 1177 }
1178 CASE("skewy(") { 1178 CASE("skewy") {
1179 m_unit = CSSPropertyParser::FAngle; 1179 m_unit = CSSPropertyParser::FAngle;
1180 m_type = CSSTransformValue::SkewYTransformOperation; 1180 m_type = CSSTransformValue::SkewYTransformOperation;
1181 } 1181 }
1182 CASE("matrix(") { 1182 CASE("matrix") {
1183 m_unit = CSSPropertyParser::FNumber; 1183 m_unit = CSSPropertyParser::FNumber;
1184 m_type = CSSTransformValue::MatrixTransformOperation; 1184 m_type = CSSTransformValue::MatrixTransformOperation;
1185 m_argCount = 11; 1185 m_argCount = 11;
1186 } 1186 }
1187 CASE("rotate(") { 1187 CASE("rotate") {
1188 m_unit = CSSPropertyParser::FAngle; 1188 m_unit = CSSPropertyParser::FAngle;
1189 m_type = CSSTransformValue::RotateTransformOperation; 1189 m_type = CSSTransformValue::RotateTransformOperation;
1190 } 1190 }
1191 CASE("scalex(") { 1191 CASE("scalex") {
1192 m_unit = CSSPropertyParser::FNumber; 1192 m_unit = CSSPropertyParser::FNumber;
1193 m_type = CSSTransformValue::ScaleXTransformOperation; 1193 m_type = CSSTransformValue::ScaleXTransformOperation;
1194 } 1194 }
1195 CASE("scaley(") { 1195 CASE("scaley") {
1196 m_unit = CSSPropertyParser::FNumber; 1196 m_unit = CSSPropertyParser::FNumber;
1197 m_type = CSSTransformValue::ScaleYTransformOperation; 1197 m_type = CSSTransformValue::ScaleYTransformOperation;
1198 } 1198 }
1199 CASE("scalez(") { 1199 CASE("scalez") {
1200 m_unit = CSSPropertyParser::FNumber; 1200 m_unit = CSSPropertyParser::FNumber;
1201 m_type = CSSTransformValue::ScaleZTransformOperation; 1201 m_type = CSSTransformValue::ScaleZTransformOperation;
1202 } 1202 }
1203 CASE("scale3d(") { 1203 CASE("scale3d") {
1204 m_unit = CSSPropertyParser::FNumber; 1204 m_unit = CSSPropertyParser::FNumber;
1205 m_type = CSSTransformValue::Scale3DTransformOperation; 1205 m_type = CSSTransformValue::Scale3DTransformOperation;
1206 m_argCount = 5; 1206 m_argCount = 5;
1207 } 1207 }
1208 CASE("rotatex(") { 1208 CASE("rotatex") {
1209 m_unit = CSSPropertyParser::FAngle; 1209 m_unit = CSSPropertyParser::FAngle;
1210 m_type = CSSTransformValue::RotateXTransformOperation; 1210 m_type = CSSTransformValue::RotateXTransformOperation;
1211 } 1211 }
1212 CASE("rotatey(") { 1212 CASE("rotatey") {
1213 m_unit = CSSPropertyParser::FAngle; 1213 m_unit = CSSPropertyParser::FAngle;
1214 m_type = CSSTransformValue::RotateYTransformOperation; 1214 m_type = CSSTransformValue::RotateYTransformOperation;
1215 } 1215 }
1216 CASE("rotatez(") { 1216 CASE("rotatez") {
1217 m_unit = CSSPropertyParser::FAngle; 1217 m_unit = CSSPropertyParser::FAngle;
1218 m_type = CSSTransformValue::RotateZTransformOperation; 1218 m_type = CSSTransformValue::RotateZTransformOperation;
1219 } 1219 }
1220 CASE("matrix3d(") { 1220 CASE("matrix3d") {
1221 m_unit = CSSPropertyParser::FNumber; 1221 m_unit = CSSPropertyParser::FNumber;
1222 m_type = CSSTransformValue::Matrix3DTransformOperation; 1222 m_type = CSSTransformValue::Matrix3DTransformOperation;
1223 m_argCount = 31; 1223 m_argCount = 31;
1224 } 1224 }
1225 CASE("rotate3d(") { 1225 CASE("rotate3d") {
1226 m_unit = CSSPropertyParser::FNumber; 1226 m_unit = CSSPropertyParser::FNumber;
1227 m_type = CSSTransformValue::Rotate3DTransformOperation; 1227 m_type = CSSTransformValue::Rotate3DTransformOperation;
1228 m_argCount = 7; 1228 m_argCount = 7;
1229 } 1229 }
1230 CASE("translate(") { 1230 CASE("translate") {
1231 m_unit = CSSPropertyParser::FLength | CSSPropertyParser::FPercen t; 1231 m_unit = CSSPropertyParser::FLength | CSSPropertyParser::FPercen t;
1232 m_type = CSSTransformValue::TranslateTransformOperation; 1232 m_type = CSSTransformValue::TranslateTransformOperation;
1233 m_allowSingleArgument = true; 1233 m_allowSingleArgument = true;
1234 m_argCount = 3; 1234 m_argCount = 3;
1235 } 1235 }
1236 CASE("translatex(") { 1236 CASE("translatex") {
1237 m_unit = CSSPropertyParser::FLength | CSSPropertyParser::FPercen t; 1237 m_unit = CSSPropertyParser::FLength | CSSPropertyParser::FPercen t;
1238 m_type = CSSTransformValue::TranslateXTransformOperation; 1238 m_type = CSSTransformValue::TranslateXTransformOperation;
1239 } 1239 }
1240 CASE("translatey(") { 1240 CASE("translatey") {
1241 m_unit = CSSPropertyParser::FLength | CSSPropertyParser::FPercen t; 1241 m_unit = CSSPropertyParser::FLength | CSSPropertyParser::FPercen t;
1242 m_type = CSSTransformValue::TranslateYTransformOperation; 1242 m_type = CSSTransformValue::TranslateYTransformOperation;
1243 } 1243 }
1244 CASE("translatez(") { 1244 CASE("translatez") {
1245 m_unit = CSSPropertyParser::FLength | CSSPropertyParser::FPercen t; 1245 m_unit = CSSPropertyParser::FLength | CSSPropertyParser::FPercen t;
1246 m_type = CSSTransformValue::TranslateZTransformOperation; 1246 m_type = CSSTransformValue::TranslateZTransformOperation;
1247 } 1247 }
1248 CASE("perspective(") { 1248 CASE("perspective") {
1249 m_unit = CSSPropertyParser::FNumber; 1249 m_unit = CSSPropertyParser::FNumber;
1250 m_type = CSSTransformValue::PerspectiveTransformOperation; 1250 m_type = CSSTransformValue::PerspectiveTransformOperation;
1251 } 1251 }
1252 CASE("translate3d(") { 1252 CASE("translate3d") {
1253 m_unit = CSSPropertyParser::FLength | CSSPropertyParser::FPercen t; 1253 m_unit = CSSPropertyParser::FLength | CSSPropertyParser::FPercen t;
1254 m_type = CSSTransformValue::Translate3DTransformOperation; 1254 m_type = CSSTransformValue::Translate3DTransformOperation;
1255 m_argCount = 5; 1255 m_argCount = 5;
1256 } 1256 }
1257 } 1257 }
1258 } 1258 }
1259 1259
1260 CSSTransformValue::TransformOperationType type() const { return m_type; } 1260 CSSTransformValue::TransformOperationType type() const { return m_type; }
1261 unsigned argCount() const { return m_argCount; } 1261 unsigned argCount() const { return m_argCount; }
1262 CSSPropertyParser::Units unit() const { return m_unit; } 1262 CSSPropertyParser::Units unit() const { return m_unit; }
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
2063 rule->setProperties(createStylePropertySet()); 2063 rule->setProperties(createStylePropertySet());
2064 clearProperties(); 2064 clearProperties();
2065 2065
2066 StyleRuleViewport* result = rule.get(); 2066 StyleRuleViewport* result = rule.get();
2067 m_parsedRules.append(rule.release()); 2067 m_parsedRules.append(rule.release());
2068 2068
2069 return result; 2069 return result;
2070 } 2070 }
2071 2071
2072 } 2072 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSSelector.cpp ('k') | Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698