Bug 217751 - MediaQueryList serialization order is inconsistent.
Summary: MediaQueryList serialization order is inconsistent.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Emilio Cobos Álvarez (:emilio)
URL:
Keywords: InRadar, WebExposed
Depends on: 218157
Blocks:
  Show dependency treegraph
 
Reported: 2020-10-15 05:05 PDT by Emilio Cobos Álvarez (:emilio)
Modified: 2020-10-26 08:30 PDT (History)
13 users (show)

See Also:


Attachments
Patch for EWS (1.10 KB, patch)
2020-10-25 06:45 PDT, Emilio Cobos Álvarez (:emilio)
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (4.62 KB, patch)
2020-10-25 10:17 PDT, Emilio Cobos Álvarez (:emilio)
no flags Details | Formatted Diff | Diff
Patch (4.91 KB, patch)
2020-10-25 16:45 PDT, Emilio Cobos Álvarez (:emilio)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Emilio Cobos Álvarez (:emilio) 2020-10-15 05:05:16 PDT
See also https://bugs.chromium.org/p/chromium/issues/detail?id=1138859

If you run: window.matchMedia('(max-width: 100px) and (max-aspect-ratio: 1/1)').media

You get back: (max-aspect-ratio: 1/1) and (max-width: 100px)

Instead of the expected original order.

Per https://drafts.csswg.org/cssom-view/#mediaquerylist-media -> https://drafts.csswg.org/cssom/#serialize-a-media-query-list:

> Serialize each media query in the list of media queries, in the same order as they appear in the media query list, and then serialize the list. 

Seems like Gecko is correct and the order shouldn't change.
Comment 1 Emilio Cobos Álvarez (:emilio) 2020-10-16 05:50:59 PDT
There's a sorting step below.
Comment 3 Radar WebKit Bug Importer 2020-10-25 06:09:13 PDT
<rdar://problem/70658754>
Comment 4 Emilio Cobos Álvarez (:emilio) 2020-10-25 06:45:17 PDT
Created attachment 412263 [details]
Patch for EWS
Comment 5 Emilio Cobos Álvarez (:emilio) 2020-10-25 10:17:06 PDT
Created attachment 412271 [details]
Patch
Comment 6 Emilio Cobos Álvarez (:emilio) 2020-10-25 16:45:31 PDT
Created attachment 412282 [details]
Patch
Comment 7 EWS 2020-10-26 04:00:40 PDT
Committed r268966: <https://trac.webkit.org/changeset/268966>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 412282 [details].