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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:18:56 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit b209903f13d7a5ca827bbc6b016c09491501534b
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Dec 14 17:10:12 2003 +0000

            Reviewed by Maciej.
    
            - fixed 3332280: REGRESSION (74-85): setting src of iframe results in two GETs
    
            * khtml/html/html_baseimpl.h: Added openURL virtual function.
            * khtml/html/html_baseimpl.cpp:
            (HTMLFrameElementImpl::updateForNewURL): Call openURL to do the meat of the work,
            since it's different for frames and iframes.
            (HTMLFrameElementImpl::openURL): Move the part that's different for frames in here.
            (HTMLFrameElementImpl::parseAttribute): Call setLocation to share code.
            (HTMLFrameElementImpl::setLocation): Do nothing if the location is not changing.
            Not needed to fix this bug, but could eliminate other cases of extra GETs.
            (HTMLIFrameElementImpl::parseAttribute): Remove special handling of SRC, because now
            we will end up calling openURL, which will do the right thing for iframes.
            (HTMLIFrameElementImpl::openURL): Instead of doing the change to the frame directly,
            use updateWidget, since that's what we do for other changes to iframes. To trigger a
            call to updateWidget(), set needWidgetUpdate and mark the node changed.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5794 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 8f50443..b45ac7f 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,23 @@
+2003-12-14  Darin Adler  <darin at apple.com>
+
+        Reviewed by Maciej.
+
+        - fixed 3332280: REGRESSION (74-85): setting src of iframe results in two GETs
+
+        * khtml/html/html_baseimpl.h: Added openURL virtual function.
+        * khtml/html/html_baseimpl.cpp:
+        (HTMLFrameElementImpl::updateForNewURL): Call openURL to do the meat of the work,
+        since it's different for frames and iframes.
+        (HTMLFrameElementImpl::openURL): Move the part that's different for frames in here.
+        (HTMLFrameElementImpl::parseAttribute): Call setLocation to share code.
+        (HTMLFrameElementImpl::setLocation): Do nothing if the location is not changing.
+        Not needed to fix this bug, but could eliminate other cases of extra GETs.
+        (HTMLIFrameElementImpl::parseAttribute): Remove special handling of SRC, because now
+        we will end up calling openURL, which will do the right thing for iframes.
+        (HTMLIFrameElementImpl::openURL): Instead of doing the change to the frame directly,
+        use updateWidget, since that's what we do for other changes to iframes. To trigger a
+        call to updateWidget(), set needWidgetUpdate and mark the node changed.
+
 2003-12-13  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Darin.
diff --git a/WebCore/khtml/html/html_baseimpl.cpp b/WebCore/khtml/html/html_baseimpl.cpp
index ec8f913..0ba1f57 100644
--- a/WebCore/khtml/html/html_baseimpl.cpp
+++ b/WebCore/khtml/html/html_baseimpl.cpp
@@ -266,27 +266,30 @@ void HTMLFrameElementImpl::updateForNewURL()
         return;
     }
     
-    DOMString relativeURL = url;
-    if (relativeURL.isEmpty()) {
-        relativeURL = "about:blank";
-    }
-
-    if (!isURLAllowed(relativeURL)) {
+    if (!isURLAllowed(url)) {
         return;
     }
 
+    openURL();
+}
+
+void HTMLFrameElementImpl::openURL()
+{
     KHTMLView *w = getDocument()->view();
     if (!w) {
         return;
     }
     
+    DOMString relativeURL = url;
+    if (relativeURL.isEmpty()) {
+        relativeURL = "about:blank";
+    }
+
     // Load the frame contents.
     KHTMLPart *part = w->part();
     KHTMLPart *framePart = part->findFrame(name.string());
-    KURL kurl = getDocument()->completeURL(relativeURL.string());
-
     if (framePart) {
-        framePart->openURL(kurl);
+        framePart->openURL(getDocument()->completeURL(relativeURL.string()));
     } else {
         part->requestFrame(static_cast<RenderFrame *>(m_render), relativeURL.string(), name.string());
     }
@@ -298,8 +301,7 @@ void HTMLFrameElementImpl::parseAttribute(AttributeImpl *attr)
     switch(attr->id())
     {
     case ATTR_SRC:
-        url = khtml::parseURL(attr->val());
-        updateForNewURL();
+        setLocation(khtml::parseURL(attr->val()));
         break;
     case ATTR_ID:
     case ATTR_NAME:
@@ -425,6 +427,7 @@ void HTMLFrameElementImpl::detach()
 
 void HTMLFrameElementImpl::setLocation( const DOMString& str )
 {
+    if (url == str) return;
     url = str;
     updateForNewURL();
 }
@@ -658,10 +661,6 @@ void HTMLIFrameElementImpl::parseAttribute(AttributeImpl *attr )
     case ATTR_HEIGHT:
       addCSSLength( CSS_PROP_HEIGHT, attr->value() );
       break;
-    case ATTR_SRC:
-      needWidgetUpdate = true; // ### do this for scrolling, margins etc?
-      HTMLFrameElementImpl::parseAttribute( attr );
-      break;
     case ATTR_ALIGN:
       addHTMLAlignment( attr->value() );
       break;
@@ -706,3 +705,8 @@ void HTMLIFrameElementImpl::recalcStyle( StyleChange ch )
     HTMLElementImpl::recalcStyle( ch );
 }
 
+void HTMLIFrameElementImpl::openURL()
+{
+    needWidgetUpdate = true;
+    setChanged();
+}
diff --git a/WebCore/khtml/html/html_baseimpl.h b/WebCore/khtml/html/html_baseimpl.h
index e8a53cd..f948af1 100644
--- a/WebCore/khtml/html/html_baseimpl.h
+++ b/WebCore/khtml/html/html_baseimpl.h
@@ -103,6 +103,7 @@ public:
 
 protected:
     bool isURLAllowed(const DOMString &) const;
+    virtual void openURL();
 
     DOMString url;
     DOMString name;
@@ -115,7 +116,7 @@ protected:
     bool frameBorderSet : 1;
     bool noresize : 1;
 
- private:
+private:
     void updateForNewURL();
 };
 
@@ -204,11 +205,12 @@ public:
     virtual void recalcStyle( StyleChange ch );
 
 protected:
+    virtual void openURL();
+
     bool needWidgetUpdate;
 };
 
 
-}; //namespace
+} //namespace
 
 #endif
-

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list