[Webkit-unassigned] [Bug 141533] New: min-width @media query with huge length incorrectly evaluates to true

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 12 14:07:28 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=141533

            Bug ID: 141533
           Summary: min-width @media query with huge length incorrectly
                    evaluates to true
    Classification: Unclassified
           Product: WebKit
           Version: 528+ (Nightly build)
          Hardware: Macintosh Intel
                OS: Mac OS X 10.10
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: webkit at rebertia.com

Safari Version: 8.0.3 (10600.3.18)

Original Bootstrap issue: https://github.com/twbs/bootstrap/issues/13632

Example URL:
http://jsfiddle.net/Lc3vZ/

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

What is the expected behavior?
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.

What went wrong?
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.

Does this work in other browsers?
Yes. In OS X Firefox 29.0.1 and OS X Chrome 40.0.2214.111, the media query's condition correctly evaluates to false.
Chrome used to suffer from this same bug, but they've fixed it; see https://code.google.com/p/chromium/issues/detail?id=375574

More details:
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150212/70576371/attachment-0002.html>


More information about the webkit-unassigned mailing list