NEW 161747
Class selectors on pseudo elements should be forbidden.
https://bugs.webkit.org/show_bug.cgi?id=161747
Summary Class selectors on pseudo elements should be forbidden.
Dave Hyatt
Reported 2016-09-08 11:40:38 PDT
From the corresponding Chromium bug: We have this selector in mediaControls(New).css: video::-webkit-media-text-track-region-container.scrolling Only user action pseudo classes should be allowed after pseudo elements. We should rewrite this somehow. If we need to express this with custom pseudo elements, an internal :scrolling pseudo class would have been better, I think. https://bugs.chromium.org/p/chromium/issues/detail?id=578131
Attachments
Ahmad Saleem
Comment 2 2023-09-03 04:08:41 PDT
Plus for some reason, we don't have 'return nulltpr' in this: if (m_precedingPseudoElement) { // FIXME: https://bugs.webkit.org/show_bug.cgi?id=161747 // The UASheetMode check is a work-around to allow this selector in mediaControls(New).css: // video::-webkit-media-text-track-region-container.scrolling if (m_context.mode != UASheetMode && !isSimpleSelectorValidAfterPseudoElement(*selector, *m_precedingPseudoElement)) m_failedParsing = true; // HERE MISSING Return? }
Ahmad Saleem
Comment 3 2023-09-03 05:34:24 PDT
(In reply to Ahmad Saleem from comment #2) > Plus for some reason, we don't have 'return nulltpr' in this: > > > if (m_precedingPseudoElement) { > // FIXME: https://bugs.webkit.org/show_bug.cgi?id=161747 > // The UASheetMode check is a work-around to allow this selector in > mediaControls(New).css: > // video::-webkit-media-text-track-region-container.scrolling > if (m_context.mode != UASheetMode && > !isSimpleSelectorValidAfterPseudoElement(*selector, > *m_precedingPseudoElement)) > m_failedParsing = true; > // HERE MISSING Return? > } Adding 'return nullptr;' compiles - haven't run any test.
Tim Nguyen (:ntim)
Comment 4 2023-09-03 21:44:44 PDT
If we were to fix this, `m_context.mode != UASheetMode &&` needs to be removed. Though it does look like we still rely on this internally: `-webkit-media-text-track-region-container.scrolling` still has hits internally.
Ahmad Saleem
Comment 5 2023-12-31 09:31:20 PST
(In reply to Tim Nguyen (:ntim) from comment #4) > If we were to fix this, `m_context.mode != UASheetMode &&` needs to be > removed. Though it does look like we still rely on this internally: > `-webkit-media-text-track-region-container.scrolling` still has hits > internally. -webkit-media-text-track-region-container.scrolling <- hit is in 'mediaControls.css', which Anne is planning to remove this with: https://github.com/WebKit/WebKit/pull/22265 So I think we can fix this now?
Ahmad Saleem
Comment 6 2023-12-31 09:32:10 PST
(In reply to Ahmad Saleem from comment #5) > (In reply to Tim Nguyen (:ntim) from comment #4) > > If we were to fix this, `m_context.mode != UASheetMode &&` needs to be > > removed. Though it does look like we still rely on this internally: > > `-webkit-media-text-track-region-container.scrolling` still has hits > > internally. > > -webkit-media-text-track-region-container.scrolling <- hit is in > 'mediaControls.css', which Anne is planning to remove this with: > > https://github.com/WebKit/WebKit/pull/22265 > > So I think we can fix this now? Ignore. Anne is removing 'mediaControlsApple.css'. I mixed it. :-(
Anne van Kesteren
Comment 7 2023-12-31 11:01:30 PST
Ahmad, I think we can use video[pseudo="-webkit-media-text-track-region-container.scrolling"].scrolling here. We have used [pseudo] elsewhere to work around similar issues. Would you be willing to give that a go? Also, happy new year!
Ahmad Saleem
Comment 8 2023-12-31 11:02:26 PST
(In reply to Anne van Kesteren from comment #7) > Ahmad, I think we can use > > video[pseudo="-webkit-media-text-track-region-container.scrolling"].scrolling > > here. We have used [pseudo] elsewhere to work around similar issues. Would > you be willing to give that a go? > > Also, happy new year! Happy New Year! Should I update 'mediaControls.css' to above. Happy to give it a go.
Ahmad Saleem
Comment 9 2023-12-31 11:42:45 PST
Draft PR - https://github.com/WebKit/WebKit/pull/22277 Any help and guidance welcome!
Note You need to log in before you can comment on or make changes to this bug.