OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
3 * Copyright (C) 2011, 2014 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011, 2014 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 } | 63 } |
64 | 64 |
65 static TextPosition uninitializedPositionValue1() | 65 static TextPosition uninitializedPositionValue1() |
66 { | 66 { |
67 return TextPosition(OrdinalNumber::fromOneBasedInt(-1), OrdinalNumber::first
()); | 67 return TextPosition(OrdinalNumber::fromOneBasedInt(-1), OrdinalNumber::first
()); |
68 } | 68 } |
69 | 69 |
70 static inline bool isAllWhitespace(const String& string) | 70 static inline bool isAllWhitespace(const String& string) |
71 { | 71 { |
72 return string.isAllSpecialCharacters<isHTMLSpace<UChar> >(); | 72 return string.isAllSpecialCharacters<isHTMLSpace<UChar>>(); |
73 } | 73 } |
74 | 74 |
75 static inline bool isAllWhitespaceOrReplacementCharacters(const String& string) | 75 static inline bool isAllWhitespaceOrReplacementCharacters(const String& string) |
76 { | 76 { |
77 return string.isAllSpecialCharacters<isHTMLSpaceOrReplacementCharacter>(); | 77 return string.isAllSpecialCharacters<isHTMLSpaceOrReplacementCharacter>(); |
78 } | 78 } |
79 | 79 |
80 static bool isNumberedHeaderTag(const AtomicString& tagName) | 80 static bool isNumberedHeaderTag(const AtomicString& tagName) |
81 { | 81 { |
82 return tagName == h1Tag | 82 return tagName == h1Tag |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 void skipAtMostOneLeadingNewline() | 169 void skipAtMostOneLeadingNewline() |
170 { | 170 { |
171 ASSERT(!isEmpty()); | 171 ASSERT(!isEmpty()); |
172 if ((*m_characters)[m_current] == '\n') | 172 if ((*m_characters)[m_current] == '\n') |
173 ++m_current; | 173 ++m_current; |
174 } | 174 } |
175 | 175 |
176 void skipLeadingWhitespace() | 176 void skipLeadingWhitespace() |
177 { | 177 { |
178 skipLeading<isHTMLSpace<UChar> >(); | 178 skipLeading<isHTMLSpace<UChar>>(); |
179 } | 179 } |
180 | 180 |
181 String takeLeadingWhitespace() | 181 String takeLeadingWhitespace() |
182 { | 182 { |
183 return takeLeading<isHTMLSpace<UChar> >(); | 183 return takeLeading<isHTMLSpace<UChar>>(); |
184 } | 184 } |
185 | 185 |
186 void skipLeadingNonWhitespace() | 186 void skipLeadingNonWhitespace() |
187 { | 187 { |
188 skipLeading<isNotHTMLSpace<UChar> >(); | 188 skipLeading<isNotHTMLSpace<UChar>>(); |
189 } | 189 } |
190 | 190 |
191 String takeRemaining() | 191 String takeRemaining() |
192 { | 192 { |
193 ASSERT(!isEmpty()); | 193 ASSERT(!isEmpty()); |
194 unsigned start = m_current; | 194 unsigned start = m_current; |
195 m_current = m_end; | 195 m_current = m_end; |
196 // Notice that substring is smart enough to return *this when start == 0
. | 196 // Notice that substring is smart enough to return *this when start == 0
. |
197 return String(m_characters->substring(start, m_end - start)); | 197 return String(m_characters->substring(start, m_end - start)); |
198 } | 198 } |
(...skipping 2605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2804 ASSERT(m_isAttached); | 2804 ASSERT(m_isAttached); |
2805 // Warning, this may detach the parser. Do not do anything else after this. | 2805 // Warning, this may detach the parser. Do not do anything else after this. |
2806 m_tree.finishedParsing(); | 2806 m_tree.finishedParsing(); |
2807 } | 2807 } |
2808 | 2808 |
2809 void HTMLTreeBuilder::parseError(AtomicHTMLToken*) | 2809 void HTMLTreeBuilder::parseError(AtomicHTMLToken*) |
2810 { | 2810 { |
2811 } | 2811 } |
2812 | 2812 |
2813 } // namespace blink | 2813 } // namespace blink |
OLD | NEW |