[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:06:34 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 5718b4e43271ecbbd46413f90ed0bd96aa6de1c0
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 28 19:13:11 2003 +0000

            Reviewed by John.
    
    	- fixed 3427046 - href and src attributes don't always give resolved URL
    
    	It turns out that all href and src attributes should be resolved
    	against the base, except for frame elements.
    
            * khtml/dom/html_base.cpp:
            (HTMLIFrameElement::src): Resolve against base URL.
            * khtml/dom/html_form.cpp:
            (HTMLInputElement::src): Resolve URL even when empty. Remove
    	comment questioning resolution against base - it's definitely
    	right.
            * khtml/dom/html_head.cpp:
            (HTMLBaseElement::href): Resolve against base URL.
            (HTMLLinkElement::href): Ditto.
            (HTMLScriptElement::src): Ditto.
            * khtml/dom/html_image.cpp:
            (HTMLAreaElement::href): Ditto.
    	(HTMLImageElement::src): Resolve URL even when empty. Remove
    	comment questioning resolution against base - it's definitely
    	right.
            * khtml/dom/html_inline.cpp:
            (HTMLAnchorElement::href): Resolve against base URL.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5283 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 03ff819..1ac79a0 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,30 @@
+2003-10-28  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by John.
+
+	- fixed 3427046 - href and src attributes don't always give resolved URL
+
+	It turns out that all href and src attributes should be resolved
+	against the base, except for frame elements.
+	
+        * khtml/dom/html_base.cpp:
+        (HTMLIFrameElement::src): Resolve against base URL.
+        * khtml/dom/html_form.cpp:
+        (HTMLInputElement::src): Resolve URL even when empty. Remove
+	comment questioning resolution against base - it's definitely
+	right.
+        * khtml/dom/html_head.cpp:
+        (HTMLBaseElement::href): Resolve against base URL.
+        (HTMLLinkElement::href): Ditto.
+        (HTMLScriptElement::src): Ditto.
+        * khtml/dom/html_image.cpp:
+        (HTMLAreaElement::href): Ditto.
+	(HTMLImageElement::src): Resolve URL even when empty. Remove
+	comment questioning resolution against base - it's definitely
+	right.
+        * khtml/dom/html_inline.cpp:
+        (HTMLAnchorElement::href): Resolve against base URL.
+
 2003-10-27  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Darin.
diff --git a/WebCore/khtml/dom/html_base.cpp b/WebCore/khtml/dom/html_base.cpp
index 9a4b127..d16a5de 100644
--- a/WebCore/khtml/dom/html_base.cpp
+++ b/WebCore/khtml/dom/html_base.cpp
@@ -370,7 +370,9 @@ void HTMLIFrameElement::setScrolling( const DOMString &value )
 DOMString HTMLIFrameElement::src() const
 {
     if(!impl) return DOMString();
-    return ((ElementImpl *)impl)->getAttribute(ATTR_SRC);
+    DOMString s = ((ElementImpl *)impl)->getAttribute(ATTR_SRC);
+    s = ownerDocument().completeURL( s );
+    return s;
 }
 
 void HTMLIFrameElement::setSrc( const DOMString &value )
diff --git a/WebCore/khtml/dom/html_form.cpp b/WebCore/khtml/dom/html_form.cpp
index f93c1c8..4d09dcf 100644
--- a/WebCore/khtml/dom/html_form.cpp
+++ b/WebCore/khtml/dom/html_form.cpp
@@ -464,10 +464,7 @@ DOMString HTMLInputElement::src() const
 {
     if(!impl) return DOMString();
     DOMString s = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SRC);
-    // ### not sure if we're supposed to do the completion
-    if ( !s.isEmpty() )
-        s = ownerDocument().completeURL( s );
-
+    s = ownerDocument().completeURL( s );
     return s;
 }
 
