Changeset 276296 in webkit
- Timestamp:
- Apr 20, 2021, 3:19:21 AM (5 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 7 added
- 10 edited
-
ChangeLog (modified) (1 diff)
-
TestExpectations (modified) (1 diff)
-
imported/w3c/ChangeLog (modified) (1 diff)
-
imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt (modified) (1 diff)
-
imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio.html (modified) (3 diffs)
-
imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio-expected.txt (modified) (1 diff)
-
imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html (modified) (3 diffs)
-
imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/number-placeholder-right-aligned-expected.html (added)
-
imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/number-placeholder-right-aligned.html (added)
-
imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio-expected.txt (added)
-
imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html (added)
-
imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources (added)
-
imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js (added)
-
imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/w3c-import.log (added)
-
imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt (modified) (1 diff)
-
imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html (modified) (4 diffs)
-
imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/w3c-import.log (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r276293 r276296 1 2021-04-20 Cathie Chen <cathiechen@igalia.com> 2 3 Update html/rendering/replaced-elements/attributes-for-embedded-content-and-images/ tests from WPT 4 https://bugs.webkit.org/show_bug.cgi?id=224748 5 6 Reviewed by Rob Buis. 7 8 picture-aspect-ratio.html is flaky. 9 10 * TestExpectations: 11 1 12 2021-04-20 Tim Nguyen <ntim@apple.com> 2 13 -
trunk/LayoutTests/TestExpectations
r276240 r276296 1417 1417 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-standards-mode.html [ Failure Pass ] 1418 1418 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-object-element/object-fallback-failed-cross-origin-navigation.sub.html [ Failure Pass ] 1419 1420 # Newly importing aspect ratio test is flaky. 1421 imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html [ Failure Pass ] 1419 1422 1420 1423 # Newly importing W3C tests needed support for reftest-wait. -
trunk/LayoutTests/imported/w3c/ChangeLog
r276293 r276296 1 2021-04-20 Cathie Chen <cathiechen@igalia.com> 2 3 Update html/rendering/replaced-elements/attributes-for-embedded-content-and-images/ tests from WPT 4 https://bugs.webkit.org/show_bug.cgi?id=224748 5 6 Reviewed by Rob Buis. 7 8 Update the tests for "mapping attribute width and height as the implicit aspect ratio" which are based on the latest agreement 9 from WPT commit 19445e7b39. 10 11 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt: 12 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio.html: 13 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio-expected.txt: 14 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html: 15 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/number-placeholder-right-aligned-expected.html: Added. 16 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/number-placeholder-right-aligned.html: Added. 17 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio-expected.txt: Added. 18 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html: Added. 19 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js: Added. 20 (test_computed_style_aspect_ratio): 21 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/w3c-import.log: Added. 22 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt: 23 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html: 24 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/w3c-import.log: 25 1 26 2021-04-20 Tim Nguyen <ntim@apple.com> 2 27 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt
r267646 r276296 1 1 2 3 PASS Canvas width and height attributes are used as the surface size with contain:size 2 4 PASS Canvas width and height attributes are used as the surface size 5 FAIL canvas with {"width":"10","height":"20"} assert_equals: expected "auto 10 / 20" but got "auto" 6 PASS canvas with {"width":"0","height":"1"} 7 PASS canvas with {"width":"1","height":"0"} 8 PASS canvas with {"width":"0","height":"0"} 9 FAIL canvas with {"width":"0.5","height":"1.5"} assert_in_array: value "auto" not in array ["auto 0 / 1", "auto 0.5 / 1.5"] 10 PASS canvas with {"width":"10%","height":"20"} 11 PASS canvas with {"width":null,"height":null} 12 PASS canvas with {"width":"10","height":null} 13 PASS canvas with {"width":null,"height":"20"} 14 PASS canvas with {"width":"xx","height":"20"} 3 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio.html
r269360 r276296 1 1 <!doctype html><!-- webkit-test-runner [ AspectRatioOfImgFromWidthAndHeightEnabled=true ] --> 2 <title>Canvas width and height attributes are used as the surface size </title>2 <title>Canvas width and height attributes are used as the surface size, and also to infer aspect ratio</title> 3 3 <script src="/resources/testharness.js"></script> 4 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="resources/aspect-ratio.js"></script> 5 6 <style> 6 7 canvas { … … 11 12 </style> 12 13 <body> 14 <canvas id="contained" width="250" height="100" style="contain: size;"></canvas> 13 15 <script> 14 let t = async_test("Canvas width and height attributes are used as the surface size");15 16 function assert_ratio(img, expected) { 16 17 let epsilon = 0.001; 17 18 assert_approx_equals(parseInt(getComputedStyle(img).width, 10) / parseInt(getComputedStyle(img).height, 10), expected, epsilon); 18 19 } 20 21 function test_computed_style(width, height, expected) { 22 test_computed_style_aspect_ratio("canvas", {width: width, height: height}, expected); 23 } 24 25 test(function() { 26 canvas = document.getElementById("contained"); 27 assert_ratio(canvas, 2.5); 28 }, "Canvas width and height attributes are used as the surface size with contain:size"); 29 19 30 // Create and append a new canvas and immediately check the ratio. 20 t .step(function() {31 test(function() { 21 32 var canvas = document.createElement("canvas"); 22 33 canvas.setAttribute("width", "250"); … … 25 36 // Canvases always use the aspect ratio from their surface size. 26 37 assert_ratio(canvas, 2.5); 38 }, "Canvas width and height attributes are used as the surface size"); 27 39 28 t.done(); 29 }); 40 test_computed_style("10", "20", "auto 10 / 20"); 41 // These are invalid per spec, but see 42 // https://github.com/whatwg/html/issues/4961 43 test_computed_style("0", "1", ["auto", "auto 0 / 1"]); 44 test_computed_style("1", "0", ["auto", "auto 1 / 0"]); 45 test_computed_style("0", "0", ["auto", "auto 0 / 0"]); 46 47 // See https://github.com/whatwg/html/issues/4961: 48 // https://html.spec.whatwg.org/#attr-canvas-width 49 // https://html.spec.whatwg.org/#rules-for-parsing-non-negative-integers 50 test_computed_style("0.5", "1.5", ["auto 0 / 1", "auto 0.5 / 1.5"]); 51 test_computed_style("10%", "20", ["auto", "auto 10 / 20"]); 52 53 test_computed_style(null, null, "auto"); 54 test_computed_style("10", null, "auto"); 55 test_computed_style(null, "20", "auto"); 56 test_computed_style("xx", "20", "auto"); 57 30 58 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio-expected.txt
r276228 r276296 1 1 2 2 3 FAIL Image width and height attributes are used to infer aspect-ratio assert_approx_equals: expected 1.2547169811320755 +/- 0.001 but got 1.25 3 FAIL Image width and height attributes are used to infer aspect-ratio assert_approx_equals: aspect-ratio should override intrinsic size of images that don't have any src. expected 0.8 +/- 0.001 but got Infinity 4 FAIL img with {"width":"10","height":"20"} assert_equals: expected "auto 10 / 20" but got "auto" 5 FAIL input with {"type":"image","width":"10","height":"20"} assert_equals: expected "auto 10 / 20" but got "auto" 6 PASS input with {"type":"submit","width":"10","height":"20"} 7 FAIL img with {"width":"0","height":"1"} assert_equals: expected "auto 0 / 1" but got "auto" 8 FAIL input with {"type":"image","width":"0","height":"1"} assert_equals: expected "auto 0 / 1" but got "auto" 9 PASS input with {"type":"submit","width":"0","height":"1"} 10 FAIL img with {"width":"1","height":"0"} assert_equals: expected "auto 1 / 0" but got "auto" 11 FAIL input with {"type":"image","width":"1","height":"0"} assert_equals: expected "auto 1 / 0" but got "auto" 12 PASS input with {"type":"submit","width":"1","height":"0"} 13 FAIL img with {"width":"0","height":"0"} assert_equals: expected "auto 0 / 0" but got "auto" 14 FAIL input with {"type":"image","width":"0","height":"0"} assert_equals: expected "auto 0 / 0" but got "auto" 15 PASS input with {"type":"submit","width":"0","height":"0"} 16 FAIL img with {"width":"0.5","height":"1.5"} assert_equals: expected "auto 0.5 / 1.5" but got "auto" 17 FAIL input with {"type":"image","width":"0.5","height":"1.5"} assert_equals: expected "auto 0.5 / 1.5" but got "auto" 18 PASS input with {"type":"submit","width":"0.5","height":"1.5"} 19 PASS img with {"width":null,"height":null} 20 PASS input with {"type":"image","width":null,"height":null} 21 PASS input with {"type":"submit","width":null,"height":null} 22 PASS img with {"width":"10","height":null} 23 PASS input with {"type":"image","width":"10","height":null} 24 PASS input with {"type":"submit","width":"10","height":null} 25 PASS img with {"width":null,"height":"20"} 26 PASS input with {"type":"image","width":null,"height":"20"} 27 PASS input with {"type":"submit","width":null,"height":"20"} 28 PASS img with {"width":"xx","height":"20"} 29 PASS input with {"type":"image","width":"xx","height":"20"} 30 PASS input with {"type":"submit","width":"xx","height":"20"} 31 PASS img with {"width":"10%","height":"20"} 32 PASS input with {"type":"image","width":"10%","height":"20"} 33 PASS input with {"type":"submit","width":"10%","height":"20"} 4 34 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html
r269360 r276296 3 3 <script src="/resources/testharness.js"></script> 4 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="resources/aspect-ratio.js"></script> 5 6 <style> 6 7 img { … … 15 16 <img src="error.png" width=100 height=125> 16 17 <img src="error.png"> 18 <img src="error.png" alt="Alt text" width=100 height=500> 17 19 <script> 18 20 let t = async_test("Image width and height attributes are used to infer aspect-ratio"); 19 function assert_ratio(img, expected ) {21 function assert_ratio(img, expected, description) { 20 22 let epsilon = 0.001; 21 assert_approx_equals(parseFloat(getComputedStyle(img).width, 10) / parseFloat(getComputedStyle(img).height, 10), expected, epsilon); 23 assert_approx_equals(parseFloat(getComputedStyle(img).width, 10) / parseFloat(getComputedStyle(img).height, 10), 24 expected, epsilon, description); 22 25 } 26 27 function test_computed_style(width, height, expected) { 28 test_computed_style_aspect_ratio("img", {width: width, height: height}, expected); 29 test_computed_style_aspect_ratio("input", {type: "image", width: width, height: height}, expected); 30 // input type=submit should not do this mapping. 31 test_computed_style_aspect_ratio("input", {type: "submit", width: width, height: height}, "auto"); 32 } 33 23 34 // Create and append a new image and immediately check the ratio. 24 35 // This is not racy because the spec requires the user agent to queue a task: … … 50 61 onload = t.step_func_done(function() { 51 62 let images = document.querySelectorAll("img"); 52 assert_ratio(images[0], 2.0); // Loaded image's aspect ratio, at least by default, overrides width / height ratio. 53 assert_ratio(images[1], 2.0); // 2.0 is the original aspect ratio of green.png 54 assert_equals(getComputedStyle(images[2]).height, "0px"); // aspect-ratio doesn't override intrinsic size of images that don't have any src. 55 assert_equals(getComputedStyle(images[3]).height, getComputedStyle(images[4]).height); // aspect-ratio doesn't override intrinsic size of error images. 56 assert_ratio(images[5], 133/106); // The original aspect ratio of blue.png 63 assert_ratio(images[0], 2.0, "2.0 is the original aspect ratio of green.png"); 64 assert_ratio(images[1], 2.0, "Loaded image's aspect ratio, at least by default, overrides width / height ratio."); 65 assert_ratio(images[2], 100/125, "aspect-ratio should override intrinsic size of images that don't have any src."); 66 assert_ratio(images[3], 100/125, "aspect-ratio should affect the size of error images."); 67 assert_not_equals(images[5].offsetHeight, 500, "Images with alt text should be inline and ignore the aspect ratio"); 68 assert_ratio(images[6], 133/106, "The original aspect ratio of blue.png"); 57 69 }); 70 71 test_computed_style("10", "20", "auto 10 / 20"); 72 // These are invalid per spec, but see 73 // https://github.com/whatwg/html/issues/4961 74 test_computed_style("0", "1", "auto 0 / 1"); 75 test_computed_style("1", "0", "auto 1 / 0"); 76 test_computed_style("0", "0", "auto 0 / 0"); 77 // https://html.spec.whatwg.org/#map-to-the-aspect-ratio-property 78 // https://html.spec.whatwg.org/#rules-for-parsing-non-zero-dimension-values 79 test_computed_style("0.5", "1.5", "auto 0.5 / 1.5"); 80 81 test_computed_style(null, null, "auto"); 82 test_computed_style("10", null, "auto"); 83 test_computed_style(null, "20", "auto"); 84 test_computed_style("xx", "20", "auto"); 85 test_computed_style("10%", "20", "auto"); 86 58 87 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt
r267646 r276296 1 1 2 2 3 PASS Video width and height attributes are not used to infer aspect-ratio 3 FAIL Video width and height attributes are not used to infer aspect-ratio assert_approx_equals: expected 2.5 +/- 0.001 but got 2 4 FAIL video with {"width":"10","height":"20"} assert_equals: expected "auto 10 / 20" but got "auto" 5 FAIL video with {"width":"0.5","height":"1.5"} assert_equals: expected "auto 0.5 / 1.5" but got "auto" 6 PASS video with {"width":"0","height":"1"} 7 PASS video with {"width":"1","height":"0"} 8 PASS video with {"width":"0","height":"0"} 9 PASS video with {"width":null,"height":null} 10 PASS video with {"width":"10","height":null} 11 PASS video with {"width":null,"height":"20"} 12 PASS video with {"width":"xx","height":"20"} 13 PASS video with {"width":"10%","height":"20"} 4 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html
r269360 r276296 1 1 <!doctype html><!-- webkit-test-runner [ AspectRatioOfImgFromWidthAndHeightEnabled=true ] --> 2 <title>Video width and height attributes are notused to infer aspect-ratio</title>2 <title>Video width and height attributes are used to infer aspect-ratio</title> 3 3 <script src="/resources/testharness.js"></script> 4 4 <script src="/resources/testharnessreport.js"></script> 5 5 <script src="/common/media.js"></script> 6 <script src="resources/aspect-ratio.js"></script> 6 7 <style> 7 8 video { … … 12 13 </style> 13 14 <body> 15 <video width="250" height="100" id="contained" style="contain: size;"></video> 14 16 <script> 15 17 let t = async_test("Video width and height attributes are not used to infer aspect-ratio"); … … 18 20 assert_approx_equals(parseInt(getComputedStyle(img).width, 10) / parseInt(getComputedStyle(img).height, 10), expected, epsilon); 19 21 } 22 23 function test_computed_style(width, height, expected) { 24 test_computed_style_aspect_ratio("video", {width: width, height: height}, expected); 25 } 26 27 t.step(function() { 28 var video = document.getElementById("contained"); 29 video.src = getVideoURI('/media/2x2-green'); 30 assert_ratio(video, 2.5); 31 }, "contain:size aspect ratio"); 32 20 33 // Create and append a new video and immediately check the ratio. 21 34 // This is not racy because the spec requires the user agent to queue a task: 22 35 // https://html.spec.whatwg.org/multipage/media.html#concept-media-load-algorithm 23 36 t.step(function() { 24 v ar video = document.createElement("video");37 video = document.createElement("video"); 25 38 video.setAttribute("width", "250"); 26 39 video.setAttribute("height", "100"); … … 36 49 assert_ratio(video, 1); 37 50 }); 38 }); 51 }, "aspect ratio for regular video"); 52 53 test_computed_style("10", "20", "auto 10 / 20"); 54 test_computed_style("0.5", "1.5", "auto 0.5 / 1.5"); 55 56 // These are invalid per spec, but see 57 // https://github.com/whatwg/html/issues/4961 58 test_computed_style("0", "1", ["auto", "auto 0 / 1"]); 59 test_computed_style("1", "0", ["auto", "auto 1 / 0"]); 60 test_computed_style("0", "0", ["auto", "auto 0 / 0"]); 61 62 test_computed_style(null, null, "auto"); 63 test_computed_style("10", null, "auto"); 64 test_computed_style(null, "20", "auto"); 65 test_computed_style("xx", "20", "auto"); 66 test_computed_style("10%", "20", "auto"); 67 39 68 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/w3c-import.log
r264117 r276296 39 39 /LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/input-type-change-from-image-1-expected.html 40 40 /LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/input-type-change-from-image-1.html 41 /LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/number-placeholder-right-aligned-expected.html 42 /LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/number-placeholder-right-aligned.html 41 43 /LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_perc-expected.xhtml 42 44 /LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_perc.xhtml 43 45 /LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel-expected.xhtml 44 46 /LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel.xhtml 47 /LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html 45 48 /LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html
Note:
See TracChangeset
for help on using the changeset viewer.