[webkit-changes] cvs commit: LayoutTests/fast/dom/HTMLImageElement
image-src-absolute-url-expected.txt image-src-absolute-url.html
Eric
eseidel at opensource.apple.com
Thu Nov 10 14:54:41 PST 2005
eseidel 05/11/10 14:54:41
Modified: . ChangeLog
Added: fast/dom/HTMLImageElement
image-src-absolute-url-expected.txt
image-src-absolute-url.html
Log:
Bug #: 3473
Submitted by: eseidel
Reviewed by: ggaren
* fast/dom/HTMLImageElement/image-src-absolute-url-expected.txt: Added.
* fast/dom/HTMLImageElement/image-src-absolute-url.html: Added.
http://bugzilla.opendarwin.org/show_bug.cgi?id=3473
<rdar://problem/3787988> Preloaded Image objects .src field is not a fully resolved path (3473)
Revision Changes Path
1.80 +9 -0 LayoutTests/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/LayoutTests/ChangeLog,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- ChangeLog 9 Nov 2005 19:57:11 -0000 1.79
+++ ChangeLog 10 Nov 2005 22:54:39 -0000 1.80
@@ -1,3 +1,12 @@
+2005-11-10 Eric Seidel <eseidel at apple.com>
+
+ Reviewed by ggaren.
+
+ * fast/dom/HTMLImageElement/image-src-absolute-url-expected.txt: Added.
+ * fast/dom/HTMLImageElement/image-src-absolute-url.html: Added.
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=3473
+ <rdar://problem/3787988> Preloaded Image objects .src field is not a fully resolved path (3473)
+
2005-11-07 David Harrison <harrison at apple.com>
Layout tests for <rdar://problem/4313925>
1.1 LayoutTests/fast/dom/HTMLImageElement/image-src-absolute-url-expected.txt
Index: image-src-absolute-url-expected.txt
===================================================================
This page preloads 2 images in an onLoad function.
The image object.src is expected to be the full path to the image, relative to the document base.
To match WinIE (but not FireFox), we resolve the image path in the getter, rather than the setter, allowing for pages to change the Document base URL via javascript and have object.src reflect said change.
SUCCESS (document.images[0].src = http://www.apple.com/test.jpg)
SUCCESS (IconImages['grey'].src = http://www.apple.com/test.jpg)
After changing the base URL:
SUCCESS (document.images[0].src = http://www.apple.com/test.jpg)
SUCCESS (IconImages['grey'].src = http://www.example.com/test.jpg)
1.1 LayoutTests/fast/dom/HTMLImageElement/image-src-absolute-url.html
Index: image-src-absolute-url.html
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Image Tester</title>
<base id="foo" href="http://www.apple.com/">
<script type="text/javascript" language="javascript">
var IconImages = null;
function stringResult(value, expected) {
var result = eval(value);
var resultString;
if (result == expected)
resultString = "SUCCESS";
else
resultString = "FAILURE";
return "<strong>" + resultString + "<\/strong> (" + value + " = " + result + ")";
}
function init() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
IconImages = new Array();
IconImages["grey"] = new Image(129,35);
IconImages["grey"].src ="test.jpg";
document.images["grey"].src = IconImages["grey"].src;
var beforeDiv = document.getElementById("before");
beforeDiv.innerHTML = stringResult("document.images[0].src", "http://www.apple.com/test.jpg");
beforeDiv.innerHTML += "<br>" + stringResult("IconImages['grey'].src", "http://www.apple.com/test.jpg");
document.getElementById("foo").setAttribute("href", "http://www.example.com/");
var afterDiv = document.getElementById("after");
afterDiv.innerHTML = stringResult("document.images[0].src", "http://www.apple.com/test.jpg");
afterDiv.innerHTML += "<br>" + stringResult("IconImages['grey'].src", "http://www.example.com/test.jpg");
}
</script>
</head>
<body onLoad="init()">
<p>
This page preloads 2 images in an onLoad function.<br>
The image object.src is expected to be the full path to the image, relative to the document base.<br>
To match WinIE (but not FireFox), we resolve the image path in the getter, rather than the setter, allowing for pages to change the Document base URL via javascript and have object.src reflect said change.
</p>
<image id="grey" name="grey" src="" style="display: none">
<div style="font-size:small" id="before"></div>
<p>After changing the base URL:</p>
<div style="font-size:small" id="after"></div>
</body>
</html>
More information about the webkit-changes
mailing list