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

Side by Side Diff: Source/core/css/parser/CSSParserFastPaths.cpp

Issue 1216523006: Only allow the -webkit-text color keyword in quirks/UA-sheet mode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/css/parser/CSSParserFastPaths.h" 6 #include "core/css/parser/CSSParserFastPaths.h"
7 7
8 #include "core/StylePropertyShorthand.h" 8 #include "core/StylePropertyShorthand.h"
9 #include "core/css/CSSFunctionValue.h" 9 #include "core/css/CSSFunctionValue.h"
10 #include "core/css/CSSValuePool.h" 10 #include "core/css/CSSValuePool.h"
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 return false; 428 return false;
429 } 429 }
430 430
431 PassRefPtrWillBeRawPtr<CSSValue> CSSParserFastPaths::parseColor(const String& st ring, bool quirksMode) 431 PassRefPtrWillBeRawPtr<CSSValue> CSSParserFastPaths::parseColor(const String& st ring, bool quirksMode)
432 { 432 {
433 ASSERT(!string.isEmpty()); 433 ASSERT(!string.isEmpty());
434 CSSParserString cssString; 434 CSSParserString cssString;
435 cssString.init(string); 435 cssString.init(string);
436 CSSValueID valueID = cssValueKeywordID(cssString); 436 CSSValueID valueID = cssValueKeywordID(cssString);
437 if (valueID == CSSValueWebkitText || valueID == CSSValueCurrentcolor || valu eID == CSSValueGrey 437 if (valueID == CSSValueCurrentcolor || valueID == CSSValueGrey
438 || (valueID >= CSSValueAqua && valueID <= CSSValueWindowtext) || valueID == CSSValueMenu 438 || (valueID >= CSSValueAqua && valueID <= CSSValueWindowtext) || valueID == CSSValueMenu
439 || (quirksMode && valueID >= CSSValueWebkitFocusRingColor && valueID < C SSValueWebkitText)) 439 || (quirksMode && valueID >= CSSValueWebkitFocusRingColor && valueID <= CSSValueWebkitText))
440 return cssValuePool().createIdentifierValue(valueID); 440 return cssValuePool().createIdentifierValue(valueID);
441 441
442 RGBA32 color; 442 RGBA32 color;
443 443
444 // Fast path for hex colors and rgb()/rgba() colors 444 // Fast path for hex colors and rgb()/rgba() colors
445 bool parseResult; 445 bool parseResult;
446 if (string.is8Bit()) 446 if (string.is8Bit())
447 parseResult = fastParseColorInternal(color, string.characters8(), string .length(), quirksMode); 447 parseResult = fastParseColorInternal(color, string.characters8(), string .length(), quirksMode);
448 else 448 else
449 parseResult = fastParseColorInternal(color, string.characters16(), strin g.length(), quirksMode); 449 parseResult = fastParseColorInternal(color, string.characters16(), strin g.length(), quirksMode);
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 if (isColorPropertyID(propertyID)) 949 if (isColorPropertyID(propertyID))
950 return parseColor(string, isQuirksModeBehavior(parserMode)); 950 return parseColor(string, isQuirksModeBehavior(parserMode));
951 if (RefPtrWillBeRawPtr<CSSValue> keyword = parseKeywordValue(propertyID, str ing)) 951 if (RefPtrWillBeRawPtr<CSSValue> keyword = parseKeywordValue(propertyID, str ing))
952 return keyword.release(); 952 return keyword.release();
953 if (RefPtrWillBeRawPtr<CSSValue> transform = parseSimpleTransform(propertyID , string)) 953 if (RefPtrWillBeRawPtr<CSSValue> transform = parseSimpleTransform(propertyID , string))
954 return transform.release(); 954 return transform.release();
955 return nullptr; 955 return nullptr;
956 } 956 }
957 957
958 } // namespace blink 958 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/webkit-text-display-none.html ('k') | Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698