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

Issue 77553004: Defer setting type in the WebVTT tokenizer until emitting the token (Closed)

Created:
7 years, 1 month ago by fs
Modified:
7 years, 1 month ago
CC:
blink-reviews, nessy, philipj_slow, gasubic, feature-media-reviews_chromium.org, dglazkov+blink, adamk+blink_chromium.org, vcarbune.chromium
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Defer setting type in the WebVTT tokenizer until emitting the token Remove setting of the token type from begin* (and analog) methods in VTTToken, and add a new setType. Call setType from the token-emitting methods in VTTTokenizer. Remove ASSERTs that no longer apply. Because of this change, VTTTokenizer::haveBufferedCharacterToken can no longer return a value based on the type of token - make it return false always (there should never be a buffered character token - a token should be emitted after each and every call to nextToken that returns true). This also means that "EOF" (read: end-of-string) handling needs to be improved. Adopt the method from the HTML parser, that appends a segment with an EOF marker (a NUL) to the input, and adjust EOF handling to match (make sure to consume the EOF, and exit early and return false if encountering a EOF mark at the start of the FSM). While doing this, also hide the "implementation detail" that SegmentedString is used, by just passing a String to the tokenizer via the constructor. After doing the above, it becomes apparent that the EndTagOpenState is redundant with the EndTagState, so they can be merged. (The former state does not appear in the spec text.) A number of end-of-input cases are fixed: tags.html - "<c." now parses correctly. timestamp.html - "<00:00:00.500" now parses correctly. New tests: entities.html - (A number of FAIL -> PASS transitions here compared to previously - due to actually setting the correct token- type for content with only an entity (or something looking like an entity. Also no longer triggers an assert in Debug.) BUG=319391 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=162373

Patch Set 1 #

Total comments: 2

Messages

Total messages: 6 (0 generated)
fs
7 years, 1 month ago (2013-11-20 10:16:46 UTC) #1
jochen (gone - plz use gerrit)
https://codereview.chromium.org/77553004/diff/1/Source/core/html/track/vtt/VTTToken.h File Source/core/html/track/vtt/VTTToken.h (right): https://codereview.chromium.org/77553004/diff/1/Source/core/html/track/vtt/VTTToken.h#newcode107 Source/core/html/track/vtt/VTTToken.h:107: void beginTimestampTag(UChar character) what's the point of having all ...
7 years, 1 month ago (2013-11-20 14:09:37 UTC) #2
fs
On 2013/11/20 14:09:37, jochen wrote: > https://codereview.chromium.org/77553004/diff/1/Source/core/html/track/vtt/VTTToken.h > File Source/core/html/track/vtt/VTTToken.h (right): > > https://codereview.chromium.org/77553004/diff/1/Source/core/html/track/vtt/VTTToken.h#newcode107 > ...
7 years, 1 month ago (2013-11-20 14:21:28 UTC) #3
jochen (gone - plz use gerrit)
lgtm
7 years, 1 month ago (2013-11-20 14:22:00 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fs@opera.com/77553004/1
7 years, 1 month ago (2013-11-20 14:29:47 UTC) #5
commit-bot: I haz the power
7 years, 1 month ago (2013-11-20 15:31:40 UTC) #6
Message was sent while issue was closed.
Change committed as 162373

Powered by Google App Engine
This is Rietveld 408576698