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

Side by Side Diff: third_party/WebKit/Source/core/css/properties/CSSPropertyAPIZoom.cpp

Issue 2821843002: Delete deprecated properties zoom:reset and zoom:document. (Closed)
Patch Set: rebase-update Created 3 years, 7 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 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "core/css/properties/CSSPropertyAPIZoom.h" 5 #include "core/css/properties/CSSPropertyAPIZoom.h"
6 6
7 #include "core/css/parser/CSSParserContext.h" 7 #include "core/css/parser/CSSParserContext.h"
8 #include "core/css/parser/CSSPropertyParserHelpers.h" 8 #include "core/css/parser/CSSPropertyParserHelpers.h"
9 #include "core/frame/UseCounter.h" 9 #include "core/frame/UseCounter.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 const CSSValue* CSSPropertyAPIZoom::parseSingleValue( 13 const CSSValue* CSSPropertyAPIZoom::parseSingleValue(
14 CSSParserTokenRange& range, 14 CSSParserTokenRange& range,
15 const CSSParserContext& context, 15 const CSSParserContext& context,
16 CSSPropertyID) { 16 CSSPropertyID) {
17 const CSSParserToken& token = range.Peek(); 17 const CSSParserToken& token = range.Peek();
18 CSSValue* zoom = nullptr; 18 CSSValue* zoom = nullptr;
19 if (token.GetType() == kIdentToken) { 19 if (token.GetType() == kIdentToken) {
20 zoom = CSSPropertyParserHelpers::ConsumeIdent<CSSValueNormal, CSSValueReset, 20 zoom = CSSPropertyParserHelpers::ConsumeIdent<CSSValueNormal>(range);
21 CSSValueDocument>(range);
22 } else { 21 } else {
23 zoom = 22 zoom =
24 CSSPropertyParserHelpers::ConsumePercent(range, kValueRangeNonNegative); 23 CSSPropertyParserHelpers::ConsumePercent(range, kValueRangeNonNegative);
25 if (!zoom) { 24 if (!zoom) {
26 zoom = CSSPropertyParserHelpers::ConsumeNumber(range, 25 zoom = CSSPropertyParserHelpers::ConsumeNumber(range,
27 kValueRangeNonNegative); 26 kValueRangeNonNegative);
28 } 27 }
29 } 28 }
30 if (zoom) { 29 if (zoom) {
31 if (!(token.Id() == CSSValueNormal || 30 if (!(token.Id() == CSSValueNormal ||
32 (token.GetType() == kNumberToken && 31 (token.GetType() == kNumberToken &&
33 ToCSSPrimitiveValue(zoom)->GetDoubleValue() == 1) || 32 ToCSSPrimitiveValue(zoom)->GetDoubleValue() == 1) ||
34 (token.GetType() == kPercentageToken && 33 (token.GetType() == kPercentageToken &&
35 ToCSSPrimitiveValue(zoom)->GetDoubleValue() == 100))) 34 ToCSSPrimitiveValue(zoom)->GetDoubleValue() == 100)))
36 context.Count(UseCounter::kCSSZoomNotEqualToOne); 35 context.Count(UseCounter::kCSSZoomNotEqualToOne);
37 if (token.Id() == CSSValueReset)
38 context.CountDeprecation(UseCounter::kCSSZoomReset);
39 if (token.Id() == CSSValueDocument)
40 context.CountDeprecation(UseCounter::kCSSZoomDocument);
41 } 36 }
42 return zoom; 37 return zoom;
43 } 38 }
44 39
45 } // namespace blink 40 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698