<?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>250820</bug_id>
          
          <creation_ts>2023-01-18 19:16:37 -0800</creation_ts>
          <short_desc>[MQ4] (regression) nested media query failure</short_desc>
          <delta_ts>2023-01-18 23:35:58 -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 Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>250293</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philippe Wittenbergh">phiw2</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>karlcow</cc>
    
    <cc>koivisto</cc>
    
    <cc>m_dubet</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1926515</commentid>
    <comment_count>0</comment_count>
      <attachid>464550</attachid>
    <who name="Philippe Wittenbergh">phiw2</who>
    <bug_when>2023-01-18 19:16:37 -0800</bug_when>
    <thetext>Created attachment 464550
test case

A nested media query (MQ) prematurely closes the parent MQ, causing subsequent styles to be wrongly applied.

example:&lt;style&gt;
body { background: green; color: white }

@media screen and (min-width:10000px){
  body { border: 2px solid yellow;}
  @media screen { /* any MQ will do */
    .class { font-size: 2em;}
  }
  body { background: red;}
&lt;/style&gt;

In Safari TP the background is red instead of green. Safari 16.2, Firefox and Blink all are correct.

I think this started with Safari TP 160.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926536</commentid>
    <comment_count>1</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2023-01-18 23:35:58 -0800</bug_when>
    <thetext>This was fixed in &lt;https://commits.webkit.org/258732@main&gt;

*** This bug has been marked as a duplicate of bug 250293 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>464550</attachid>
            <date>2023-01-18 19:16:37 -0800</date>
            <delta_ts>2023-01-18 19:16:37 -0800</delta_ts>
            <desc>test case</desc>
            <filename>nested-MQ.html</filename>
            <type>text/html</type>
            <size>584</size>
            <attacher name="Philippe Wittenbergh">phiw2</attacher>
            
              <data encoding="base64">PCFkb2N0eXBlIGh0bWw+CjxodG1sIGxhbmc9ImVuIiBkaXI9Imx0ciI+CjxoZWFkPgoKPG1ldGEg
Y2hhcnNldD0idXRmLTgiPgo8dGl0bGU+dGVzdDogbmVzdGVkIE1RPC90aXRsZT4KPG1ldGEgbmFt
ZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRoPWRldmljZS13aWR0aCwgaW5pdGlhbC1zY2FsZT0x
LCBzaHJpbmstdG8tZml0PW5vIj4KPG1ldGEgbmFtZT0iY29sb3Itc2NoZW1lIiBjb250ZW50PSJs
aWdodCBkYXJrIj4KPHN0eWxlPgpib2R5IHsgYmFja2dyb3VuZDogZ3JlZW47IGNvbG9yOiB3aGl0
ZSB9CgpAbWVkaWEgc2NyZWVuIGFuZCAobWluLXdpZHRoOjEwMDAwcHgpewogIGJvZHkgeyBib3Jk
ZXI6IDJweCBzb2xpZCB5ZWxsb3c7fQogIEBtZWRpYSBzY3JlZW4geyAvKiBhbnkgTVEgKi8KICAg
IC5jbGFzcyB7IGZvbnQtc2l6ZTogMmVtO30KICB9CiAgYm9keSB7IGJhY2tncm91bmQ6IHJlZDt9
Cjwvc3R5bGU+Cgo8L2hlYWQ+Cgo8Ym9keT4KCjxwPiBUaGVyZSBzaG91bGQgYmUgbm8gcmVkIG9u
IHRoaXMgcGFnZSwgdW5sZXNzIHRoZSB3aW5kb3cgaXMgd2lkZXIgdGhhdCAxMDAwMHB4LgoKPC9i
b2R5Pgo8L2h0bWw+Cgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>