WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
211505
REGRESSION (
r253875
?): Element styles incorrect after media query evaluation changes
https://bugs.webkit.org/show_bug.cgi?id=211505
Summary
REGRESSION (r253875?): Element styles incorrect after media query evaluation ...
James Brooks
Reported
2020-05-06 05:44:53 PDT
Created
attachment 398603
[details]
A video demonstrating the bug in Safari 13.1 Media queries don't always yield the expected results when resizing my browser window. I have a media query that repositions two divs side-by-side on screen sizes wider the 900px, and on mobile they stack on top of each other. When resizing up from mobile the styles don't update until the page is reloaded. The media queries behave as expected on both Safari 13.0 and Safari 12.1, this issue only seems to be present in Safari 13.1. The release notes for Safari 13.1 contained the extract:
> Made media query updates more efficient.
I traced that back to the equivalent Safari Technical Preview release notes and found:
> Improved performance by invalidating only affected elements after media query evaluation changes
I think the issues I am seeing are linked to the changes made in
r253875
as a result of
bug 205392
. I have also been able to validate that the issue is still present on the most recent WebKit build archive at the time of writing this
r261218
.
Attachments
A video demonstrating the bug in Safari 13.1
(12.49 MB, video/quicktime)
2020-05-06 05:44 PDT
,
James Brooks
no flags
Details
Basic recreation of the issue
(1.32 KB, text/html)
2020-05-08 03:14 PDT
,
James Brooks
no flags
Details
patch
(6.77 KB, patch)
2020-06-05 04:54 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2020-05-07 10:52:32 PDT
<
rdar://problem/62983242
>
Antti Koivisto
Comment 2
2020-05-08 01:05:13 PDT
Can you attach the test case?
James Brooks
Comment 3
2020-05-08 03:14:46 PDT
Created
attachment 398850
[details]
Basic recreation of the issue
James Brooks
Comment 4
2020-05-08 03:15:07 PDT
I've attached a minimal reproduction similar to the video above - let me know if you need something more specific. I also spent a bit more time looking into the cause and it seems like the inclusion of a @keyframes rule inside of the media query is at fault in this example. This was a mistake on my part and moving the rule outside of the media query appears to result in the expected behaviour. I do still think there's a regression here though - in the first instance the @keyframes rule was in a different media query to the one where I had noticed the issue so it seems that this was causing issues with invalidating styles across the tree rather than just the query containing the @keyframes rule? And as I mentioned in the original report, this doesn't appear to have been an issue prior to Safari 13.1.
Antti Koivisto
Comment 5
2020-05-08 09:18:46 PDT
Thanks for the repro. Interesting that it is triggered by an unused @keyframes rule inside @media.
James Brooks
Comment 6
2020-05-08 09:55:41 PDT
Agreed. Not been able to confirm if any other at-rules have the same outcome. I think I used an @supports rule in the repro which didn't seem to cause any problems?
Antti Koivisto
Comment 7
2020-06-05 04:54:10 PDT
Created
attachment 401141
[details]
patch
EWS
Comment 8
2020-06-05 07:39:12 PDT
Committed
r262618
: <
https://trac.webkit.org/changeset/262618
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 401141
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug