min-width @media query with huge length incorrectly evaluates to true

Originator:cvrebert
Number:rdar://21886923 Date Originated:18-Jul-2015
Status:Open Resolved:
Product:Safari Product Version:8.0.7 (10600.7.12)
Classification:Other Bug Reproducible:Always
 
Summary:
Example URL: http://jsfiddle.net/Lc3vZ/

Based on http://www.w3.org/TR/css3-values/#length-value , Safari's current behavior seems incorrect:
"In cases where the used length cannot be supported, user agents must approximate it in the actual value."
So Safari should be clamping it to some maximum value instead.

In OS X Firefox 29.0.1 and OS X Chrome 40.0.2214.111, the media query's condition correctly evaluates to false.

Steps to Reproduce:
1. Open http://jsfiddle.net/Lc3vZ/
2. Note that it contains the following CSS:
@media (min-width: 9999999999px) {
    body {
        background-color: red;
    }
}

Expected Results:
The media query's condition should not be deemed satisfied since my monitor isn't several miles wide, and the background-color in the "Result" pane should thus remain at its default of white.

Actual Results:
The media query's condition somehow evaluated to true even though my viewport/screen is significantly less than 9999999999px wide. Thus, in the "Result" pane, the background is red.

Version:
Safari Version 8.0.7 (10600.7.12)
Mac OS X Yosemite

Notes:
WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=141533
Analogous Chrome bug (which has been fixed): https://code.google.com/p/chromium/issues/detail?id=375574
Original Bootstrap issue: https://github.com/twbs/bootstrap/issues/13632

Configuration:


Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!