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

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

Issue 252743004: A thread safe CSS calc parser for sizes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed CSSCalc tests that assert Created 6 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
« no previous file with comments | « Source/core/css/parser/MediaQueryToken.h ('k') | Source/core/css/parser/MediaQueryTokenizer.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/MediaQueryToken.h" 6 #include "core/css/parser/MediaQueryToken.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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 if (m_numericValueType == IntegerValueType) 99 if (m_numericValueType == IntegerValueType)
100 sprintf(buffer, "%d%s", static_cast<int>(m_numericValue), unitBuffer ); 100 sprintf(buffer, "%d%s", static_cast<int>(m_numericValue), unitBuffer );
101 else 101 else
102 sprintf(buffer, "%f%s", m_numericValue, unitBuffer); 102 sprintf(buffer, "%f%s", m_numericValue, unitBuffer);
103 103
104 return String(buffer, strlen(buffer)); 104 return String(buffer, strlen(buffer));
105 } 105 }
106 return String(); 106 return String();
107 } 107 }
108 108
109 UChar MediaQueryToken::delimiter() const
110 {
111 ASSERT(m_type == DelimiterToken);
112 return m_delimiter;
113 }
114
115 NumericValueType MediaQueryToken::numericValueType() const
116 {
117 ASSERT(m_type == NumberToken || m_type == PercentageToken || m_type == Dimen sionToken);
118 return m_numericValueType;
119 }
120
121 double MediaQueryToken::numericValue() const
122 {
123 ASSERT(m_type == NumberToken || m_type == PercentageToken || m_type == Dimen sionToken);
124 return m_numericValue;
125 }
126
109 } // namespace WebCore 127 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/parser/MediaQueryToken.h ('k') | Source/core/css/parser/MediaQueryTokenizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698