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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/images/border.html

Issue 2496663002: Merge css3/image/ and fast/images/ to images/ (Closed)
Patch Set: Address failing tests (3 of them) Created 4 years, 1 month 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>This tests the HTMLImageElement border property.</title>
3 <body>
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <script type="text/javascript">
7 function imageBorderWidth(borderValue, style) {
8 var image = document.createElement("img");
9 if (borderValue !== undefined)
10 image.setAttribute("border", borderValue);
11 image.setAttribute("style", style);
12 image.setAttribute("width", "0");
13 document.body.appendChild(image);
14 var borderBoxWidth = image.offsetWidth;
15 document.body.removeChild(image);
16 return borderBoxWidth / 2;
17 }
18
19 test(function() {
20 assert_equals(imageBorderWidth(), 0);
21 assert_equals(imageBorderWidth(null), 0);
22 assert_equals(imageBorderWidth(''), 0);
23 assert_equals(imageBorderWidth(0), 0);
24 assert_equals(imageBorderWidth('x'), 0);
25 assert_equals(imageBorderWidth(undefined, 'border-width: 20px'), 0);
26
27 assert_equals(imageBorderWidth(null, 'border-width: 20px'), 20);
28 assert_equals(imageBorderWidth('', 'border-width: 20px'), 20);
29 assert_equals(imageBorderWidth('x', 'border-width: 20px'), 20);
30 assert_equals(imageBorderWidth(0, 'border-width: 20px'), 20);
31
32 assert_equals(imageBorderWidth(10), 10);
33 assert_equals(imageBorderWidth(' 10'), 10);
34 assert_equals(imageBorderWidth('10 '), 10);
35 assert_equals(imageBorderWidth(' 10 '), 10);
36 assert_equals(imageBorderWidth('10q'), 10);
37 assert_equals(imageBorderWidth(' 10q'), 10);
38 assert_equals(imageBorderWidth('10q '), 10);
39 assert_equals(imageBorderWidth(' 10q '), 10);
40 });
41 </script>
42
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698