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

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

Issue 18311002: Partial implementation of CSSVariablesMap for CSS Variables CSSOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased onto ToT, cleaned up includes Created 7 years, 5 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
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSStyleDeclaration.h » ('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 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 } 1349 }
1350 1350
1351 static inline void filterProperties(bool important, const CSSParser::ParsedPrope rtyVector& input, Vector<CSSProperty, 256>& output, size_t& unusedEntries, BitAr ray<numCSSProperties>& seenProperties, HashSet<AtomicString>& seenVariables) 1351 static inline void filterProperties(bool important, const CSSParser::ParsedPrope rtyVector& input, Vector<CSSProperty, 256>& output, size_t& unusedEntries, BitAr ray<numCSSProperties>& seenProperties, HashSet<AtomicString>& seenVariables)
1352 { 1352 {
1353 // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found. 1353 // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found.
1354 for (int i = input.size() - 1; i >= 0; --i) { 1354 for (int i = input.size() - 1; i >= 0; --i) {
1355 const CSSProperty& property = input[i]; 1355 const CSSProperty& property = input[i];
1356 if (property.isImportant() != important) 1356 if (property.isImportant() != important)
1357 continue; 1357 continue;
1358 if (property.id() == CSSPropertyVariable) { 1358 if (property.id() == CSSPropertyVariable) {
1359 const AtomicString& name = static_cast<CSSVariableValue*>(property.v alue())->name(); 1359 const AtomicString& name = toCSSVariableValue(property.value())->nam e();
1360 if (!seenVariables.add(name).isNewEntry) 1360 if (!seenVariables.add(name).isNewEntry)
1361 continue; 1361 continue;
1362 output[--unusedEntries] = property; 1362 output[--unusedEntries] = property;
1363 continue; 1363 continue;
1364 } 1364 }
1365 const unsigned propertyIDIndex = property.id() - firstCSSProperty; 1365 const unsigned propertyIDIndex = property.id() - firstCSSProperty;
1366 if (seenProperties.get(propertyIDIndex)) 1366 if (seenProperties.get(propertyIDIndex))
1367 continue; 1367 continue;
1368 seenProperties.set(propertyIDIndex); 1368 seenProperties.set(propertyIDIndex);
1369 output[--unusedEntries] = property; 1369 output[--unusedEntries] = property;
(...skipping 10373 matching lines...) Expand 10 before | Expand all | Expand 10 after
11743 { 11743 {
11744 // The tokenizer checks for the construct of an+b. 11744 // The tokenizer checks for the construct of an+b.
11745 // However, since the {ident} rule precedes the {nth} rule, some of those 11745 // However, since the {ident} rule precedes the {nth} rule, some of those
11746 // tokens are identified as string literal. Furthermore we need to accept 11746 // tokens are identified as string literal. Furthermore we need to accept
11747 // "odd" and "even" which does not match to an+b. 11747 // "odd" and "even" which does not match to an+b.
11748 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 11748 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
11749 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 11749 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
11750 } 11750 }
11751 11751
11752 } 11752 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSStyleDeclaration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698