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

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

Issue 1311713004: Add UseCounters for usage of -webkit-text (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 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 | « no previous file | Source/core/frame/UseCounter.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 2311 matching lines...) Expand 10 before | Expand all | Expand 10 after
2322 || (id >= CSSValueAliceblue && id <= CSSValueYellowgreen) 2322 || (id >= CSSValueAliceblue && id <= CSSValueYellowgreen)
2323 || id == CSSValueMenu; 2323 || id == CSSValueMenu;
2324 } 2324 }
2325 2325
2326 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseColor(const CS SParserValue* value, bool acceptQuirkyColors) 2326 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseColor(const CS SParserValue* value, bool acceptQuirkyColors)
2327 { 2327 {
2328 CSSValueID id = value->id; 2328 CSSValueID id = value->id;
2329 if (isColorKeyword(id)) { 2329 if (isColorKeyword(id)) {
2330 if (!isValueAllowedInMode(id, m_context.mode())) 2330 if (!isValueAllowedInMode(id, m_context.mode()))
2331 return nullptr; 2331 return nullptr;
2332 if (id == CSSValueWebkitText && m_context.useCounter())
2333 m_context.useCounter()->count(UseCounter::WebkitTextInColorProperty) ;
2332 return cssValuePool().createIdentifierValue(id); 2334 return cssValuePool().createIdentifierValue(id);
2333 } 2335 }
2334 RGBA32 c = Color::transparent; 2336 RGBA32 c = Color::transparent;
2335 if (!parseColorFromValue(value, c, acceptQuirkyColors)) 2337 if (!parseColorFromValue(value, c, acceptQuirkyColors))
2336 return nullptr; 2338 return nullptr;
2337 return cssValuePool().createColorValue(c); 2339 return cssValuePool().createColorValue(c);
2338 } 2340 }
2339 2341
2340 bool CSSPropertyParser::parseFillImage(CSSParserValueList* valueList, RefPtrWill BeRawPtr<CSSValue>& value) 2342 bool CSSPropertyParser::parseFillImage(CSSParserValueList* valueList, RefPtrWill BeRawPtr<CSSValue>& value)
2341 { 2343 {
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
2844 case CSSPropertyWebkitBackgroundClip: 2846 case CSSPropertyWebkitBackgroundClip:
2845 case CSSPropertyWebkitBackgroundOrigin: 2847 case CSSPropertyWebkitBackgroundOrigin:
2846 case CSSPropertyWebkitMaskClip: 2848 case CSSPropertyWebkitMaskClip:
2847 case CSSPropertyWebkitMaskOrigin: 2849 case CSSPropertyWebkitMaskOrigin:
2848 // The first three values here are deprecated and do not apply to th e version of the property that has 2850 // The first three values here are deprecated and do not apply to th e version of the property that has
2849 // the -webkit- prefix removed. 2851 // the -webkit- prefix removed.
2850 if (val->id == CSSValueBorder || val->id == CSSValuePadding || val-> id == CSSValueContent 2852 if (val->id == CSSValueBorder || val->id == CSSValuePadding || val-> id == CSSValueContent
2851 || val->id == CSSValueBorderBox || val->id == CSSValuePaddingBox || val->id == CSSValueContentBox 2853 || val->id == CSSValueBorderBox || val->id == CSSValuePaddingBox || val->id == CSSValueContentBox
2852 || ((propId == CSSPropertyWebkitBackgroundClip || propId == CSSP ropertyWebkitMaskClip) 2854 || ((propId == CSSPropertyWebkitBackgroundClip || propId == CSSP ropertyWebkitMaskClip)
2853 && (val->id == CSSValueText || val->id == CSSValueWebkitText ))) { 2855 && (val->id == CSSValueText || val->id == CSSValueWebkitText ))) {
2856 if (val->id == CSSValueWebkitText && m_context.useCounter())
2857 m_context.useCounter()->count(UseCounter::WebkitTextInClipPr operty);
2854 currValue = cssValuePool().createIdentifierValue(val->id); 2858 currValue = cssValuePool().createIdentifierValue(val->id);
2855 m_valueList->next(); 2859 m_valueList->next();
2856 } 2860 }
2857 break; 2861 break;
2858 case CSSPropertyBackgroundClip: 2862 case CSSPropertyBackgroundClip:
2859 if (parseBackgroundClip(val, currValue)) 2863 if (parseBackgroundClip(val, currValue)) {
2864 if (val->id == CSSValueWebkitText && m_context.useCounter())
2865 m_context.useCounter()->count(UseCounter::WebkitTextInClipPr operty);
2860 m_valueList->next(); 2866 m_valueList->next();
2867 }
2861 break; 2868 break;
2862 case CSSPropertyBackgroundOrigin: 2869 case CSSPropertyBackgroundOrigin:
2863 if (val->id == CSSValueBorderBox || val->id == CSSValuePaddingBox || val->id == CSSValueContentBox) { 2870 if (val->id == CSSValueBorderBox || val->id == CSSValuePaddingBox || val->id == CSSValueContentBox) {
2864 currValue = cssValuePool().createIdentifierValue(val->id); 2871 currValue = cssValuePool().createIdentifierValue(val->id);
2865 m_valueList->next(); 2872 m_valueList->next();
2866 } 2873 }
2867 break; 2874 break;
2868 case CSSPropertyBackgroundPosition: 2875 case CSSPropertyBackgroundPosition:
2869 if (!inShorthand()) 2876 if (!inShorthand())
2870 unitless = FUnitlessQuirk; 2877 unitless = FUnitlessQuirk;
(...skipping 5222 matching lines...) Expand 10 before | Expand all | Expand 10 after
8093 } 8100 }
8094 } 8101 }
8095 8102
8096 if (!list->length()) 8103 if (!list->length())
8097 return nullptr; 8104 return nullptr;
8098 8105
8099 return list.release(); 8106 return list.release();
8100 } 8107 }
8101 8108
8102 } // namespace blink 8109 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698