<?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>232402</bug_id>
          
          <creation_ts>2021-10-27 14:04:23 -0700</creation_ts>
          <short_desc>:empty selector matches elements with a shadow root</short_desc>
          <delta_ts>2021-10-29 12:19:20 -0700</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>Safari 15</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <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="Luke Warlow">lwarlow</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>emilio</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1809417</commentid>
    <comment_count>0</comment_count>
    <who name="Luke Warlow">lwarlow</who>
    <bug_when>2021-10-27 14:04:23 -0700</bug_when>
    <thetext>Steps to reproduce:

Go to https://jsfiddle.net/hyjfkwqx/
You should see there is no output.

Actual results:

The :empty selector matches an element with an open shadow root that itself has child elements. So the parent div is not displayed.

Expected results:

I would expect the :empty selector to not match these elements. So I would expect to see a red square with a smaller blue square in it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1809420</commentid>
    <comment_count>1</comment_count>
    <who name="Luke Warlow">lwarlow</who>
    <bug_when>2021-10-27 14:05:04 -0700</bug_when>
    <thetext>Chrome Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1264139

Firefox Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1738113</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1810070</commentid>
    <comment_count>2</comment_count>
    <who name="Luke Warlow">lwarlow</who>
    <bug_when>2021-10-29 08:27:36 -0700</bug_when>
    <thetext>I made an issue in the CSSWG github just in case it&apos;s a spec &quot;issue&quot; rather than a browser one. https://github.com/w3c/csswg-drafts/issues/6771</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1810184</commentid>
    <comment_count>3</comment_count>
    <who name="Emilio Cobos Álvarez (:emilio)">emilio</who>
    <bug_when>2021-10-29 12:19:20 -0700</bug_when>
    <thetext>Let&apos;s reopen if the CSSWG decides to change behavior here but this is invalid as per spec.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>