Diff
Modified: trunk/LayoutTests/ChangeLog (116388 => 116389)
--- trunk/LayoutTests/ChangeLog 2012-05-08 03:34:47 UTC (rev 116388)
+++ trunk/LayoutTests/ChangeLog 2012-05-08 03:49:57 UTC (rev 116389)
@@ -1,3 +1,25 @@
+2012-05-07 Dongwoo Im <[email protected]>
+
+ width/height attributes of input element cannot be accessed by _javascript_.
+ https://bugs.webkit.org/show_bug.cgi?id=70304
+
+ Reviewed by Darin Adler.
+
+ If the type of input element is image button, width/height attributes should be supported.
+ These attributes are defined in HTML5 spec.
+ http://www.w3.org/TR/html5/the-map-element.html#attr-dim-width
+
+ * fast/forms/input-width-height-attributes-expected.txt: Added.
+ * fast/forms/input-width-height-attributes-without-renderer-expected.txt: Added.
+ * fast/forms/input-width-height-attributes-without-renderer-loaded-image-expected.txt: Added.
+ * fast/forms/input-width-height-attributes-without-renderer-loaded-image.html: Added.
+ * fast/forms/input-width-height-attributes-without-renderer-not-loaded-image-expected.txt: Added.
+ * fast/forms/input-width-height-attributes-without-renderer-not-loaded-image.html: Added.
+ * fast/forms/input-width-height-attributes-without-renderer.html: Added.
+ * fast/forms/input-width-height-attributes.html: Added.
+ * fast/forms/resources/green.jpg: Added.
+ * fast/forms/resources/image-slow.pl: Added.
+
2012-05-07 Kinuko Yasuda <[email protected]>
Support cross-filesystem operations in FileSystem API
Added: trunk/LayoutTests/fast/forms/input-width-height-attributes-expected.txt (0 => 116389)
--- trunk/LayoutTests/fast/forms/input-width-height-attributes-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/input-width-height-attributes-expected.txt 2012-05-08 03:49:57 UTC (rev 116389)
@@ -0,0 +1,65 @@
+width and height attributes of HTMLInputElement.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Test case #1 : Image, HTML inline setting as "160", "80"
+PASS ('width' in image1) is true
+PASS ('height' in image1) is true
+PASS image1.width,image1.height is 160,80
+Test case #2 : Image, Setting by _javascript_ API as "260", "130"
+PASS ('width' in image1) is true
+PASS ('height' in image1) is true
+PASS image2.width,image2.height is 260,130
+Test case #3 : Image, Setting by _javascript_ API as "120px", "60px"
+PASS ('width' in image1) is true
+PASS ('height' in image1) is true
+PASS image3.width,image3.height is 0,0
+Test case #4 : Image, Setting by _javascript_ API as "120.99", "60.55"
+PASS ('width' in image1) is true
+PASS ('height' in image1) is true
+PASS image4.width,image4.height is 120,60
+Test case #5 : Text, Setting by _javascript_ API as "100", "50"
+PASS ('width' in text1) is true
+PASS ('height' in text1) is true
+PASS text1.width,text1.height is 0,0
+PASS text1.width,text1.height is 100,50
+PASS text1.width,text1.height is 60,40
+Test case #6 : File, Setting by _javascript_ API as "100", "50"
+PASS ('width' in file1) is true
+PASS ('height' in file1) is true
+PASS file1.width,file1.height is 0,0
+PASS file1.width,file1.height is 100,50
+PASS file1.width,file1.height is 60,40
+Test case #7 : Date, Setting by _javascript_ API as "100", "50"
+PASS ('width' in date1) is true
+PASS ('height' in date1) is true
+PASS date1.width,date1.height is 0,0
+PASS date1.width,date1.height is 100,50
+PASS date1.width,date1.height is 60,40
+Test case #8 : Button, Setting by _javascript_ API as "100", "50"
+PASS ('width' in button1) is true
+PASS ('height' in button1) is true
+PASS button1.width,button1.height is 0,0
+PASS button1.width,button1.height is 100,50
+PASS button1.width,button1.height is 60,40
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Added: trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer-expected.txt (0 => 116389)
--- trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer-expected.txt 2012-05-08 03:49:57 UTC (rev 116389)
@@ -0,0 +1,6 @@
+PASS inputElement.width is 50
+PASS inputElement.height is 50
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer-loaded-image-expected.txt (0 => 116389)
--- trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer-loaded-image-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer-loaded-image-expected.txt 2012-05-08 03:49:57 UTC (rev 116389)
@@ -0,0 +1,7 @@
+
+PASS e.width is 16
+PASS e.height is 16
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer-loaded-image.html (0 => 116389)
--- trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer-loaded-image.html (rev 0)
+++ trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer-loaded-image.html 2012-05-08 03:49:57 UTC (rev 116389)
@@ -0,0 +1,26 @@
+<html>
+<head>
+<script src=""
+<script>
+jsTestIsAsync = true;
+</script>
+</head>
+<body>
+<input type="image" id="imageElement" src=""
+<div id="console"></div>
+<script language="_javascript_">
+ document._onreadystatechange_ = function() {
+ readyState = document.readyState;
+ if (readyState == 'complete') {
+ e = document.getElementById("imageElement");
+ e.style = "display:none";
+ shouldBe('e.width', '16');
+ shouldBe('e.height', '16');
+ finishJSTest();
+ }
+ }
+</script>
+<script src=""
+</body>
+</html>
+
Added: trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer-not-loaded-image-expected.txt (0 => 116389)
--- trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer-not-loaded-image-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer-not-loaded-image-expected.txt 2012-05-08 03:49:57 UTC (rev 116389)
@@ -0,0 +1,6 @@
+PASS e.width is 0
+PASS e.height is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer-not-loaded-image.html (0 => 116389)
--- trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer-not-loaded-image.html (rev 0)
+++ trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer-not-loaded-image.html 2012-05-08 03:49:57 UTC (rev 116389)
@@ -0,0 +1,20 @@
+<html>
+<head>
+<script src=""
+<script>
+jsTestIsAsync = true;
+</script>
+</head>
+<body>
+<input type="image" id="imageSlow" src="" style="display:none">
+<div id="console"></div>
+<script language="_javascript_">
+ var e = document.getElementById("imageSlow");
+ shouldBe('e.width', '0');
+ shouldBe('e.height', '0');
+ finishJSTest();
+</script>
+<script src=""
+</body>
+</html>
+
Added: trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer.html (0 => 116389)
--- trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer.html (rev 0)
+++ trunk/LayoutTests/fast/forms/input-width-height-attributes-without-renderer.html 2012-05-08 03:49:57 UTC (rev 116389)
@@ -0,0 +1,21 @@
+<html>
+<head>
+<head>
+<script src=""
+<script>
+jsTestIsAsync = true;
+function test()
+{
+ inputElement = document.getElementById("inputElement");
+ shouldBe('inputElement.width', '50');
+ shouldBe('inputElement.height', '50');
+ finishJSTest();
+
+}
+</script>
+</head>
+<body _onload_="test()">
+<input id="inputElement" type="image" width="50" height="50" style="display:none">
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/forms/input-width-height-attributes.html (0 => 116389)
--- trunk/LayoutTests/fast/forms/input-width-height-attributes.html (rev 0)
+++ trunk/LayoutTests/fast/forms/input-width-height-attributes.html 2012-05-08 03:49:57 UTC (rev 116389)
@@ -0,0 +1,156 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+description('width and height attributes of HTMLInputElement.');
+</script>
+
+<p id="description"></p>
+
+<div id="div1">
+ <input type="image" id="image1" src="" width="160" height="80px">
+</div>
+<br>
+
+<div id="div2">
+ <input type="image" id="image2" src=""
+</div>
+<br>
+
+<div id="div3">
+ <input type="image" id="image3" src=""
+</div>
+<br>
+
+<div id="div4">
+ <input type="image" id="image4" src=""
+</div>
+<br>
+
+<div id="div5">
+ <input type="text" id="text1">
+</div>
+<br>
+
+<div id="div6">
+ <input type="file" id="file1">
+</div>
+<br>
+
+<div id="div7">
+ <input type="date" id="date1">
+</div>
+<br>
+
+<div id="div8">
+ <input type="button" id="button1">
+</div>
+<br>
+
+<script>
+var div = document.getElementById("div1");
+var image1 = document.getElementById("image1");
+debug('Test case #1 : Image, HTML inline setting as \"160\", \"80\"');
+shouldBeTrue("('width' in image1)");
+shouldBeTrue("('height' in image1)");
+shouldBe('image1.width,image1.height', '160,80');
+
+div = document.getElementById("div2");
+var image2 = document.getElementById("image2");
+debug('Test case #2 : Image, Setting by _javascript_ API as \"260\", \"130\"');
+shouldBeTrue("('width' in image1)");
+shouldBeTrue("('height' in image1)");
+image2.width = 260;
+image2.height = 130;
+shouldBe('image2.width,image2.height', '260,130');
+
+div = document.getElementById("div3");
+var image3 = document.getElementById("image3");
+debug('Test case #3 : Image, Setting by _javascript_ API as \"120px\", \"60px\"');
+shouldBeTrue("('width' in image1)");
+shouldBeTrue("('height' in image1)");
+image3.width = "120px";
+image3.height = "60px";
+shouldBe('image3.width,image3.height', '0,0');
+
+div = document.getElementById("div4");
+var image4 = document.getElementById("image4");
+debug('Test case #4 : Image, Setting by _javascript_ API as \"120.99\", \"60.55\"');
+shouldBeTrue("('width' in image1)");
+shouldBeTrue("('height' in image1)");
+image4.width = 120.99;
+image4.height = 60.99;
+shouldBe('image4.width,image4.height', '120,60');
+
+div = document.getElementById("div5");
+var text1 = document.getElementById("text1");
+debug('Test case #5 : Text, Setting by _javascript_ API as \"100\", \"50\"');
+shouldBeTrue("('width' in text1)");
+shouldBeTrue("('height' in text1)");
+text1.width = 100;
+text1.height = 50;
+shouldBe('text1.width,text1.height', '0,0');
+
+text1.type = 'image';
+text1.src = ""
+shouldBe('text1.width,text1.height', '100,50');
+text1.width = 60;
+text1.height = 40;
+shouldBe('text1.width,text1.height', '60,40');
+
+div = document.getElementById("div6");
+var file1 = document.getElementById("file1");
+debug('Test case #6 : File, Setting by _javascript_ API as \"100\", \"50\"');
+shouldBeTrue("('width' in file1)");
+shouldBeTrue("('height' in file1)");
+file1.width = 100;
+file1.height = 50;
+shouldBe('file1.width,file1.height', '0,0');
+
+file1.type = 'image';
+file1.src = ""
+shouldBe('file1.width,file1.height', '100,50');
+file1.width = 60;
+file1.height = 40;
+shouldBe('file1.width,file1.height', '60,40');
+
+div = document.getElementById("div7");
+var date1 = document.getElementById("date1");
+debug('Test case #7 : Date, Setting by _javascript_ API as \"100\", \"50\"');
+shouldBeTrue("('width' in date1)");
+shouldBeTrue("('height' in date1)");
+date1.width = 100;
+date1.height = 50;
+shouldBe('date1.width,date1.height', '0,0');
+
+date1.type = 'image';
+date1.src = ""
+shouldBe('date1.width,date1.height', '100,50');
+date1.width = 60;
+date1.height = 40;
+shouldBe('date1.width,date1.height', '60,40');
+
+div = document.getElementById("div8");
+var button1 = document.getElementById("button1");
+debug('Test case #8 : Button, Setting by _javascript_ API as \"100\", \"50\"');
+shouldBeTrue("('width' in button1)");
+shouldBeTrue("('height' in button1)");
+button1.width = 100;
+button1.height = 50;
+shouldBe('button1.width,button1.height', '0,0');
+
+button1.type = 'image';
+button1.src = ""
+shouldBe('button1.width,button1.height', '100,50');
+button1.width = 60;
+button1.height = 40;
+shouldBe('button1.width,button1.height', '60,40');
+
+var successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/forms/resources/green.jpg (0 => 116389)
--- trunk/LayoutTests/fast/forms/resources/green.jpg (rev 0)
+++ trunk/LayoutTests/fast/forms/resources/green.jpg 2012-05-08 03:49:57 UTC (rev 116389)
@@ -0,0 +1,10 @@
+\xFF\xD8\xFF\xE0 JFIF ` ` \xFF\xE1 \x80Exif MM * J R( \x87i Z ` ` \xA0 \xA0 \xFF\xDB C
+
+
+
+
+\xFF\xDB C\xFF\xC0 "