Bug 213243

Summary: O(n^2) behavior in media query resolution
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 212757    
Attachments:
Description Flags
patch
none
patch none

Description Antti Koivisto 2020-06-16 04:58:06 PDT
RuleSet::evaluteDynamicMediaQueryRules has complexity num(media queries) * num(style rules) for queries that flip value.

This can become significant for pages that have 1000s of media queries.
Comment 1 Antti Koivisto 2020-06-16 05:01:43 PDT
<rdar://63997043>
Comment 2 Antti Koivisto 2020-06-16 05:10:05 PDT
Created attachment 401995 [details]
patch
Comment 3 Antti Koivisto 2020-06-16 05:53:00 PDT
Created attachment 401997 [details]
patch
Comment 4 EWS 2020-06-16 08:12:35 PDT
Committed r263092: <https://trac.webkit.org/changeset/263092>

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