Bug 190369

Summary: [WebVTT] Support inline WebVTT styles
Product: WebKit Reporter: Per Arne Vollan <pvollan>
Component: WebCore Misc.Assignee: Per Arne Vollan <pvollan>
Status: NEW    
Severity: Normal CC: bfulgham, commit-queue, eric.carlson, jonlee, tsavell, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=191200
Attachments:
Description Flags
Patch
none
Patch
eric.carlson: review+
Patch none

Per Arne Vollan
Reported 2018-10-08 13:10:18 PDT
Inline WebVTT styles are currently not supported in WebKit, see https://w3c.github.io/webvtt/#styling.
Attachments
Patch (19.70 KB, patch)
2018-10-08 14:00 PDT, Per Arne Vollan
no flags
Patch (18.47 KB, patch)
2018-10-15 10:48 PDT, Per Arne Vollan
eric.carlson: review+
Patch (18.47 KB, patch)
2018-10-16 09:46 PDT, Per Arne Vollan
no flags
Per Arne Vollan
Comment 1 2018-10-08 13:10:59 PDT
Per Arne Vollan
Comment 2 2018-10-08 14:00:27 PDT
Eric Carlson
Comment 3 2018-10-09 06:27:56 PDT
Comment on attachment 351812 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=351812&action=review > Source/WebCore/dom/ExtensionStyleSheets.cpp:151 > + for (auto styleSheet : *owningPage->webVTTStyleSheets()) { const auto& > Source/WebCore/dom/ExtensionStyleSheets.cpp:154 > + m_injectedAuthorStyleSheets.append(WTFMove(sheet)); Won't this make the style apply to *every* <track> in the document? Styles in a WebVTT file should only apply to the cues in one track. > Source/WebCore/html/track/LoadableTextTrack.cpp:137 > +void LoadableTextTrack::newStyleSheetsAvailable(TextTrackLoader* loader) TextTrackLoader&, and please file a bug about changing all TextTrackLoader* method parameters in this class. > Source/WebCore/html/track/LoadableTextTrack.cpp:142 > + for (auto cssString : newStyleSheets) const auto& cssString > Source/WebCore/html/track/LoadableTextTrack.cpp:144 > + if (!newStyleSheets.isEmpty()) You could return immediately above if the vector is empty. > Source/WebCore/html/track/WebVTTParser.cpp:359 > + if (line.startsWith("STYLE") && line.substring(regionIdentifierLength).isAllSpecialCharacters<isASpace>()) You need a new constant, "regionIdentifierLength" is wrong for STYLE > LayoutTests/media/track/track-cue-css.html:19 > + waitForEvent('seeked', seeked); Nit: this could be simplified to "waitForEvent('seeked', endTest);"
Per Arne Vollan
Comment 4 2018-10-15 10:48:28 PDT
Eric Carlson
Comment 5 2018-10-15 13:56:45 PDT
Comment on attachment 352345 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=352345&action=review > Source/WebCore/html/track/WebVTTParser.h:176 > + ParseState collectStyleSheet(const String& line); Nit: "line" isn't necessary. > Source/WebCore/loader/TextTrackLoader.h:75 > + void newStyleSheetsParsed() override; Nit: override -> final
Per Arne Vollan
Comment 6 2018-10-16 09:46:54 PDT
Per Arne Vollan
Comment 7 2018-10-16 10:25:06 PDT
(In reply to Eric Carlson from comment #5) > Comment on attachment 352345 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=352345&action=review > > > Source/WebCore/html/track/WebVTTParser.h:176 > > + ParseState collectStyleSheet(const String& line); > > Nit: "line" isn't necessary. > > > Source/WebCore/loader/TextTrackLoader.h:75 > > + void newStyleSheetsParsed() override; > > Nit: override -> final Thanks for reviewing!
WebKit Commit Bot
Comment 8 2018-10-16 10:29:41 PDT
Comment on attachment 352464 [details] Patch Clearing flags on attachment: 352464 Committed r237187: <https://trac.webkit.org/changeset/237187>
Note You need to log in before you can comment on or make changes to this bug.