Changeset 254461 in webkit


Ignore:
Timestamp:
Jan 13, 2020 3:35:24 PM (4 years ago)
Author:
cathiechen
Message:

Import the update of img-aspect-ratio.html.
https://bugs.webkit.org/show_bug.cgi?id=206160

Reviewed by Frédéric Wang

Use parseFloat() instead of parseInt() in img-aspect-ratio.html.
The resource location was changed to relative in bug 205678. To keep them consistent with others, restore them.

  • web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/align.html:
  • web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio.html:
  • web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/content-aspect-ratio.html:
  • web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html:
  • web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-no-alt-replaced.html:
  • web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-replaced-box-while-loading.html:
  • web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html:
Location:
trunk/LayoutTests/imported/w3c
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r254408 r254461  
     12020-01-13  Cathie Chen  <cathiechen@igalia.com>
     2
     3        Import the update of img-aspect-ratio.html.
     4        https://bugs.webkit.org/show_bug.cgi?id=206160
     5
     6        Reviewed by Frédéric Wang
     7
     8        Use parseFloat() instead of parseInt() in img-aspect-ratio.html.
     9        The resource location was changed to relative in bug 205678. To keep them consistent with others, restore them.
     10
     11        * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/align.html:
     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/content-aspect-ratio.html:
     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/img-no-alt-replaced.html:
     16        * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-replaced-box-while-loading.html:
     17        * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html:
     18
    1192020-01-10  Yusuke Suzuki  <ysuzuki@apple.com>
    220
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/align.html

    r253996 r254461  
    11<!doctype html>
    22<title>align attribute mapping on replaced elements</title>
    3 <script src="../../../../../../../resources/testharness.js"></script>
    4 <script src="../../../../../../../resources/testharnessreport.js"></script>
     3<script src="/resources/testharness.js"></script>
     4<script src="/resources/testharnessreport.js"></script>
    55<img id="replaced" src="/images/green.png">
    66<something id="non-replaced"></something>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio.html

    r253996 r254461  
    11<!doctype html>
    22<title>Canvas width and height attributes are used as the surface size</title>
    3 <script src="../../../../../../../resources/testharness.js"></script>
    4 <script src="../../../../../../../resources/testharnessreport.js"></script>
     3<script src="/resources/testharness.js"></script>
     4<script src="/resources/testharnessreport.js"></script>
    55<style>
    66  canvas {
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/content-aspect-ratio.html

    r253996 r254461  
    22<title>div with content style's width and height attributes are not used to infer aspect-ratio</title>
    33<link rel="help" href="https://bugs.webkit.org/show_bug.cgi?id=201641#c22">
    4 <script src="../../../../../../../resources/testharness.js"></script>
    5 <script src="../../../../../../../resources/testharnessreport.js"></script>
     4<script src="/resources/testharness.js"></script>
     5<script src="/resources/testharnessreport.js"></script>
    66<style>
    77  video {
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html

    r253996 r254461  
    11<!doctype html>
    22<title>Image width and height attributes are used to infer aspect-ratio</title>
    3 <script src="../../../../../../../resources/testharness.js"></script>
    4 <script src="../../../../../../../resources/testharnessreport.js"></script>
     3<script src="/resources/testharness.js"></script>
     4<script src="/resources/testharnessreport.js"></script>
    55<style>
    66  img {
     
    1919function assert_ratio(img, expected) {
    2020  let epsilon = 0.001;
    21   assert_approx_equals(parseInt(getComputedStyle(img).width, 10) / parseInt(getComputedStyle(img).height, 10), expected, epsilon);
     21  assert_approx_equals(parseFloat(getComputedStyle(img).width, 10) / parseFloat(getComputedStyle(img).height, 10), expected, epsilon);
    2222}
    2323// Create and append a new image and immediately check the ratio.
     
    5454  assert_equals(getComputedStyle(images[2]).height, "0px"); // aspect-ratio doesn't override intrinsic size of images that don't have any src.
    5555  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], 1.266); // 1.266 is the original aspect ratio of blue.png
     56  assert_ratio(images[5], 133/106); // The original aspect ratio of blue.png
    5757});
    5858</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-no-alt-replaced.html

    r253996 r254461  
    11<!doctype html>
    22<title>Images without alt attribute or with an empty alt attribute render as replaced elements regardless of src</title>
    3 <script src="../../../../../../../resources/testharness.js"></script>
    4 <script src="../../../../../../../resources/testharnessreport.js"></script>
     3<script src="/resources/testharness.js"></script>
     4<script src="/resources/testharnessreport.js"></script>
    55<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
    66<link rel="author" href="https://mozilla.org" title="Mozilla">
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-replaced-box-while-loading.html

    r253996 r254461  
    11<!doctype html>
    22<title>Images don't render as a non-replaced inline while loading, even when there's no concrete size specified</title>
    3 <script src="../../../../../../../resources/testharness.js"></script>
    4 <script src="../../../../../../../resources/testharnessreport.js"></script>
     3<script src="/resources/testharness.js"></script>
     4<script src="/resources/testharnessreport.js"></script>
    55<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
    66<link rel="author" href="https://mozilla.org" title="Mozilla">
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html

    r253996 r254461  
    11<!doctype html>
    22<title>Video width and height attributes are not used to infer aspect-ratio</title>
    3 <script src="../../../../../../../resources/testharness.js"></script>
    4 <script src="../../../../../../../resources/testharnessreport.js"></script>
     3<script src="/resources/testharness.js"></script>
     4<script src="/resources/testharnessreport.js"></script>
    55<script src="/common/media.js"></script>
    66<style>
Note: See TracChangeset for help on using the changeset viewer.