2007-07-01 MorganL <morganl.webkit@yahoo.com>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Jul 2007 14:20:13 +0000 (14:20 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Jul 2007 14:20:13 +0000 (14:20 +0000)
        Reviewed by Darin.

        Fix for http://bugs.webkit.org/show_bug.cgi?id=14448
        HTMLObjectElement::data should return an absolute URL

        * html/HTMLObjectElement.cpp:
        (WebCore::HTMLObjectElement::isImageType):
        (WebCore::HTMLObjectElement::data):

2007-07-01  MorganL  <morganl.webkit@yahoo.com>

        Reviewed by Darin.

        Tests for http://bugs.webkit.org/show_bug.cgi?id=14448
        HTMLObjectElement::data should return an absolute URL

        * fast/dom/object-data-absurl-expected.txt: Added.
        * fast/dom/object-data-absurl.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@23911 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/dom/object-data-absurl-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/object-data-absurl.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/HTMLObjectElement.cpp

index fa367f8..4c9edb5 100644 (file)
@@ -1,3 +1,13 @@
+2007-07-01  MorganL  <morganl.webkit@yahoo.com>
+
+        Reviewed by Darin.
+
+        Tests for http://bugs.webkit.org/show_bug.cgi?id=14448
+        HTMLObjectElement::data should return an absolute URL
+
+        * fast/dom/object-data-absurl-expected.txt: Added.
+        * fast/dom/object-data-absurl.html: Added.
+
 2007-06-29  Adam Roben  <aroben@apple.com>
 
         New test that makes sure we handle putting isindex into form data correctly.
diff --git a/LayoutTests/fast/dom/object-data-absurl-expected.txt b/LayoutTests/fast/dom/object-data-absurl-expected.txt
new file mode 100644 (file)
index 0000000..01423f6
--- /dev/null
@@ -0,0 +1,6 @@
+This test checks that the data property of an HTMLObjectElement returns an absolute URL. See bug 14448 for reference.
+
+If the test passes, you should see the text PASS below the Apple logo.
+
+
+PASS
diff --git a/LayoutTests/fast/dom/object-data-absurl.html b/LayoutTests/fast/dom/object-data-absurl.html
new file mode 100644 (file)
index 0000000..35632e8
--- /dev/null
@@ -0,0 +1,34 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+function getBaseURL() {
+    var href = document.location.href;
+    var lastSlash = href.lastIndexOf("/");
+    return href.substring(0, lastSlash);
+}
+function test() {
+    var result;
+    var url = document.getElementsByTagName("object")[0].data;
+    if (url == "resources/apple.gif" || url.indexOf(getBaseURL()) != 0) {
+        result = "FAIL";
+    } else {
+        result = "PASS";
+    }
+    document.getElementById("console").appendChild(document.createTextNode(result));
+}
+</script>
+</head>
+<body onload="test()">
+<p>
+This test checks that the <tt>data</tt> property of an HTMLObjectElement returns an absolute URL.
+See <a href="http://bugs.webkit.org/show_bug.cgi?id=14448">bug 14448</a> for reference.
+</p>
+<p>
+If the test passes, you should see the text PASS below the Apple logo.
+</p>
+<object data="resources/apple.gif"></object>
+<div id="console"></div>
+</body>
+</html>
index f5ace05..d23c54e 100644 (file)
@@ -1,3 +1,14 @@
+2007-07-01  MorganL  <morganl.webkit@yahoo.com>
+
+        Reviewed by Darin.
+
+        Fix for http://bugs.webkit.org/show_bug.cgi?id=14448
+        HTMLObjectElement::data should return an absolute URL
+
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::isImageType):
+        (WebCore::HTMLObjectElement::data):
+
 2007-07-01  Holger Hans Peter Freyther  <zecke@selfish.org>
 
         Reviewed by Darin.
index 64d4d02..2c55ae8 100644 (file)
@@ -287,7 +287,7 @@ bool HTMLObjectElement::isImageType()
         }
     }
     if (Frame* frame = document()->frame()) {
-        KURL completedURL(frame->loader()->completeURL(m_url));
+        KURL completedURL(document()->completeURL(m_url).deprecatedString());
         return frame->loader()->client()->objectContentType(completedURL, m_serviceType) == ObjectContentImage;
     }
 
@@ -392,7 +392,7 @@ void HTMLObjectElement::setCodeType(const String& value)
 
 String HTMLObjectElement::data() const
 {
-    return getAttribute(dataAttr);
+    return document()->completeURL(getAttribute(dataAttr));
 }
 
 void HTMLObjectElement::setData(const String& value)