Bug 182816 - `@supports (display: contents)` feature query in CSS incorrectly passes
Summary: `@supports (display: contents)` feature query in CSS incorrectly passes
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 11
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-14 16:39 PST by Rhys Powell
Modified: 2022-07-15 14:05 PDT (History)
7 users (show)

See Also:


Attachments
Comparison of my test page between Firefox and Safari (151.35 KB, image/png)
2018-02-15 16:33 PST, Rhys Powell
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rhys Powell 2018-02-14 16:39:52 PST
If I write the following in a CSS stylesheet:

    @supports (display: contents) {
      display: contents;
    }

WebKit will incorrectly claim to support `display: contents` and apply the styles inside that `@supports` block. As WebKit doesn't actually support this property, and instead falls back to `display: inline` which breaks many layouts dependent on `display: contents`, this feature query should not pass.
Comment 1 Alexey Proskuryakov 2018-02-15 15:15:46 PST
Could you please clarify which Safari version are you seeing this with? In particular, is this with shipping Safari/WebKit, STP or nightly builds?
Comment 2 Rhys Powell 2018-02-15 16:33:19 PST
Created attachment 333967 [details]
Comparison of my test page between Firefox and Safari

Yep, this bug affects the shipping version of Safari on both iOS and macOS. I've created a test case at https://low-organization.glitch.me/ that demonstrates the bug, as you can see in the attached screenshot.
Comment 3 Tim Nguyen (:ntim) 2022-01-05 06:13:27 PST
Rhys, do you have a testcase? Seems like the glitch link expired.

To me, it sounds like display: contents is not behaving as expected,  because WebKit does actually support display: contents.
Comment 4 Brent Fulgham 2022-07-15 14:05:36 PDT
The relevant test site no longer exists. We can't take further action on this bug report.