Summary: | Not all properties apply to the '::cue' pseudo-element | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Eric Carlson <eric.carlson> | ||||||||||
Component: | Media | Assignee: | Dima Gorbik <dgorbik> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | allan.jensen, dglazkov, dgorbik, esprehn+autocc, feature-media-reviews, jer.noble, koivisto, macpherson, menard, ojan.autocc, vcarbune, webkit-bug-importer, webkit.review.bot | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Attachments: |
|
Description
Eric Carlson
2013-02-23 20:27:07 PST
This is expected. Specs require background properties to apply to cueBox instead of the cue itself (only for ::cue without an argument, if there is an argument we just skip background properties). I have few ideas on how to implement this. (In reply to comment #0) >I wonder if “cue” should be what we now call -webkit-media-text-track-all-nodes? So the hierarchy is: -webkit-media-text-track-container (MediaControlTextTrackContainerElement) | - ::cue (m_cueContainer) | - TextTrackCueBox (WebVTT cue background box according to specs) |- -webkit-media-text-track-all-nodes (m_allDocumentNodes) It should be fine to apply all properties to TextTrackCueBox as there are no differences. Created attachment 190185 [details]
Patch
Comment on attachment 190185 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=190185&action=review CaptionUserPreferencesMac::captionsStyleSheetOverride also needs to be updated so the user preference overrides work. > LayoutTests/media/track/track-css-all-cues.html:21 > + testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).color", "rgb(128, 0, 128)"); > + testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor", "rgb(0, 255, 0)"); We should have tests for all of the white-listed properties. (In reply to comment #5) > We should have tests for all of the white-listed properties. I think this should be done separately and for other test (whitelists related probably), track-css-all-cues.html checks if ::cue matches the right container in general. Also it would be good to have DRT enabled for this. I've created a bug report: https://bugs.webkit.org/show_bug.cgi?id=110902 Created attachment 190348 [details]
Patch
Comment on attachment 190348 [details]
Patch
These changes look correct to me, but I don't know enough about StyleResolver to r+ it.
Would it be better in terms of performance to save MatchingUARulesScope::isMatchingUARules() result to an intermediate variable or is this being optimized by the compiler itself? Comment on attachment 190348 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=190348&action=review > Source/WebCore/html/track/TextTrackCue.cpp:745 > - m_allDocumentNodes->setPseudo(allNodesShadowPseudoId()); > + m_allDocumentNodes->setPseudo(cueShadowPseudoId()); m_allDocumentNodes could still use a less confusing name Comment on attachment 190348 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=190348&action=review > Source/WebCore/css/StyleResolver.cpp:539 > - addMatchedProperties(result, matchedRules[i]->rule()->properties(), matchedRules[i]->rule(), matchedRules[i]->linkMatchType(), matchedRules[i]->propertyWhitelistType()); > + addMatchedProperties(result, matchedRules[i]->rule()->properties(), matchedRules[i]->rule(), matchedRules[i]->linkMatchType(), MatchingUARulesScope::isMatchingUARules() ? PropertyWhitelistNone : matchedRules[i]->propertyWhitelistType()); This seems hackish. Couldn't the propertyWhitelistType() just be correct? Comment on attachment 190348 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=190348&action=review >> Source/WebCore/css/StyleResolver.cpp:539 >> + addMatchedProperties(result, matchedRules[i]->rule()->properties(), matchedRules[i]->rule(), matchedRules[i]->linkMatchType(), MatchingUARulesScope::isMatchingUARules() ? PropertyWhitelistNone : matchedRules[i]->propertyWhitelistType()); > > This seems hackish. Couldn't the propertyWhitelistType() just be correct? Extra space after ? (In reply to comment #11) > (From update of attachment 190348 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=190348&action=review > > > Source/WebCore/css/StyleResolver.cpp:539 > > - addMatchedProperties(result, matchedRules[i]->rule()->properties(), matchedRules[i]->rule(), matchedRules[i]->linkMatchType(), matchedRules[i]->propertyWhitelistType()); > > + addMatchedProperties(result, matchedRules[i]->rule()->properties(), matchedRules[i]->rule(), matchedRules[i]->linkMatchType(), MatchingUARulesScope::isMatchingUARules() ? PropertyWhitelistNone : matchedRules[i]->propertyWhitelistType()); > > This seems hackish. Couldn't the propertyWhitelistType() just be correct? This is the earliest possible point to check MatchingUARulesScope. The problem is that RuleSets are being populated (and whitelist type determined) outside of MatchingUARulesScope visibility. I consider this piece of code as customizing matched properties for a particular type of rules (UA in this case). (In reply to comment #13) > (In reply to comment #11) > > (From update of attachment 190348 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=190348&action=review > > > > > Source/WebCore/css/StyleResolver.cpp:539 > > > - addMatchedProperties(result, matchedRules[i]->rule()->properties(), matchedRules[i]->rule(), matchedRules[i]->linkMatchType(), matchedRules[i]->propertyWhitelistType()); > > > + addMatchedProperties(result, matchedRules[i]->rule()->properties(), matchedRules[i]->rule(), matchedRules[i]->linkMatchType(), MatchingUARulesScope::isMatchingUARules() ? PropertyWhitelistNone : matchedRules[i]->propertyWhitelistType()); > > > > This seems hackish. Couldn't the propertyWhitelistType() just be correct? > > This is the earliest possible point to check MatchingUARulesScope. The problem is that RuleSets are being populated (and whitelist type determined) outside of MatchingUARulesScope visibility. I consider this piece of code as customizing matched properties for a particular type of rules (UA in this case). Could you pass MatchingUARulesScope::isMatchingUARules() to propertyWhitelistType()? MatchingUARulesScope is out-of-band signaling and shouldn't be used at all if possible. It has only one special case client atm. It think you can just pass the information about RuleData being on a UA sheet in AddRuleFlags and set the whitelist appropriately. Comment on attachment 190348 [details] Patch Attachment 190348 [details] did not pass chromium-ews (chromium-xvfb): Output: http://webkit-commit-queue.appspot.com/results/16807018 New failing tests: media/track/track-cue-rendering-horizontal.html Created attachment 190403 [details]
Patch
Comment on attachment 190403 [details] Patch Attachment 190403 [details] did not pass chromium-ews (chromium-xvfb): Output: http://webkit-commit-queue.appspot.com/results/16794019 New failing tests: media/track/track-cue-rendering-horizontal.html Comment on attachment 190348 [details] Patch Cleared Antti Koivisto's review+ from obsolete attachment 190348 [details] so that this bug does not appear in http://webkit.org/pending-commit. (In reply to comment #19) > (From update of attachment 190348 [details]) > Cleared Antti Koivisto's review+ from obsolete attachment 190348 [details] so that this bug does not appear in http://webkit.org/pending-commit. Actually the last one needs to be landed. Though there are some chromium-specific pixel/layout tests that will need a rebaseline after changes land. Comment on attachment 190403 [details] Patch Rejecting attachment 190403 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=webkit-commit-queue.appspot.com', '--bot-id=gce-cq-04', 'apply-attachment', '--no-update', '--non-interactive', 190403, '--port=chromium-xvfb']" exit_code: 2 cwd: /mnt/git/webkit-commit-queue Last 500 characters of output: Core/html/shadow/MediaControlsGtk.cpp.rej patching file Source/WebCore/html/track/TextTrackCue.cpp Hunk #4 FAILED at 741. 1 out of 4 hunks FAILED -- saving rejects to file Source/WebCore/html/track/TextTrackCue.cpp.rej patching file Source/WebCore/html/track/TextTrackCue.h patching file Source/WebCore/page/CaptionUserPreferencesMac.mm Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', '--force', '--reviewer', 'Eric Carlson']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue Full output: http://webkit-commit-queue.appspot.com/results/16987181 Created attachment 191842 [details]
Patch
Comment on attachment 191842 [details] Patch Attachment 191842 [details] did not pass chromium-ews (chromium-xvfb): Output: http://webkit-commit-queue.appspot.com/results/17001110 New failing tests: media/track/track-cue-rendering-horizontal.html media/track/track-cue-rendering-vertical.html Comment on attachment 191842 [details] Patch Attachment 191842 [details] did not pass chromium-ews (chromium-xvfb): Output: http://webkit-commit-queue.appspot.com/results/17060068 New failing tests: media/track/track-cue-rendering-horizontal.html media/track/track-cue-rendering-vertical.html Committed r145397 (http://trac.webkit.org/changeset/145397) |