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

Side by Side Diff: Source/core/css/CSSParser.cpp

Issue 17450016: Implementation of CSS3 nav-up/down/left/right properties from CSS3 UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Implementation of CSS3 nav-up/down/left/right properties from CSS3 UI Created 7 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
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 * Copyright (C) 2013 Opera Software ASA. All rights reserved.
10 * 11 *
11 * This library is free software; you can redistribute it and/or 12 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public 13 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either 14 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version. 15 * version 2 of the License, or (at your option) any later version.
15 * 16 *
16 * This library is distributed in the hope that it will be useful, 17 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details. 20 * Library General Public License for more details.
(...skipping 2260 matching lines...) Expand 10 before | Expand all | Expand 10 after
2280 } 2281 }
2281 return false; 2282 return false;
2282 } 2283 }
2283 break; 2284 break;
2284 case CSSPropertyMixBlendMode: 2285 case CSSPropertyMixBlendMode:
2285 if (!RuntimeEnabledFeatures::cssCompositingEnabled()) 2286 if (!RuntimeEnabledFeatures::cssCompositingEnabled())
2286 return false; 2287 return false;
2287 2288
2288 validPrimitive = true; 2289 validPrimitive = true;
2289 break; 2290 break;
2291 case CSSPropertyNavDown: // auto | <id> targetframe | inherit
2292 case CSSPropertyNavLeft:
2293 case CSSPropertyNavRight:
2294 case CSSPropertyNavUp:
2295 if (id == CSSValueAuto
2296 || (num == 1 && (value->unit == CSSPrimitiveValue::CSS_STRING || val ue->unit == CSSPrimitiveValue::CSS_PARSER_HEXCOLOR))) {
2297 value->unit = CSSPrimitiveValue::CSS_STRING;
2298 validPrimitive = true;
2299 } else if (num == 2) {
2300 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
2301 while (value) {
2302 list->append(cssValuePool().createValue(value->string, CSSPrimit iveValue::CSS_STRING));
2303 value = m_valueList->next();
2304 }
2305 parsedValue = list.release();
2306 } else {
2307 return false;
esprehn 2013/06/20 19:45:10 It'd be nicer if you split out these cases more, I
Krzysztof Olczyk 2013/07/22 14:14:16 Done
2308 }
2309 break;
2290 case CSSPropertyWebkitFlex: { 2310 case CSSPropertyWebkitFlex: {
2291 ShorthandScope scope(this, propId); 2311 ShorthandScope scope(this, propId);
2292 if (id == CSSValueNone) { 2312 if (id == CSSValueNone) {
2293 addProperty(CSSPropertyWebkitFlexGrow, cssValuePool().createValue(0, CSSPrimitiveValue::CSS_NUMBER), important); 2313 addProperty(CSSPropertyWebkitFlexGrow, cssValuePool().createValue(0, CSSPrimitiveValue::CSS_NUMBER), important);
2294 addProperty(CSSPropertyWebkitFlexShrink, cssValuePool().createValue( 0, CSSPrimitiveValue::CSS_NUMBER), important); 2314 addProperty(CSSPropertyWebkitFlexShrink, cssValuePool().createValue( 0, CSSPrimitiveValue::CSS_NUMBER), important);
2295 addProperty(CSSPropertyWebkitFlexBasis, cssValuePool().createIdentif ierValue(CSSValueAuto), important); 2315 addProperty(CSSPropertyWebkitFlexBasis, cssValuePool().createIdentif ierValue(CSSValueAuto), important);
2296 return true; 2316 return true;
2297 } 2317 }
2298 return parseFlex(m_valueList.get(), important); 2318 return parseFlex(m_valueList.get(), important);
2299 } 2319 }
(...skipping 9503 matching lines...) Expand 10 before | Expand all | Expand 10 after
11803 { 11823 {
11804 // The tokenizer checks for the construct of an+b. 11824 // The tokenizer checks for the construct of an+b.
11805 // However, since the {ident} rule precedes the {nth} rule, some of those 11825 // However, since the {ident} rule precedes the {nth} rule, some of those
11806 // tokens are identified as string literal. Furthermore we need to accept 11826 // tokens are identified as string literal. Furthermore we need to accept
11807 // "odd" and "even" which does not match to an+b. 11827 // "odd" and "even" which does not match to an+b.
11808 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 11828 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
11809 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 11829 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
11810 } 11830 }
11811 11831
11812 } 11832 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698