OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 result.append(noBreakSpace); | 134 result.append(noBreakSpace); |
135 } else { | 135 } else { |
136 buffer.append(static_cast<LChar>(cc)); | 136 buffer.append(static_cast<LChar>(cc)); |
137 result.append(buffer); | 137 result.append(buffer); |
138 } | 138 } |
139 buffer.clear(); | 139 buffer.clear(); |
140 WEBVTT_ADVANCE_TO(DataState); | 140 WEBVTT_ADVANCE_TO(DataState); |
141 } else if (isASCIIAlphanumeric(cc)) { | 141 } else if (isASCIIAlphanumeric(cc)) { |
142 buffer.append(static_cast<LChar>(cc)); | 142 buffer.append(static_cast<LChar>(cc)); |
143 WEBVTT_ADVANCE_TO(EscapeState); | 143 WEBVTT_ADVANCE_TO(EscapeState); |
| 144 } else if (cc == '<') { |
| 145 result.append(buffer); |
| 146 return emitToken(VTTToken::StringToken(result.toString())); |
144 } else if (cc == kEndOfFileMarker) { | 147 } else if (cc == kEndOfFileMarker) { |
145 result.append(buffer); | 148 result.append(buffer); |
146 return advanceAndEmitToken(source, VTTToken::StringToken(result.
toString())); | 149 return advanceAndEmitToken(source, VTTToken::StringToken(result.
toString())); |
147 } else { | 150 } else { |
148 if (!equalLiteral(buffer, "&")) | 151 result.append(buffer); |
149 result.append(buffer); | |
150 buffer.clear(); | 152 buffer.clear(); |
| 153 |
| 154 if (cc == '&') { |
| 155 buffer.append(static_cast<LChar>(cc)); |
| 156 WEBVTT_ADVANCE_TO(EscapeState); |
| 157 } |
| 158 result.append(cc); |
151 WEBVTT_ADVANCE_TO(DataState); | 159 WEBVTT_ADVANCE_TO(DataState); |
152 } | 160 } |
153 } | 161 } |
154 END_STATE() | 162 END_STATE() |
155 | 163 |
156 WEBVTT_BEGIN_STATE(TagState) { | 164 WEBVTT_BEGIN_STATE(TagState) { |
157 if (isTokenizerWhitespace(cc)) { | 165 if (isTokenizerWhitespace(cc)) { |
158 ASSERT(result.isEmpty()); | 166 ASSERT(result.isEmpty()); |
159 WEBVTT_ADVANCE_TO(StartTagAnnotationState); | 167 WEBVTT_ADVANCE_TO(StartTagAnnotationState); |
160 } else if (cc == '.') { | 168 } else if (cc == '.') { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 END_STATE() | 243 END_STATE() |
236 | 244 |
237 } | 245 } |
238 | 246 |
239 ASSERT_NOT_REACHED(); | 247 ASSERT_NOT_REACHED(); |
240 return false; | 248 return false; |
241 } | 249 } |
242 | 250 |
243 } | 251 } |
244 | 252 |
OLD | NEW |