[Webkit-unassigned] [Bug 234297] New: Shadow DOM Recalculating styles on every hover with position absolute slot

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 14 07:51:29 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=234297

            Bug ID: 234297
           Summary: Shadow DOM Recalculating styles on every hover with
                    position absolute slot
           Product: WebKit
           Version: Safari 15
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ldebeasi at gmail.com

Created attachment 447133

  --> https://bugs.webkit.org/attachment.cgi?id=447133&action=review

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 `<slot>` 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 "Timelines" recording.
3. Hover over "Div outside of component". Observe that no style recalculations occur.
4. Hover over "Div outside component with position: absolute". Observe that no style recalculations occur.
5. Hover over "Div inside component". Observe that style recalculations occur.
6. Disable the "position: absolute" styles for the "absolute" slot inside of app-content.
7. Hover over "Div inside component". 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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211214/3bf8a980/attachment-0001.htm>


More information about the webkit-unassigned mailing list