<?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>263081</bug_id>
          
          <creation_ts>2023-10-12 10:36:59 -0700</creation_ts>
          <short_desc>[popover] element within complex shadow DOM breaks light dismiss calculation</short_desc>
          <delta_ts>2023-10-20 15:16:34 -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>DOM</component>
          <version>Safari 17</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://github.com/web-platform-tests/wpt/pull/42651</see_also>
          <bug_file_loc>https://codepen.io/Westbrook/pen/JjwVYmr</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>148695</blocked>
    
    <blocked>250171</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Westbrook">westbrook.johnson</reporter>
          <assigned_to name="Luke Warlow">lwarlow</assigned_to>
          <cc>karlcow</cc>
    
    <cc>lwarlow</cc>
    
    <cc>ntim</cc>
    
    <cc>stearns</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1984630</commentid>
    <comment_count>0</comment_count>
    <who name="Westbrook">westbrook.johnson</who>
    <bug_when>2023-10-12 10:36:59 -0700</bug_when>
    <thetext>This issue is closely related to https://bugs.webkit.org/show_bug.cgi?id=259261 in that I would have expected the flattened tree calculation added there to have prevented this, but here again, we see the light dismiss calculation for a `[popover=&quot;auto&quot;]` element going awry.

As seen in https://codepen.io/Westbrook/pen/JjwVYmr Safari 17 and TP both overreach and close the root popover erroneously when opening the child popover.

Steps:

1) Visit https://codepen.io/Westbrook/pen/JjwVYmr
2) Click the &quot;Show&quot; button.
3) See the &quot;outer&quot; [popover] element open at the center of the page.
4) Click the &quot;Show&quot; button within the initial [popover] element.
5) See the &quot;outer&quot; [popover] element closed due to the light dismiss calculation, preventing the &quot;inner&quot; [popover] element from becoming visible.

If you run the same steps in Chrome, you&apos;ll see the &quot;inner&quot; [popover] open over the &quot;outer&quot; [popover] as expected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1985235</commentid>
    <comment_count>1</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-10-15 19:12:13 -0700</bug_when>
    <thetext>Firefox Nightly Not working
(after setting dom.element.popover.enabled to true in about:config)


In Safari the second nested showPopover() fails silently.
In chrome we can see it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1985301</commentid>
    <comment_count>2</comment_count>
    <who name="Westbrook">westbrook.johnson</who>
    <bug_when>2023-10-16 05:26:09 -0700</bug_when>
    <thetext>It seems that the DSD flag was maybe removed from Firefox nightly, but that feature was only leveraged for simplicity, it wasn&apos;t part of the larger issue. This demo exemplifies the issue with imperative Shadow DOM: https://codepen.io/Westbrook/pen/jOXooPB?editors=1010</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1986177</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-10-19 10:37:19 -0700</bug_when>
    <thetext>&lt;rdar://problem/117214343&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1986248</commentid>
    <comment_count>4</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2023-10-19 13:42:56 -0700</bug_when>
    <thetext>Here&apos;s another place that needs to use the flat tree: https://searchfox.org/wubkat/rev/c64f97a4afc2aa3f73f74f59630410234ca8a659/Source/WebCore/html/HTMLElement.cpp#1286</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1986306</commentid>
    <comment_count>5</comment_count>
    <who name="Luke Warlow">lwarlow</who>
    <bug_when>2023-10-19 15:28:57 -0700</bug_when>
    <thetext>I&apos;m happy to take a look at this. I&apos;ve got a WPT that covers it so shouldn&apos;t take long.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1986308</commentid>
    <comment_count>6</comment_count>
    <who name="Luke Warlow">lwarlow</who>
    <bug_when>2023-10-19 15:41:39 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/19314</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1986563</commentid>
    <comment_count>7</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-10-20 15:11:52 -0700</bug_when>
    <thetext>Committed 269596@main (4ab4d8351529): &lt;https://commits.webkit.org/269596@main&gt;

Reviewed commits have been landed. Closing PR #19314 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>