OLD | NEW |
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 Loading... |
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 |
OLD | NEW |