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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.h

Issue 1636333003: Implement specced parsing algorithm for <area coords> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
OLDNEW
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
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 // https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing- a-list-of-floating-point-numbers
64 Vector<double> parseHTMLListOfFloatingPointNumbers(const String&);
65
63 typedef Vector<std::pair<String, String>> HTMLAttributeList; 66 typedef Vector<std::pair<String, String>> HTMLAttributeList;
64 // The returned encoding might not be valid. 67 // The returned encoding might not be valid.
65 WTF::TextEncoding encodingFromMetaAttributes(const HTMLAttributeList&); 68 WTF::TextEncoding encodingFromMetaAttributes(const HTMLAttributeList&);
66 69
67 // Space characters as defined by the HTML specification. 70 // Space characters as defined by the HTML specification.
68 template<typename CharType> 71 template<typename CharType>
69 inline bool isHTMLSpace(CharType character) 72 inline bool isHTMLSpace(CharType character)
70 { 73 {
71 // Histogram from Apple's page load test combined with some ad hoc browsing some other test suites. 74 // Histogram from Apple's page load test combined with some ad hoc browsing some other test suites.
72 // 75 //
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 128
126 inline static String attemptStaticStringCreation(const String str) 129 inline static String attemptStaticStringCreation(const String str)
127 { 130 {
128 if (!str.is8Bit()) 131 if (!str.is8Bit())
129 return attemptStaticStringCreation(str.characters16(), str.length(), For ce16Bit); 132 return attemptStaticStringCreation(str.characters16(), str.length(), For ce16Bit);
130 return attemptStaticStringCreation(str.characters8(), str.length()); 133 return attemptStaticStringCreation(str.characters8(), str.length());
131 } 134 }
132 135
133 } // namespace blink 136 } // namespace blink
134 #endif 137 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698