[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

darin at apple.com darin at apple.com
Wed Dec 22 12:45:52 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 17c2d2c5c1e63c73365937528374fab663e946b6
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Aug 29 05:48:44 2010 +0000

    Some IDL attributes don't reflect URL content attributes properly
    https://bugs.webkit.org/show_bug.cgi?id=43650
    
    Reviewed by Sam Weinig.
    
    WebCore:
    
    * dom/Document.cpp:
    (WebCore::Document::processBaseElement): Added. Implements the rules for base elements
    from the HTML5 specification. Handles multiple base elements in the same document.
    
    * dom/Document.h: Removed setBaseElementURL and setBaseElementTarget, replacing them
    with processBaseElement.
    
    * html/HTMLBaseElement.cpp:
    (WebCore::HTMLBaseElement::parseMappedAttribute): Call the new processBaseElement
    function.
    (WebCore::HTMLBaseElement::insertedIntoDocument): Ditto.
    (WebCore::HTMLBaseElement::removedFromDocument): Ditto.
    (WebCore::HTMLBaseElement::isURLAttribute): Added.
    (WebCore::HTMLBaseElement::target): Moved here from the .h file and changed to not
    realy on an m_target local variable.
    
    * html/HTMLBaseElement.h: Added an override of the isURLAttribute function. Removed
    unneeded process function. Removed declaration of nonexistent setHref and setTarget
    functions. Removed unneeded m_hrefAttrValue, m_href, and m_target. Moved
    implementation of target function into the .cpp file.
    
    * html/HTMLBaseElement.idl: Marked the href attribute as URL.
    
    * html/HTMLBlockquoteElement.cpp:
    (WebCore::HTMLBlockquoteElement::isURLAttribute): Added.
    * html/HTMLBlockquoteElement.h: Added isURLAttribute.
    * html/HTMLBlockquoteElement.idl: Marked the cite attribute as URL.
    
    * html/HTMLEmbedElement.idl: Marked the src attribute as URL.
    
    * html/HTMLFormElement.cpp: Added a comment about the action function, which should
    be removed.
    
    * html/HTMLFormElement.idl: Marked the action attribute as URL.
    
    * html/HTMLHtmlElement.cpp:
    (WebCore::HTMLHtmlElement::isURLAttribute): Added.
    (WebCore::HTMLHtmlElement::insertedIntoDocument): Tweaked a bit.
    * html/HTMLHtmlElement.h: Added isURLAttribute.
    * html/HTMLHtmlElement.idl: Marked the manifest attribute as URL.
    
    * html/HTMLIFrameElement.idl: Marked the src attribute a URL.
    
    * html/HTMLModElement.cpp:
    (WebCore::HTMLModElement::isURLAttribute): Added.
    * html/HTMLModElement.h: Added isURLAttribute.
    * html/HTMLModElement.idl: Marked the cite attribute as URL.
    
    * html/HTMLQuoteElement.cpp:
    (WebCore::HTMLQuoteElement::isURLAttribute): Added.
    * html/HTMLQuoteElement.h: Added isURLAttribute.
    * html/HTMLQuoteElement.idl: Marked the cite attribute as URL.
    
    * html/HTMLViewSourceDocument.cpp:
    (WebCore::HTMLViewSourceDocument::processTagToken): Changed code to create a base
    element instead of calling setBaseElementURL directly.
    (WebCore::HTMLViewSourceDocument::addSpanWithClassName): Use AtomicString instead of String.
    (WebCore::HTMLViewSourceDocument::addLine): Ditto.
    (WebCore::HTMLViewSourceDocument::addText): Ditto.
    (WebCore::HTMLViewSourceDocument::addBase): Added. Creates a base element and inserts it.
    (WebCore::HTMLViewSourceDocument::addLink): Use AtomicString instead of String.
    
    * html/HTMLViewSourceDocument.h: Updated function declarations as above.
    
    * bindings/scripts/test/CPP/WebDOMTestCallback.h:
    * bindings/scripts/test/CPP/WebDOMTestInterface.h:
    * bindings/scripts/test/CPP/WebDOMTestObj.h:
    * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
    * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
    Updated results, which changed due to the fixes for at
    least these bugs, and perhaps a few more:
    https://bugs.webkit.org/show_bug.cgi?id=42115
    https://bugs.webkit.org/show_bug.cgi?id=44597
    https://bugs.webkit.org/show_bug.cgi?id=44738
    
    * bindings/scripts/test/TestObj.idl:
    * html/HTMLAnchorElement.idl:
    * html/HTMLAreaElement.idl:
    * html/HTMLEmbedElement.idl:
    * html/HTMLFormElement.cpp:
    * html/HTMLFormElement.idl:
    * html/HTMLFrameElement.idl:
    * html/HTMLIFrameElement.idl:
    * html/HTMLImageElement.idl:
    * html/HTMLInputElement.idl:
    * html/HTMLLinkElement.idl:
    * html/HTMLMediaElement.idl:
    * html/HTMLObjectElement.idl:
    * html/HTMLScriptElement.idl:
    * html/HTMLSourceElement.idl:
    * html/HTMLVideoElement.idl:
    Tweaked formatting.
    
    LayoutTests:
    
    * dom/html/level2/html/button03.js: Added a "WebKit modification" section so this
    correctly expects the action attribute to return a completed URL.
    * dom/xhtml/level2/html/button03.js: Ditto.
    
    * fast/dom/URL-attribute-reflection-expected.txt: Updaed expected results to expecte
    more successes.
    
    * fast/dom/script-tests/URL-attribute-reflection.js:
    (testURLReflection): Fixed wrong variable name in the test script.
    
    * http/tests/security/xssAuditor/full-block-iframe-no-inherit.php: Removed a call
    to encodeURI that was needed to work around our incorrect implementation of
    HTMLIFrameElement's src attribute.
    
    * fast/dom/HTMLBaseElement: Added.
    * fast/dom/HTMLBaseElement/multiple-base-elements-expected.txt: Added.
    * fast/dom/HTMLBaseElement/multiple-base-elements.html: Added.
    * fast/dom/HTMLBaseElement/script-tests: Added.
    * fast/dom/HTMLBaseElement/script-tests/TEMPLATE.html:
    Copied from fast/dom/HTMLAnchorElement/script-tests/TEMPLATE.html.
    * fast/dom/HTMLBaseElement/script-tests/multiple-base-elements.js: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66327 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 9c6cf0b..be91f67 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,32 @@
+2010-08-28  Darin Adler  <darin at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Some IDL attributes don't reflect URL content attributes properly
+        https://bugs.webkit.org/show_bug.cgi?id=43650
+
+        * dom/html/level2/html/button03.js: Added a "WebKit modification" section so this
+        correctly expects the action attribute to return a completed URL.
+        * dom/xhtml/level2/html/button03.js: Ditto.
+
+        * fast/dom/URL-attribute-reflection-expected.txt: Updaed expected results to expecte
+        more successes.
+
+        * fast/dom/script-tests/URL-attribute-reflection.js:
+        (testURLReflection): Fixed wrong variable name in the test script.
+
+        * http/tests/security/xssAuditor/full-block-iframe-no-inherit.php: Removed a call
+        to encodeURI that was needed to work around our incorrect implementation of
+        HTMLIFrameElement's src attribute.
+
+        * fast/dom/HTMLBaseElement: Added.
+        * fast/dom/HTMLBaseElement/multiple-base-elements-expected.txt: Added.
+        * fast/dom/HTMLBaseElement/multiple-base-elements.html: Added.
+        * fast/dom/HTMLBaseElement/script-tests: Added.
+        * fast/dom/HTMLBaseElement/script-tests/TEMPLATE.html:
+        Copied from fast/dom/HTMLAnchorElement/script-tests/TEMPLATE.html.
+        * fast/dom/HTMLBaseElement/script-tests/multiple-base-elements.js: Added.
+
 2010-08-28  Sam Weinig  <sam at webkit.org>
 
         Update WebKit2 skipped list.
@@ -47752,3 +47781,4 @@
         * platform/mac/editing/pasteboard/styled-element-markup-expected.checksum: Replaced.
         * platform/mac/editing/pasteboard/styled-element-markup-expected.png: Replaced.
         * platform/mac/editing/pasteboard/subframe-dragndrop-1-expected.che
+svn
\ No newline at end of file
diff --git a/LayoutTests/dom/html/level2/html/button03.js b/LayoutTests/dom/html/level2/html/button03.js
index 1a4ac91..5dc6952 100644
--- a/LayoutTests/dom/html/level2/html/button03.js
+++ b/LayoutTests/dom/html/level2/html/button03.js
@@ -103,7 +103,11 @@ testNode = nodeList.item(0);
 
       vfaction = formNode.action;
 
-      assertEquals("formLink","...",vfaction);
+//  WebKit modification: 26-August-2010
+      var expectedAction = document.URL.replace(/[^/]*$/, "") + "...";
+//  End WebKit modification
+
+      assertEquals("formLink",expectedAction,vfaction);
        
 }
 
