OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // The double* parameter may be 0 to check if the string can be parsed without g
etting the result. | 53 // The double* parameter may be 0 to check if the string can be parsed without g
etting the result. |
54 Decimal parseToDecimalForNumberType(const String&, const Decimal& fallbackValue
= Decimal::nan()); | 54 Decimal parseToDecimalForNumberType(const String&, const Decimal& fallbackValue
= Decimal::nan()); |
55 double parseToDoubleForNumberType(const String&, double fallbackValue = std::num
eric_limits<double>::quiet_NaN()); | 55 double parseToDoubleForNumberType(const String&, double fallbackValue = std::num
eric_limits<double>::quiet_NaN()); |
56 | 56 |
57 // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-integers | 57 // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-integers |
58 bool parseHTMLInteger(const String&, int&); | 58 bool parseHTMLInteger(const String&, int&); |
59 | 59 |
60 // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-non-nega
tive-integers | 60 // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-non-nega
tive-integers |
61 bool parseHTMLNonNegativeInteger(const String&, unsigned&); | 61 bool parseHTMLNonNegativeInteger(const String&, unsigned&); |
62 | 62 |
63 typedef Vector<pair<String, String> > HTMLAttributeList; | 63 typedef Vector<pair<String, String>> HTMLAttributeList; |
64 // The returned encoding might not be valid. | 64 // The returned encoding might not be valid. |
65 WTF::TextEncoding encodingFromMetaAttributes(const HTMLAttributeList&); | 65 WTF::TextEncoding encodingFromMetaAttributes(const HTMLAttributeList&); |
66 | 66 |
67 // Space characters as defined by the HTML specification. | 67 // Space characters as defined by the HTML specification. |
68 template<typename CharType> | 68 template<typename CharType> |
69 inline bool isHTMLSpace(CharType character) | 69 inline bool isHTMLSpace(CharType character) |
70 { | 70 { |
71 // Histogram from Apple's page load test combined with some ad hoc browsing
some other test suites. | 71 // Histogram from Apple's page load test combined with some ad hoc browsing
some other test suites. |
72 // | 72 // |
73 // 82%: 216330 non-space characters, all > U+0020 | 73 // 82%: 216330 non-space characters, all > U+0020 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 inline static String attemptStaticStringCreation(const String str) | 126 inline static String attemptStaticStringCreation(const String str) |
127 { | 127 { |
128 if (!str.is8Bit()) | 128 if (!str.is8Bit()) |
129 return attemptStaticStringCreation(str.characters16(), str.length(), For
ce16Bit); | 129 return attemptStaticStringCreation(str.characters16(), str.length(), For
ce16Bit); |
130 return attemptStaticStringCreation(str.characters8(), str.length()); | 130 return attemptStaticStringCreation(str.characters8(), str.length()); |
131 } | 131 } |
132 | 132 |
133 | 133 |
134 } | 134 } |
135 #endif | 135 #endif |
OLD | NEW |