[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

weinig at apple.com weinig at apple.com
Thu Oct 29 20:37:03 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 1f89004f22efb97687b893e7064973a17d8a061f
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 30 20:56:33 2009 +0000

    Fix for <rdar://problem/7259706>
    Need WebKit API or SPI on Mac and Windows to test whether it's safe to load a page in a new tab/window
    
    Reviewed by Dan Bernstein.
    
    WebKit/mac:
    
    * WebView/WebFrame.mm:
    (-[WebFrame _allowsFollowingLink:]):
    * WebView/WebFramePrivate.h:
    
    WebKit/win:
    
    * Interfaces/IWebFramePrivate.idl:
    * WebFrame.cpp:
    (WebFrame::allowsFollowingLink):
    * WebFrame.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48946 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 6cf03c9..9b6dcdf 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,14 @@
+2009-09-30  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Dan Bernstein.
+
+        Fix for <rdar://problem/7259706>
+        Need WebKit API or SPI on Mac and Windows to test whether it's safe to load a page in a new tab/window
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _allowsFollowingLink:]):
+        * WebView/WebFramePrivate.h:
+
 2009-09-30  Dave Hyatt  <hyatt at apple.com>
 
         Reviewed by Adam Roben.
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index 95a76e2..672f189 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -1195,6 +1195,13 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
     return result;
 }
 
+- (BOOL)_allowsFollowingLink:(NSURL *)URL
+{
+    if (!_private->coreFrame)
+        return YES;
+    return FrameLoader::canLoad(URL, String(), _private->coreFrame->document());
+}
+
 @end
 
 @implementation WebFrame
diff --git a/WebKit/mac/WebView/WebFramePrivate.h b/WebKit/mac/WebView/WebFramePrivate.h
index 8e7a2ef..7446584 100644
--- a/WebKit/mac/WebView/WebFramePrivate.h
+++ b/WebKit/mac/WebView/WebFramePrivate.h
@@ -110,4 +110,6 @@ typedef enum {
 - (void)_replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
 
 - (NSMutableDictionary *)_cacheabilityDictionary;
+
+- (BOOL)_allowsFollowingLink:(NSURL *)URL;
 @end
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 09c5a35..f56d073 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,15 @@
+2009-09-30  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Dan Bernstein.
+
+        Fix for <rdar://problem/7259706>
+        Need WebKit API or SPI on Mac and Windows to test whether it's safe to load a page in a new tab/window
+
+        * Interfaces/IWebFramePrivate.idl:
+        * WebFrame.cpp:
+        (WebFrame::allowsFollowingLink):
+        * WebFrame.h:
+
 2009-09-30  Dave Hyatt  <hyatt at apple.com>
 
         Reviewed by Adam Roben.
diff --git a/WebKit/win/Interfaces/IWebFramePrivate.idl b/WebKit/win/Interfaces/IWebFramePrivate.idl
index 96b42ab..a3366da 100644
--- a/WebKit/win/Interfaces/IWebFramePrivate.idl
+++ b/WebKit/win/Interfaces/IWebFramePrivate.idl
@@ -91,4 +91,6 @@ interface IWebFramePrivate : IUnknown
     HRESULT numberOfActiveAnimations([out, retval] UINT* number);
 
     HRESULT isDisplayingStandaloneImage([out, retval] BOOL* result);
+
+    HRESULT allowsFollowingLink([in] BSTR url, [out, retval] BOOL* result);
 }
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index cc3d5c4..36e8cfc 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -1148,6 +1148,21 @@ HRESULT WebFrame::isDisplayingStandaloneImage(BOOL* result)
     return S_OK;
 }
 
+HRESULT WebFrame::allowsFollowingLink(BSTR url, BOOL* result)
+{
+    if (!result)
+        return E_POINTER;
+
+    *result = TRUE;
+
+    Frame* frame = core(this);
+    if (!frame)
+        return E_FAIL;
+
+    *result = FrameLoader::canLoad(MarshallingHelpers::BSTRToKURL(url), String(), frame->document());
+    return S_OK;
+}
+
 HRESULT WebFrame::controlsInForm(IDOMElement* form, IDOMElement** controls, int* cControls)
 {
     if (!form)
diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h
index 7de61ec..8edc81a 100644
--- a/WebKit/win/WebFrame.h
+++ b/WebKit/win/WebFrame.h
@@ -240,6 +240,10 @@ public:
 
     virtual HRESULT STDMETHODCALLTYPE isDisplayingStandaloneImage(BOOL*);
 
+    virtual HRESULT STDMETHODCALLTYPE allowsFollowingLink(
+        /* [in] */ BSTR url,
+        /* [retval][out] */ BOOL* result);
+
     // IWebDocumentText
     virtual HRESULT STDMETHODCALLTYPE supportsTextEncoding( 
         /* [retval][out] */ BOOL* result);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list