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

enrica at apple.com enrica at apple.com
Wed Dec 22 13:28:30 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 44ddabcb837bf51efa657c232e9c18cb3de5f700
Author: enrica at apple.com <enrica at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 16 16:28:41 2010 +0000

    Pasteboard doesn't work in WebKit2.
    https://bugs.webkit.org/show_bug.cgi?id=42317
    <rdar://problem/7660537>
    
    Reviewed by Sam Weinig.
    
    Initial work to support cut, copy, paste and selectAll in WebKit2.
    It still does not support RTF and RTFD format for Mac and the selective
    enabling of the editing menu entries.
    
    * Shared/CoreIPCSupport/WebPageMessageKinds.h: Added messages to support the
    new editing commands.
    * UIProcess/API/mac/WKView.mm:
    (-[WKView validateUserInterfaceItem:]): Added.
    (-[WKView copy:]): Added.
    (-[WKView cut:]): Added.
    (-[WKView paste:]): Addded.
    (-[WKView selectAll:]): Added.
    * UIProcess/WebPageProxy.cpp: Added all the proxy methods.
    (WebKit::WebPageProxy::selectAll):
    (WebKit::WebPageProxy::copy):
    (WebKit::WebPageProxy::cut):
    (WebKit::WebPageProxy::paste):
    * UIProcess/WebPageProxy.h:
    * WebProcess/WebCoreSupport/WebEditorClient.cpp:
    (WebKit::WebEditorClient::documentFragmentFromAttributedString): Added but not
    implemented. This is needed to support RTF and RTFD.
    (WebKit::WebEditorClient::setInsertionPasteboard): Added but not implemented.
    This is needed only to support Mail on the Mac.
    * WebProcess/WebPage/WebPage.cpp: Added all the stub methods.
    (WebKit::WebPage::selectAll):
    (WebKit::WebPage::copy):
    (WebKit::WebPage::cut):
    (WebKit::WebPage::paste):
    (WebKit::WebPage::didReceiveMessage): Modified to handle the new messages from
    the UI process.
    * WebProcess/WebPage/WebPage.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67631 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index aef4143..d739272 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,43 @@
+2010-09-15  Enrica Casucci  <enrica at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Pasteboard doesn't work in WebKit2.
+        https://bugs.webkit.org/show_bug.cgi?id=42317
+        <rdar://problem/7660537>
+        
+        Initial work to support cut, copy, paste and selectAll in WebKit2.
+        It still does not support RTF and RTFD format for Mac and the selective
+        enabling of the editing menu entries.
+        
+        * Shared/CoreIPCSupport/WebPageMessageKinds.h: Added messages to support the
+        new editing commands.
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView validateUserInterfaceItem:]): Added.
+        (-[WKView copy:]): Added.
+        (-[WKView cut:]): Added.
+        (-[WKView paste:]): Addded.
+        (-[WKView selectAll:]): Added.
+        * UIProcess/WebPageProxy.cpp: Added all the proxy methods.
+        (WebKit::WebPageProxy::selectAll):
+        (WebKit::WebPageProxy::copy):
+        (WebKit::WebPageProxy::cut):
+        (WebKit::WebPageProxy::paste):
+        * UIProcess/WebPageProxy.h:
+        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+        (WebKit::WebEditorClient::documentFragmentFromAttributedString): Added but not
+        implemented. This is needed to support RTF and RTFD.
+        (WebKit::WebEditorClient::setInsertionPasteboard): Added but not implemented.
+        This is needed only to support Mail on the Mac.
+        * WebProcess/WebPage/WebPage.cpp: Added all the stub methods.
+        (WebKit::WebPage::selectAll):
+        (WebKit::WebPage::copy):
+        (WebKit::WebPage::cut):
+        (WebKit::WebPage::paste):
+        (WebKit::WebPage::didReceiveMessage): Modified to handle the new messages from
+        the UI process.
+        * WebProcess/WebPage/WebPage.h:
+
 2010-09-16  Eric Uhrhane  <ericu at chromium.org>
 
         Reviewed by Jian Li.
diff --git a/WebKit2/Shared/CoreIPCSupport/WebPageMessageKinds.h b/WebKit2/Shared/CoreIPCSupport/WebPageMessageKinds.h
index 060da63..21facd7 100644
--- a/WebKit2/Shared/CoreIPCSupport/WebPageMessageKinds.h
+++ b/WebKit2/Shared/CoreIPCSupport/WebPageMessageKinds.h
@@ -58,6 +58,10 @@ enum Kind {
     SetTextZoomFactor,
     StopLoading,
     TryClose,
+    SelectAll,
+    Copy,
+    Cut,
+    Paste,
     UnapplyEditCommand,
     WheelEvent
 #if ENABLE(TOUCH_EVENTS)
diff --git a/WebKit2/UIProcess/API/mac/WKView.mm b/WebKit2/UIProcess/API/mac/WKView.mm
index 813df61..0de05ec 100644
--- a/WebKit2/UIProcess/API/mac/WKView.mm
+++ b/WebKit2/UIProcess/API/mac/WKView.mm
@@ -146,6 +146,34 @@ using namespace WebCore;
     _data->_page->drawingArea()->setSize(IntSize(size));
 }
 
+- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
+{
+    // FIXME: this needs to be implemented
+    return YES;
+}
+
+// Editing commands
+
+- (void)copy:(id)sender
+{ 
+    _data->_page->copy();
+}
+
+- (void)cut:(id)sender
+{ 
+    _data->_page->cut();
+}
+
+- (void)paste:(id)sender
+{ 
+    _data->_page->paste();
+}
+
+- (void)selectAll:(id)sender
+{
+    _data->_page->selectAll();
+}
+
 // Events
 
 // Override this so that AppKit will send us arrow keys as key down events so we can
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index 9f2e209..47b970b 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -316,6 +316,38 @@ void WebPageProxy::setActive(bool active)
     process()->send(WebPageMessage::SetActive, m_pageID, CoreIPC::In(active));
 }
 
+void WebPageProxy::selectAll()
+{
+    if (!isValid())
+        return;
+
+    process()->send(WebPageMessage::SelectAll, m_pageID, CoreIPC::In());
+}
+
+void WebPageProxy::copy()
+{
+    if (!isValid())
+        return;
+
+    process()->send(WebPageMessage::Copy, m_pageID, CoreIPC::In());
+}
+
+void WebPageProxy::cut()
+{
+    if (!isValid())
+        return;
+
+    process()->send(WebPageMessage::Cut, m_pageID, CoreIPC::In());
+}
+
+void WebPageProxy::paste()
+{
+    if (!isValid())
+        return;
+
+    process()->send(WebPageMessage::Paste, m_pageID, CoreIPC::In());
+}
+    
 void WebPageProxy::setIsInWindow(bool isInWindow)
 {
     if (m_isInWindow == isInWindow)
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index 3e6c980..7a7e8da 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -129,6 +129,11 @@ public:
     void setActive(bool active);
     void setIsInWindow(bool isInWindow);
 
+    void selectAll();
+    void copy();
+    void cut();
+    void paste();
+    
     void mouseEvent(const WebMouseEvent&);
     void wheelEvent(const WebWheelEvent&);
     void keyEvent(const WebKeyboardEvent&);
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
index 9140f51..745c19b 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
@@ -318,12 +318,14 @@ NSString* WebEditorClient::userVisibleString(NSURL*)
 DocumentFragment* WebEditorClient::documentFragmentFromAttributedString(NSAttributedString*, Vector<ArchiveResource*>&)
 {
     // FIXME: add code here to create fake WebView and load WebKit 1
-    notImplemented();
+    // This is needed to support RTF and RTFD in the pasteboard
     return 0;
 }
 
 void WebEditorClient::setInsertionPasteboard(NSPasteboard*)
 {
+    // This is used only by Mail, no need to implement it now.
+    notImplemented();
 }
 
 #ifdef BUILDING_ON_TIGER
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index a897565..30d75d0 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -432,6 +432,30 @@ void WebPage::keyEvent(const WebKeyboardEvent& keyboardEvent)
     (void)handled;
 }
 
+void WebPage::selectAll()
+{
+    if (m_page->focusController()->focusedOrMainFrame())
+        m_page->focusController()->focusedOrMainFrame()->selection()->selectAll();
+}
+
+void WebPage::copy()
+{
+    if (m_page->focusController()->focusedOrMainFrame())
+        m_page->focusController()->focusedOrMainFrame()->editor()->copy();
+}
+
+void WebPage::cut()
+{
+    if (m_page->focusController()->focusedOrMainFrame())
+        m_page->focusController()->focusedOrMainFrame()->editor()->cut();
+}
+
+void WebPage::paste()
+{
+    if (m_page->focusController()->focusedOrMainFrame())
+        m_page->focusController()->focusedOrMainFrame()->editor()->paste();
+}    
+    
 #if ENABLE(TOUCH_EVENTS)
 void WebPage::touchEvent(const WebTouchEvent& touchEvent)
 {
@@ -666,6 +690,22 @@ void WebPage::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Messag
             keyEvent(event);
             return;
         }
+        case WebPageMessage::SelectAll: {
+            selectAll();
+            return;
+        }
+        case WebPageMessage::Copy: {
+            copy();
+            return;
+        }
+        case WebPageMessage::Cut: {
+            cut();
+            return;
+        }
+        case WebPageMessage::Paste: {
+            paste();
+            return;
+        }            
 #if ENABLE(TOUCH_EVENTS)
         case WebPageMessage::TouchEvent: {
             WebTouchEvent event;
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index 21261a6..b0b71c2 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -166,6 +166,10 @@ private:
     void mouseEvent(const WebMouseEvent&);
     void wheelEvent(const WebWheelEvent&);
     void keyEvent(const WebKeyboardEvent&);
+    void selectAll();
+    void copy();
+    void cut();
+    void paste();
 #if ENABLE(TOUCH_EVENTS)
     void touchEvent(const WebTouchEvent&);
 #endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list