<?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>281131</bug_id>
          
          <creation_ts>2024-10-09 03:18:03 -0700</creation_ts>
          <short_desc>Immediate crash when WebComponents are combined with global styles &amp; container queries.</short_desc>
          <delta_ts>2026-04-25 17:21: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 Technology Preview</version>
          <rep_platform>All</rep_platform>
          <op_sys>iOS 18</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=292247</see_also>
          <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="herr.moms">marco</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>koivisto</cc>
    
    <cc>nicole</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>woodlxf00</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2066462</commentid>
    <comment_count>0</comment_count>
      <attachid>472875</attachid>
    <who name="herr.moms">marco</who>
    <bug_when>2024-10-09 03:18:03 -0700</bug_when>
    <thetext>Created attachment 472875
Crash Sample Component

The following issue occurs with Safari 18 on all platforms, including Mac, also Technology Preview. 

When using container queries, I noticed a malfunction that I cannot further isolate. The combination of container queries, WebComponents, and (this is where I get stuck) the application of irrelevant CSS causes the page to crash.

I have isolated a Stackblitz sample and partially narrowed down the problem. https://stackblitz.com/edit/stackblitz-starters-gxvbz9?file=index.html

Steps to Reproduce:
1. Open the provided Stackblitz or sample-crash.html sample in Safari 18.
2. Ensure lines 7 to 9 are active.
3. Observe the page crash a few seconds after loading.

The page crashes a few seconds after loading with no error message or indication of the cause. There is no apparent connection between the responsible CSS block and the WebComponent in the example.

Additional Information:
- The issue does not occur when CSS lines 14-20 are commented out.
- The problem seems to be related to the interaction between container queries and WebComponents.
- `.ux-button--no-border:not(:active):not(:disabled):hover ux-icon`==&gt; crashed immediately 
- `.ux-button--no-border:not(:active):not(:disabled):hover &gt; ux-icon` ==&gt; works</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2067809</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2024-10-14 12:52:50 -0700</bug_when>
    <thetext>rdar://137812974

I can reproduce this after uncommenting lines 7-9 (as per original steps to reproduce), and clicking in the content (which is not).

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   WebCore                       	       0x11a38a380 WebCore::Style::Update::elementStyle(WebCore::Element const&amp;) + 0
1   WebCore                       	       0x11a32ddd8 WebCore::Style::ContainerQueryEvaluator::selectContainer(WTF::OptionSet&lt;WebCore::CQ::Axis&gt;, WTF::String const&amp;, WebCore::Element const&amp;, WebCore::Style::ContainerQueryEvaluator::SelectionMode, WebCore::Style::ScopeOrdinal, WebCore::Style::ContainerQueryEvaluationState const*)::$_0::operator()(WebCore::Element const&amp;, WebCore::Element const*) const + 120
2   WebCore                       	       0x11a32db90 WebCore::Style::ContainerQueryEvaluator::selectContainer(WTF::OptionSet&lt;WebCore::CQ::Axis&gt;, WTF::String const&amp;, WebCore::Element const&amp;, WebCore::Style::ContainerQueryEvaluator::SelectionMode, WebCore::Style::ScopeOrdinal, WebCore::Style::ContainerQueryEvaluationState const*) + 464
3   WebCore                       	       0x11a335a44 WebCore::Style::ElementRuleCollector::containerQueriesMatch(WebCore::Style::RuleData const&amp;, WebCore::Style::MatchRequest const&amp;) + 392
4   WebCore                       	       0x11a3332c0 WebCore::Style::ElementRuleCollector::collectMatchingRulesForList(WTF::Vector&lt;WebCore::Style::RuleData, 1ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc&gt; const*, WebCore::Style::MatchRequest const&amp;) + 1944</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2114258</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2025-04-30 10:55:01 -0700</bug_when>
    <thetext>I can still reproduce this with macOS Sequoia 15.5 beta.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2204503</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2026-04-25 17:21:03 -0700</bug_when>
    <thetext>Hm... I can&apos;t reproduce this crash on Safari 26.4.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>472875</attachid>
            <date>2024-10-09 03:18:03 -0700</date>
            <delta_ts>2024-10-09 03:18:03 -0700</delta_ts>
            <desc>Crash Sample Component</desc>
            <filename>sample-crash.html</filename>
            <type>text/html</type>
            <size>1042</size>
            <attacher name="herr.moms">marco</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+DQo8aHRtbCBsYW5nPSJlbiI+DQogIDxoZWFkPg0KICAgIDxtZXRhIGNo
YXJzZXQ9IlVURi04IiAvPg0KICAgIDxtZXRhIG5hbWU9InZpZXdwb3J0IiBjb250ZW50PSJ3aWR0
aD1kZXZpY2Utd2lkdGgsIGluaXRpYWwtc2NhbGU9MS4wIiAvPg0KICAgIDxzdHlsZT4NCiAgICAg
IC8qIC51eC1idXR0b24tLW5vLWJvcmRlcjpub3QoOmFjdGl2ZSk6bm90KDpkaXNhYmxlZCk6aG92
ZXIgdXgtaWNvbiB7DQogICAgICAgIGNvbG9yOiB2YXIoLS11eC1jb2xvci1wcmltYXJ5KTsNCiAg
ICAgIH0gKi8NCiAgICA8L3N0eWxlPg0KICA8L2hlYWQ+DQoNCiAgPGJvZHk+DQogICAgPG15LWNv
bXBvbmVudCB2YXJpYW50PSJzcGlubmVyIj48L215LWNvbXBvbmVudD4NCg0KICAgIDxzY3JpcHQ+
DQogICAgICBjbGFzcyBNeUNvbXBvbmVudCBleHRlbmRzIEhUTUxFbGVtZW50IHsNCiAgICAgICAg
Y29uc3RydWN0b3IoKSB7DQogICAgICAgICAgc3VwZXIoKTsNCiAgICAgICAgICBjb25zdCBzaGFk
b3cgPSB0aGlzLmF0dGFjaFNoYWRvdyh7IG1vZGU6ICdvcGVuJyB9KTsNCiAgICAgICAgICBjb25z
dCBzdHlsZSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ3N0eWxlJyk7DQogICAgICAgICAgc3R5
bGUudGV4dENvbnRlbnQgPSBgDQogICAgICAgICAgICAgICAgICAgICAgICAgIEBjb250YWluZXIg
c3R5bGUoLS1zb21lOiB3ZWIpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6aG9zdCB7
DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLXV4LXNwaW5uZXItdHJhY2stY29sb3I6
ICNiYmQwM2EgOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAg
ICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIGA7DQogICAgICAgICAgc2hhZG93LmFwcGVu
ZENoaWxkKHN0eWxlKTsNCiAgICAgICAgfQ0KICAgICAgfQ0KICAgICAgY3VzdG9tRWxlbWVudHMu
ZGVmaW5lKCdteS1jb21wb25lbnQnLCBNeUNvbXBvbmVudCk7DQogICAgPC9zY3JpcHQ+DQogIDwv
Ym9keT4NCjwvaHRtbD4NCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>