diff --git a/LayoutTests/fast/dom/HTMLBaseElement/multiple-base-elements-expected.txt b/LayoutTests/fast/dom/HTMLBaseElement/multiple-base-elements-expected.txt
new file mode 100644
index 0000000..8afcc8f
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLBaseElement/multiple-base-elements-expected.txt
@@ -0,0 +1,16 @@
+Test the behavior of multiple base elements.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS clean(anchor.href) is 'http://originalbase.com/file'
+PASS document.head.appendChild(base), clean(anchor.href) is 'http://domain.com/base/file'
+PASS base.href = 'http://domain.com/base-changed/', clean(anchor.href) is 'http://domain.com/base-changed/file'
+PASS document.head.removeChild(base), clean(anchor.href) is 'http://originalbase.com/file'
+PASS document.head.appendChild(base), document.head.appendChild(base2), clean(anchor.href) is 'http://domain.com/base/file'
+PASS base.removeAttribute('href'), clean(anchor.href) is 'http://domain.com/base2/file'
+PASS document.head.appendChild(base3), clean(anchor.href) is 'http://domain.com/base2/file'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLBaseElement/multiple-base-elements.html b/LayoutTests/fast/dom/HTMLBaseElement/multiple-base-elements.html
new file mode 100644
index 0000000..6102609
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLBaseElement/multiple-base-elements.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/multiple-base-elements.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/backgrounds/repeat/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/HTMLBaseElement/script-tests/TEMPLATE.html
similarity index 100%
copy from LayoutTests/fast/backgrounds/repeat/script-tests/TEMPLATE.html
copy to LayoutTests/fast/dom/HTMLBaseElement/script-tests/TEMPLATE.html
diff --git a/LayoutTests/fast/dom/HTMLBaseElement/script-tests/multiple-base-elements.js b/LayoutTests/fast/dom/HTMLBaseElement/script-tests/multiple-base-elements.js
new file mode 100644
index 0000000..c120266
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLBaseElement/script-tests/multiple-base-elements.js
@@ -0,0 +1,44 @@
+description('Test the behavior of multiple base elements.');
+
+var originalBase = document.URL.replace(/[^/]*$/, "");
+
+function clean(url)
+{
+    if (url.length < originalBase.length)
+        return url;
+    if (url.substring(0, originalBase.length) !== originalBase)
+        return url;
+    return "http://originalbase.com/" + url.substring(originalBase.length);
+}
+
+var anchor = document.createElement('a');
+anchor.href = "file";
+
+document.body.appendChild(anchor);
+
+shouldBe("clean(anchor.href)", "'http://originalbase.com/file'");
+
+var base = document.createElement('base');
+base.href = "http://domain.com/base/";
+
+shouldBe("document.head.appendChild(base), clean(anchor.href)", "'http://domain.com/base/file'");
+shouldBe("base.href = 'http://domain.com/base-changed/', clean(anchor.href)", "'http://domain.com/base-changed/file'");
+shouldBe("document.head.removeChild(base), clean(anchor.href)", "'http://originalbase.com/file'");
+
+base.href = "http://domain.com/base/";
+
+var base2 = document.createElement('base');
+base2.href = "http://domain.com/base2/";
+
+var base3 = document.createElement('base');
+base3.href = "http://domain.com/base3/";
+
+shouldBe("document.head.appendChild(base), document.head.appendChild(base2), clean(anchor.href)", "'http://domain.com/base/file'");
+shouldBe("base.removeAttribute('href'), clean(anchor.href)", "'http://domain.com/base2/file'");
+shouldBe("document.head.appendChild(base3), clean(anchor.href)", "'http://domain.com/base2/file'");
+
+document.head.removeChild(base);
+document.head.removeChild(base2);
+document.head.removeChild(base3);
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/URL-attribute-reflection-expected.txt b/LayoutTests/fast/dom/URL-attribute-reflection-expected.txt
index c7f8f81..56e3d49 100644
--- a/LayoutTests/fast/dom/URL-attribute-reflection-expected.txt
+++ b/LayoutTests/fast/dom/URL-attribute-reflection-expected.txt
@@ -5,24 +5,24 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 PASS testURLReflection('attribute', 'element') is 'none'
 PASS testURLReflection('id', 'element') is 'non-URL'
-FAIL testURLReflection('action', 'form') should be URL. Was non-URL.
-FAIL testURLReflection('cite', 'blockquote') should be URL. Was non-URL.
-FAIL testURLReflection('cite', 'del') should be URL. Was non-URL.
-FAIL testURLReflection('cite', 'ins') should be URL. Was non-URL.
-FAIL testURLReflection('cite', 'q') should be URL. Was non-URL.
+PASS testURLReflection('action', 'form') is 'URL'
+PASS testURLReflection('cite', 'blockquote') is 'URL'
+PASS testURLReflection('cite', 'del') is 'URL'
+PASS testURLReflection('cite', 'ins') is 'URL'
+PASS testURLReflection('cite', 'q') is 'URL'
 PASS testURLReflection('data', 'object') is 'URL'
 FAIL testURLReflection('formaction', 'button') should be URL. Was none.
 FAIL testURLReflection('formaction', 'input') should be URL. Was none.
 PASS testURLReflection('href', 'a') is 'URL'
 PASS testURLReflection('href', 'area') is 'URL'
 PASS testURLReflection('href', 'link') is 'URL'
-FAIL testURLReflection('href', 'base') should be URL. Was non-URL.
+PASS testURLReflection('href', 'base') is 'URL'
 FAIL testURLReflection('icon', 'command') should be URL. Was none.
-FAIL testURLReflection('manifest', 'html') should be URL. Was none.
+PASS testURLReflection('manifest', 'html') is 'URL'
 PASS testURLReflection('poster', 'video') is 'URL'
 PASS testURLReflection('src', 'audio') is 'URL'
-FAIL testURLReflection('src', 'embed') should be URL. Was non-URL.
-FAIL testURLReflection('src', 'iframe') should be URL. Was non-URL.
+PASS testURLReflection('src', 'embed') is 'URL'
+PASS testURLReflection('src', 'iframe') is 'URL'
 PASS testURLReflection('src', 'img') is 'URL'
 PASS testURLReflection('src', 'input') is 'URL'
 PASS testURLReflection('src', 'script') is 'URL'
diff --git a/LayoutTests/fast/dom/script-tests/URL-attribute-reflection.js b/LayoutTests/fast/dom/script-tests/URL-attribute-reflection.js
index d9aa497..551597e 100644
--- a/LayoutTests/fast/dom/script-tests/URL-attribute-reflection.js
+++ b/LayoutTests/fast/dom/script-tests/URL-attribute-reflection.js
@@ -24,12 +24,12 @@ function testURLReflection(attributeName, tag, scriptAttributeName)
     if (xValue === "x")
         return "non-URL";
     if (xValue !== document.baseURI.replace(/[^\/]+$/, "x"))
-        return "error: " + xValue;
+        return "error (x): " + xValue;
     if (emptyValue === "")
         return "non-empty URL";
     if (emptyValue === document.baseURI)
         return "URL";
