Commit 2871d281 authored by Xiaocheng Hu's avatar Xiaocheng Hu Committed by Commit Bot

Remove invalid test cases using unitless zero length in math functions

Spec (*) explicitly disallows unitless zero length in math functions:

> Note: Because <number-token>s are always interpreted as <number>s or
> <integer>s, "unitless 0" <length>s aren’t supported in math functions.
> That is, 'width: calc(0 + 5px);' is invalid, because it’s trying to
> add a <number> to a <length>, even though both 'width: 0;' and
> 'width: 5px;' are valid.

There are some existing WPT test cases violating this, which are
removed in this patch.

(*) https://drafts.csswg.org/css-values-4/#calc-type-checking

Bug: 994359
Change-Id: Iba66c4e425ec24133c7f70bbbeca7a60d59e1883
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1758734Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688401}
parent bf03211a
This is a testharness.js-based test. This is a testharness.js-based test.
Found 171 tests; 158 PASS, 13 FAIL, 0 TIMEOUT, 0 NOTRUN. Found 169 tests; 158 PASS, 11 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS <img srcset="/images/green-1x1.png?a2 300w, /images/green-16x16.png?a2 301w"> ref sizes="100vw" (display:none) PASS <img srcset="/images/green-1x1.png?a2 300w, /images/green-16x16.png?a2 301w"> ref sizes="100vw" (display:none)
PASS <img srcset="/images/green-1x1.png?b2 450w, /images/green-16x16.png?b2 451w"> ref sizes="100vw" (display:none) PASS <img srcset="/images/green-1x1.png?b2 450w, /images/green-16x16.png?b2 451w"> ref sizes="100vw" (display:none)
PASS <img srcset="/images/green-1x1.png?c2 600w, /images/green-16x16.png?c2 601w"> ref sizes="100vw" (display:none) PASS <img srcset="/images/green-1x1.png?c2 600w, /images/green-16x16.png?c2 601w"> ref sizes="100vw" (display:none)
...@@ -45,8 +45,6 @@ PASS <img srcset="/images/green-1x1.png?e37 50w, /images/green-16x16.png?e37 51w ...@@ -45,8 +45,6 @@ PASS <img srcset="/images/green-1x1.png?e37 50w, /images/green-16x16.png?e37 51w
PASS <img srcset="/images/green-1x1.png?e37a 50w, /images/green-16x16.png?e37a 51w" sizes="(min-width:0) min(1px, 100px)"> ref sizes="1px" (display:none) PASS <img srcset="/images/green-1x1.png?e37a 50w, /images/green-16x16.png?e37a 51w" sizes="(min-width:0) min(1px, 100px)"> ref sizes="1px" (display:none)
PASS <img srcset="/images/green-1x1.png?e37b 50w, /images/green-16x16.png?e37b 51w" sizes="(min-width:0) max(-100px, 1px)"> ref sizes="1px" (display:none) PASS <img srcset="/images/green-1x1.png?e37b 50w, /images/green-16x16.png?e37b 51w" sizes="(min-width:0) max(-100px, 1px)"> ref sizes="1px" (display:none)
PASS <img srcset="/images/green-1x1.png?e38 50w, /images/green-16x16.png?e38 51w" sizes="(min-width:calc(0)) 1px"> ref sizes="1px" (display:none) PASS <img srcset="/images/green-1x1.png?e38 50w, /images/green-16x16.png?e38 51w" sizes="(min-width:calc(0)) 1px"> ref sizes="1px" (display:none)
FAIL <img srcset="/images/green-1x1.png?e38a 50w, /images/green-16x16.png?e38a 51w" sizes="(min-width:min(0, 200vw)) 1px"> ref sizes="1px" (display:none) assert_equals: expected "http://web-platform.test:8001/images/green-1x1.png" but got "http://web-platform.test:8001/images/green-16x16.png"
FAIL <img srcset="/images/green-1x1.png?e38b 50w, /images/green-16x16.png?e38b 51w" sizes="(min-width:max(-200vw, 0)) 1px"> ref sizes="1px" (display:none) assert_equals: expected "http://web-platform.test:8001/images/green-1x1.png" but got "http://web-platform.test:8001/images/green-16x16.png"
PASS <img srcset="/images/green-1x1.png?e39 50w, /images/green-16x16.png?e39 51w" sizes="(min-width:0) 1px, 100vw"> ref sizes="1px" (display:none) PASS <img srcset="/images/green-1x1.png?e39 50w, /images/green-16x16.png?e39 51w" sizes="(min-width:0) 1px, 100vw"> ref sizes="1px" (display:none)
PASS <img srcset="/images/green-1x1.png?e40 50w, /images/green-16x16.png?e40 51w" sizes="(min-width:0) 1px, (min-width:0) 100vw, 100vw"> ref sizes="1px" (display:none) PASS <img srcset="/images/green-1x1.png?e40 50w, /images/green-16x16.png?e40 51w" sizes="(min-width:0) 1px, (min-width:0) 100vw, 100vw"> ref sizes="1px" (display:none)
PASS <img srcset="/images/green-1x1.png?e41 50w, /images/green-16x16.png?e41 51w" sizes="(min-width:0) 1px"> ref sizes="1px" (display:none) PASS <img srcset="/images/green-1x1.png?e41 50w, /images/green-16x16.png?e41 51w" sizes="(min-width:0) 1px"> ref sizes="1px" (display:none)
......
This is a testharness.js-based test. This is a testharness.js-based test.
Found 171 tests; 158 PASS, 13 FAIL, 0 TIMEOUT, 0 NOTRUN. Found 169 tests; 158 PASS, 11 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS <img srcset="/images/green-1x1.png?a2 300w, /images/green-16x16.png?a2 301w"> ref sizes="100vw" (quirks mode) PASS <img srcset="/images/green-1x1.png?a2 300w, /images/green-16x16.png?a2 301w"> ref sizes="100vw" (quirks mode)
PASS <img srcset="/images/green-1x1.png?b2 450w, /images/green-16x16.png?b2 451w"> ref sizes="100vw" (quirks mode) PASS <img srcset="/images/green-1x1.png?b2 450w, /images/green-16x16.png?b2 451w"> ref sizes="100vw" (quirks mode)
PASS <img srcset="/images/green-1x1.png?c2 600w, /images/green-16x16.png?c2 601w"> ref sizes="100vw" (quirks mode) PASS <img srcset="/images/green-1x1.png?c2 600w, /images/green-16x16.png?c2 601w"> ref sizes="100vw" (quirks mode)
...@@ -45,8 +45,6 @@ PASS <img srcset="/images/green-1x1.png?e37 50w, /images/green-16x16.png?e37 51w ...@@ -45,8 +45,6 @@ PASS <img srcset="/images/green-1x1.png?e37 50w, /images/green-16x16.png?e37 51w
PASS <img srcset="/images/green-1x1.png?e37a 50w, /images/green-16x16.png?e37a 51w" sizes="(min-width:0) min(1px, 100px)"> ref sizes="1px" (quirks mode) PASS <img srcset="/images/green-1x1.png?e37a 50w, /images/green-16x16.png?e37a 51w" sizes="(min-width:0) min(1px, 100px)"> ref sizes="1px" (quirks mode)
PASS <img srcset="/images/green-1x1.png?e37b 50w, /images/green-16x16.png?e37b 51w" sizes="(min-width:0) max(-100px, 1px)"> ref sizes="1px" (quirks mode) PASS <img srcset="/images/green-1x1.png?e37b 50w, /images/green-16x16.png?e37b 51w" sizes="(min-width:0) max(-100px, 1px)"> ref sizes="1px" (quirks mode)
PASS <img srcset="/images/green-1x1.png?e38 50w, /images/green-16x16.png?e38 51w" sizes="(min-width:calc(0)) 1px"> ref sizes="1px" (quirks mode) PASS <img srcset="/images/green-1x1.png?e38 50w, /images/green-16x16.png?e38 51w" sizes="(min-width:calc(0)) 1px"> ref sizes="1px" (quirks mode)
FAIL <img srcset="/images/green-1x1.png?e38a 50w, /images/green-16x16.png?e38a 51w" sizes="(min-width:min(0, 200vw)) 1px"> ref sizes="1px" (quirks mode) assert_equals: expected "http://web-platform.test:8001/images/green-1x1.png" but got "http://web-platform.test:8001/images/green-16x16.png"
FAIL <img srcset="/images/green-1x1.png?e38b 50w, /images/green-16x16.png?e38b 51w" sizes="(min-width:max(-200vw, 0)) 1px"> ref sizes="1px" (quirks mode) assert_equals: expected "http://web-platform.test:8001/images/green-1x1.png" but got "http://web-platform.test:8001/images/green-16x16.png"
PASS <img srcset="/images/green-1x1.png?e39 50w, /images/green-16x16.png?e39 51w" sizes="(min-width:0) 1px, 100vw"> ref sizes="1px" (quirks mode) PASS <img srcset="/images/green-1x1.png?e39 50w, /images/green-16x16.png?e39 51w" sizes="(min-width:0) 1px, 100vw"> ref sizes="1px" (quirks mode)
PASS <img srcset="/images/green-1x1.png?e40 50w, /images/green-16x16.png?e40 51w" sizes="(min-width:0) 1px, (min-width:0) 100vw, 100vw"> ref sizes="1px" (quirks mode) PASS <img srcset="/images/green-1x1.png?e40 50w, /images/green-16x16.png?e40 51w" sizes="(min-width:0) 1px, (min-width:0) 100vw, 100vw"> ref sizes="1px" (quirks mode)
PASS <img srcset="/images/green-1x1.png?e41 50w, /images/green-16x16.png?e41 51w" sizes="(min-width:0) 1px"> ref sizes="1px" (quirks mode) PASS <img srcset="/images/green-1x1.png?e41 50w, /images/green-16x16.png?e41 51w" sizes="(min-width:0) 1px"> ref sizes="1px" (quirks mode)
......
This is a testharness.js-based test. This is a testharness.js-based test.
Found 171 tests; 158 PASS, 13 FAIL, 0 TIMEOUT, 0 NOTRUN. Found 169 tests; 158 PASS, 11 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS <img srcset="/images/green-1x1.png?a2 300w, /images/green-16x16.png?a2 301w"> ref sizes="100vw" (standards mode) PASS <img srcset="/images/green-1x1.png?a2 300w, /images/green-16x16.png?a2 301w"> ref sizes="100vw" (standards mode)
PASS <img srcset="/images/green-1x1.png?b2 450w, /images/green-16x16.png?b2 451w"> ref sizes="100vw" (standards mode) PASS <img srcset="/images/green-1x1.png?b2 450w, /images/green-16x16.png?b2 451w"> ref sizes="100vw" (standards mode)
PASS <img srcset="/images/green-1x1.png?c2 600w, /images/green-16x16.png?c2 601w"> ref sizes="100vw" (standards mode) PASS <img srcset="/images/green-1x1.png?c2 600w, /images/green-16x16.png?c2 601w"> ref sizes="100vw" (standards mode)
...@@ -45,8 +45,6 @@ PASS <img srcset="/images/green-1x1.png?e37 50w, /images/green-16x16.png?e37 51w ...@@ -45,8 +45,6 @@ PASS <img srcset="/images/green-1x1.png?e37 50w, /images/green-16x16.png?e37 51w
PASS <img srcset="/images/green-1x1.png?e37a 50w, /images/green-16x16.png?e37a 51w" sizes="(min-width:0) min(1px, 100px)"> ref sizes="1px" (standards mode) PASS <img srcset="/images/green-1x1.png?e37a 50w, /images/green-16x16.png?e37a 51w" sizes="(min-width:0) min(1px, 100px)"> ref sizes="1px" (standards mode)
PASS <img srcset="/images/green-1x1.png?e37b 50w, /images/green-16x16.png?e37b 51w" sizes="(min-width:0) max(-100px, 1px)"> ref sizes="1px" (standards mode) PASS <img srcset="/images/green-1x1.png?e37b 50w, /images/green-16x16.png?e37b 51w" sizes="(min-width:0) max(-100px, 1px)"> ref sizes="1px" (standards mode)
PASS <img srcset="/images/green-1x1.png?e38 50w, /images/green-16x16.png?e38 51w" sizes="(min-width:calc(0)) 1px"> ref sizes="1px" (standards mode) PASS <img srcset="/images/green-1x1.png?e38 50w, /images/green-16x16.png?e38 51w" sizes="(min-width:calc(0)) 1px"> ref sizes="1px" (standards mode)
FAIL <img srcset="/images/green-1x1.png?e38a 50w, /images/green-16x16.png?e38a 51w" sizes="(min-width:min(0, 200vw)) 1px"> ref sizes="1px" (standards mode) assert_equals: expected "http://web-platform.test:8001/images/green-1x1.png" but got "http://web-platform.test:8001/images/green-16x16.png"
FAIL <img srcset="/images/green-1x1.png?e38b 50w, /images/green-16x16.png?e38b 51w" sizes="(min-width:max(-200vw, 0)) 1px"> ref sizes="1px" (standards mode) assert_equals: expected "http://web-platform.test:8001/images/green-1x1.png" but got "http://web-platform.test:8001/images/green-16x16.png"
PASS <img srcset="/images/green-1x1.png?e39 50w, /images/green-16x16.png?e39 51w" sizes="(min-width:0) 1px, 100vw"> ref sizes="1px" (standards mode) PASS <img srcset="/images/green-1x1.png?e39 50w, /images/green-16x16.png?e39 51w" sizes="(min-width:0) 1px, 100vw"> ref sizes="1px" (standards mode)
PASS <img srcset="/images/green-1x1.png?e40 50w, /images/green-16x16.png?e40 51w" sizes="(min-width:0) 1px, (min-width:0) 100vw, 100vw"> ref sizes="1px" (standards mode) PASS <img srcset="/images/green-1x1.png?e40 50w, /images/green-16x16.png?e40 51w" sizes="(min-width:0) 1px, (min-width:0) 100vw, 100vw"> ref sizes="1px" (standards mode)
PASS <img srcset="/images/green-1x1.png?e41 50w, /images/green-16x16.png?e41 51w" sizes="(min-width:0) 1px"> ref sizes="1px" (standards mode) PASS <img srcset="/images/green-1x1.png?e41 50w, /images/green-16x16.png?e41 51w" sizes="(min-width:0) 1px"> ref sizes="1px" (standards mode)
......
This is a testharness.js-based test. This is a testharness.js-based test.
Found 171 tests; 158 PASS, 13 FAIL, 0 TIMEOUT, 0 NOTRUN. Found 169 tests; 158 PASS, 11 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS <img srcset="/images/green-1x1.png?a2 300w, /images/green-16x16.png?a2 301w"> ref sizes="100vw" (width:1000px) PASS <img srcset="/images/green-1x1.png?a2 300w, /images/green-16x16.png?a2 301w"> ref sizes="100vw" (width:1000px)
PASS <img srcset="/images/green-1x1.png?b2 450w, /images/green-16x16.png?b2 451w"> ref sizes="100vw" (width:1000px) PASS <img srcset="/images/green-1x1.png?b2 450w, /images/green-16x16.png?b2 451w"> ref sizes="100vw" (width:1000px)
PASS <img srcset="/images/green-1x1.png?c2 600w, /images/green-16x16.png?c2 601w"> ref sizes="100vw" (width:1000px) PASS <img srcset="/images/green-1x1.png?c2 600w, /images/green-16x16.png?c2 601w"> ref sizes="100vw" (width:1000px)
...@@ -45,8 +45,6 @@ PASS <img srcset="/images/green-1x1.png?e37 50w, /images/green-16x16.png?e37 51w ...@@ -45,8 +45,6 @@ PASS <img srcset="/images/green-1x1.png?e37 50w, /images/green-16x16.png?e37 51w
PASS <img srcset="/images/green-1x1.png?e37a 50w, /images/green-16x16.png?e37a 51w" sizes="(min-width:0) min(1px, 100px)"> ref sizes="1px" (width:1000px) PASS <img srcset="/images/green-1x1.png?e37a 50w, /images/green-16x16.png?e37a 51w" sizes="(min-width:0) min(1px, 100px)"> ref sizes="1px" (width:1000px)
PASS <img srcset="/images/green-1x1.png?e37b 50w, /images/green-16x16.png?e37b 51w" sizes="(min-width:0) max(-100px, 1px)"> ref sizes="1px" (width:1000px) PASS <img srcset="/images/green-1x1.png?e37b 50w, /images/green-16x16.png?e37b 51w" sizes="(min-width:0) max(-100px, 1px)"> ref sizes="1px" (width:1000px)
PASS <img srcset="/images/green-1x1.png?e38 50w, /images/green-16x16.png?e38 51w" sizes="(min-width:calc(0)) 1px"> ref sizes="1px" (width:1000px) PASS <img srcset="/images/green-1x1.png?e38 50w, /images/green-16x16.png?e38 51w" sizes="(min-width:calc(0)) 1px"> ref sizes="1px" (width:1000px)
FAIL <img srcset="/images/green-1x1.png?e38a 50w, /images/green-16x16.png?e38a 51w" sizes="(min-width:min(0, 200vw)) 1px"> ref sizes="1px" (width:1000px) assert_equals: expected "http://web-platform.test:8001/images/green-1x1.png" but got "http://web-platform.test:8001/images/green-16x16.png"
FAIL <img srcset="/images/green-1x1.png?e38b 50w, /images/green-16x16.png?e38b 51w" sizes="(min-width:max(-200vw, 0)) 1px"> ref sizes="1px" (width:1000px) assert_equals: expected "http://web-platform.test:8001/images/green-1x1.png" but got "http://web-platform.test:8001/images/green-16x16.png"
PASS <img srcset="/images/green-1x1.png?e39 50w, /images/green-16x16.png?e39 51w" sizes="(min-width:0) 1px, 100vw"> ref sizes="1px" (width:1000px) PASS <img srcset="/images/green-1x1.png?e39 50w, /images/green-16x16.png?e39 51w" sizes="(min-width:0) 1px, 100vw"> ref sizes="1px" (width:1000px)
PASS <img srcset="/images/green-1x1.png?e40 50w, /images/green-16x16.png?e40 51w" sizes="(min-width:0) 1px, (min-width:0) 100vw, 100vw"> ref sizes="1px" (width:1000px) PASS <img srcset="/images/green-1x1.png?e40 50w, /images/green-16x16.png?e40 51w" sizes="(min-width:0) 1px, (min-width:0) 100vw, 100vw"> ref sizes="1px" (width:1000px)
PASS <img srcset="/images/green-1x1.png?e41 50w, /images/green-16x16.png?e41 51w" sizes="(min-width:0) 1px"> ref sizes="1px" (width:1000px) PASS <img srcset="/images/green-1x1.png?e41 50w, /images/green-16x16.png?e41 51w" sizes="(min-width:0) 1px"> ref sizes="1px" (width:1000px)
......
...@@ -58,8 +58,6 @@ ...@@ -58,8 +58,6 @@
<img srcset='/images/green-1x1.png?e37a 50w, /images/green-16x16.png?e37a 51w' sizes='(min-width:0) min(1px, 100px)'> <img srcset='/images/green-1x1.png?e37a 50w, /images/green-16x16.png?e37a 51w' sizes='(min-width:0) min(1px, 100px)'>
<img srcset='/images/green-1x1.png?e37b 50w, /images/green-16x16.png?e37b 51w' sizes='(min-width:0) max(-100px, 1px)'> <img srcset='/images/green-1x1.png?e37b 50w, /images/green-16x16.png?e37b 51w' sizes='(min-width:0) max(-100px, 1px)'>
<img srcset='/images/green-1x1.png?e38 50w, /images/green-16x16.png?e38 51w' sizes='(min-width:calc(0)) 1px'> <img srcset='/images/green-1x1.png?e38 50w, /images/green-16x16.png?e38 51w' sizes='(min-width:calc(0)) 1px'>
<img srcset='/images/green-1x1.png?e38a 50w, /images/green-16x16.png?e38a 51w' sizes='(min-width:min(0, 200vw)) 1px'>
<img srcset='/images/green-1x1.png?e38b 50w, /images/green-16x16.png?e38b 51w' sizes='(min-width:max(-200vw, 0)) 1px'>
<img srcset='/images/green-1x1.png?e39 50w, /images/green-16x16.png?e39 51w' sizes='(min-width:0) 1px, 100vw'> <img srcset='/images/green-1x1.png?e39 50w, /images/green-16x16.png?e39 51w' sizes='(min-width:0) 1px, 100vw'>
<img srcset='/images/green-1x1.png?e40 50w, /images/green-16x16.png?e40 51w' sizes='(min-width:0) 1px, (min-width:0) 100vw, 100vw'> <img srcset='/images/green-1x1.png?e40 50w, /images/green-16x16.png?e40 51w' sizes='(min-width:0) 1px, (min-width:0) 100vw, 100vw'>
<img srcset='/images/green-1x1.png?e41 50w, /images/green-16x16.png?e41 51w' sizes='(min-width:0) 1px'> <img srcset='/images/green-1x1.png?e41 50w, /images/green-16x16.png?e41 51w' sizes='(min-width:0) 1px'>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment