Pass | source width and height attributes are used to infer aspect-ratio in <picture> | Asserts runNo asserts ran |
Pass | Computed style for width/height/aspect-ratio | Asserts runPass | assert_approx_equals(1, 1, 0.001, undefined)
at assert_ratio ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:49:3) | Pass | assert_equals("auto 100 / 100", "auto 100 / 100")
at assert_cs ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:69:3) | Pass | assert_equals("100px", "100px")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:81:3) | Pass | assert_equals("100px", "100px")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:82:3) | Pass | assert_equals("auto", "auto")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:84:3) | Pass | assert_equals("auto", "auto")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:85:3) |
|
Pass | Source width/height should take precedence over img attributes. | Asserts runPass | assert_approx_equals(2, 2, 0.001, undefined)
at assert_ratio ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:49:3) | Pass | assert_equals("auto 200 / 100", "auto 200 / 100")
at assert_cs ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:69:3) | Pass | assert_equals("200px", "200px")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:96:3) | Pass | assert_equals("100px", "100px")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:97:3) | Pass | assert_equals("auto", "auto")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:99:3) | Pass | assert_equals("auto", "auto")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:100:3) |
|
Pass | Make sure style gets invalidated correctly when the source gets removed. | Asserts runPass | assert_equals("auto 250 / 50", "auto 250 / 50")
at assert_cs ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:69:3) | Pass | assert_approx_equals(5, 5, 0.001, undefined)
at assert_ratio ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:49:3) | Pass | assert_equals("250px", "250px")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:110:3) | Pass | assert_equals("50px", "50px")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:111:3) |
|
Pass | If the <source> has only one of width/height, we don't get an aspect ratio, even if the <img> has both. | Asserts runPass | assert_equals("auto", "auto")
at assert_cs ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:69:3) | Pass | assert_equals("100px", "100px")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:121:3) | Pass | assert_equals("auto", "auto")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:122:3) |
|
Pass | If we don't have width/height on the source, we fall back to width/height on the <img>. | Asserts runPass | assert_equals("auto 200 / 100", "auto 200 / 100")
at assert_cs ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:69:3) |
|
Pass | If we only have one width attribute, we should get width mapped but no aspect ratio, even if <img> has attributes. | Asserts runPass | assert_equals("auto", "auto")
at assert_cs ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:69:3) | Pass | assert_equals("100px", "100px")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:139:3) | Pass | assert_equals("auto", "auto")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:140:3) |
|
Pass | If we only have height attribute, we should get height mapped but no aspect ratio, even if <img> has attributes. | Asserts runPass | assert_equals("auto", "auto")
at assert_cs ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:69:3) | Pass | assert_equals("auto", "auto")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:150:3) | Pass | assert_equals("100px", "100px")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:151:3) |
|
Pass | Dynamically changing width/height should change computed style | Asserts runPass | assert_equals("auto 100 / 100", "auto 100 / 100")
at assert_cs ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:69:3) | Pass | assert_equals("auto 100 / 300", "auto 100 / 300")
at assert_cs ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:69:3) | Pass | assert_equals("auto 10 / 300", "auto 10 / 300")
at assert_cs ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:69:3) | Pass | assert_equals("10px", "10px")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:163:3) | Pass | assert_equals("300px", "300px")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:164:3) |
|
Pass | Changing which <source> matches should change computed style | Asserts runPass | assert_equals("auto 100 / 100", "auto 100 / 100")
at assert_cs ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:69:3) | Pass | assert_equals("auto 300 / 150", "auto 300 / 150")
at assert_cs ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:69:3) | Pass | assert_equals("300px", "300px")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:176:3) | Pass | assert_equals("150px", "150px")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:177:3) |
|
Pass | Percentages on source should be ignored for aspect-ratio but used for width/height. | Asserts runPass | assert_equals(100, 100)
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:182:3) | Pass | assert_equals(0, 0)
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:183:3) | Pass | assert_equals("auto", "auto")
at assert_cs ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:69:3) | Pass | assert_equals(100, 100)
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:186:3) | Pass | assert_equals(50, 50)
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:187:3) | Pass | assert_equals("100%", "100%")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:190:3) | Pass | assert_equals("50%", "50%")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:191:3) |
|
Pass | Trailing garbage should be ignored but not make the attribute invalid | Asserts runPass | assert_equals(100, 100)
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:196:3) | Pass | assert_equals(50, 50)
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:197:3) | Pass | assert_equals("auto 100 / 50", "auto 100 / 50")
at assert_cs ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:69:3) | Pass | assert_equals(100, 100)
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:200:3) | Pass | assert_equals(50, 50)
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:201:3) | Pass | assert_equals("100px", "100px")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:204:3) | Pass | assert_equals("50px", "50px")
at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:205:3) |
|
Fail | Loaded picture test: Both <source> and <img> are without width and height attributes | assert_approx_equals: 2.0 is the original aspect ratio of green-100x50.png expected 2 +/- 0.001 but got NaN at assert_ratio (https://wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:49:3)
at Test.<anonymous> (https://wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:212:5)
at Test.step (https://wpt.live/resources/testharness.js:2642:25)
at test (https://wpt.live/resources/testharness.js:633:30)
at onload (https://wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:210:3) Asserts runFail | assert_approx_equals(NaN, 2, 0.001, "2.0 is the original aspect ratio of green-100x50.png")
at assert_ratio ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:49:3) |
|
Fail | Loaded picture test: <source> with width and height attributes, <img> without width and height attributes | assert_approx_equals: Loaded image's aspect ratio, at least by default, overrides width / height ratio. expected 2 +/- 0.001 but got 1 at assert_ratio (https://wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:49:3)
at Test.<anonymous> (https://wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:222:5)
at Test.step (https://wpt.live/resources/testharness.js:2642:25)
at test (https://wpt.live/resources/testharness.js:633:30)
at onload (https://wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:220:3) Asserts runFail | assert_approx_equals(1, 2, 0.001, "Loaded image's aspect ratio, at least by default, overrides width / height ratio.")
at assert_ratio ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:49:3) |
|
Fail | Loaded picture test: Both <source> and <img> are with width and height attributes | assert_approx_equals: Loaded image's aspect ratio, at least by default, overrides width / height ratio (2). expected 2 +/- 0.001 but got 1 at assert_ratio (https://wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:49:3)
at Test.<anonymous> (https://wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:232:5)
at Test.step (https://wpt.live/resources/testharness.js:2642:25)
at test (https://wpt.live/resources/testharness.js:633:30)
at onload (https://wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:230:3) Asserts runFail | assert_approx_equals(1, 2, 0.001, "Loaded image's aspect ratio, at least by default, overrides width / height ratio (2).")
at assert_ratio ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html:49:3) |
|