-    return "error: " + value;
+    return "error (empty): " + emptyValue;
 }
 
 shouldBe("testURLReflection('attribute', 'element')", "'none'");
diff --git a/LayoutTests/http/tests/security/xssAuditor/full-block-iframe-no-inherit.php b/LayoutTests/http/tests/security/xssAuditor/full-block-iframe-no-inherit.php
index 9f665eb..df7bff3 100644
--- a/LayoutTests/http/tests/security/xssAuditor/full-block-iframe-no-inherit.php
+++ b/LayoutTests/http/tests/security/xssAuditor/full-block-iframe-no-inherit.php
@@ -14,7 +14,7 @@ if (window.layoutTestController) {
 }
 function checkIfDone()
 {
-    checkIfFrameLocationMatchesURLAndCallDone('frame', encodeURI(document.getElementById('frame').src));
+    checkIfFrameLocationMatchesURLAndCallDone('frame', document.getElementById('frame').src);
 }
 </script>
 </head>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ddfb1cf..817d61c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,103 @@
+2010-08-28  Darin Adler  <darin at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Some IDL attributes don't reflect URL content attributes properly
+        https://bugs.webkit.org/show_bug.cgi?id=43650
+
+        * dom/Document.cpp:
+        (WebCore::Document::processBaseElement): Added. Implements the rules for base elements
+        from the HTML5 specification. Handles multiple base elements in the same document.
+
+        * dom/Document.h: Removed setBaseElementURL and setBaseElementTarget, replacing them
+        with processBaseElement.
+
+        * html/HTMLBaseElement.cpp:
+        (WebCore::HTMLBaseElement::parseMappedAttribute): Call the new processBaseElement
+        function.
+        (WebCore::HTMLBaseElement::insertedIntoDocument): Ditto.
+        (WebCore::HTMLBaseElement::removedFromDocument): Ditto.
+        (WebCore::HTMLBaseElement::isURLAttribute): Added.
+        (WebCore::HTMLBaseElement::target): Moved here from the .h file and changed to not
+        realy on an m_target local variable.
+
+        * html/HTMLBaseElement.h: Added an override of the isURLAttribute function. Removed
+        unneeded process function. Removed declaration of nonexistent setHref and setTarget
+        functions. Removed unneeded m_hrefAttrValue, m_href, and m_target. Moved
+        implementation of target function into the .cpp file.
+
+        * html/HTMLBaseElement.idl: Marked the href attribute as URL.
+
+        * html/HTMLBlockquoteElement.cpp:
+        (WebCore::HTMLBlockquoteElement::isURLAttribute): Added.
+        * html/HTMLBlockquoteElement.h: Added isURLAttribute.
+        * html/HTMLBlockquoteElement.idl: Marked the cite attribute as URL.
+
+        * html/HTMLEmbedElement.idl: Marked the src attribute as URL.
+
+        * html/HTMLFormElement.cpp: Added a comment about the action function, which should
+        be removed.
+
+        * html/HTMLFormElement.idl: Marked the action attribute as URL.
+
+        * html/HTMLHtmlElement.cpp:
+        (WebCore::HTMLHtmlElement::isURLAttribute): Added.
+        (WebCore::HTMLHtmlElement::insertedIntoDocument): Tweaked a bit.
+        * html/HTMLHtmlElement.h: Added isURLAttribute.
+        * html/HTMLHtmlElement.idl: Marked the manifest attribute as URL.
+
+        * html/HTMLIFrameElement.idl: Marked the src attribute a URL.
+
+        * html/HTMLModElement.cpp:
+        (WebCore::HTMLModElement::isURLAttribute): Added.
+        * html/HTMLModElement.h: Added isURLAttribute.
+        * html/HTMLModElement.idl: Marked the cite attribute as URL.
+
+        * html/HTMLQuoteElement.cpp:
+        (WebCore::HTMLQuoteElement::isURLAttribute): Added.
+        * html/HTMLQuoteElement.h: Added isURLAttribute.
+        * html/HTMLQuoteElement.idl: Marked the cite attribute as URL.
+
+        * html/HTMLViewSourceDocument.cpp:
+        (WebCore::HTMLViewSourceDocument::processTagToken): Changed code to create a base
+        element instead of calling setBaseElementURL directly.
+        (WebCore::HTMLViewSourceDocument::addSpanWithClassName): Use AtomicString instead of String.
+        (WebCore::HTMLViewSourceDocument::addLine): Ditto.
+        (WebCore::HTMLViewSourceDocument::addText): Ditto.
+        (WebCore::HTMLViewSourceDocument::addBase): Added. Creates a base element and inserts it.
+        (WebCore::HTMLViewSourceDocument::addLink): Use AtomicString instead of String.
+ 
+        * html/HTMLViewSourceDocument.h: Updated function declarations as above.
+
+        * bindings/scripts/test/CPP/WebDOMTestCallback.h:
+        * bindings/scripts/test/CPP/WebDOMTestInterface.h:
+        * bindings/scripts/test/CPP/WebDOMTestObj.h:
+        * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+        Updated results, which changed due to the fixes for at
+        least these bugs, and perhaps a few more:
+        https://bugs.webkit.org/show_bug.cgi?id=42115
+        https://bugs.webkit.org/show_bug.cgi?id=44597
+        https://bugs.webkit.org/show_bug.cgi?id=44738
+
+        * bindings/scripts/test/TestObj.idl:
+        * html/HTMLAnchorElement.idl:
+        * html/HTMLAreaElement.idl:
+        * html/HTMLEmbedElement.idl:
+        * html/HTMLFormElement.cpp:
+        * html/HTMLFormElement.idl:
+        * html/HTMLFrameElement.idl:
+        * html/HTMLIFrameElement.idl:
+        * html/HTMLImageElement.idl:
+        * html/HTMLInputElement.idl:
+        * html/HTMLLinkElement.idl:
+        * html/HTMLMediaElement.idl:
+        * html/HTMLObjectElement.idl:
+        * html/HTMLScriptElement.idl:
+        * html/HTMLSourceElement.idl:
+        * html/HTMLVideoElement.idl:
+        Tweaked formatting.
+
 2010-08-28  Ryosuke Niwa  <rniwa at webkit.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h
index a4d130e..91ff787 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h
@@ -44,7 +44,7 @@ public:
     explicit WebDOMTestCallback(WebCore::TestCallback*);
     WebDOMTestCallback(const WebDOMTestCallback&);
     WebDOMTestCallback& operator=(const WebDOMTestCallback&);
-    ~WebDOMTestCallback();
+    virtual ~WebDOMTestCallback();
 
     bool callbackWithClass1Param(const WebDOMClass1& class1Param);
     bool callbackWithClass2Param(const WebDOMClass2& class2Param, const WebDOMString& strArg);
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h
index ca20c4e..5db5db8 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h
@@ -39,7 +39,7 @@ public:
     explicit WebDOMTestInterface(WebCore::TestInterface*);
     WebDOMTestInterface(const WebDOMTestInterface&);
     WebDOMTestInterface& operator=(const WebDOMTestInterface&);
-    ~WebDOMTestInterface();
+    virtual ~WebDOMTestInterface();
 
 
     WebCore::TestInterface* impl() const;
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
index 2fedf41..770ce51 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
@@ -41,7 +41,7 @@ public:
     explicit WebDOMTestObj(WebCore::TestObj*);
     WebDOMTestObj(const WebDOMTestObj&);
     WebDOMTestObj& operator=(const WebDOMTestObj&);
