[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

eric at webkit.org eric at webkit.org
Thu Feb 4 21:32:28 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 49e74b802979a9a1ca9ca53c306e2c3f097b7abd
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 29 17:56:44 2010 +0000

    2010-01-29  Ben Murdoch  <benm at google.com>
    
            Reviewed by Dimitri Glazkov.
    
            [Android] Android needs functionality in the ChromeClient to be informed when touch events are and are not needed by the webpage.
            https://bugs.webkit.org/show_bug.cgi?id=34215
    
            Add a function on the ChromeClient that WebCore can use to inform the platform when it needs touch events. This way the platform can optimise by not forwarding the events if they are not required.
    
            No new tests as the only implementation is specific to Android.
    
            * dom/Document.cpp:
            (WebCore::Document::detach): Check if this is the top level document and if so, stop forwarding touch events.
            (WebCore::Document::addListenerTypeIfNeeded): Inform the ChromeClient it should start forwarding touch events and guard touch event code properly.
            * history/CachedFrame.cpp:
            (WebCore::CachedFrameBase::restore): If the document uses touch events, inform the ChromeClient to start forwarding them.
            (WebCore::CachedFrame::CachedFrame): If the document uses touch events, inform the ChromeClient to stop forwarding them, as the document is being put into the page cache.
            * loader/EmptyClients.h:
            (WebCore::EmptyChromeClient::needTouchEvents): Add an empty implementation.
            * page/ChromeClient.h: Add the needTouchEvents() function.
    2010-01-29  Ben Murdoch  <benm at google.com>
    
            Reviewed by Dimitri Glazkov.
    
            [Android] Android needs functionality in the ChromeClient to be informed when touch events are and are not needed by the webpage.
            https://bugs.webkit.org/show_bug.cgi?id=34215
    
            Add needTouchEvents() to the ChromeClient which is called when the page decides it needs or no longer needs to be informed of touch events.
    
            * WebCoreSupport/ChromeClientQt.h:
            (WebCore::ChromeClientQt::needTouchEvents): Add an empty implementation.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54069 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4285054..501a634 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-01-29  Ben Murdoch  <benm at google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        [Android] Android needs functionality in the ChromeClient to be informed when touch events are and are not needed by the webpage.
+        https://bugs.webkit.org/show_bug.cgi?id=34215
+
+        Add a function on the ChromeClient that WebCore can use to inform the platform when it needs touch events. This way the platform can optimise by not forwarding the events if they are not required.
+
+        No new tests as the only implementation is specific to Android.
+
+        * dom/Document.cpp:
+        (WebCore::Document::detach): Check if this is the top level document and if so, stop forwarding touch events.
+        (WebCore::Document::addListenerTypeIfNeeded): Inform the ChromeClient it should start forwarding touch events and guard touch event code properly.
+        * history/CachedFrame.cpp:
+        (WebCore::CachedFrameBase::restore): If the document uses touch events, inform the ChromeClient to start forwarding them.
+        (WebCore::CachedFrame::CachedFrame): If the document uses touch events, inform the ChromeClient to stop forwarding them, as the document is being put into the page cache.
+        * loader/EmptyClients.h:
+        (WebCore::EmptyChromeClient::needTouchEvents): Add an empty implementation.
+        * page/ChromeClient.h: Add the needTouchEvents() function.
+
 2010-01-29  Alexander Pavlov  <apavlov at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index c22055f..2c76ca5 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -1518,6 +1518,17 @@ void Document::detach()
         FrameView* view = m_frame->view();
         if (view)
             view->detachCustomScrollbars();
+
+#if ENABLE(TOUCH_EVENTS)
+        Page* ownerPage = page();
+        if (ownerPage && (m_frame == ownerPage->mainFrame())) {
+            // Inform the Chrome Client that it no longer needs to
+            // foward touch events to WebCore as the document is being
+            // destroyed. It may start again if a subsequent page
+            // registers a touch event listener.
+            ownerPage->chrome()->client()->needTouchEvents(false);
+        }
+#endif
     }
 
     // indicate destruction mode,  i.e. attached() but renderer == 0
@@ -3069,11 +3080,16 @@ void Document::addListenerTypeIfNeeded(const AtomicString& eventType)
         addListenerType(TRANSITIONEND_LISTENER);
     else if (eventType == eventNames().beforeloadEvent)
         addListenerType(BEFORELOAD_LISTENER);
