diff options
author | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2009-09-24 12:56:11 (GMT) |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2009-09-24 12:56:11 (GMT) |
commit | 512d332d21860b1d08e86d6de96b80ce12d742bf (patch) | |
tree | 339a6f5962b587b198f2ed21bf9f64ac338b66eb /src/3rdparty/webkit/WebCore/loader/appcache | |
parent | cb89aab6b29fd5761f3b9d41354abcde11e103dc (diff) | |
download | Qt-512d332d21860b1d08e86d6de96b80ce12d742bf.zip Qt-512d332d21860b1d08e86d6de96b80ce12d742bf.tar.gz Qt-512d332d21860b1d08e86d6de96b80ce12d742bf.tar.bz2 |
Updated WebKit from /home/joce/dev/qtwebkit3/ to qtwebkit-4.6-snapshot-24092009 ( 75c44947a340d74a9e0098a3dfffabce0c9512ef )
Changes in WebKit/qt since the last update:
++ b/WebKit/qt/ChangeLog
2009-09-24 Martin Smith <msmith@trolltech.com>
Reviewed by Simon Hausmann.
qdoc: Added \brief texts to all the since 4.6 functions.
* Api/qwebhistory.cpp:
2009-09-23 J-P Nurmi <jpnurmi@gmail.com>
Reviewed by Simon Hausmann.
Prevent QWebPage::setView() from changing the viewport size on the fly
in case the view doesn't actually change. QWebPage::setView() is
called upon every QWebGraphicsItem::hoverMoveEvent(), which forced
the viewport size to be equal to the size of the whole graphics view.
https://bugs.webkit.org/show_bug.cgi?id=29676
* Api/qwebpage.cpp:
(QWebPage::setView):
2009-09-23 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed by Simon Hausmann.
[Qt] Crash fix in QWebHistory back and forward methods.
QWebHistory::back() and QWebHistory::forward() were crashing on
ASSERT in WebCore::BackForwardList. The methods should check
canGoBack() and canGoForward() at the beginning.
https://bugs.webkit.org/show_bug.cgi?id=29675
* Api/qwebhistory.cpp:
(QWebHistory::back):
(QWebHistory::forward):
2009-09-23 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed by Simon Hausmann.
[Qt] Bug fix. QWebHistory should call QWebPage::updateNavigationActions
In QWebHistory's methods that change item count or current item call
to QWebPage::updateNavigationActions should be executed.
QWebHistory::clear() and QWebHistory::restorState() were changed.
New helper method, QWebPagePrivate accesor, were created in
QWebHistoryPrivate class.
Two autotest were developed.
https://bugs.webkit.org/show_bug.cgi?id=29246
* Api/qwebhistory.cpp:
(QWebHistory::clear):
(QWebHistory::restoreState):
(QWebHistoryPrivate::page):
* Api/qwebhistory_p.h:
* tests/qwebhistory/tst_qwebhistory.cpp:
(tst_QWebHistory::saveAndRestore_1):
(tst_QWebHistory::clear):
2009-09-23 Norbert Leser <norbert.leser@nokia.com>
Reviewed by Tor Arne Vestbø.
Need to guard QX11Info include with Q_WS_X11.
That class may not be available (in QT 4.5 for Symbian, for instance).
Completes fixes in r48627 and r48604.
* Api/qwebgraphicsitem.cpp:
* Api/qwebview.cpp:
2009-09-22 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by Simon Hausmann.
[Qt] Add default timeout while waiting for signals in QWebPage auto
tests.
https://bugs.webkit.org/show_bug.cgi?id=29637
* tests/qwebpage/tst_qwebpage.cpp:
(waitForSignal):
2009-09-22 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
Reivewed by Simon Hausmann.
Fix the Qt/Mac build after r48604 (Implement new QWebPageClient class)
There's no QWidget::x11Info() on Mac, and setPlatformPluginWidget()
takes a QWidget*, not a QWebPageClient*
* Api/qwebgraphicsitem.cpp:
(QWebGraphicsItemPrivate::screenNumber):
* Api/qwebview.cpp:
(QWebViewPrivate::screenNumber):
2009-09-21 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Simon Hausmann.
For Qt, platformPageClient() will now return a class derived from
the QWebPageClient, so the patch adapts our Qt hooks to go though
this class and not depend on the QWebView.
* Api/qwebgraphicsitem.cpp:
(QWebGraphicsItemPrivate::scroll):
(QWebGraphicsItemPrivate::update):
(QWebGraphicsItemPrivate::cursor):
(QWebGraphicsItemPrivate::updateCursor):
(QWebGraphicsItemPrivate::screenNumber):
(QWebGraphicsItemPrivate::winId):
(QWebGraphicsItem::event):
(QWebGraphicsItem::setPage):
* Api/qwebgraphicsitem.h:
* Api/qwebpage.cpp:
(QWebPagePrivate::QWebPagePrivate):
* Api/qwebpage_p.h:
* Api/qwebview.cpp:
(QWebViewPrivate::scroll):
(QWebViewPrivate::update):
(QWebViewPrivate::cursor):
(QWebViewPrivate::updateCursor):
(QWebViewPrivate::screenNumber):
(QWebViewPrivate::winId):
(QWebView::setPage):
(QWebView::event):
* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::repaint):
(WebCore::ChromeClientQt::scroll):
(WebCore::ChromeClientQt::platformPageClient):
2009-09-21 Yael Aharon <yael.aharon@nokia.com>
Reviewed by Simon Hausmann.
https://bugs.webkit.org/show_bug.cgi?id=29609
Build fix for windows when using Qt 4.5.0.
* Api/qwebpage.cpp:
(QWebPage::userAgentForUrl):
2009-09-19 Benjamin Poulain <benjamin.poulain@nokia.com>
Reviewed by Simon Hausmann.
https://bugs.webkit.org/show_bug.cgi?id=29345
The tests of QWebFrame did not use QTRY_VERIFY for
tests involving the event loop.
* tests/qwebframe/tst_qwebframe.cpp:
* tests/util.h: Added. Copy of tests/shared/util.h of Qt
2009-09-19 Jakub Wieczorek <faw217@gmail.com>
Reviewed by Simon Hausmann.
[Qt] Add an autotest stub for QWebGraphicsItem.
It just calls all the functions and makes sure they don't crash.
* tests/qwebgraphicsitem/qwebgraphicsitem.pro: Added.
* tests/qwebgraphicsitem/tst_qwebgraphicsitem.cpp: Added.
(tst_QWebGraphicsItem::qwebgraphicsitem):
* tests/tests.pro:
2009-09-18 Norbert Leser <norbert.leser@nokia.com>
Reviewed by Eric Seidel.
Corrected the Symbian specific UID3 values to be assigned
from the "unprotected" pool that permits self-signing of
those test and demo executables. (Added new UID3 values
where they were missing for new components.)
* QGVLauncher/QGVLauncher.pro:
* QtLauncher/QtLauncher.pro:
* tests/benchmarks/loading/tst_loading.pro:
* tests/benchmarks/painting/tst_painting.pro:
* tests/qwebelement/qwebelement.pro:
* tests/qwebframe/qwebframe.pro:
* tests/qwebhistory/qwebhistory.pro:
* tests/qwebhistoryinterface/qwebhistoryinterface.pro:
* tests/qwebpage/qwebpage.pro:
* tests/qwebplugindatabase/qwebplugindatabase.pro:
* tests/qwebview/qwebview.pro:
2009-09-17 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Simon Hausmann.
Make PlatformWindow return something else than PlatformWidget
https://bugs.webkit.org/show_bug.cgi?id=29085
Reflect the rename of platformWindow and it's return type.
* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::platformPageClient):
* WebCoreSupport/ChromeClientQt.h:
2009-09-18 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by Simon Hausmann.
[Qt] Add persistence support for configuration options in the
inspector.
* Api/qwebinspector.cpp:
* QtLauncher/main.cpp:
(main):
* WebCoreSupport/InspectorClientQt.cpp:
(WebCore::InspectorClientQt::populateSetting):
(WebCore::InspectorClientQt::storeSetting):
(WebCore::variantToSetting):
(WebCore::settingToVariant):
2009-09-17 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Simon Hausmann.
Improve documentation for Page Cache.
* Api/qwebsettings.cpp:
2009-09-17 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
Reviewed by Simon Hausmann.
[Qt] Update QWebSettings::setUserStyleSheetUrl() docs and test
https://bugs.webkit.org/show_bug.cgi?id=29081
The documentation now specifies that the URL has to be a local file
or a a data-URL (with utf-8 and base64-encoded data), as these are the
only two schemes that the current code path accepts.
The auto-test has been updated to reflect this limitation.
At a later point we should concider adding API for the new way of
doing both user defined stylesheets and scripts.
* Api/qwebsettings.cpp:
* tests/qwebpage/tst_qwebpage.cpp:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/loader/appcache')
6 files changed, 30 insertions, 139 deletions
diff --git a/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheGroup.cpp b/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheGroup.cpp index d18dcf2..ed27ba0 100644 --- a/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheGroup.cpp +++ b/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheGroup.cpp @@ -774,7 +774,7 @@ void ApplicationCacheGroup::checkIfLoadIsComplete() ASSERT(cacheStorage().isMaximumSizeReached() && m_calledReachedMaxAppCacheSize); } - RefPtr<ApplicationCache> oldNewestCache = (m_newestCache == m_cacheBeingUpdated) ? 0 : m_newestCache; + RefPtr<ApplicationCache> oldNewestCache = (m_newestCache == m_cacheBeingUpdated) ? RefPtr<ApplicationCache>(0) : m_newestCache; setNewestCache(m_cacheBeingUpdated.release()); if (cacheStorage().storeNewestCache(this)) { @@ -962,7 +962,7 @@ public: ASSERT(frame->loader()->documentLoader() == m_documentLoader.get()); - m_documentLoader->applicationCacheHost()->notifyEventListener(m_eventID); + m_documentLoader->applicationCacheHost()->notifyDOMApplicationCache(m_eventID); } private: diff --git a/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheHost.cpp b/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheHost.cpp index 992f9e9..751efc1 100644 --- a/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheHost.cpp +++ b/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheHost.cpp @@ -227,10 +227,13 @@ void ApplicationCacheHost::setDOMApplicationCache(DOMApplicationCache* domApplic m_domApplicationCache = domApplicationCache; } -void ApplicationCacheHost::notifyEventListener(EventID id) +void ApplicationCacheHost::notifyDOMApplicationCache(EventID id) { - if (m_domApplicationCache) - m_domApplicationCache->callEventListener(id); + if (m_domApplicationCache) { + ExceptionCode ec = 0; + m_domApplicationCache->dispatchEvent(Event::create(DOMApplicationCache::toEventType(id), false, false), ec); + ASSERT(!ec); + } } void ApplicationCacheHost::setCandidateApplicationCacheGroup(ApplicationCacheGroup* group) diff --git a/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheHost.h b/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheHost.h index cb68862..236013d 100644 --- a/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheHost.h +++ b/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheHost.h @@ -108,7 +108,7 @@ namespace WebCore { bool swapCache(); void setDOMApplicationCache(DOMApplicationCache* domApplicationCache); - void notifyEventListener(EventID id); + void notifyDOMApplicationCache(EventID id); private: bool isApplicationCacheEnabled(); diff --git a/src/3rdparty/webkit/WebCore/loader/appcache/DOMApplicationCache.cpp b/src/3rdparty/webkit/WebCore/loader/appcache/DOMApplicationCache.cpp index dd0aed9..29c1bd5 100644 --- a/src/3rdparty/webkit/WebCore/loader/appcache/DOMApplicationCache.cpp +++ b/src/3rdparty/webkit/WebCore/loader/appcache/DOMApplicationCache.cpp @@ -91,73 +91,6 @@ ScriptExecutionContext* DOMApplicationCache::scriptExecutionContext() const return m_frame->document(); } -void DOMApplicationCache::addEventListener(const AtomicString& eventType, PassRefPtr<EventListener> eventListener, bool) -{ - EventListenersMap::iterator iter = m_eventListeners.find(eventType); - if (iter == m_eventListeners.end()) { - ListenerVector listeners; - listeners.append(eventListener); - m_eventListeners.add(eventType, listeners); - } else { - ListenerVector& listeners = iter->second; - for (ListenerVector::iterator listenerIter = listeners.begin(); listenerIter != listeners.end(); ++listenerIter) { - if (**listenerIter == *eventListener) - return; - } - - listeners.append(eventListener); - m_eventListeners.add(eventType, listeners); - } -} - -void DOMApplicationCache::removeEventListener(const AtomicString& eventType, EventListener* eventListener, bool) -{ - EventListenersMap::iterator iter = m_eventListeners.find(eventType); - if (iter == m_eventListeners.end()) - return; - - ListenerVector& listeners = iter->second; - for (ListenerVector::const_iterator listenerIter = listeners.begin(); listenerIter != listeners.end(); ++listenerIter) { - if (**listenerIter == *eventListener) { - listeners.remove(listenerIter - listeners.begin()); - return; - } - } -} - -bool DOMApplicationCache::dispatchEvent(PassRefPtr<Event> event, ExceptionCode& ec) -{ - if (!event || event->type().isEmpty()) { - ec = EventException::UNSPECIFIED_EVENT_TYPE_ERR; - return true; - } - - ListenerVector listenersCopy = m_eventListeners.get(event->type()); - for (ListenerVector::const_iterator listenerIter = listenersCopy.begin(); listenerIter != listenersCopy.end(); ++listenerIter) { - event->setTarget(this); - event->setCurrentTarget(this); - listenerIter->get()->handleEvent(event.get(), false); - } - - return !event->defaultPrevented(); -} - -void DOMApplicationCache::callListener(const AtomicString& eventType, EventListener* listener) -{ - ASSERT(m_frame); - - RefPtr<Event> event = Event::create(eventType, false, false); - if (listener) { - event->setTarget(this); - event->setCurrentTarget(this); - listener->handleEvent(event.get(), false); - } - - ExceptionCode ec = 0; - dispatchEvent(event.release(), ec); - ASSERT(!ec); -} - const AtomicString& DOMApplicationCache::toEventType(ApplicationCacheHost::EventID id) { switch (id) { @@ -182,27 +115,14 @@ const AtomicString& DOMApplicationCache::toEventType(ApplicationCacheHost::Event return eventNames().errorEvent; } -ApplicationCacheHost::EventID DOMApplicationCache::toEventID(const AtomicString& eventType) +EventTargetData* DOMApplicationCache::eventTargetData() { - if (eventType == eventNames().checkingEvent) - return ApplicationCacheHost::CHECKING_EVENT; - if (eventType == eventNames().errorEvent) - return ApplicationCacheHost::ERROR_EVENT; - if (eventType == eventNames().noupdateEvent) - return ApplicationCacheHost::NOUPDATE_EVENT; - if (eventType == eventNames().downloadingEvent) - return ApplicationCacheHost::DOWNLOADING_EVENT; - if (eventType == eventNames().progressEvent) - return ApplicationCacheHost::PROGRESS_EVENT; - if (eventType == eventNames().updatereadyEvent) - return ApplicationCacheHost::UPDATEREADY_EVENT; - if (eventType == eventNames().cachedEvent) - return ApplicationCacheHost::CACHED_EVENT; - if (eventType == eventNames().obsoleteEvent) - return ApplicationCacheHost::OBSOLETE_EVENT; - - ASSERT_NOT_REACHED(); - return ApplicationCacheHost::ERROR_EVENT; + return &m_eventTargetData; +} + +EventTargetData* DOMApplicationCache::ensureEventTargetData() +{ + return &m_eventTargetData; } } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/loader/appcache/DOMApplicationCache.h b/src/3rdparty/webkit/WebCore/loader/appcache/DOMApplicationCache.h index 09e9a03..077cae0 100644 --- a/src/3rdparty/webkit/WebCore/loader/appcache/DOMApplicationCache.h +++ b/src/3rdparty/webkit/WebCore/loader/appcache/DOMApplicationCache.h @@ -30,8 +30,9 @@ #include "ApplicationCacheHost.h" #include "AtomicStringHash.h" -#include "EventTarget.h" #include "EventListener.h" +#include "EventNames.h" +#include "EventTarget.h" #include <wtf/HashMap.h> #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> @@ -55,72 +56,39 @@ public: void update(ExceptionCode&); void swapCache(ExceptionCode&); - // Event listener attributes by EventID - - void setAttributeEventListener(ApplicationCacheHost::EventID id, PassRefPtr<EventListener> eventListener) { m_attributeEventListeners[id] = eventListener; } - EventListener* getAttributeEventListener(ApplicationCacheHost::EventID id) const { return m_attributeEventListeners[id].get(); } - void clearAttributeEventListener(ApplicationCacheHost::EventID id) { m_attributeEventListeners[id] = 0; } - void callEventListener(ApplicationCacheHost::EventID id) { callListener(toEventType(id), getAttributeEventListener(id)); } - // EventTarget impl - virtual void addEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, bool useCapture); - virtual void removeEventListener(const AtomicString& eventType, EventListener*, bool useCapture); - virtual bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&); - typedef Vector<RefPtr<EventListener> > ListenerVector; - typedef HashMap<AtomicString, ListenerVector> EventListenersMap; - EventListenersMap& eventListeners() { return m_eventListeners; } - using RefCounted<DOMApplicationCache>::ref; using RefCounted<DOMApplicationCache>::deref; // Explicitly named attribute event listener helpers - void setOnchecking(PassRefPtr<EventListener> listener) { setAttributeEventListener(ApplicationCacheHost::CHECKING_EVENT, listener); } - EventListener* onchecking() const { return getAttributeEventListener(ApplicationCacheHost::CHECKING_EVENT); } - - void setOnerror(PassRefPtr<EventListener> listener) { setAttributeEventListener(ApplicationCacheHost::ERROR_EVENT, listener);} - EventListener* onerror() const { return getAttributeEventListener(ApplicationCacheHost::ERROR_EVENT); } - - void setOnnoupdate(PassRefPtr<EventListener> listener) { setAttributeEventListener(ApplicationCacheHost::NOUPDATE_EVENT, listener); } - EventListener* onnoupdate() const { return getAttributeEventListener(ApplicationCacheHost::NOUPDATE_EVENT); } - - void setOndownloading(PassRefPtr<EventListener> listener) { setAttributeEventListener(ApplicationCacheHost::DOWNLOADING_EVENT, listener); } - EventListener* ondownloading() const { return getAttributeEventListener(ApplicationCacheHost::DOWNLOADING_EVENT); } - - void setOnprogress(PassRefPtr<EventListener> listener) { setAttributeEventListener(ApplicationCacheHost::PROGRESS_EVENT, listener); } - EventListener* onprogress() const { return getAttributeEventListener(ApplicationCacheHost::PROGRESS_EVENT); } - - void setOnupdateready(PassRefPtr<EventListener> listener) { setAttributeEventListener(ApplicationCacheHost::UPDATEREADY_EVENT, listener); } - EventListener* onupdateready() const { return getAttributeEventListener(ApplicationCacheHost::UPDATEREADY_EVENT); } - - void setOncached(PassRefPtr<EventListener> listener) { setAttributeEventListener(ApplicationCacheHost::CACHED_EVENT, listener); } - EventListener* oncached() const { return getAttributeEventListener(ApplicationCacheHost::CACHED_EVENT); } - - void setOnobsolete(PassRefPtr<EventListener> listener) { setAttributeEventListener(ApplicationCacheHost::OBSOLETE_EVENT, listener); } - EventListener* onobsolete() const { return getAttributeEventListener(ApplicationCacheHost::OBSOLETE_EVENT); } + DEFINE_ATTRIBUTE_EVENT_LISTENER(checking); + DEFINE_ATTRIBUTE_EVENT_LISTENER(error); + DEFINE_ATTRIBUTE_EVENT_LISTENER(noupdate); + DEFINE_ATTRIBUTE_EVENT_LISTENER(downloading); + DEFINE_ATTRIBUTE_EVENT_LISTENER(progress); + DEFINE_ATTRIBUTE_EVENT_LISTENER(updateready); + DEFINE_ATTRIBUTE_EVENT_LISTENER(cached); + DEFINE_ATTRIBUTE_EVENT_LISTENER(obsolete); virtual ScriptExecutionContext* scriptExecutionContext() const; DOMApplicationCache* toDOMApplicationCache() { return this; } static const AtomicString& toEventType(ApplicationCacheHost::EventID id); - static ApplicationCacheHost::EventID toEventID(const AtomicString& eventType); private: DOMApplicationCache(Frame*); - void callListener(const AtomicString& eventType, EventListener*); - virtual void refEventTarget() { ref(); } virtual void derefEventTarget() { deref(); } + virtual EventTargetData* eventTargetData(); + virtual EventTargetData* ensureEventTargetData(); ApplicationCacheHost* applicationCacheHost() const; - - RefPtr<EventListener> m_attributeEventListeners[ApplicationCacheHost::OBSOLETE_EVENT + 1]; - - EventListenersMap m_eventListeners; Frame* m_frame; + EventTargetData m_eventTargetData; }; } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/loader/appcache/DOMApplicationCache.idl b/src/3rdparty/webkit/WebCore/loader/appcache/DOMApplicationCache.idl index ebc1d19..dd5468a 100644 --- a/src/3rdparty/webkit/WebCore/loader/appcache/DOMApplicationCache.idl +++ b/src/3rdparty/webkit/WebCore/loader/appcache/DOMApplicationCache.idl @@ -27,7 +27,7 @@ module offline { interface [ Conditional=OFFLINE_WEB_APPLICATIONS, - CustomMarkFunction + EventTarget ] DOMApplicationCache { // update status const unsigned short UNCACHED = 0; |