haikuwebkit/LayoutTests/fast/media/media-query-lengths-evaluat...

24 lines
463 B
HTML
Raw Permalink Normal View History

Media queries with max-width greater than 999999999px evaluate to false https://bugs.webkit.org/show_bug.cgi?id=224097 Patch by Tyler Wilcock <twilco.o@protonmail.com> on 2021-04-17 Reviewed by Darin Adler. We now evaluate <length> values in media queries with double Source/WebCore: precision instead of int precision to match other browsers and pass a WPT. See similar method in Chromium: https://github.com/chromium/chromium/blob/09a0b960b27f6e08fbe67ad97e6c4fb55ada383f/third_party/blink/renderer/core/css/media_query_evaluator.cc#L436 Test: fast/media/media-query-lengths-evaluate-with-double-precision.html and WPT imported/w3c/web-platform-tests/css/mediaqueries/min-width-001.xht * css/MediaQueryEvaluator.cpp: (WebCore::computeLength): Return Optional<double> rather than int& out-value. (WebCore::deviceHeightEvaluate): (WebCore::deviceWidthEvaluate): (WebCore::heightEvaluate): (WebCore::widthEvaluate): Evaluate `length` values as doubles instead of ints. LayoutTests: precision instead of int precision to match other browsers and pass another WPT. * TestExpectations: Remove ImageOnlyFailure for imported/w3c/web-platform-tests/css/mediaqueries/min-width-001.xht because it passes now. * fast/media/media-query-lengths-evaluate-with-double-precision-expected.html: Added. * fast/media/media-query-lengths-evaluate-with-double-precision.html: Added to test properties that WPT min-width-001.xht doesn't (min-height, device-min-height, device-min-width). Canonical link: https://commits.webkit.org/236690@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-17 22:21:20 +00:00
<!DOCTYPE html>
<html>
<head>
<title>CSS Test: @media <length> values are evaluated with greater-than-int precision.</title>
<meta name="assert" content="All boxes are blue.">
<style>
div {
display: inline-block;
width: 250px;
height: 250px;
margin: 30px;
background-color: blue;
}
</style>
</head>
<body>
<div></div>
<div></div>
<div></div>
<div></div>
</body>
</html>