Summary

Harness status: OK

Found 15 tests

Details

ResultTest NameMessage
Passsource width and height attributes are used to infer aspect-ratio in <picture>
Asserts runNo asserts ran
PassComputed style for width/height/aspect-ratio
Asserts run
Pass
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)
PassSource width/height should take precedence over img attributes.
Asserts run
Pass
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)
PassMake sure style gets invalidated correctly when the source gets removed.
Asserts run
Pass
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)
PassIf the <source> has only one of width/height, we don't get an aspect ratio, even if the <img> has both.
Asserts run
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("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)
PassIf we don't have width/height on the source, we fall back to width/height on the <img>.
Asserts run
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)
PassIf we only have one width attribute, we should get width mapped but no aspect ratio, even if <img> has attributes.
Asserts run
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("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)
PassIf we only have height attribute, we should get height mapped but no aspect ratio, even if <img> has attributes.
Asserts run
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("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)
PassDynamically changing width/height should change computed style
Asserts run
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("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)
PassChanging which <source> matches should change computed style
Asserts run
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("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)
PassPercentages on source should be ignored for aspect-ratio but used for width/height.
Asserts run
Pass
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)
PassTrailing garbage should be ignored but not make the attribute invalid
Asserts run
Pass
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)
FailLoaded picture test: Both <source> and <img> are without width and height attributesassert_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 run
Fail
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)
FailLoaded picture test: <source> with width and height attributes, <img> without width and height attributesassert_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 run
Fail
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)
FailLoaded picture test: Both <source> and <img> are with width and height attributesassert_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 run
Fail
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)