[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

benm at google.com benm at google.com
Wed Apr 7 23:46:56 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit f291e60b8bd479b8ba0ee07bdfc13c2c064cafa4
Author: benm at google.com <benm at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 18 17:57:10 2009 +0000

    HTMLAnchorElement is inconsistent with its internal handling of the value returned for the href attribute.
    https://bugs.webkit.org/show_bug.cgi?id=31593
    
    Reviewed by Darin Adler.
    
    WebCore:
    
    Test: fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html
    
    * html/HTMLAnchorElement.cpp:
    (WebCore::HTMLAnchorElement::href): Add call to deprecatedParseURL.
    
    LayoutTests:
    
    * fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-whitespace.js: Added.
    * fast/dom/HTMLAnchorElement/set-href-attribute-whitespace-expected.txt: Added.
    * fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51118 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 0f32e3f..c68f858 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2009-11-18  Ben Murdoch  <benm at google.com>
+
+        Reviewed by Darin Adler.
+
+        HTMLAnchorElement is inconsistent with its internal handling of the value returned for the href attribute.
+        https://bugs.webkit.org/show_bug.cgi?id=31593
+
+        * fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-whitespace.js: Added.
+        * fast/dom/HTMLAnchorElement/set-href-attribute-whitespace-expected.txt: Added.
+        * fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html: Added.
+
 2009-11-18  Alexey Proskuryakov  <ap at apple.com>
 
         Trying to enable WebSocket tests on Tiger again, now that bug 31603 is fixed.
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-whitespace.js b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-whitespace.js
new file mode 100644
index 0000000..8be6232
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-whitespace.js
@@ -0,0 +1,49 @@
+description('Test setting the href attribute of an HTMLAnchorElement to a URL with leading and trailing whitespace.');
+
+var a = document.createElement('a');
+
+debug("Set href that starts with a space");
+a.href = " https://www.mydomain.com/path/testurl.html?key=value";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that starts with a newline");
+a.href = "\nhttps://www.mydomain.com/path/testurl.html?key=value";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that starts with a tab");
+a.href = "\thttps://www.mydomain.com/path/testurl.html?key=value";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that starts with a carriage return");
+a.href = "\rhttps://www.mydomain.com/path/testurl.html?key=value";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that starts with a combination of newlines, spaces and tabs");
+a.href = "\n \t\r \nhttps://www.mydomain.com/path/testurl.html?key=value";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that ends with a space");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value ";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that ends with a newline");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value\n";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that ends with a tab");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value\t";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that ends with a carriage return");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value\r";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that ends with a combination of newlines, spaces and tabs");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value\n \t\r \n";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that starts and ends with a combination of newlines, spaces and tabs");
+a.href = "\n \t\r \nhttps://www.mydomain.com/path/testurl.html?key=value\n \t\r \n";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace-expected.txt b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace-expected.txt
new file mode 100644
index 0000000..f7dfc61
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace-expected.txt
@@ -0,0 +1,31 @@
+Test setting the href attribute of an HTMLAnchorElement to a URL with leading and trailing whitespace.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Set href that starts with a space
+PASS a.hostname is 'www.mydomain.com'
+Set href that starts with a newline
+PASS a.hostname is 'www.mydomain.com'
+Set href that starts with a tab
+PASS a.hostname is 'www.mydomain.com'
+Set href that starts with a carriage return
+PASS a.hostname is 'www.mydomain.com'
+Set href that starts with a combination of newlines, spaces and tabs
+PASS a.hostname is 'www.mydomain.com'
+Set href that ends with a space
+PASS a.hostname is 'www.mydomain.com'
+Set href that ends with a newline
+PASS a.hostname is 'www.mydomain.com'
+Set href that ends with a tab
+PASS a.hostname is 'www.mydomain.com'
+Set href that ends with a carriage return
+PASS a.hostname is 'www.mydomain.com'
+Set href that ends with a combination of newlines, spaces and tabs
+PASS a.hostname is 'www.mydomain.com'
+Set href that starts and ends with a combination of newlines, spaces and tabs
+PASS a.hostname is 'www.mydomain.com'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html
new file mode 100644
index 0000000..7f86293
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/set-href-attribute-whitespace.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0ea879d..e200919 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2009-11-18  Ben Murdoch  <benm at google.com>
+
+        Reviewed by Darin Adler.
+
+        HTMLAnchorElement is inconsistent with its internal handling of the value returned for the href attribute.
+        https://bugs.webkit.org/show_bug.cgi?id=31593
+
+        Test: fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html
+
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::href): Add call to deprecatedParseURL.
+
 2009-11-18  Pavel Feldman  <pfeldman at chromium.org>
 
         Not reviewed. Touch InspectorController so that frontend
diff --git a/WebCore/html/HTMLAnchorElement.cpp b/WebCore/html/HTMLAnchorElement.cpp
index 1f71fcd..446d4e0 100644
--- a/WebCore/html/HTMLAnchorElement.cpp
+++ b/WebCore/html/HTMLAnchorElement.cpp
@@ -327,7 +327,7 @@ bool HTMLAnchorElement::draggable() const
 
 KURL HTMLAnchorElement::href() const
 {
-    return document()->completeURL(getAttribute(hrefAttr));
+    return document()->completeURL(deprecatedParseURL(getAttribute(hrefAttr)));
 }
 
 void HTMLAnchorElement::setHref(const AtomicString& value)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list