RESOLVED FIXED 194227
[WebVTT] Inline WebVTT styles should start with '::cue'
https://bugs.webkit.org/show_bug.cgi?id=194227
Summary [WebVTT] Inline WebVTT styles should start with '::cue'
Per Arne Vollan
Reported 2019-02-04 10:46:26 PST
Inline WebVTT starting with e.g. 'video::cue' should not be allowed.
Attachments
Patch (4.61 KB, patch)
2019-02-04 11:56 PST, Per Arne Vollan
no flags
Patch (4.62 KB, patch)
2019-02-04 11:58 PST, Per Arne Vollan
no flags
Patch (4.62 KB, patch)
2019-02-08 10:07 PST, Per Arne Vollan
no flags
Patch (4.67 KB, patch)
2019-02-08 10:52 PST, Per Arne Vollan
no flags
Patch (4.22 KB, patch)
2019-02-13 16:23 PST, Per Arne Vollan
no flags
Patch (4.20 KB, patch)
2019-02-13 16:32 PST, Per Arne Vollan
no flags
Patch (4.20 KB, patch)
2019-02-14 09:51 PST, Per Arne Vollan
no flags
Patch (4.48 KB, patch)
2019-02-14 12:12 PST, Per Arne Vollan
no flags
Archive of layout-test-results from ews107 for mac-highsierra-wk2 (2.86 MB, application/zip)
2019-02-14 15:23 PST, EWS Watchlist
no flags
Patch (4.53 KB, patch)
2019-02-15 09:45 PST, Per Arne Vollan
no flags
Radar WebKit Bug Importer
Comment 1 2019-02-04 10:47:03 PST
Per Arne Vollan
Comment 2 2019-02-04 11:56:37 PST
Per Arne Vollan
Comment 3 2019-02-04 11:58:01 PST
Brent Fulgham
Comment 4 2019-02-08 09:14:16 PST
Comment on attachment 361083 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=361083&action=review > Source/WebCore/ChangeLog:4 > + https://bugs.webkit.org/show_bug.cgi?id=194227 Please show the radar here. > Source/WebCore/html/track/WebVTTParser.cpp:374 > + // Check that stylesheet starts with "::cue". This comment isn't needed (it just repeats what the code says). Maybe it would be better to say "Inline VTT styles must start with ::cue." > Source/WebCore/html/track/WebVTTParser.cpp:380 > + // Check that stylesheet can be parsed. I don't think this comment is needed. > LayoutTests/media/track/captions-webvtt/css-styling.vtt:30 > +} I don't understand these changes. Previously we had a green video::cue style. Now we have a blue inline ::cue style, and an identical video::cue style. Shouldn't these be different so we can see in the test if the right one is being used? And why is "video::cue" now blue, instead of green?
Per Arne Vollan
Comment 5 2019-02-08 10:07:14 PST
Per Arne Vollan
Comment 6 2019-02-08 10:11:19 PST
(In reply to Brent Fulgham from comment #4) > Comment on attachment 361083 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=361083&action=review > > > Source/WebCore/ChangeLog:4 > > + https://bugs.webkit.org/show_bug.cgi?id=194227 > > Please show the radar here. > > > Source/WebCore/html/track/WebVTTParser.cpp:374 > > + // Check that stylesheet starts with "::cue". > > This comment isn't needed (it just repeats what the code says). Maybe it > would be better to say "Inline VTT styles must start with ::cue." > > > Source/WebCore/html/track/WebVTTParser.cpp:380 > > + // Check that stylesheet can be parsed. > > I don't think this comment is needed. > > > LayoutTests/media/track/captions-webvtt/css-styling.vtt:30 > > +} > > I don't understand these changes. Previously we had a green video::cue > style. Now we have a blue inline ::cue style, and an identical video::cue > style. Shouldn't these be different so we can see in the test if the right > one is being used? And why is "video::cue" now blue, instead of green? The original style block was changed from 'video::cue' to '::cue', since 'video::cue' is no longer allowed. The two new style blocks with blue color are testing that we don't allow parse errors and 'video::cue'. There is a syntax error in the first style block. If we see blue text, the test has failed. Thanks for reviewing!
Eric Carlson
Comment 7 2019-02-08 10:26:12 PST
(In reply to Per Arne Vollan from comment #6) > > Thanks for reviewing! I also missed the syntax error (missing semi-colon). Please add a comment or make the error more obvious.
Per Arne Vollan
Comment 8 2019-02-08 10:52:31 PST
Per Arne Vollan
Comment 9 2019-02-08 10:54:28 PST
(In reply to Eric Carlson from comment #7) > (In reply to Per Arne Vollan from comment #6) > > > > Thanks for reviewing! > > I also missed the syntax error (missing semi-colon). Please add a comment or > make the error more obvious. Yes, I think I hid that pretty well :) I have added a comment. Thanks for reviewing!
WebKit Commit Bot
Comment 10 2019-02-08 11:48:10 PST
Comment on attachment 361516 [details] Patch Clearing flags on attachment: 361516 Committed r241203: <https://trac.webkit.org/changeset/241203>
Per Arne Vollan
Comment 11 2019-02-13 16:23:24 PST
Per Arne Vollan
Comment 12 2019-02-13 16:32:20 PST
Eric Carlson
Comment 13 2019-02-13 18:12:15 PST
Comment on attachment 361959 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=361959&action=review > Source/WebCore/html/track/WebVTTParser.cpp:397 > + auto listSize = selectorList.listSize(); > + if (!listSize) > + return true; Do we want to reject the entire style block if any of the selectors is empty?
Per Arne Vollan
Comment 14 2019-02-14 09:51:20 PST
Per Arne Vollan
Comment 15 2019-02-14 09:55:01 PST
(In reply to Eric Carlson from comment #13) > Comment on attachment 361959 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=361959&action=review > > > Source/WebCore/html/track/WebVTTParser.cpp:397 > > + auto listSize = selectorList.listSize(); > > + if (!listSize) > > + return true; > > Do we want to reject the entire style block if any of the selectors is empty? That is a good point. I agree that it would be good to allow the valid selectors in a STYLE block. However, I cannot find a method to remove rules from the stylesheet, maybe we can look closer into this in a follow-up patch? Thanks for reviewing!
Eric Carlson
Comment 16 2019-02-14 11:01:11 PST
(In reply to Per Arne Vollan from comment #15) > (In reply to Eric Carlson from comment #13) > > Comment on attachment 361959 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=361959&action=review > > > > > Source/WebCore/html/track/WebVTTParser.cpp:397 > > > + auto listSize = selectorList.listSize(); > > > + if (!listSize) > > > + return true; > > > > Do we want to reject the entire style block if any of the selectors is empty? > > That is a good point. I agree that it would be good to allow the valid > selectors in a STYLE block. However, I cannot find a method to remove rules > from the stylesheet, maybe we can look closer into this in a follow-up patch? > Do we need to remove empty selectors? What happens if you just leave it?
Eric Carlson
Comment 17 2019-02-14 11:03:27 PST
Comment on attachment 362030 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=362030&action=review > LayoutTests/media/track/captions-webvtt/css-styling.vtt:44 > +STYLE > +::cue { > +color: blue > +font-size: 25px; > +} > +video::cue { > +color: blue; > +font-size: 25px; > +} The test should have style blocks that contain the invalid rule types rejected by WebVTTParser::checkAndStoreStyleSheet (namespace, etc).
Per Arne Vollan
Comment 18 2019-02-14 12:12:36 PST
Per Arne Vollan
Comment 19 2019-02-14 12:15:00 PST
(In reply to Eric Carlson from comment #13) > Comment on attachment 361959 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=361959&action=review > > > Source/WebCore/html/track/WebVTTParser.cpp:397 > > + auto listSize = selectorList.listSize(); > > + if (!listSize) > > + return true; > > Do we want to reject the entire style block if any of the selectors is empty? That is a good point. I agree that it would be good to allow the valid selectors in a STYLE block. However, I cannot find a method to remove rules from the stylesheet, maybe we can look closer into this in a follow-up patch? Thanks for reviewing!(In reply to Eric Carlson from comment #16) > (In reply to Per Arne Vollan from comment #15) > > (In reply to Eric Carlson from comment #13) > > > Comment on attachment 361959 [details] > > > Patch > > > > > > View in context: > > > https://bugs.webkit.org/attachment.cgi?id=361959&action=review > > > > > > > Source/WebCore/html/track/WebVTTParser.cpp:397 > > > > + auto listSize = selectorList.listSize(); > > > > + if (!listSize) > > > > + return true; > > > > > > Do we want to reject the entire style block if any of the selectors is empty? > > > > That is a good point. I agree that it would be good to allow the valid > > selectors in a STYLE block. However, I cannot find a method to remove rules > > from the stylesheet, maybe we can look closer into this in a follow-up patch? > > > Do we need to remove empty selectors? What happens if you just leave it? I think there should be only one selector (::cue) for each rule. I have updated the patch accordingly.
Jon Lee
Comment 20 2019-02-14 14:19:54 PST
EWS Watchlist
Comment 21 2019-02-14 15:23:12 PST
Comment on attachment 362045 [details] Patch Attachment 362045 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/11151241 New failing tests: inspector/css/modify-inline-style.html
EWS Watchlist
Comment 22 2019-02-14 15:23:14 PST
Created attachment 362069 [details] Archive of layout-test-results from ews107 for mac-highsierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-highsierra-wk2 Platform: Mac OS X 10.13.6
Per Arne Vollan
Comment 23 2019-02-15 09:35:55 PST
(In reply to Eric Carlson from comment #17) > Comment on attachment 362030 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=362030&action=review > > > LayoutTests/media/track/captions-webvtt/css-styling.vtt:44 > > +STYLE > > +::cue { > > +color: blue > > +font-size: 25px; > > +} > > +video::cue { > > +color: blue; > > +font-size: 25px; > > +} > > The test should have style blocks that contain the invalid rule types > rejected by WebVTTParser::checkAndStoreStyleSheet (namespace, etc). Unfortunately, I am not able to apply styles to the '::cue' element by using @namespace or @import rules, possibly because it is a pseudo element. I have filed https://bugs.webkit.org/show_bug.cgi?id=194708 to look closer into this.
Per Arne Vollan
Comment 24 2019-02-15 09:45:31 PST
WebKit Commit Bot
Comment 25 2019-02-15 13:13:12 PST
Comment on attachment 362120 [details] Patch Clearing flags on attachment: 362120 Committed r241608: <https://trac.webkit.org/changeset/241608>
WebKit Commit Bot
Comment 26 2019-02-15 13:13:14 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.