| 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 "core/css/parser/CSSTokenizerInputStream.h" | 5 #include "core/css/parser/CSSTokenizerInputStream.h" |
| 6 | 6 |
| 7 #include "core/html/parser/HTMLParserIdioms.h" | 7 #include "core/html/parser/HTMLParserIdioms.h" |
| 8 #include "wtf/text/StringToNumber.h" | 8 #include "platform/wtf/text/StringToNumber.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 CSSTokenizerInputStream::CSSTokenizerInputStream(const String& input) | 12 CSSTokenizerInputStream::CSSTokenizerInputStream(const String& input) |
| 13 : offset_(0), string_length_(input.length()), string_(input.Impl()) {} | 13 : offset_(0), string_length_(input.length()), string_(input.Impl()) {} |
| 14 | 14 |
| 15 void CSSTokenizerInputStream::AdvanceUntilNonWhitespace() { | 15 void CSSTokenizerInputStream::AdvanceUntilNonWhitespace() { |
| 16 // Using HTML space here rather than CSS space since we don't do preprocessing | 16 // Using HTML space here rather than CSS space since we don't do preprocessing |
| 17 if (string_->Is8Bit()) { | 17 if (string_->Is8Bit()) { |
| 18 const LChar* characters = string_->Characters8(); | 18 const LChar* characters = string_->Characters8(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 35 end - start, &is_result_ok); | 35 end - start, &is_result_ok); |
| 36 else | 36 else |
| 37 result = CharactersToDouble(string_->Characters16() + offset_ + start, | 37 result = CharactersToDouble(string_->Characters16() + offset_ + start, |
| 38 end - start, &is_result_ok); | 38 end - start, &is_result_ok); |
| 39 } | 39 } |
| 40 // FIXME: It looks like callers ensure we have a valid number | 40 // FIXME: It looks like callers ensure we have a valid number |
| 41 return is_result_ok ? result : 0.0; | 41 return is_result_ok ? result : 0.0; |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace blink | 44 } // namespace blink |
| OLD | NEW |