-    ~WebDOMTestObj();
+    virtual ~WebDOMTestObj();
 
     enum {
         WEBDOM_CONST_VALUE_0 = 0,
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp
index e547d35..fbe538d 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp
@@ -62,8 +62,11 @@ webkit_dom_test_callback_callback_with_class1param(WebKitDOMTestCallback* self,
     g_return_val_if_fail(self, 0);
     WebCore::TestCallback * item = WebKit::core(self);
     g_return_val_if_fail(class1param, 0);
-    WebCore::Class1 * converted_class1param = WebKit::core(class1param);
-    g_return_val_if_fail(converted_class1param, 0);
+    WebCore::Class1 * converted_class1param = NULL;
+    if (class1param != NULL) {
+        converted_class1param = WebKit::core(class1param);
+        g_return_val_if_fail(converted_class1param, 0);
+    }
     gboolean res = item->callbackWithClass1Param(converted_class1param);
     return res;
 }
@@ -76,8 +79,11 @@ webkit_dom_test_callback_callback_with_class2param(WebKitDOMTestCallback* self,
     WebCore::TestCallback * item = WebKit::core(self);
     g_return_val_if_fail(class2param, 0);
     g_return_val_if_fail(str_arg, 0);
-    WebCore::Class2 * converted_class2param = WebKit::core(class2param);
-    g_return_val_if_fail(converted_class2param, 0);
+    WebCore::Class2 * converted_class2param = NULL;
+    if (class2param != NULL) {
+        converted_class2param = WebKit::core(class2param);
+        g_return_val_if_fail(converted_class2param, 0);
+    }
     WTF::String converted_str_arg = WTF::String::fromUTF8(str_arg);
     gboolean res = item->callbackWithClass2Param(converted_class2param, converted_str_arg);
     return res;
@@ -90,8 +96,11 @@ webkit_dom_test_callback_callback_with_non_bool_return_type(WebKitDOMTestCallbac
     g_return_val_if_fail(self, 0);
     WebCore::TestCallback * item = WebKit::core(self);
     g_return_val_if_fail(class3param, 0);
-    WebCore::Class3 * converted_class3param = WebKit::core(class3param);
-    g_return_val_if_fail(converted_class3param, 0);
+    WebCore::Class3 * converted_class3param = NULL;
+    if (class3param != NULL) {
+        converted_class3param = WebKit::core(class3param);
+        g_return_val_if_fail(converted_class3param, 0);
+    }
     glong res = item->callbackWithNonBoolReturnType(converted_class3param);
     return res;
 }
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
index 56c6e14..3c27b81 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
@@ -70,8 +70,11 @@ webkit_dom_test_obj_void_method_with_args(WebKitDOMTestObj* self, glong int_arg,
     g_return_if_fail(str_arg);
     g_return_if_fail(obj_arg);
     WTF::String converted_str_arg = WTF::String::fromUTF8(str_arg);
-    WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
-    g_return_if_fail(converted_obj_arg);
+    WebCore::TestObj * converted_obj_arg = NULL;
+    if (obj_arg != NULL) {
+        converted_obj_arg = WebKit::core(obj_arg);
+        g_return_if_fail(converted_obj_arg);
+    }
     item->voidMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg);
 }
 
@@ -94,8 +97,11 @@ webkit_dom_test_obj_int_method_with_args(WebKitDOMTestObj* self, glong int_arg,
     g_return_val_if_fail(str_arg, 0);
     g_return_val_if_fail(obj_arg, 0);
     WTF::String converted_str_arg = WTF::String::fromUTF8(str_arg);
-    WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
-    g_return_val_if_fail(converted_obj_arg, 0);
+    WebCore::TestObj * converted_obj_arg = NULL;
+    if (obj_arg != NULL) {
+        converted_obj_arg = WebKit::core(obj_arg);
+        g_return_val_if_fail(converted_obj_arg, 0);
+    }
     glong res = item->intMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg);
     return res;
 }
@@ -120,8 +126,11 @@ webkit_dom_test_obj_obj_method_with_args(WebKitDOMTestObj* self, glong int_arg,
     g_return_val_if_fail(str_arg, 0);
     g_return_val_if_fail(obj_arg, 0);
     WTF::String converted_str_arg = WTF::String::fromUTF8(str_arg);
-    WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
-    g_return_val_if_fail(converted_obj_arg, 0);
+    WebCore::TestObj * converted_obj_arg = NULL;
+    if (obj_arg != NULL) {
+        converted_obj_arg = WebKit::core(obj_arg);
+        g_return_val_if_fail(converted_obj_arg, 0);
+    }
     PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->objMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg));
     WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj*>(WebKit::kit(g_res.get()));
     return res;
@@ -136,8 +145,11 @@ webkit_dom_test_obj_method_that_requires_all_args(WebKitDOMTestObj* self, const
     g_return_val_if_fail(str_arg, 0);
     g_return_val_if_fail(obj_arg, 0);
     WTF::String converted_str_arg = WTF::String::fromUTF8(str_arg);
-    WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
-    g_return_val_if_fail(converted_obj_arg, 0);
+    WebCore::TestObj * converted_obj_arg = NULL;
+    if (obj_arg != NULL) {
+        converted_obj_arg = WebKit::core(obj_arg);
+        g_return_val_if_fail(converted_obj_arg, 0);
+    }
     PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgs(converted_str_arg, converted_obj_arg));
     WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj*>(WebKit::kit(g_res.get()));
     return res;
@@ -152,8 +164,11 @@ webkit_dom_test_obj_method_that_requires_all_args_and_throws(WebKitDOMTestObj* s
     g_return_val_if_fail(str_arg, 0);
     g_return_val_if_fail(obj_arg, 0);
     WTF::String converted_str_arg = WTF::String::fromUTF8(str_arg);
-    WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
-    g_return_val_if_fail(converted_obj_arg, 0);
+    WebCore::TestObj * converted_obj_arg = NULL;
+    if (obj_arg != NULL) {
+        converted_obj_arg = WebKit::core(obj_arg);
+        g_return_val_if_fail(converted_obj_arg, 0);
+    }
     WebCore::ExceptionCode ec = 0;
     PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgsAndThrows(converted_str_arg, converted_obj_arg, ec));
     if (ec) {
@@ -172,8 +187,11 @@ webkit_dom_test_obj_serialized_value(WebKitDOMTestObj* self, WebKitDOMSerialized
     g_return_if_fail(self);
     WebCore::TestObj * item = WebKit::core(self);
     g_return_if_fail(serialized_arg);
-    WebCore::SerializedScriptValue * converted_serialized_arg = WebKit::core(serialized_arg);
-    g_return_if_fail(converted_serialized_arg);
+    WebCore::SerializedScriptValue * converted_serialized_arg = NULL;
+    if (serialized_arg != NULL) {
+        converted_serialized_arg = WebKit::core(serialized_arg);
+        g_return_if_fail(converted_serialized_arg);
+    }
     item->serializedValue(converted_serialized_arg);
 }
 
@@ -184,8 +202,11 @@ webkit_dom_test_obj_idb_key(WebKitDOMTestObj* self, WebKitDOMIDBKey* key)
     g_return_if_fail(self);
     WebCore::TestObj * item = WebKit::core(self);
     g_return_if_fail(key);
-    WebCore::IDBKey * converted_key = WebKit::core(key);
-    g_return_if_fail(converted_key);
+    WebCore::IDBKey * converted_key = NULL;
+    if (key != NULL) {
+        converted_key = WebKit::core(key);
+        g_return_if_fail(converted_key);
+    }
     item->idbKey(converted_key);
 }
 
@@ -470,8 +491,11 @@ webkit_dom_test_obj_set_test_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj*
     g_return_if_fail(self);
     WebCore::TestObj * item = WebKit::core(self);
     g_return_if_fail(value);
-    WebCore::TestObj * converted_value = WebKit::core(value);
-    g_return_if_fail(converted_value);
+    WebCore::TestObj * converted_value = NULL;
+    if (value != NULL) {
+        converted_value = WebKit::core(value);
+        g_return_if_fail(converted_value);
+    }
     item->setTestObjAttr(converted_value);
 }
 
@@ -493,8 +517,11 @@ webkit_dom_test_obj_set_xml_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* v
     g_return_if_fail(self);
     WebCore::TestObj * item = WebKit::core(self);
     g_return_if_fail(value);
-    WebCore::TestObj * converted_value = WebKit::core(value);
-    g_return_if_fail(converted_value);
+    WebCore::TestObj * converted_value = NULL;
+    if (value != NULL) {
+        converted_value = WebKit::core(value);
+        g_return_if_fail(converted_value);
+    }
     item->setXMLObjAttr(converted_value);
 }
 
