<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>161747</bug_id>
          
          <creation_ts>2016-09-08 11:40:38 -0700</creation_ts>
          <short_desc>Class selectors on pseudo elements should be forbidden.</short_desc>
          <delta_ts>2023-12-31 11:42:45 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=241815</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dave Hyatt">hyatt</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>annevk</cc>
    
    <cc>ntim</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1227663</commentid>
    <comment_count>0</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2016-09-08 11:40:38 -0700</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1975246</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-09-03 04:06:59 -0700</bug_when>
    <thetext>We still have this FIXME:

https://searchfox.org/wubkat/source/Source/WebCore/css/parser/CSSSelectorParser.cpp#618

Plus this FIXME was removed by Blink in 2019: https://chromium.googlesource.com/chromium/src.git/+/6c24c2e8b1963818eabe2038a0b74db2e86de83f</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1975247</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-09-03 04:08:41 -0700</bug_when>
    <thetext>Plus for some reason, we don&apos;t have &apos;return nulltpr&apos; 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 &amp;&amp; !isSimpleSelectorValidAfterPseudoElement(*selector, *m_precedingPseudoElement))
            m_failedParsing = true;
// HERE MISSING Return?
    }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1975250</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-09-03 05:34:24 -0700</bug_when>
    <thetext>(In reply to Ahmad Saleem from comment #2)
&gt; Plus for some reason, we don&apos;t have &apos;return nulltpr&apos; in this:
&gt; 
&gt; 
&gt;     if (m_precedingPseudoElement) {
&gt;         // FIXME: https://bugs.webkit.org/show_bug.cgi?id=161747
&gt;         // The UASheetMode check is a work-around to allow this selector in
&gt; mediaControls(New).css:
&gt;         // video::-webkit-media-text-track-region-container.scrolling
&gt;         if (m_context.mode != UASheetMode &amp;&amp;
&gt; !isSimpleSelectorValidAfterPseudoElement(*selector,
&gt; *m_precedingPseudoElement))
&gt;             m_failedParsing = true;
&gt; // HERE MISSING Return?
&gt;     }

Adding &apos;return nullptr;&apos; compiles - haven&apos;t run any test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1975307</commentid>
    <comment_count>4</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2023-09-03 21:44:44 -0700</bug_when>
    <thetext>If we were to fix this, `m_context.mode != UASheetMode &amp;&amp;` 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2002351</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-12-31 09:31:20 -0800</bug_when>
    <thetext>(In reply to Tim Nguyen (:ntim) from comment #4)
&gt; If we were to fix this, `m_context.mode != UASheetMode &amp;&amp;` needs to be
&gt; removed. Though it does look like we still rely on this internally:
&gt; `-webkit-media-text-track-region-container.scrolling` still has hits
&gt; internally.

-webkit-media-text-track-region-container.scrolling &lt;- hit is in &apos;mediaControls.css&apos;, which Anne is planning to remove this with:

https://github.com/WebKit/WebKit/pull/22265

So I think we can fix this now?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2002352</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-12-31 09:32:10 -0800</bug_when>
    <thetext>(In reply to Ahmad Saleem from comment #5)
&gt; (In reply to Tim Nguyen (:ntim) from comment #4)
&gt; &gt; If we were to fix this, `m_context.mode != UASheetMode &amp;&amp;` needs to be
&gt; &gt; removed. Though it does look like we still rely on this internally:
&gt; &gt; `-webkit-media-text-track-region-container.scrolling` still has hits
&gt; &gt; internally.
&gt; 
&gt; -webkit-media-text-track-region-container.scrolling &lt;- hit is in
&gt; &apos;mediaControls.css&apos;, which Anne is planning to remove this with:
&gt; 
&gt; https://github.com/WebKit/WebKit/pull/22265
&gt; 
&gt; So I think we can fix this now?

Ignore. Anne is removing &apos;mediaControlsApple.css&apos;. I mixed it. :-(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2002355</commentid>
    <comment_count>7</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2023-12-31 11:01:30 -0800</bug_when>
    <thetext>Ahmad, I think we can use 

video[pseudo=&quot;-webkit-media-text-track-region-container.scrolling&quot;].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!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2002356</commentid>
    <comment_count>8</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-12-31 11:02:26 -0800</bug_when>
    <thetext>(In reply to Anne van Kesteren from comment #7)
&gt; Ahmad, I think we can use 
&gt; 
&gt; video[pseudo=&quot;-webkit-media-text-track-region-container.scrolling&quot;].scrolling
&gt; 
&gt; here. We have used [pseudo] elsewhere to work around similar issues. Would
&gt; you be willing to give that a go?
&gt; 
&gt; Also, happy new year!

Happy New Year! Should I update &apos;mediaControls.css&apos; to above. Happy to give it a go.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2002357</commentid>
    <comment_count>9</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-12-31 11:42:45 -0800</bug_when>
    <thetext>Draft PR - https://github.com/WebKit/WebKit/pull/22277

Any help and guidance welcome!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>