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

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

Issue 1285263005: Add use counter for prefixed intrinsic size keywords (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
« 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 || id == CSSValueWebkitGradient 364 || id == CSSValueWebkitGradient
365 || id == CSSValueWebkitCanvas 365 || id == CSSValueWebkitCanvas
366 || id == CSSValueWebkitCrossFade; 366 || id == CSSValueWebkitCrossFade;
367 } 367 }
368 368
369 bool CSSPropertyParser::validWidthOrHeight(CSSParserValue* value, Units unitless ) 369 bool CSSPropertyParser::validWidthOrHeight(CSSParserValue* value, Units unitless )
370 { 370 {
371 int id = value->id; 371 int id = value->id;
372 if (id == CSSValueIntrinsic || id == CSSValueMinIntrinsic || id == CSSValueW ebkitMinContent || id == CSSValueWebkitMaxContent || id == CSSValueWebkitFillAva ilable || id == CSSValueWebkitFitContent) { 372 if (id == CSSValueIntrinsic || id == CSSValueMinIntrinsic || id == CSSValueW ebkitMinContent || id == CSSValueWebkitMaxContent || id == CSSValueWebkitFillAva ilable || id == CSSValueWebkitFitContent) {
373 if (m_context.useCounter()) { 373 if (m_context.useCounter()) {
374 if (value->id == CSSValueIntrinsic) 374 if (value->id == CSSValueIntrinsic)
leviw_travelin_and_unemployed 2015/08/12 21:05:01 Should we switch this to a switch?
cbiesinger 2015/08/12 21:13:53 Done.
375 m_context.useCounter()->count(UseCounter::LegacyCSSValueIntrinsi c); 375 m_context.useCounter()->count(UseCounter::LegacyCSSValueIntrinsi c);
376 else if (value->id == CSSValueMinIntrinsic) 376 else if (value->id == CSSValueMinIntrinsic)
377 m_context.useCounter()->count(UseCounter::LegacyCSSValueMinIntri nsic); 377 m_context.useCounter()->count(UseCounter::LegacyCSSValueMinIntri nsic);
378 else if (value->id == CSSValueWebkitMinContent)
379 m_context.useCounter()->count(UseCounter::CSSValuePrefixedMinCon tent);
380 else if (value->id == CSSValueWebkitMaxContent)
381 m_context.useCounter()->count(UseCounter::CSSValuePrefixedMaxCon tent);
382 else if (value->id == CSSValueWebkitFillAvailable)
383 m_context.useCounter()->count(UseCounter::CSSValuePrefixedFillAv ailable);
384 else if (value->id == CSSValueWebkitFitContent)
385 m_context.useCounter()->count(UseCounter::CSSValuePrefixedFitCon tent);
378 } 386 }
379 return true; 387 return true;
380 } 388 }
381 return validUnit(value, FLength | FPercent | FNonNeg | unitless); 389 return validUnit(value, FLength | FPercent | FNonNeg | unitless);
382 } 390 }
383 391
384 inline PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseValidPr imitive(CSSValueID identifier, CSSParserValue* value) 392 inline PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseValidPr imitive(CSSValueID identifier, CSSParserValue* value)
385 { 393 {
386 if (identifier) 394 if (identifier)
387 return cssValuePool().createIdentifierValue(identifier); 395 return cssValuePool().createIdentifierValue(identifier);
(...skipping 7755 matching lines...) Expand 10 before | Expand all | Expand 10 after
8143 } 8151 }
8144 } 8152 }
8145 8153
8146 if (!list->length()) 8154 if (!list->length())
8147 return nullptr; 8155 return nullptr;
8148 8156
8149 return list.release(); 8157 return list.release();
8150 } 8158 }
8151 8159
8152 } // namespace blink 8160 } // 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