diff --git a/WebCore/bindings/scripts/test/TestObj.idl b/WebCore/bindings/scripts/test/TestObj.idl
index a2bc89d..94f734b 100644
--- a/WebCore/bindings/scripts/test/TestObj.idl
+++ b/WebCore/bindings/scripts/test/TestObj.idl
@@ -50,13 +50,13 @@ module test {
         attribute [Reflect] DOMString reflectedStringAttr;
         attribute [Reflect] long reflectedIntegralAttr;
         attribute [Reflect] boolean reflectedBooleanAttr;
-        attribute [Reflect,URL] DOMString reflectedURLAttr;
-        attribute [Reflect,NonEmpty,URL] DOMString reflectedNonEmptyURLAttr;
+        attribute [Reflect, URL] DOMString reflectedURLAttr;
+        attribute [Reflect, NonEmpty, URL] DOMString reflectedNonEmptyURLAttr;
         attribute [Reflect=customContentStringAttr] DOMString reflectedStringAttr;
         attribute [Reflect=customContentIntegralAttr] long reflectedCustomIntegralAttr;
         attribute [Reflect=customContentBooleanAttr] boolean reflectedCustomBooleanAttr;
-        attribute [Reflect=customContentURLAttr,URL] DOMString reflectedCustomURLAttr;
-        attribute [Reflect=customContentNonEmptyURLAttr,NonEmpty,URL] DOMString reflectedCustomNonEmptyURLAttr;
+        attribute [Reflect=customContentURLAttr, URL] DOMString reflectedCustomURLAttr;
+        attribute [Reflect=customContentNonEmptyURLAttr, NonEmpty, URL] DOMString reflectedCustomNonEmptyURLAttr;
 
         // Methods
         void    voidMethod();
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 5d83474..efd9a13 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -136,6 +136,7 @@
 #include "XMLHttpRequest.h"
 #include "XMLNSNames.h"
 #include "XMLNames.h"
+#include "XSSAuditor.h"
 #include "htmlediting.h"
 #include <wtf/CurrentTime.h>
 #include <wtf/HashFunctions.h>
@@ -2196,12 +2197,6 @@ void Document::setURL(const KURL& url)
     updateBaseURL();
 }
 
-void Document::setBaseElementURL(const KURL& baseElementURL)
-{ 
-    m_baseElementURL = baseElementURL;
-    updateBaseURL();
-}
-
 void Document::updateBaseURL()
 {
     // DOM 3 Core: When the Document supports the feature "HTML" [DOM Level 2 HTML], the base URI is computed using
@@ -2222,6 +2217,41 @@ void Document::updateBaseURL()
         m_mappedElementSheet->setFinalURL(m_baseURL);
 }
 
+void Document::processBaseElement()
+{
+    // Find the first href attribute in a base element and the first target attribute in a base element.
+    const AtomicString* href = 0;
+    const AtomicString* target = 0;
+    for (Node* node = document()->firstChild(); node && (!href || !target); node = node->traverseNextNode()) {
+        if (node->hasTagName(baseTag)) {
+            if (!href) {
+                const AtomicString& value = static_cast<Element*>(node)->fastGetAttribute(hrefAttr);
+                if (!value.isNull())
+                    href = &value;
+            }
+            if (!target) {
+                const AtomicString& value = static_cast<Element*>(node)->fastGetAttribute(targetAttr);
+                if (!value.isNull())
+                    target = &value;
+            }
+        }
+    }
+
+    // FIXME: Since this doesn't share code with completeURL it may not handle encodings correctly.
+    KURL baseElementURL;
+    if (href) {
+        String strippedHref = deprecatedParseURL(*href);
+        if (!strippedHref.isEmpty() && (!frame() || frame()->script()->xssAuditor()->canSetBaseElementURL(*href)))
+            baseElementURL = KURL(url(), strippedHref);
+    }
+    if (m_baseElementURL != baseElementURL) {
+        m_baseElementURL = baseElementURL;
+        updateBaseURL();
+    }
+
+    m_baseTarget = target ? *target : nullAtom;
+}
+
 String Document::userAgent(const KURL& url) const
 {
     return frame() ? frame()->loader()->userAgent(url) : String();
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index 4cfb6bc..a3d5cfe 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -543,12 +543,8 @@ public:
     void setURL(const KURL&);
 
     const KURL& baseURL() const { return m_baseURL; }
-    // Setting the BaseElementURL will change the baseURL.
-    void setBaseElementURL(const KURL&);
-
     const String& baseTarget() const { return m_baseTarget; }
-    // Setting the BaseElementTarget will change the baseTarget.
-    void setBaseElementTarget(const String& baseTarget) { m_baseTarget = baseTarget; }
+    void processBaseElement();
 
     KURL completeURL(const String&) const;
 
diff --git a/WebCore/html/HTMLAnchorElement.idl b/WebCore/html/HTMLAnchorElement.idl
index d57fcb6..f5e1bd9 100644
--- a/WebCore/html/HTMLAnchorElement.idl
+++ b/WebCore/html/HTMLAnchorElement.idl
@@ -24,7 +24,7 @@ module html {
         attribute [Reflect] DOMString accessKey;
         attribute [Reflect] DOMString charset;
         attribute [Reflect] DOMString coords;
-        attribute [Reflect,URL] DOMString href;
+        attribute [Reflect, URL] DOMString href;
         attribute [Reflect] DOMString hreflang;
         attribute [Reflect] DOMString name;
         attribute [Reflect] DOMString rel;
diff --git a/WebCore/html/HTMLAreaElement.idl b/WebCore/html/HTMLAreaElement.idl
index 64c6468..a77e615 100644
--- a/WebCore/html/HTMLAreaElement.idl
+++ b/WebCore/html/HTMLAreaElement.idl
@@ -24,7 +24,7 @@ module html {
         attribute [Reflect] DOMString accessKey;
         attribute [Reflect] DOMString alt;
         attribute [Reflect] DOMString coords;
-        attribute [Reflect,URL] DOMString href;
+        attribute [Reflect, URL] DOMString href;
         attribute [Reflect] boolean noHref;
         attribute [Reflect] DOMString shape;
         attribute [Reflect] DOMString target;
diff --git a/WebCore/html/HTMLBaseElement.cpp b/WebCore/html/HTMLBaseElement.cpp
index a3095d1..0dd16fa 100644
--- a/WebCore/html/HTMLBaseElement.cpp
+++ b/WebCore/html/HTMLBaseElement.cpp
@@ -24,11 +24,8 @@
 #include "HTMLBaseElement.h"
 
 #include "Attribute.h"
-#include "CSSHelper.h"
 #include "Document.h"
-#include "Frame.h"
 #include "HTMLNames.h"
-#include "XSSAuditor.h"
 
 namespace WebCore {
 
@@ -45,47 +42,34 @@ PassRefPtr<HTMLBaseElement> HTMLBaseElement::create(const QualifiedName& tagName
     return adoptRef(new HTMLBaseElement(tagName, document));
 }
 
-void HTMLBaseElement::parseMappedAttribute(Attribute* attr)
+void HTMLBaseElement::parseMappedAttribute(Attribute* attribute)
 {
-    if (attr->name() == hrefAttr) {
-        m_hrefAttrValue = attr->value();
-        m_href = deprecatedParseURL(attr->value());
-        process();
-    } else if (attr->name() == targetAttr) {
-        m_target = attr->value();
-        process();
-    } else
-        HTMLElement::parseMappedAttribute(attr);
+    if (attribute->name() == hrefAttr || attribute->name() == targetAttr)
+        document()->processBaseElement();
+    else
+        HTMLElement::parseMappedAttribute(attribute);
 }
 
 void HTMLBaseElement::insertedIntoDocument()
 {
     HTMLElement::insertedIntoDocument();
-    process();
+    document()->processBaseElement();
 }
 
 void HTMLBaseElement::removedFromDocument()
 {
     HTMLElement::removedFromDocument();
-
-    // Since the document doesn't have a base element, clear the base URL and target.
-    // FIXME: This does not handle the case of multiple base elements correctly.
-    document()->setBaseElementURL(KURL());
-    document()->setBaseElementTarget(String());
+    document()->processBaseElement();
 }
 
-void HTMLBaseElement::process()
+bool HTMLBaseElement::isURLAttribute(Attribute* attribute) const
 {
-    if (!inDocument())
-        return;
-
-    if (!m_href.isEmpty() && (!document()->frame() || document()->frame()->script()->xssAuditor()->canSetBaseElementURL(m_hrefAttrValue)))
-        document()->setBaseElementURL(KURL(document()->url(), m_href));
-
-    if (!m_target.isEmpty())
-        document()->setBaseElementTarget(m_target);
+    return attribute->name() == hrefAttr;
+}
 
-    // FIXME: Changing a document's base URL should probably automatically update the resolved relative URLs of all images, stylesheets, etc.
+String HTMLBaseElement::target() const
+{
+    return fastGetAttribute(targetAttr);
 }
 
 }
diff --git a/WebCore/html/HTMLBaseElement.h b/WebCore/html/HTMLBaseElement.h
index aa1454f..fd3cef6 100644
--- a/WebCore/html/HTMLBaseElement.h
+++ b/WebCore/html/HTMLBaseElement.h
@@ -34,20 +34,11 @@ public:
 private:
     HTMLBaseElement(const QualifiedName&, Document*);
 
-    virtual String target() const { return m_target; }
-
+    virtual String target() const;
+    virtual bool isURLAttribute(Attribute*) const;
     virtual void parseMappedAttribute(Attribute*);
     virtual void insertedIntoDocument();
     virtual void removedFromDocument();
-
-    void process();
-    
-    void setHref(const String&);
-    void setTarget(const String&);
-
-    String m_hrefAttrValue;
-    String m_href;
-    String m_target;
 };
 
 } // namespace
diff --git a/WebCore/html/HTMLBaseElement.idl b/WebCore/html/HTMLBaseElement.idl
index 8bf82a9..2750c9e 100644
--- a/WebCore/html/HTMLBaseElement.idl
+++ b/WebCore/html/HTMLBaseElement.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2009, 2010 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -20,7 +20,7 @@
 module html {
 
     interface HTMLBaseElement : HTMLElement {
-        attribute [Reflect] DOMString href;
+        attribute [Reflect, URL] DOMString href;
         attribute [Reflect] DOMString target;
     };
 
diff --git a/WebCore/html/HTMLBlockquoteElement.cpp b/WebCore/html/HTMLBlockquoteElement.cpp
index cacd8b4..726bc0f 100644
--- a/WebCore/html/HTMLBlockquoteElement.cpp
+++ b/WebCore/html/HTMLBlockquoteElement.cpp
@@ -45,4 +45,9 @@ PassRefPtr<HTMLBlockquoteElement> HTMLBlockquoteElement::create(const QualifiedN
     return adoptRef(new HTMLBlockquoteElement(tagName, document));
 }
 
+bool HTMLBlockquoteElement::isURLAttribute(Attribute* attribute) const
+{
+    return attribute->name() == citeAttr;
+}
+
 }
diff --git a/WebCore/html/HTMLBlockquoteElement.h b/WebCore/html/HTMLBlockquoteElement.h
index 194fe54..6566117 100644
--- a/WebCore/html/HTMLBlockquoteElement.h
+++ b/WebCore/html/HTMLBlockquoteElement.h
@@ -34,6 +34,8 @@ public:
 
 private:
     HTMLBlockquoteElement(const QualifiedName&, Document*);
+
+    virtual bool isURLAttribute(Attribute*) const;
 };
 
 } // namespace WebCore