diff --git a/WebCore/khtml/dom/html_head.cpp b/WebCore/khtml/dom/html_head.cpp
index baf5d27..fb25e45 100644
--- a/WebCore/khtml/dom/html_head.cpp
+++ b/WebCore/khtml/dom/html_head.cpp
@@ -22,6 +22,7 @@
 // --------------------------------------------------------------------------
 
 #include "dom/html_head.h"
+#include "dom/dom_doc.h"
 #include "html/html_headimpl.h"
 #include "misc/htmlhashes.h"
 
@@ -58,7 +59,9 @@ HTMLBaseElement::~HTMLBaseElement()
 DOMString HTMLBaseElement::href() const
 {
     if(!impl) return DOMString();
-    return ((ElementImpl *)impl)->getAttribute(ATTR_HREF);
+    DOMString s = ((ElementImpl *)impl)->getAttribute(ATTR_HREF);
+    s = ownerDocument().completeURL( s );
+    return s;
 }
 
 void HTMLBaseElement::setHref( const DOMString &value )
@@ -135,7 +138,9 @@ void HTMLLinkElement::setCharset( const DOMString &value )
 DOMString HTMLLinkElement::href() const
 {
     if(!impl) return DOMString();
-    return ((ElementImpl *)impl)->getAttribute(ATTR_HREF);
+    DOMString s = ((ElementImpl *)impl)->getAttribute(ATTR_HREF);
+    s = ownerDocument().completeURL( s );
+    return s;
 }
 
 void HTMLLinkElement::setHref( const DOMString &value )
@@ -379,7 +384,9 @@ void HTMLScriptElement::setDefer( bool _defer )
 DOMString HTMLScriptElement::src() const
 {
     if(!impl) return DOMString();
-    return ((ElementImpl *)impl)->getAttribute(ATTR_SRC);
+    DOMString s = ((ElementImpl *)impl)->getAttribute(ATTR_SRC);
+    s = ownerDocument().completeURL( s );
+    return s;
 }
 
 void HTMLScriptElement::setSrc( const DOMString &value )
diff --git a/WebCore/khtml/dom/html_image.cpp b/WebCore/khtml/dom/html_image.cpp
index 2aef83f..e53f07e 100644
--- a/WebCore/khtml/dom/html_image.cpp
+++ b/WebCore/khtml/dom/html_image.cpp
@@ -96,7 +96,9 @@ void HTMLAreaElement::setCoords( const DOMString &value )
 DOMString HTMLAreaElement::href() const
 {
     if(!impl) return DOMString();
-    return ((ElementImpl *)impl)->getAttribute(ATTR_HREF);
+    DOMString s = ((ElementImpl *)impl)->getAttribute(ATTR_HREF);
+    s = ownerDocument().completeURL( s );
+    return s;
 }
 
 void HTMLAreaElement::setHref( const DOMString &value )
@@ -287,9 +289,7 @@ DOMString HTMLImageElement::src() const
 {
     if(!impl) return DOMString();
     DOMString s = ((ElementImpl *)impl)->getAttribute(ATTR_SRC);
-    // ### not sure if we're supposed to do the completion
-    if ( !s.isEmpty() )
-        s = ownerDocument().completeURL( s );
+    s = ownerDocument().completeURL( s );
     return s;
 }
 
diff --git a/WebCore/khtml/dom/html_inline.cpp b/WebCore/khtml/dom/html_inline.cpp
index 134d1c7..873b4c7 100644
--- a/WebCore/khtml/dom/html_inline.cpp
+++ b/WebCore/khtml/dom/html_inline.cpp
@@ -95,7 +95,9 @@ void HTMLAnchorElement::setCoords( const DOMString &value )
 DOMString HTMLAnchorElement::href() const
 {
     if(!impl) return DOMString();
-    return ((ElementImpl *)impl)->getAttribute(ATTR_HREF);
+    DOMString s = ((ElementImpl *)impl)->getAttribute(ATTR_HREF);
+    s = ownerDocument().completeURL( s );
+    return s;
 }
 
 void HTMLAnchorElement::setHref( const DOMString &value )

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list