Alt text

Summary

Harness status: OK

Found 41 tests

Details

ResultTest NameMessage
PassImage width and height attributes are used to infer aspect-ratio
Asserts runNo asserts ran
PassCreate, append and test immediately: <img> with attributes width=250, height=100
Asserts run
Pass
assert_approx_equals(2.5, 2.5, 0.001, undefined)
    at assert_ratio ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:24:3)
PassCreate, append and test immediately: <img> with attributes width=0.8, height=0.2
Asserts run
Pass
assert_approx_equals(4, 4, 0.001, undefined)
    at assert_ratio ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:24:3)
PassCreate, append and test immediately: <img> with attributes width=50% height=25%
Asserts run
Pass
assert_equals("0px", "0px")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:66:3)
PassCreate, append and test immediately: <img> with invalid trailing attributes width=50pp height=25xx
Asserts run
Pass
assert_approx_equals(2, 2, 0.001, undefined)
    at assert_ratio ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:24:3)
PassComputed style test: img with {"width":"10","height":"20"}
Asserts run
Pass
assert_equals("auto 10 / 20", "auto 10 / 20")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"image","width":"10","height":"20"}
Asserts run
Pass
assert_equals("auto 10 / 20", "auto 10 / 20")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"submit","width":"10","height":"20"}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: img with {"width":"0","height":"1"}
Asserts run
Pass
assert_equals("auto 0 / 1", "auto 0 / 1")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"image","width":"0","height":"1"}
Asserts run
Pass
assert_equals("auto 0 / 1", "auto 0 / 1")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"submit","width":"0","height":"1"}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: img with {"width":"1","height":"0"}
Asserts run
Pass
assert_equals("auto 1 / 0", "auto 1 / 0")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"image","width":"1","height":"0"}
Asserts run
Pass
assert_equals("auto 1 / 0", "auto 1 / 0")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"submit","width":"1","height":"0"}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: img with {"width":"0","height":"0"}
Asserts run
Pass
assert_equals("auto 0 / 0", "auto 0 / 0")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"image","width":"0","height":"0"}
Asserts run
Pass
assert_equals("auto 0 / 0", "auto 0 / 0")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"submit","width":"0","height":"0"}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: img with {"width":"0.5","height":"1.5"}
Asserts run
Pass
assert_equals("auto 0.5 / 1.5", "auto 0.5 / 1.5")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"image","width":"0.5","height":"1.5"}
Asserts run
Pass
assert_equals("auto 0.5 / 1.5", "auto 0.5 / 1.5")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"submit","width":"0.5","height":"1.5"}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: img with {"width":null,"height":null}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"image","width":null,"height":null}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"submit","width":null,"height":null}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: img with {"width":"10","height":null}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"image","width":"10","height":null}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"submit","width":"10","height":null}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: img with {"width":null,"height":"20"}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"image","width":null,"height":"20"}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"submit","width":null,"height":"20"}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: img with {"width":"xx","height":"20"}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"image","width":"xx","height":"20"}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"submit","width":"xx","height":"20"}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: img with {"width":"10%","height":"20"}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"image","width":"10%","height":"20"}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
PassComputed style test: input with {"type":"submit","width":"10%","height":"20"}
Asserts run
Pass
assert_equals("auto", "auto")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js:11:5)
FailLoaded images test: <img> without width height attributesassert_approx_equals: 2.0 is the original aspect ratio of green.png expected 2 +/- 0.001 but got 1
    at assert_ratio (https://www1.wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:24:3)
    at Test.<anonymous> (https://www1.wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:93:5)
    at Test.step (https://www1.wpt.live/resources/testharness.js:2638:25)
    at test (https://www1.wpt.live/resources/testharness.js:633:30)
    at onload (https://www1.wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:92:3)
Asserts run
Fail
assert_approx_equals(1, 2, 0.001, "2.0 is the original aspect ratio of green.png")
    at assert_ratio ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:24:3)
FailLoaded images test: <img> with width and height attributes, but conflicting to the original aspect ratioassert_approx_equals: Loaded image's aspect ratio, at least by default, overrides width / height ratio. expected 2 +/- 0.001 but got 0.8
    at assert_ratio (https://www1.wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:24:3)
    at Test.<anonymous> (https://www1.wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:97:5)
    at Test.step (https://www1.wpt.live/resources/testharness.js:2638:25)
    at test (https://www1.wpt.live/resources/testharness.js:633:30)
    at onload (https://www1.wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:96:3)
Asserts run
Fail
assert_approx_equals(0.8, 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/img-aspect-ratio.html:24:3)
PassLoaded images test: <img> with width, height and empty src attributes
Asserts run
Pass
assert_approx_equals(0.8, 0.8, 0.001, "aspect-ratio should override intrinsic size of images that don't have any src.")
    at assert_ratio ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:24:3)
PassLoaded images test: Error image with width and height attributes
Asserts run
Pass
assert_approx_equals(0.8, 0.8, 0.001, "aspect-ratio should affect the size of error images.")
    at assert_ratio ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:24:3)
FailLoaded images test: Error image with width, height and alt attributesassert_equals: expected "auto 100 / 500" but got "auto"
    at Test.<anonymous> (https://www1.wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:111:5)
    at Test.step (https://www1.wpt.live/resources/testharness.js:2638:25)
    at test (https://www1.wpt.live/resources/testharness.js:633:30)
    at onload (https://www1.wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:108:3)
Asserts run
Pass
assert_not_equals(19, 500, "Images with alt text should be inline and ignore the aspect ratio")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:109:5)
Fail
assert_equals("auto", "auto 100 / 500")
    at Test.<anonymous> ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:111:5)
FailLoaded images test: <img> with width and height attributes, but not equal to the original aspect ratioassert_approx_equals: The original aspect ratio of blue.png expected 1.2547169811320755 +/- 0.001 but got 2.5
    at assert_ratio (https://www1.wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:24:3)
    at Test.<anonymous> (https://www1.wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:115:5)
    at Test.step (https://www1.wpt.live/resources/testharness.js:2638:25)
    at test (https://www1.wpt.live/resources/testharness.js:633:30)
    at onload (https://www1.wpt.live/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:114:3)
Asserts run
Fail
assert_approx_equals(2.5, 1.2547169811320755, 0.001, "The original aspect ratio of blue.png")
    at assert_ratio ( /html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:24:3)