diff --git a/WebCore/html/HTMLBlockquoteElement.idl b/WebCore/html/HTMLBlockquoteElement.idl
index f0045c7..5a319a3 100644
--- a/WebCore/html/HTMLBlockquoteElement.idl
+++ b/WebCore/html/HTMLBlockquoteElement.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2009, 2010 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -20,7 +20,7 @@
 module html {
 
     interface HTMLBlockquoteElement : HTMLElement {
-        attribute [Reflect] DOMString cite;
+        attribute [Reflect, URL] DOMString cite;
     };
 
 }
diff --git a/WebCore/html/HTMLEmbedElement.idl b/WebCore/html/HTMLEmbedElement.idl
index 4997210..e395fc6 100644
--- a/WebCore/html/HTMLEmbedElement.idl
+++ b/WebCore/html/HTMLEmbedElement.idl
@@ -32,7 +32,7 @@ module html {
     attribute [Reflect] long height;
 #endif
     attribute [Reflect] DOMString name;
-    attribute [Reflect] DOMString src;
+    attribute [Reflect, URL] DOMString src;
     attribute [Reflect] DOMString type;
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
     attribute [Reflect] DOMString width;
diff --git a/WebCore/html/HTMLFormElement.cpp b/WebCore/html/HTMLFormElement.cpp
index c53ea1d..56ffd0f 100644
--- a/WebCore/html/HTMLFormElement.cpp
+++ b/WebCore/html/HTMLFormElement.cpp
@@ -449,6 +449,9 @@ bool HTMLFormElement::noValidate() const
     return !getAttribute(novalidateAttr).isNull();
 }
 
