Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(926)

Side by Side Diff: LayoutTests/imported/web-platform-tests/html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html

Issue 1144143009: W3C Test: Import web-platform-tests/html/semantics (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!doctype html>
2 <title>img current pixel density basic</title>
3 <script src="../../../../../../../resources/testharness.js"></script>
4 <script src="../../../../../../../resources/testharnessreport.js"></script>
5 <div id=log></div>
6 <img src="/images/green-256x256.png" data-expect="256">
7 <img srcset="/images/green-256x256.png 1x" data-expect="256">
8 <img srcset="/images/green-256x256.png 1.6x" data-expect="160">
9 <img srcset="/images/green-256x256.png 2x" data-expect="128">
10 <img srcset="/images/green-256x256.png 10000x" data-expect="0">
11 <img srcset="/images/green-256x256.png 9e99999999999999999999999x" data-expect=" 0">
12 <img srcset="/images/green-256x256.png 256w" sizes="256px" data-expect="256">
13 <img srcset="/images/green-256x256.png 512w" sizes="256px" data-expect="128">
14 <img srcset="/images/green-256x256.png 256w" sizes="512px" data-expect="512">
15 <img srcset="/images/green-256x256.png 256w" sizes="1px" data-expect="1">
16 <img srcset="/images/green-256x256.png 256w" sizes="0px" data-expect="0">
17 <script>
18 setup({explicit_done:true});
19 onload = function() {
20 [].forEach.call(document.images, function(img) {
21 test(function() {
22 var expected = parseFloat(img.dataset.expect);
23 assert_equals(img.width, expected, 'width');
24 assert_equals(img.height, expected, 'height');
25 assert_equals(img.clientWidth, expected, 'clientWidth');
26 assert_equals(img.clientHeight, expected, 'clientHeight');
27 assert_equals(img.naturalWidth, 256, 'naturalWidth');
28 assert_equals(img.naturalHeight, 256, 'naturalHeight');
29 }, img.outerHTML);
30 });
31 done();
32 };
33 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698