<?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>234297</bug_id>
          
          <creation_ts>2021-12-14 07:51:29 -0800</creation_ts>
          <short_desc>Shadow DOM Recalculating styles on every hover with position absolute slot</short_desc>
          <delta_ts>2022-03-03 11:44:16 -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>Safari 15</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>148695</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Liam DeBeasi">ldebeasi</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>koivisto</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1824000</commentid>
    <comment_count>0</comment_count>
      <attachid>447133</attachid>
    <who name="Liam DeBeasi">ldebeasi</who>
    <bug_when>2021-12-14 07:51:29 -0800</bug_when>
    <thetext>Created attachment 447133
Code reproduction

When hovering over elements slotted into a Shadow DOM custom element, WebKit will recalculate the styles for every mouse over/mouse out event. This is caused by the presence of a `&lt;slot&gt;` with `position: absolute`. Even if the element is slotted in a different slot, this style recalculation behavior will still happen.

Steps to reproduce:

1. Open code reproduction in Safari for macOS.
2. Open Dev Tools and start a new &quot;Timelines&quot; recording.
3. Hover over &quot;Div outside of component&quot;. Observe that no style recalculations occur.
4. Hover over &quot;Div outside component with position: absolute&quot;. Observe that no style recalculations occur.
5. Hover over &quot;Div inside component&quot;. Observe that style recalculations occur.
6. Disable the &quot;position: absolute&quot; styles for the &quot;absolute&quot; slot inside of app-content.
7. Hover over &quot;Div inside component&quot;. Observe that style recalculations occur.

Expected Behavior:

I expect styles to not get recalculated when hovering over the div slotted inside of the Web Component.

Actual Behavior:

Styles get recalculated when hovering over the div slotted inside of the Web Component.

Other Information:

- This issue does not happen in Chrome.
- This issue only happens with slotted content. If the slot with position: absolute is a non-slot inside of the Shadow DOM, this issue does not happen.
- If the slotted div is placed inside of the Shadow DOM, this issue does not happen.
- This issue does not happen with an position: absolute element outside of the component.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1825997</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-12-21 07:52:15 -0800</bug_when>
    <thetext>&lt;rdar://problem/86768793&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>447133</attachid>
            <date>2021-12-14 07:51:29 -0800</date>
            <delta_ts>2021-12-14 07:51:29 -0800</delta_ts>
            <desc>Code reproduction</desc>
            <filename>index.html</filename>
            <type>text/html</type>
            <size>1592</size>
            <attacher name="Liam DeBeasi">ldebeasi</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgogIDxoZWFkPgogICAgPHRpdGxlPldlYktpdCBTdHlsZSBS
ZWNhbGN1bGF0aW9uPC90aXRsZT4KCiAgICA8bWV0YSBuYW1lPSJ2aWV3cG9ydCIgY29udGVudD0i
dmlld3BvcnQtZml0PWNvdmVyLHdpZHRoPWRldmljZS13aWR0aCwgaW5pdGlhbC1zY2FsZT0xLjAs
IG1pbmltdW0tc2NhbGU9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BhcHAtY29udGVudC48L2xpPgogICAgICA8bGk+SG92
ZXIgb3ZlciAiRGl2IGluc2lkZSBjb21wb25lbnQiLiBPYnNlcnZlIHRoYXQgc3R5bGUgcmVjYWxj
dWxhdGlvbnMgb2NjdXIuPC9saT4KICAgIDwvb2w+CiAgICAKICAgIDxzY3JpcHQ+CiAgICAgIGNv
bnN0IEFwcENvbnRlbnQgPSBjbGFzcyBleHRlbmRzIEhUTUxFbGVtZW50IHsKICAgICAgICBjb25z
dHJ1Y3RvcigpIHsKICAgICAgICAgIHN1cGVyKCk7CiAgICAgICAgICBjb25zdCByb290ID0gdGhp
cy5hdHRhY2hTaGFkb3coeyBtb2RlOiAnb3BlbicgfSk7CiAgICAgICAgICByb290LmlubmVySFRN
TCA9IGAKICAgICAgICAgICAgPHN0eWxlPjo6c2xvdHRlZChbc2xvdD0iYWJzb2x1dGUiXSkgeyBw
b3NpdGlvbjogYWJzb2x1dGU7IH08L3N0eWxlPgogICAgICAgICAgICA8c2xvdD48L3Nsb3Q+CiAg
ICAgICAgICAgIDxzbG90IG5hbWU9ImFic29sdXRlIj48L3Nsb3Q+CiAgICAgICAgICBgOwogICAg
ICAgIH0KICAgICAgfTsKICAgICAgCiAgICAgIGN1c3RvbUVsZW1lbnRzLmRlZmluZSgnYXBwLWNv
bnRlbnQnLCBBcHBDb250ZW50KTsKICAgIDwvc2NyaXB0PgogIDwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>