+// FIXME: This function should be removed because it does not do the same thing as the
+// JavaScript binding for action, which treats action as a URL attribute. Last time I
+// (Darin Adler) removed this, someone added it back, so I am leaving it in for now.
 String HTMLFormElement::action() const
 {
     return getAttribute(actionAttr);
diff --git a/WebCore/html/HTMLFormElement.idl b/WebCore/html/HTMLFormElement.idl
index c5162f9..a9f8ea1 100644
--- a/WebCore/html/HTMLFormElement.idl
+++ b/WebCore/html/HTMLFormElement.idl
@@ -30,7 +30,7 @@ module html {
         attribute [Reflect] DOMString name;
         attribute [Reflect] boolean noValidate;
         attribute [Reflect=accept_charset] DOMString acceptCharset;
-        attribute [Reflect] DOMString action;
+        attribute [Reflect, URL] DOMString action;
         attribute [ConvertNullToNullString] DOMString encoding;  /* Netscape/Firefox legacy attribute. Same as enctype. */
         attribute [ConvertNullToNullString] DOMString enctype;
         attribute [Reflect] DOMString method;
diff --git a/WebCore/html/HTMLFrameElement.idl b/WebCore/html/HTMLFrameElement.idl
index 4a5268c..dfe4ef8 100644
--- a/WebCore/html/HTMLFrameElement.idl
+++ b/WebCore/html/HTMLFrameElement.idl
@@ -29,7 +29,7 @@ module html {
         attribute [Reflect] DOMString name;
         attribute [Reflect] boolean noResize;
         attribute [Reflect] DOMString scrolling;
-        attribute [Reflect,URL] DOMString src;
+        attribute [Reflect, URL] DOMString src;
 
         // Introduced in DOM Level 2:
         readonly attribute [CheckFrameSecurity] Document contentDocument;
diff --git a/WebCore/html/HTMLHtmlElement.cpp b/WebCore/html/HTMLHtmlElement.cpp
index 6205d10..6007805 100644
--- a/WebCore/html/HTMLHtmlElement.cpp
+++ b/WebCore/html/HTMLHtmlElement.cpp
@@ -50,6 +50,11 @@ PassRefPtr<HTMLHtmlElement> HTMLHtmlElement::create(const QualifiedName& tagName
     return adoptRef(new HTMLHtmlElement(tagName, document));
 }
 
+bool HTMLHtmlElement::isURLAttribute(Attribute* attribute) const
+{
+    return attribute->name() == manifestAttr;
+}
+
 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
 void HTMLHtmlElement::insertedIntoDocument()
 {
@@ -68,8 +73,8 @@ void HTMLHtmlElement::insertedIntoDocument()
     // Check the manifest attribute
     // FIXME: Revisit this when we get a clarification from whatwg on how to handle empty
     // manifest attributes. As spec'd, and coded here, the system will initiate an update
-    // passing in the document url as the manifest url. That's not a good thing.
-    AtomicString manifest = getAttribute(manifestAttr);
+    // passing in the document URL as the manifest URL. That's not a good thing.
+    const AtomicString& manifest = getAttribute(manifestAttr);
     if (manifest.isNull())
         documentLoader->applicationCacheHost()->selectCacheWithoutManifest();
     else
diff --git a/WebCore/html/HTMLHtmlElement.h b/WebCore/html/HTMLHtmlElement.h
index e854fb1..47503f7 100644
--- a/WebCore/html/HTMLHtmlElement.h
+++ b/WebCore/html/HTMLHtmlElement.h
@@ -36,6 +36,8 @@ public:
 private:
     HTMLHtmlElement(const QualifiedName&, Document*);
 
+    virtual bool isURLAttribute(Attribute*) const;
+
 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
     virtual void insertedIntoDocument();
 #endif
diff --git a/WebCore/html/HTMLHtmlElement.idl b/WebCore/html/HTMLHtmlElement.idl
index 42ba861..03c661c 100644
--- a/WebCore/html/HTMLHtmlElement.idl
+++ b/WebCore/html/HTMLHtmlElement.idl
@@ -21,6 +21,7 @@ module html {
 
     interface HTMLHtmlElement : HTMLElement {
         attribute [Reflect] DOMString version;
+        attribute [Reflect, URL] DOMString manifest;
     };
 
 }
diff --git a/WebCore/html/HTMLIFrameElement.idl b/WebCore/html/HTMLIFrameElement.idl
index b21263e..7f9e25a 100644
--- a/WebCore/html/HTMLIFrameElement.idl
+++ b/WebCore/html/HTMLIFrameElement.idl
@@ -30,7 +30,7 @@ module html {
         attribute [Reflect] DOMString name;
         attribute [Reflect] DOMString sandbox;
         attribute [Reflect] DOMString scrolling;
-        attribute [Reflect] DOMString src;
+        attribute [Reflect, URL] DOMString src;
         attribute [Reflect] DOMString width;
 
         // Introduced in DOM Level 2:
diff --git a/WebCore/html/HTMLImageElement.idl b/WebCore/html/HTMLImageElement.idl
index 1bf8a28..935b721 100644
--- a/WebCore/html/HTMLImageElement.idl
+++ b/WebCore/html/HTMLImageElement.idl
@@ -30,8 +30,8 @@ module html {
         attribute long height;
         attribute [Reflect] long hspace;
         attribute [Reflect] boolean isMap;
-        attribute [Reflect,URL] DOMString longDesc;
-        attribute [Reflect,URL] DOMString src;
+        attribute [Reflect, URL] DOMString longDesc;
+        attribute [Reflect, URL] DOMString src;
         attribute [Reflect] DOMString useMap;
         attribute [Reflect] long vspace;
         attribute long width;
diff --git a/WebCore/html/HTMLInputElement.idl b/WebCore/html/HTMLInputElement.idl
index c726caa..19e4226 100644
--- a/WebCore/html/HTMLInputElement.idl
+++ b/WebCore/html/HTMLInputElement.idl
@@ -54,7 +54,7 @@ module html {
         // FIXME: The spec says this should be a long, not an unsigned long.
         attribute unsigned long size; // Changed string -> long as part of DOM level 2
 #endif
-        attribute [Reflect,URL] DOMString src;
+        attribute [Reflect, URL] DOMString src;
         attribute [Reflect] DOMString step;
         attribute [ConvertNullToNullString, JSCCustomGetter] DOMString type; // readonly dropped as part of DOM level 2
         attribute [Reflect] DOMString useMap;
diff --git a/WebCore/html/HTMLLinkElement.idl b/WebCore/html/HTMLLinkElement.idl
index dfec24b..734e8cc 100644
--- a/WebCore/html/HTMLLinkElement.idl
+++ b/WebCore/html/HTMLLinkElement.idl
@@ -23,7 +23,7 @@ module html {
     interface HTMLLinkElement : HTMLElement {
         attribute [Reflect] boolean disabled;
         attribute [Reflect] DOMString charset;
-        attribute [Reflect,URL] DOMString href;
+        attribute [Reflect, URL] DOMString href;
         attribute [Reflect] DOMString hreflang;
         attribute [Reflect] DOMString media;
         attribute [Reflect] DOMString rel;
diff --git a/WebCore/html/HTMLMediaElement.idl b/WebCore/html/HTMLMediaElement.idl
index 12a1464..d6ba79d 100644
--- a/WebCore/html/HTMLMediaElement.idl
+++ b/WebCore/html/HTMLMediaElement.idl
@@ -30,7 +30,7 @@ interface [Conditional=VIDEO] HTMLMediaElement : HTMLElement {
     readonly attribute MediaError error;
 
     // network state
-    attribute [Reflect,URL] DOMString src;
+    attribute [Reflect, URL] DOMString src;
     readonly attribute DOMString currentSrc;
     
     const unsigned short NETWORK_EMPTY = 0;
diff --git a/WebCore/html/HTMLModElement.cpp b/WebCore/html/HTMLModElement.cpp
index ab161d9..2d409b0 100644
--- a/WebCore/html/HTMLModElement.cpp
+++ b/WebCore/html/HTMLModElement.cpp
@@ -39,4 +39,9 @@ PassRefPtr<HTMLModElement> HTMLModElement::create(const QualifiedName& tagName,
     return adoptRef(new HTMLModElement(tagName, document));
 }
 
+bool HTMLModElement::isURLAttribute(Attribute* attribute) const
+{
+    return attribute->name() == citeAttr;
+}
+
 }
diff --git a/WebCore/html/HTMLModElement.h b/WebCore/html/HTMLModElement.h
index 2b09e21..cdb6dce 100644
--- a/WebCore/html/HTMLModElement.h
+++ b/WebCore/html/HTMLModElement.h
@@ -34,6 +34,8 @@ public:
 
 private:
     HTMLModElement(const QualifiedName&, Document*);
+
+    virtual bool isURLAttribute(Attribute*) const;
 };
 
 } //namespace
diff --git a/WebCore/html/HTMLModElement.idl b/WebCore/html/HTMLModElement.idl
index e9e996d..ad8281c 100644
--- a/WebCore/html/HTMLModElement.idl
+++ b/WebCore/html/HTMLModElement.idl
@@ -20,7 +20,7 @@
 module html {
 
     interface HTMLModElement : HTMLElement {
-        attribute [Reflect] DOMString cite;
+        attribute [Reflect, URL] DOMString cite;
         attribute [Reflect] DOMString dateTime;
     };
     
diff --git a/WebCore/html/HTMLObjectElement.idl b/WebCore/html/HTMLObjectElement.idl
index e4d85b3..82801ae 100644
--- a/WebCore/html/HTMLObjectElement.idl
+++ b/WebCore/html/HTMLObjectElement.idl
@@ -32,7 +32,7 @@ module html {
         attribute [Reflect] DOMString border;
         attribute [Reflect] DOMString codeBase;
         attribute [Reflect] DOMString codeType;
-        attribute [Reflect,URL] DOMString data;
+        attribute [Reflect, URL] DOMString data;
         attribute [Reflect] boolean declare;
         attribute [Reflect] DOMString height;
         attribute [Reflect] long hspace;
diff --git a/WebCore/html/HTMLQuoteElement.cpp b/WebCore/html/HTMLQuoteElement.cpp
index 2a2440a..a58a504 100644
--- a/WebCore/html/HTMLQuoteElement.cpp
+++ b/WebCore/html/HTMLQuoteElement.cpp
@@ -48,4 +48,9 @@ void HTMLQuoteElement::insertedIntoDocument()
     HTMLElement::insertedIntoDocument();
 }
 
+bool HTMLQuoteElement::isURLAttribute(Attribute* attribute) const
+{
+    return attribute->name() == citeAttr;
+}
+
 }
diff --git a/WebCore/html/HTMLQuoteElement.h b/WebCore/html/HTMLQuoteElement.h
index 225dde8..d378de4 100644
--- a/WebCore/html/HTMLQuoteElement.h
+++ b/WebCore/html/HTMLQuoteElement.h
@@ -37,6 +37,7 @@ private:
     HTMLQuoteElement(const QualifiedName&, Document*);
     
     virtual void insertedIntoDocument();
+    virtual bool isURLAttribute(Attribute*) const;
 };
 
 } //namespace
diff --git a/WebCore/html/HTMLQuoteElement.idl b/WebCore/html/HTMLQuoteElement.idl
index a4e6005..fa1bcdb 100644
--- a/WebCore/html/HTMLQuoteElement.idl
+++ b/WebCore/html/HTMLQuoteElement.idl
@@ -20,6 +20,6 @@
 module html {
 
     interface HTMLQuoteElement : HTMLElement {
-        attribute [Reflect] DOMString cite;
+        attribute [Reflect, URL] DOMString cite;
     };
 }
diff --git a/WebCore/html/HTMLScriptElement.idl b/WebCore/html/HTMLScriptElement.idl
index 6b7c86d..20b7331 100644
--- a/WebCore/html/HTMLScriptElement.idl
+++ b/WebCore/html/HTMLScriptElement.idl
@@ -26,7 +26,7 @@ module html {
         attribute [Reflect] DOMString charset;
         attribute [Reflect] boolean async;
         attribute [Reflect] boolean defer;
-        attribute [Reflect,URL] DOMString src;
+        attribute [Reflect, URL] DOMString src;
         attribute [Reflect] DOMString type;
     };
 }
diff --git a/WebCore/html/HTMLSourceElement.idl b/WebCore/html/HTMLSourceElement.idl
index 61dc4d0..dbd6d6a 100644
--- a/WebCore/html/HTMLSourceElement.idl
+++ b/WebCore/html/HTMLSourceElement.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2007, 2010 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -25,7 +25,7 @@
 
 module html {
 interface [Conditional=VIDEO] HTMLSourceElement : HTMLElement {
-    attribute [Reflect,URL] DOMString src;
+    attribute [Reflect, URL] DOMString src;
     attribute DOMString type;
     attribute DOMString media;
 };
diff --git a/WebCore/html/HTMLVideoElement.idl b/WebCore/html/HTMLVideoElement.idl
index ca5db5e..770e4b2 100644
--- a/WebCore/html/HTMLVideoElement.idl
+++ b/WebCore/html/HTMLVideoElement.idl
@@ -32,7 +32,7 @@ module html {
         attribute [Reflect] unsigned long height;
         readonly attribute unsigned long videoWidth;
         readonly attribute unsigned long videoHeight;
-        attribute [Reflect,URL] DOMString poster;
+        attribute [Reflect, URL] DOMString poster;
 
         readonly attribute boolean webkitSupportsFullscreen;
         readonly attribute boolean webkitDisplayingFullscreen;
diff --git a/WebCore/html/HTMLViewSourceDocument.cpp b/WebCore/html/HTMLViewSourceDocument.cpp
index f268192..3299b27 100644
--- a/WebCore/html/HTMLViewSourceDocument.cpp
+++ b/WebCore/html/HTMLViewSourceDocument.cpp
@@ -28,6 +28,7 @@
 #include "Attribute.h"
 #include "DOMImplementation.h"
 #include "HTMLAnchorElement.h"
+#include "HTMLBaseElement.h"
 #include "HTMLBodyElement.h"
 #include "HTMLDivElement.h"
 #include "HTMLHtmlElement.h"
@@ -140,8 +141,7 @@ void HTMLViewSourceDocument::processDoctypeToken(const String& source, HTMLToken
 
 void HTMLViewSourceDocument::processTagToken(const String& source, HTMLToken& token)
 {
-    String classNameStr = "webkit-html-tag";
-    m_current = addSpanWithClassName(classNameStr);
+    m_current = addSpanWithClassName("webkit-html-tag");
 
     AtomicString tagName(token.name().data(), token.name().size());
 
@@ -161,11 +161,8 @@ void HTMLViewSourceDocument::processTagToken(const String& source, HTMLToken& to
         index = addRange(source, index, iter->m_nameRange.m_start - token.startIndex(), "");
         index = addRange(source, index, iter->m_nameRange.m_end - token.startIndex(), "webkit-html-attribute-name");
 
-        if (tagName == baseTag && name == hrefAttr) {
-            // Catch the href attribute in the base element. It will be used
-            // for rendering anchors created by addLink() below.
-            setBaseElementURL(KURL(url(), value));
-        }
+        if (tagName == baseTag && name == hrefAttr)
+            m_current = addBase(value);
 
         index = addRange(source, index, iter->m_valueRange.m_start - token.startIndex(), "");
 
@@ -189,7 +186,7 @@ void HTMLViewSourceDocument::processCharacterToken(const String& source, HTMLTok
     addText(source, "");
 }
 
-PassRefPtr<Element> HTMLViewSourceDocument::addSpanWithClassName(const String& className)
+PassRefPtr<Element> HTMLViewSourceDocument::addSpanWithClassName(const AtomicString& className)
 {
     if (m_current == m_tbody) {
         addLine(className);
@@ -205,7 +202,7 @@ PassRefPtr<Element> HTMLViewSourceDocument::addSpanWithClassName(const String& c
     return span.release();
 }
 
-void HTMLViewSourceDocument::addLine(const String& className)
+void HTMLViewSourceDocument::addLine(const AtomicString& className)
 {
     // Create a table row.
     RefPtr<HTMLTableRowElement> trow = HTMLTableRowElement::create(this);
@@ -243,7 +240,7 @@ void HTMLViewSourceDocument::addLine(const String& className)
     }
 }
 
-void HTMLViewSourceDocument::addText(const String& text, const String& className)
+void HTMLViewSourceDocument::addText(const String& text, const AtomicString& className)
 {
     if (text.isEmpty())
         return;
@@ -292,7 +289,18 @@ int HTMLViewSourceDocument::addRange(const String& source, int start, int end, c
     return end;
 }
 
-PassRefPtr<Element> HTMLViewSourceDocument::addLink(const String& url, bool isAnchor)
+PassRefPtr<Element> HTMLViewSourceDocument::addBase(const AtomicString& href)
+{
+    RefPtr<HTMLBaseElement> base = HTMLBaseElement::create(baseTag, this);
+    RefPtr<NamedNodeMap> attributeMap = NamedNodeMap::create();
+    attributeMap->addAttribute(Attribute::createMapped(hrefAttr, href));
+    base->setAttributeMap(attributeMap.release());
+    m_current->parserAddChild(base);
+    base->attach();
+    return base.release();
+}
+
+PassRefPtr<Element> HTMLViewSourceDocument::addLink(const AtomicString& url, bool isAnchor)
 {
     if (m_current == m_tbody)
         addLine("webkit-html-tag");
diff --git a/WebCore/html/HTMLViewSourceDocument.h b/WebCore/html/HTMLViewSourceDocument.h
index f459016..445c95b 100644
--- a/WebCore/html/HTMLViewSourceDocument.h
+++ b/WebCore/html/HTMLViewSourceDocument.h
@@ -57,11 +57,12 @@ private:
     void processCharacterToken(const String& source, HTMLToken&);
 
     void createContainingTable();
-    PassRefPtr<Element> addSpanWithClassName(const String&);
-    void addLine(const String& className);
-    void addText(const String& text, const String& className);
+    PassRefPtr<Element> addSpanWithClassName(const AtomicString&);
+    void addLine(const AtomicString& className);
+    void addText(const String& text, const AtomicString& className);
     int addRange(const String& source, int start, int end, const String& className, bool isLink = false, bool isAnchor = false);
-    PassRefPtr<Element> addLink(const String& url, bool isAnchor);
+    PassRefPtr<Element> addLink(const AtomicString& url, bool isAnchor);
+    PassRefPtr<Element> addBase(const AtomicString& href);
 
     String m_type;
     RefPtr<Element> m_current;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list