+#if ENABLE(TOUCH_EVENTS)
     else if (eventType == eventNames().touchstartEvent
              || eventType == eventNames().touchmoveEvent
              || eventType == eventNames().touchendEvent
-             || eventType == eventNames().touchcancelEvent)
+             || eventType == eventNames().touchcancelEvent) {
         addListenerType(TOUCH_LISTENER);
+        if (Page* page = this->page())
+            page->chrome()->client()->needTouchEvents(true);
+    }
+#endif
 }
 
 CSSStyleDeclaration* Document::getOverrideStyle(Element*, const String&)
diff --git a/WebCore/history/CachedFrame.cpp b/WebCore/history/CachedFrame.cpp
index e889990..a7261dd 100644
--- a/WebCore/history/CachedFrame.cpp
+++ b/WebCore/history/CachedFrame.cpp
@@ -42,6 +42,12 @@
 #include "SVGDocumentExtensions.h"
 #endif
 
+#if ENABLE(TOUCH_EVENTS)
+#include "Chrome.h"
+#include "ChromeClient.h"
+#include "Page.h"
+#endif
+
 namespace WebCore {
 
 #ifndef NDEBUG
@@ -100,6 +106,10 @@ void CachedFrameBase::restore()
         m_childFrames[i]->open();
 
     m_document->dispatchWindowEvent(PageTransitionEvent::create(eventNames().pageshowEvent, true), m_document);
+#if ENABLE(TOUCH_EVENTS)
+    if (m_document->hasListenerType(Document::TOUCH_LISTENER))
+        m_document->page()->chrome()->client()->needTouchEvents(true);
+#endif
 }
 
 CachedFrame::CachedFrame(Frame* frame)
@@ -145,6 +155,11 @@ CachedFrame::CachedFrame(Frame* frame)
     else
         LOG(PageCache, "Finished creating CachedFrame for child frame with url '%s' and DocumentLoader %p\n", m_url.string().utf8().data(), m_documentLoader.get());
 #endif
+
+#if ENABLE(TOUCH_EVENTS)
+    if (m_document->hasListenerType(Document::TOUCH_LISTENER))
+        m_document->page()->chrome()->client()->needTouchEvents(false);
+#endif
 }
 
 void CachedFrame::open()
diff --git a/WebCore/loader/EmptyClients.h b/WebCore/loader/EmptyClients.h
index a69339b..c0b06d5 100644
--- a/WebCore/loader/EmptyClients.h
+++ b/WebCore/loader/EmptyClients.h
@@ -165,6 +165,10 @@ public:
     virtual void setNeedsOneShotDrawingSynchronization() {};
     virtual void scheduleCompositingLayerSync() {};
 #endif
+
+#if ENABLE(TOUCH_EVENTS)
+    virtual void needTouchEvents(bool) { }
+#endif
 };
 
 class EmptyFrameLoaderClient : public FrameLoaderClient, public Noncopyable {
diff --git a/WebCore/page/ChromeClient.h b/WebCore/page/ChromeClient.h
index 1052ea6..db52c9d 100644
--- a/WebCore/page/ChromeClient.h
+++ b/WebCore/page/ChromeClient.h
@@ -221,6 +221,10 @@ namespace WebCore {
         virtual void willPopUpMenu(NSMenu *) { }
 #endif
 
+#if ENABLE(TOUCH_EVENTS)
+        virtual void needTouchEvents(bool) = 0;
+#endif
+
     protected:
         virtual ~ChromeClient() { }
     };
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 67e76dc..170665a 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-29  Ben Murdoch  <benm at google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        [Android] Android needs functionality in the ChromeClient to be informed when touch events are and are not needed by the webpage.
+        https://bugs.webkit.org/show_bug.cgi?id=34215
+
+        Add needTouchEvents() to the ChromeClient which is called when the page decides it needs or no longer needs to be informed of touch events.
+
+        * WebCoreSupport/ChromeClientQt.h:
+        (WebCore::ChromeClientQt::needTouchEvents): Add an empty implementation.
+
 2010-01-29  Kenneth Rohde Christiansen  <kenneth at webkit.org>
 
         Reviewed by Simon Hausmann
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index d60ec06..7699349 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -132,6 +132,10 @@ namespace WebCore {
         virtual void scheduleCompositingLayerSync();
 #endif
 
+#if ENABLE(TOUCH_EVENTS)
+        virtual void needTouchEvents(bool) { }
+#endif
+
         virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
 
         virtual void formStateDidChange(const Node*) { }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list