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

Side by Side Diff: Source/core/css/CSSParser-in.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: Added tests Created 7 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
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 2255 matching lines...) Expand 10 before | Expand all | Expand 10 after
2275 } 2276 }
2276 return false; 2277 return false;
2277 } 2278 }
2278 break; 2279 break;
2279 case CSSPropertyMixBlendMode: 2280 case CSSPropertyMixBlendMode:
2280 if (!RuntimeEnabledFeatures::cssCompositingEnabled()) 2281 if (!RuntimeEnabledFeatures::cssCompositingEnabled())
2281 return false; 2282 return false;
2282 2283
2283 validPrimitive = true; 2284 validPrimitive = true;
2284 break; 2285 break;
2286 case CSSPropertyNavDown: // auto | <id> targetframe | inherit
2287 case CSSPropertyNavLeft:
2288 case CSSPropertyNavRight:
2289 case CSSPropertyNavUp:
2290 if (id == CSSValueAuto) {
2291 value->unit = CSSPrimitiveValue::CSS_STRING;
2292 validPrimitive = true;
2293 } else if (num == 1 && (value->unit == CSSPrimitiveValue::CSS_STRING || value->unit == CSSPrimitiveValue::CSS_PARSER_HEXCOLOR)) {
2294 value->unit = CSSPrimitiveValue::CSS_STRING;
2295 validPrimitive = true;
2296 } else if (num == 2) {
2297 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
2298 while (value) {
2299 list->append(cssValuePool().createValue(value->string, CSSPrimit iveValue::CSS_STRING));
2300 value = m_valueList->next();
2301 }
2302 parsedValue = list.release();
2303 } else {
2304 return false;
esprehn 2013/08/08 03:39:40 indent is wrong
Krzysztof Olczyk 2013/12/04 13:56:50 Done.
2305 }
2306 break;
2285 case CSSPropertyFlex: { 2307 case CSSPropertyFlex: {
2286 ShorthandScope scope(this, propId); 2308 ShorthandScope scope(this, propId);
2287 if (id == CSSValueNone) { 2309 if (id == CSSValueNone) {
2288 addProperty(CSSPropertyFlexGrow, cssValuePool().createValue(0, CSSPr imitiveValue::CSS_NUMBER), important); 2310 addProperty(CSSPropertyFlexGrow, cssValuePool().createValue(0, CSSPr imitiveValue::CSS_NUMBER), important);
2289 addProperty(CSSPropertyFlexShrink, cssValuePool().createValue(0, CSS PrimitiveValue::CSS_NUMBER), important); 2311 addProperty(CSSPropertyFlexShrink, cssValuePool().createValue(0, CSS PrimitiveValue::CSS_NUMBER), important);
2290 addProperty(CSSPropertyFlexBasis, cssValuePool().createIdentifierVal ue(CSSValueAuto), important); 2312 addProperty(CSSPropertyFlexBasis, cssValuePool().createIdentifierVal ue(CSSValueAuto), important);
2291 return true; 2313 return true;
2292 } 2314 }
2293 return parseFlex(m_valueList.get(), important); 2315 return parseFlex(m_valueList.get(), important);
2294 } 2316 }
(...skipping 9511 matching lines...) Expand 10 before | Expand all | Expand 10 after
11806 { 11828 {
11807 // The tokenizer checks for the construct of an+b. 11829 // The tokenizer checks for the construct of an+b.
11808 // However, since the {ident} rule precedes the {nth} rule, some of those 11830 // However, since the {ident} rule precedes the {nth} rule, some of those
11809 // tokens are identified as string literal. Furthermore we need to accept 11831 // tokens are identified as string literal. Furthermore we need to accept
11810 // "odd" and "even" which does not match to an+b. 11832 // "odd" and "even" which does not match to an+b.
11811 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 11833 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
11812 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 11834 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
11813 } 11835 }
11814 11836
11815 } 11837 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698