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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // 4.8.10.13.4 WebVTT cue text tokenizer | 108 // 4.8.10.13.4 WebVTT cue text tokenizer |
109 switch (state) { | 109 switch (state) { |
110 WEBVTT_BEGIN_STATE(DataState) { | 110 WEBVTT_BEGIN_STATE(DataState) { |
111 if (cc == '&') { | 111 if (cc == '&') { |
112 buffer.append(static_cast<LChar>(cc)); | 112 buffer.append(static_cast<LChar>(cc)); |
113 WEBVTT_ADVANCE_TO(EscapeState); | 113 WEBVTT_ADVANCE_TO(EscapeState); |
114 } else if (cc == '<') { | 114 } else if (cc == '<') { |
115 if (result.isEmpty()) { | 115 if (result.isEmpty()) { |
116 WEBVTT_ADVANCE_TO(TagState); | 116 WEBVTT_ADVANCE_TO(TagState); |
117 } else { | 117 } else { |
118 // We don't want to advance input or perform a state transition - just
return a (new) token. | 118 // We don't want to advance input or perform a state transition - just |
119 // (On the next call to nextToken we will see '<' again, but take the
other branch in this if instead.) | 119 // return a (new) token. (On the next call to nextToken we will see |
| 120 // '<' again, but take the other branch in this if instead.) |
120 return emitToken(token, VTTToken::StringToken(result.toString())); | 121 return emitToken(token, VTTToken::StringToken(result.toString())); |
121 } | 122 } |
122 } else if (cc == kEndOfFileMarker) { | 123 } else if (cc == kEndOfFileMarker) { |
123 return advanceAndEmitToken(m_input, token, | 124 return advanceAndEmitToken(m_input, token, |
124 VTTToken::StringToken(result.toString())); | 125 VTTToken::StringToken(result.toString())); |
125 } else { | 126 } else { |
126 result.append(cc); | 127 result.append(cc); |
127 WEBVTT_ADVANCE_TO(DataState); | 128 WEBVTT_ADVANCE_TO(DataState); |
128 } | 129 } |
129 } | 130 } |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 WEBVTT_ADVANCE_TO(TimestampTagState); | 263 WEBVTT_ADVANCE_TO(TimestampTagState); |
263 } | 264 } |
264 END_STATE() | 265 END_STATE() |
265 } | 266 } |
266 | 267 |
267 NOTREACHED(); | 268 NOTREACHED(); |
268 return false; | 269 return false; |
269 } | 270 } |
270 | 271 |
271 } // namespace blink | 272 } // namespace blink |
OLD | NEW |