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

weinig at apple.com weinig at apple.com
Wed Dec 22 18:14:35 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 1e3580ed0bf97795719b9cb7aa376c575f202129
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 9 01:41:57 2010 +0000

    Need a WebKit2 way to test whether a frame is displaying a standalone image
    <rdar://problem/8443059>
    WebKit2: Need a way to test whether a page or frame is showing HTML content
    <rdar://problem/8642563>
    
    Reviewed by Gavin Barraclough.
    
    Add WKFrameIsDiplayingStandaloneImageDocument and WKFrameIsDiplayingMarkupDocument.
    
    * UIProcess/API/C/WKFrame.cpp:
    (WKFrameIsDiplayingStandaloneImageDocument):
    (WKFrameIsDiplayingMarkupDocument):
    * UIProcess/API/C/WKFrame.h:
    * UIProcess/WebFrameProxy.cpp:
    (WebKit::WebFrameProxy::canProvideSource): This now just calls isDiplayingMarkupDocument.
    (WebKit::WebFrameProxy::isDiplayingStandaloneImageDocument):
    (WebKit::WebFrameProxy::isDiplayingMarkupDocument):
    * UIProcess/WebFrameProxy.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73574 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index e6f1a03..6c15219 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,24 @@
+2010-12-08  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Gavin Barraclough.
+
+        Need a WebKit2 way to test whether a frame is displaying a standalone image
+        <rdar://problem/8443059>
+        WebKit2: Need a way to test whether a page or frame is showing HTML content
+        <rdar://problem/8642563>
+
+        Add WKFrameIsDiplayingStandaloneImageDocument and WKFrameIsDiplayingMarkupDocument.
+
+        * UIProcess/API/C/WKFrame.cpp:
+        (WKFrameIsDiplayingStandaloneImageDocument):
+        (WKFrameIsDiplayingMarkupDocument):
+        * UIProcess/API/C/WKFrame.h:
+        * UIProcess/WebFrameProxy.cpp:
+        (WebKit::WebFrameProxy::canProvideSource): This now just calls isDiplayingMarkupDocument.
+        (WebKit::WebFrameProxy::isDiplayingStandaloneImageDocument):
+        (WebKit::WebFrameProxy::isDiplayingMarkupDocument):
+        * UIProcess/WebFrameProxy.h:
+
 2010-12-08  Anders Carlsson  <andersca at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebKit2/UIProcess/API/C/WKFrame.cpp b/WebKit2/UIProcess/API/C/WKFrame.cpp
index 6f501c7..f36880d 100644
--- a/WebKit2/UIProcess/API/C/WKFrame.cpp
+++ b/WebKit2/UIProcess/API/C/WKFrame.cpp
@@ -91,12 +91,22 @@ bool WKFrameCanProvideSource(WKFrameRef frameRef)
     return toImpl(frameRef)->canProvideSource();
 }
 
-bool WKFrameIsFrameSet(WKFrameRef frameRef)
+bool WKFrameCanShowMIMEType(WKFrameRef frameRef, WKStringRef mimeTypeRef)
 {
-    return toImpl(frameRef)->isFrameSet();
+    return toImpl(frameRef)->canShowMIMEType(toWTFString(mimeTypeRef));
 }
 
-bool WKFrameCanShowMIMEType(WKFrameRef frameRef, WKStringRef mimeTypeRef)
+bool WKFrameIsDiplayingStandaloneImageDocument(WKFrameRef frameRef)
 {
-    return toImpl(frameRef)->canShowMIMEType(toWTFString(mimeTypeRef));
+    return toImpl(frameRef)->isDiplayingStandaloneImageDocument();
+}
+
+bool WKFrameIsDiplayingMarkupDocument(WKFrameRef frameRef)
+{
+    return toImpl(frameRef)->isDiplayingMarkupDocument();
+}
+
+bool WKFrameIsFrameSet(WKFrameRef frameRef)
+{
+    return toImpl(frameRef)->isFrameSet();
 }
diff --git a/WebKit2/UIProcess/API/C/WKFrame.h b/WebKit2/UIProcess/API/C/WKFrame.h
index 04f657e..f4d8608 100644
--- a/WebKit2/UIProcess/API/C/WKFrame.h
+++ b/WebKit2/UIProcess/API/C/WKFrame.h
@@ -61,6 +61,9 @@ WK_EXPORT WKCertificateInfoRef WKFrameGetCertificateInfo(WKFrameRef frame);
 WK_EXPORT bool WKFrameCanProvideSource(WKFrameRef frame);
 WK_EXPORT bool WKFrameCanShowMIMEType(WKFrameRef frame, WKStringRef mimeType);
 
+WK_EXPORT bool WKFrameIsDiplayingStandaloneImageDocument(WKFrameRef frame);
+WK_EXPORT bool WKFrameIsDiplayingMarkupDocument(WKFrameRef frame);
+
 WK_EXPORT bool WKFrameIsFrameSet(WKFrameRef frame);
 
 #ifdef __cplusplus
diff --git a/WebKit2/UIProcess/WebFrameProxy.cpp b/WebKit2/UIProcess/WebFrameProxy.cpp
index 5b8a3d4..e3d1eb4 100644
--- a/WebKit2/UIProcess/WebFrameProxy.cpp
+++ b/WebKit2/UIProcess/WebFrameProxy.cpp
@@ -31,6 +31,7 @@
 #include "WebFramePolicyListenerProxy.h"
 #include "WebPageProxy.h"
 #include <WebCore/DOMImplementation.h>
+#include <WebCore/Image.h>
 #include <wtf/text/WTFString.h>
 
 using namespace WebCore;
@@ -73,10 +74,7 @@ void WebFrameProxy::setCertificateInfo(PassRefPtr<WebCertificateInfo> certificat
 
 bool WebFrameProxy::canProvideSource() const
 {
-    // FIXME: This check should be moved to somewhere in WebCore. 
-    if (m_MIMEType == "text/html" || m_MIMEType == "image/svg+xml" || DOMImplementation::isXMLMIMEType(m_MIMEType))
-        return true;
-    return false;
+    return isDiplayingMarkupDocument();
 }
 
 bool WebFrameProxy::canShowMIMEType(const String& mimeType) const
@@ -96,6 +94,17 @@ bool WebFrameProxy::canShowMIMEType(const String& mimeType) const
     return false;
 }
 
+bool WebFrameProxy::isDiplayingStandaloneImageDocument() const
+{
+    return Image::supportsType(m_MIMEType);
+}
+
+bool WebFrameProxy::isDiplayingMarkupDocument() const
+{
+    // FIXME: This check should be moved to somewhere in WebCore. 
+    return m_MIMEType == "text/html" || m_MIMEType == "image/svg+xml" || DOMImplementation::isXMLMIMEType(m_MIMEType);
+}
+
 void WebFrameProxy::didStartProvisionalLoad(const String& url)
 {
     // FIXME: Add assertions.
diff --git a/WebKit2/UIProcess/WebFrameProxy.h b/WebKit2/UIProcess/WebFrameProxy.h
index 6409d40..368924f 100644
--- a/WebKit2/UIProcess/WebFrameProxy.h
+++ b/WebKit2/UIProcess/WebFrameProxy.h
@@ -90,6 +90,9 @@ public:
     bool canProvideSource() const;
     bool canShowMIMEType(const String& mimeType) const;
 
+    bool isDiplayingStandaloneImageDocument() const;
+    bool isDiplayingMarkupDocument() const;
+
     void didStartProvisionalLoad(const String& url);
     void didReceiveServerRedirectForProvisionalLoad(const String& url);
     void didFailProvisionalLoad();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list