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

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

Issue 647483009: CSS Parser: Implement parseValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase / update Created 6 years, 1 month 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 | « Source/core/css/parser/CSSParserImpl.cpp ('k') | Source/core/css/parser/CSSParserValues.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 // 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/CSSParserToken.h" 6 #include "core/css/parser/CSSParserToken.h"
7 7
8 #include "wtf/HashMap.h" 8 #include "wtf/HashMap.h"
9 #include "wtf/text/StringHash.h" 9 #include "wtf/text/StringHash.h"
10 #include <limits.h> 10 #include <limits.h>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 , m_numericValueType(numericValueType) 48 , m_numericValueType(numericValueType)
49 , m_numericValue(numericValue) 49 , m_numericValue(numericValue)
50 , m_unit(CSSPrimitiveValue::CSS_NUMBER) 50 , m_unit(CSSPrimitiveValue::CSS_NUMBER)
51 , m_blockType(NotBlock) 51 , m_blockType(NotBlock)
52 { 52 {
53 ASSERT(type == NumberToken); 53 ASSERT(type == NumberToken);
54 } 54 }
55 55
56 CSSParserToken::CSSParserToken(CSSParserTokenType type, UChar32 start, UChar32 e nd) 56 CSSParserToken::CSSParserToken(CSSParserTokenType type, UChar32 start, UChar32 e nd)
57 : m_type(UnicodeRangeToken) 57 : m_type(UnicodeRangeToken)
58 , m_value(String::format("U+%X-%X", start, end)) // FIXME: Remove this once CSSParserValues is gone
58 , m_delimiter(0) 59 , m_delimiter(0)
59 , m_numericValue(0) 60 , m_numericValue(0)
60 , m_unit(CSSPrimitiveValue::CSS_UNKNOWN) 61 , m_unit(CSSPrimitiveValue::CSS_UNKNOWN)
61 , m_unicodeRangeStart(start) 62 , m_unicodeRangeStart(start)
62 , m_unicodeRangeEnd(end) 63 , m_unicodeRangeEnd(end)
63 , m_blockType(NotBlock) 64 , m_blockType(NotBlock)
64 { 65 {
65 ASSERT_UNUSED(type, type == UnicodeRangeToken); 66 ASSERT_UNUSED(type, type == UnicodeRangeToken);
66 } 67 }
67 68
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 return m_numericValueType; 103 return m_numericValueType;
103 } 104 }
104 105
105 double CSSParserToken::numericValue() const 106 double CSSParserToken::numericValue() const
106 { 107 {
107 ASSERT(m_type == NumberToken || m_type == PercentageToken || m_type == Dimen sionToken); 108 ASSERT(m_type == NumberToken || m_type == PercentageToken || m_type == Dimen sionToken);
108 return m_numericValue; 109 return m_numericValue;
109 } 110 }
110 111
111 } // namespace blink 112 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSParserImpl.cpp ('k') | Source/core/css/parser/CSSParserValues.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698