summaryrefslogtreecommitdiff
path: root/Source/WebKit2
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2')
-rw-r--r--Source/WebKit2/ChangeLog197
-rw-r--r--Source/WebKit2/GNUmakefile.am2
-rw-r--r--Source/WebKit2/Shared/APIClientTraits.cpp5
-rw-r--r--Source/WebKit2/Shared/APIClientTraits.h5
-rw-r--r--Source/WebKit2/Shared/CoreIPCSupport/InjectedBundleMessageKinds.h3
-rw-r--r--Source/WebKit2/Shared/WebPageCreationParameters.h2
-rw-r--r--Source/WebKit2/Shared/WebPreferencesStore.h7
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPage.cpp28
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPage.h2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitTextChecker.cpp24
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitTextChecker.h7
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp33
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h6
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp45
-rw-r--r--Source/WebKit2/UIProcess/WebBackForwardList.cpp8
-rw-r--r--Source/WebKit2/UIProcess/WebBackForwardList.h10
-rw-r--r--Source/WebKit2/UIProcess/WebContext.cpp20
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.cpp11
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.h8
-rw-r--r--Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm7
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.h8
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp24
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h1
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.cpp8
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h1
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.cpp17
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.h2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm1
-rw-r--r--Source/WebKit2/WebProcess/qt/QtBuiltinBundle.cpp3
-rw-r--r--Source/WebKit2/WebProcess/qt/WebProcessQt.cpp5
-rw-r--r--Source/WebKit2/win/WebKit2.def2
-rw-r--r--Source/WebKit2/win/WebKit2CFLite.def2
32 files changed, 405 insertions, 99 deletions
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index d147a0461..55fef59da 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,200 @@
+2012-08-23 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [WK2] Refactoring: WebBackForwardList getters should be const
+ https://bugs.webkit.org/show_bug.cgi?id=94711
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Before the change were not consistent with each other
+ (WebBackForwardList::entries() was const but WebBackForwardList::currentIndex() was not).
+ Besides having not const getters is not a good practice in C++. (Please read
+ Scott Meyers. Effective C++ (3rd edition). ISBN: 0-321-33487-6.
+ Item 3: 'Use const whenever possible').
+
+ * UIProcess/WebBackForwardList.cpp:
+ (WebKit::WebBackForwardList::backListCount):
+ (WebKit::WebBackForwardList::forwardListCount):
+ (WebKit::WebBackForwardList::backListAsImmutableArrayWithLimit):
+ (WebKit::WebBackForwardList::forwardListAsImmutableArrayWithLimit):
+ * UIProcess/WebBackForwardList.h:
+ (WebKit::WebBackForwardList::currentIndex):
+ (WebBackForwardList):
+
+2012-08-22 Nikhil Bhargava <nbhargava@google.com>
+
+ Reduce Font.h includes across project -- improves RenderObject.h compile time
+ https://bugs.webkit.org/show_bug.cgi?id=93629
+
+ Reviewed by Eric Seidel.
+
+ Adds includes due to change in RenderStyle.h
+
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+
+2012-08-22 Beth Dakin <bdakin@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=94401
+ Add support for making a web site become paginated using overflow:
+ paged-x | paged-y
+ -and corresponding-
+ <rdar://problem/11831783>
+
+ Reviewed by Dave Hyatt.
+
+ WebCore::Page::Pagination is now just WebCore::Pagination.
+ * Shared/WebPageCreationParameters.h:
+ (WebPageCreationParameters):
+ * UIProcess/API/C/WKPage.cpp:
+ (WKPageSetPaginationMode):
+ (WKPageGetPaginationMode):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::WebPageProxy):
+ (WebKit::WebPageProxy::setPaginationMode):
+ * UIProcess/WebPageProxy.h:
+ (WebPageProxy):
+ (WebKit::WebPageProxy::paginationMode):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::setPaginationMode):
+ (WebKit::WebPage::setPaginationBehavesLikeColumns):
+ (WebKit::WebPage::setPageLength):
+ (WebKit::WebPage::setGapBetweenPages):
+ * WebProcess/WebPage/WebPage.h:
+ (WebPage):
+
+2012-08-22 Jer Noble <jer.noble@apple.com>
+
+ Browser menu visible when calling webkitRequestFullscreen after user manually enters full screen mode
+ https://bugs.webkit.org/show_bug.cgi?id=93892
+
+ Reviewed by Eric Carlson.
+
+ Allow the full screen window to "Join All Spaces", so that once it's original full screen space is destroyed,
+ it can join the new one.
+
+ * UIProcess/mac/WKFullScreenWindowController.mm:
+ (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
+
+2012-08-22 Alexey Proskuryakov <ap@apple.com>
+
+ [WK2] Support posting injected bundle messages to a page
+ https://bugs.webkit.org/show_bug.cgi?id=94630
+
+ Reviewed by Sam Weinig.
+
+ * Shared/APIClientTraits.cpp:
+ * Shared/APIClientTraits.h:
+ * Shared/CoreIPCSupport/InjectedBundleMessageKinds.h:
+ * UIProcess/API/C/WKPage.cpp:
+ (WKPagePostMessageToInjectedBundle):
+ * UIProcess/API/C/WKPage.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::postMessageToInjectedBundle):
+ * UIProcess/WebPageProxy.h:
+ * WebProcess/InjectedBundle/API/c/WKBundle.h:
+ * WebProcess/InjectedBundle/InjectedBundle.cpp:
+ (WebKit::InjectedBundle::didReceiveMessageToPage):
+ (WebKit::InjectedBundle::didReceiveMessage):
+ * WebProcess/InjectedBundle/InjectedBundle.h:
+ * WebProcess/InjectedBundle/InjectedBundleClient.cpp:
+ (WebKit::InjectedBundleClient::didReceiveMessageToPage):
+ * WebProcess/InjectedBundle/InjectedBundleClient.h:
+ (InjectedBundleClient):
+ Added a PostMessageToPage injected bundle message type, with all associated
+ machinery. API is WKPagePostMessageToInjectedBundle(), and an associated
+ didReceiveMessageToPage() injected bundle client function.
+
+ * WebProcess/qt/QtBuiltinBundle.cpp: (WebKit::QtBuiltinBundle::initialize):
+ Updated for new client API.
+
+ * UIProcess/WebContext.cpp: (WebKit::WebContext::postMessageToInjectedBundle):
+ Implemented multiple process model case.
+
+2012-08-22 Gustavo Noronha Silva <gns@gnome.org>
+
+ [GTK] Split WebCore/platform into a separate library
+ https://bugs.webkit.org/show_bug.cgi?id=94435
+
+ Reviewed by Martin Robinson.
+
+ More people have been reporting problems when linking WebCore because
+ the command line limit is being exceeded. Splitting WebCore a bit more
+ is in order.
+
+ * GNUmakefile.am: link libWebCorePlatform into libwebkit2gtk
+
+2012-08-22 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Preferred languages and spellchecker APIs are not consistent in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=94683
+
+ Reviewed by Alejandro G. Castro.
+
+ Change spell-checker and preferred languages API to use a GStrv
+ instead of a comma-separated string and GList. This makes the API
+ more consistent and convenient to use.
+
+ * UIProcess/API/gtk/WebKitTextChecker.cpp:
+ (WebKitTextChecker::getSpellCheckingLanguages): Return a
+ Vector<String> instead of a String.
+ (WebKitTextChecker::setSpellCheckingLanguages): Receive a
+ Vector<String> instead of a String.
+ * UIProcess/API/gtk/WebKitTextChecker.h:
+ (WebKitTextChecker): Use a GPtrArray to cache languages.
+ * UIProcess/API/gtk/WebKitWebContext.cpp:
+ (webkit_web_context_get_spell_checking_languages):
+ (webkit_web_context_set_spell_checking_languages):
+ (webkit_web_context_set_preferred_languages):
+ * UIProcess/API/gtk/WebKitWebContext.h:
+ * UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:
+ (testWebContextSpellChecker):
+ (testWebContextLanguages):
+
+2012-08-22 Csaba Osztrogonác <ossy@webkit.org>
+
+ [Qt][WK2] Enable runtime enabled features: DeviceMotion and DeviceOrientation
+ https://bugs.webkit.org/show_bug.cgi?id=94692
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * WebProcess/qt/WebProcessQt.cpp:
+ (WebKit::WebProcess::platformInitializeWebProcess):
+
+2012-08-22 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ Wrong default for new ScrollAnimatorEnabled preference.
+
+ Reviewed by Simon Hausmann.
+
+ ScrollAnimatorEnabled introduced in r126291, should default to 'true'
+ to preserve existing behaviour on WK2 platforms that already enabled
+ SMOOTH_SCROLLING unconditionally.
+
+ * Shared/WebPreferencesStore.h:
+ (WebKit):
+
+2012-08-22 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ Unreviewed, build fixup for r126291.
+
+ * Shared/WebPreferencesStore.h:
+ (WebKit):
+
+2012-08-22 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ [Qt] Optionally support smooth-scrolling on all platforms
+ https://bugs.webkit.org/show_bug.cgi?id=74926
+
+ Reviewed by Simon Hausmann.
+
+ Expose scroll-animator preference, but ensure animated smooth scrolling
+ on the web process side is disabled when scrolling has been delegated
+ to the UI process.
+
+ * Shared/WebPreferencesStore.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::setResizesToContentsUsingLayoutSize):
+ (WebKit::WebPage::updatePreferences):
+
2012-08-22 Luiz Agostini <luiz.agostini@nokia.com>
[Qt] Avoid using WebKit macros in qrawwebview_p.h
diff --git a/Source/WebKit2/GNUmakefile.am b/Source/WebKit2/GNUmakefile.am
index ba0ac6955..7468a36aa 100644
--- a/Source/WebKit2/GNUmakefile.am
+++ b/Source/WebKit2/GNUmakefile.am
@@ -158,6 +158,7 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LDF
libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD = \
-lpthread \
libWebCore.la \
+ libWebCorePlatform.la \
libWebCoreModules.la \
libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
libWebCoreGtk.la \
@@ -475,6 +476,7 @@ Programs_WebKitPluginProcess_LDADD = \
-lpthread \
libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
libWebCore.la \
+ libWebCorePlatform.la \
libWebCoreGtk2.la \
$(CAIRO_LIBS) \
$(COVERAGE_LDFLAGS) \
diff --git a/Source/WebKit2/Shared/APIClientTraits.cpp b/Source/WebKit2/Shared/APIClientTraits.cpp
index 1926be817..ad3d22091 100644
--- a/Source/WebKit2/Shared/APIClientTraits.cpp
+++ b/Source/WebKit2/Shared/APIClientTraits.cpp
@@ -31,6 +31,11 @@
namespace WebKit {
+const size_t APIClientTraits<WKBundleClient>::interfaceSizesByVersion[] = {
+ offsetof(WKBundleClient, didReceiveMessageToPage),
+ sizeof(WKBundleClient)
+};
+
const size_t APIClientTraits<WKBundlePageLoaderClient>::interfaceSizesByVersion[] = {
offsetof(WKBundlePageLoaderClient, didLayoutForFrame),
offsetof(WKBundlePageLoaderClient, didFinishProgress),
diff --git a/Source/WebKit2/Shared/APIClientTraits.h b/Source/WebKit2/Shared/APIClientTraits.h
index e2cce1781..7352b5667 100644
--- a/Source/WebKit2/Shared/APIClientTraits.h
+++ b/Source/WebKit2/Shared/APIClientTraits.h
@@ -26,6 +26,7 @@
#ifndef APIClientTraits_h
#define APIClientTraits_h
+#include "WKBundle.h"
#include "WKBundlePage.h"
#include "WKContext.h"
#include "WKPage.h"
@@ -37,6 +38,10 @@ template <typename ClientInterface> struct APIClientTraits {
};
template <typename ClientInterface> const size_t APIClientTraits<ClientInterface>::interfaceSizesByVersion[] = { sizeof(ClientInterface) };
+template<> struct APIClientTraits<WKBundleClient> {
+ static const size_t interfaceSizesByVersion[2];
+};
+
template<> struct APIClientTraits<WKBundlePageLoaderClient> {
static const size_t interfaceSizesByVersion[4];
};
diff --git a/Source/WebKit2/Shared/CoreIPCSupport/InjectedBundleMessageKinds.h b/Source/WebKit2/Shared/CoreIPCSupport/InjectedBundleMessageKinds.h
index 1ddf0bf95..a1afd6987 100644
--- a/Source/WebKit2/Shared/CoreIPCSupport/InjectedBundleMessageKinds.h
+++ b/Source/WebKit2/Shared/CoreIPCSupport/InjectedBundleMessageKinds.h
@@ -33,7 +33,8 @@
namespace InjectedBundleMessage {
enum Kind {
- PostMessage
+ PostMessage,
+ PostMessageToPage
};
}
diff --git a/Source/WebKit2/Shared/WebPageCreationParameters.h b/Source/WebKit2/Shared/WebPageCreationParameters.h
index ce85dceca..97e88b607 100644
--- a/Source/WebKit2/Shared/WebPageCreationParameters.h
+++ b/Source/WebKit2/Shared/WebPageCreationParameters.h
@@ -67,7 +67,7 @@ struct WebPageCreationParameters {
bool useFixedLayout;
WebCore::IntSize fixedLayoutSize;
- WebCore::Page::Pagination::Mode paginationMode;
+ WebCore::Pagination::Mode paginationMode;
bool paginationBehavesLikeColumns;
double pageLength;
double gapBetweenPages;
diff --git a/Source/WebKit2/Shared/WebPreferencesStore.h b/Source/WebKit2/Shared/WebPreferencesStore.h
index af0812d40..569c5186d 100644
--- a/Source/WebKit2/Shared/WebPreferencesStore.h
+++ b/Source/WebKit2/Shared/WebPreferencesStore.h
@@ -48,6 +48,12 @@ namespace WebKit {
#define DEFAULT_WEBKIT_TABSTOLINKS_ENABLED false
#endif
+#if ENABLE(SMOOTH_SCROLLING) && !PLATFORM(QT)
+#define DEFAULT_WEBKIT_SCROLL_ANIMATOR_ENABLED true
+#else
+#define DEFAULT_WEBKIT_SCROLL_ANIMATOR_ENABLED false
+#endif
+
#define FOR_EACH_WEBKIT_BOOL_PREFERENCE(macro) \
macro(JavaScriptEnabled, javaScriptEnabled, Bool, bool, true) \
macro(LoadsImagesAutomatically, loadsImagesAutomatically, Bool, bool, true) \
@@ -119,6 +125,7 @@ namespace WebKit {
macro(ArtificialPluginInitializationDelayEnabled, artificialPluginInitializationDelayEnabled, Bool, bool, false) \
macro(ScrollingPerformanceLoggingEnabled, scrollingPerformanceLoggingEnabled, Bool, bool, false) \
macro(ThirdPartyStorageBlockingEnabled, thirdPartyStorageBlockingEnabled, Bool, bool, false) \
+ macro(ScrollAnimatorEnabled, scrollAnimatorEnabled, Bool, bool, DEFAULT_WEBKIT_SCROLL_ANIMATOR_ENABLED) \
\
#define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
diff --git a/Source/WebKit2/UIProcess/API/C/WKPage.cpp b/Source/WebKit2/UIProcess/API/C/WKPage.cpp
index a53a83161..437179bfb 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPage.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKPage.cpp
@@ -352,22 +352,22 @@ bool WKPageIsPinnedToRightSide(WKPageRef pageRef)
void WKPageSetPaginationMode(WKPageRef pageRef, WKPaginationMode paginationMode)
{
- Page::Pagination::Mode mode;
+ Pagination::Mode mode;
switch (paginationMode) {
case kWKPaginationModeUnpaginated:
- mode = Page::Pagination::Unpaginated;
+ mode = Pagination::Unpaginated;
break;
case kWKPaginationModeLeftToRight:
- mode = Page::Pagination::LeftToRightPaginated;
+ mode = Pagination::LeftToRightPaginated;
break;
case kWKPaginationModeRightToLeft:
- mode = Page::Pagination::RightToLeftPaginated;
+ mode = Pagination::RightToLeftPaginated;
break;
case kWKPaginationModeTopToBottom:
- mode = Page::Pagination::TopToBottomPaginated;
+ mode = Pagination::TopToBottomPaginated;
break;
case kWKPaginationModeBottomToTop:
- mode = Page::Pagination::BottomToTopPaginated;
+ mode = Pagination::BottomToTopPaginated;
break;
default:
return;
@@ -378,15 +378,15 @@ void WKPageSetPaginationMode(WKPageRef pageRef, WKPaginationMode paginationMode)
WKPaginationMode WKPageGetPaginationMode(WKPageRef pageRef)
{
switch (toImpl(pageRef)->paginationMode()) {
- case Page::Pagination::Unpaginated:
+ case Pagination::Unpaginated:
return kWKPaginationModeUnpaginated;
- case Page::Pagination::LeftToRightPaginated:
+ case Pagination::LeftToRightPaginated:
return kWKPaginationModeLeftToRight;
- case Page::Pagination::RightToLeftPaginated:
+ case Pagination::RightToLeftPaginated:
return kWKPaginationModeRightToLeft;
- case Page::Pagination::TopToBottomPaginated:
+ case Pagination::TopToBottomPaginated:
return kWKPaginationModeTopToBottom;
- case Page::Pagination::BottomToTopPaginated:
+ case Pagination::BottomToTopPaginated:
return kWKPaginationModeBottomToTop;
}
@@ -712,3 +712,9 @@ void WKPageSetMediaVolume(WKPageRef page, float volume)
{
toImpl(page)->setMediaVolume(volume);
}
+
+void WKPagePostMessageToInjectedBundle(WKPageRef pageRef, WKStringRef messageNameRef, WKTypeRef messageBodyRef)
+{
+ toImpl(pageRef)->postMessageToInjectedBundle(toImpl(messageNameRef)->string(), toImpl(messageBodyRef));
+}
+
diff --git a/Source/WebKit2/UIProcess/API/C/WKPage.h b/Source/WebKit2/UIProcess/API/C/WKPage.h
index ab3b8eede..f7946080b 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPage.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPage.h
@@ -489,6 +489,8 @@ typedef void (*WKPageValidateCommandCallback)(WKStringRef command, bool isEnable
WK_EXPORT void WKPageValidateCommand(WKPageRef page, WKStringRef command, void* context, WKPageValidateCommandCallback callback);
WK_EXPORT void WKPageExecuteCommand(WKPageRef page, WKStringRef command);
+WK_EXPORT void WKPagePostMessageToInjectedBundle(WKPageRef page, WKStringRef messageName, WKTypeRef messageBody);
+
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitTextChecker.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitTextChecker.cpp
index 5ae62c6fd..39f402227 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitTextChecker.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitTextChecker.cpp
@@ -29,8 +29,6 @@
#if ENABLE(SPELLCHECK)
#include "WebKitPrivate.h"
-#include <wtf/Vector.h>
-#include <wtf/text/CString.h>
using namespace WebKit;
@@ -140,15 +138,25 @@ void WebKitTextChecker::setSpellCheckingEnabled(bool enabled)
WKTextCheckerContinuousSpellCheckingEnabledStateChanged(enabled);
}
-const CString& WebKitTextChecker::getSpellCheckingLanguages()
+const char* const* WebKitTextChecker::getSpellCheckingLanguages()
{
- String spellCheckingLanguages = m_textChecker->getSpellCheckingLanguages();
- m_spellCheckingLanguages = spellCheckingLanguages.isEmpty() ? CString() : spellCheckingLanguages.utf8();
- return m_spellCheckingLanguages;
+ Vector<String> spellCheckingLanguages = m_textChecker->getSpellCheckingLanguages();
+ if (spellCheckingLanguages.isEmpty())
+ return 0;
+
+ m_spellCheckingLanguages = adoptGRef(g_ptr_array_new_with_free_func(g_free));
+ for (size_t i = 0; i < spellCheckingLanguages.size(); ++i)
+ g_ptr_array_add(m_spellCheckingLanguages.get(), g_strdup(spellCheckingLanguages[i].utf8().data()));
+ g_ptr_array_add(m_spellCheckingLanguages.get(), 0);
+
+ return reinterpret_cast<char**>(m_spellCheckingLanguages->pdata);
}
-void WebKitTextChecker::setSpellCheckingLanguages(const CString& languages)
+void WebKitTextChecker::setSpellCheckingLanguages(const char* const* languages)
{
- m_textChecker->updateSpellCheckingLanguages(String::fromUTF8(languages.data()));
+ Vector<String> spellCheckingLanguages;
+ for (size_t i = 0; languages[i]; ++i)
+ spellCheckingLanguages.append(String::fromUTF8(languages[i]));
+ m_textChecker->updateSpellCheckingLanguages(spellCheckingLanguages);
}
#endif // ENABLE(SPELLCHECK)
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitTextChecker.h b/Source/WebKit2/UIProcess/API/gtk/WebKitTextChecker.h
index 3cca5622a..15f764f61 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitTextChecker.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitTextChecker.h
@@ -26,6 +26,7 @@
#include <wtf/FastAllocBase.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
+#include <wtf/gobject/GRefPtr.h>
#include <wtf/text/CString.h>
class WebKitTextChecker {
@@ -44,14 +45,14 @@ public:
void ignoreWord(const String& word);
// To be called from WebKitWebContext only.
- const CString& getSpellCheckingLanguages();
- void setSpellCheckingLanguages(const CString& spellCheckingLanguages);
+ const char* const* getSpellCheckingLanguages();
+ void setSpellCheckingLanguages(const char* const* spellCheckingLanguages);
private:
WebKitTextChecker();
OwnPtr<WebCore::TextCheckerEnchant> m_textChecker;
- CString m_spellCheckingLanguages;
+ GRefPtr<GPtrArray> m_spellCheckingLanguages;
bool m_spellCheckingEnabled;
};
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
index 211133f0a..e9231e47b 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
@@ -495,24 +495,20 @@ void webkit_web_context_set_spell_checking_enabled(WebKitWebContext* context, gb
* @context: a #WebKitWebContext
*
* Get the the list of spell checking languages associated with
- * @context separated by commas, or %NULL if no languages have been
- * previously set.
-
+ * @context, or %NULL if no languages have been previously set.
+ *
* See webkit_web_context_set_spell_checking_languages() for more
* details on the format of the languages in the list.
*
- * Returns: (transfer none): A comma separated list of languages if
- * available, or %NULL otherwise.
+ * Returns: (array zero-terminated=1) (element-type utf8) (transfer none): A %NULL-terminated
+ * array of languages if available, or %NULL otherwise.
*/
-const gchar* webkit_web_context_get_spell_checking_languages(WebKitWebContext* context)
+const gchar* const* webkit_web_context_get_spell_checking_languages(WebKitWebContext* context)
{
g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), 0);
#if ENABLE(SPELLCHECK)
- CString spellCheckingLanguages = context->priv->textChecker->getSpellCheckingLanguages();
- if (spellCheckingLanguages.isNull())
- return 0;
- return spellCheckingLanguages.data();
+ return context->priv->textChecker->getSpellCheckingLanguages();
#else
return 0;
#endif
@@ -521,11 +517,10 @@ const gchar* webkit_web_context_get_spell_checking_languages(WebKitWebContext* c
/**
* webkit_web_context_set_spell_checking_languages:
* @context: a #WebKitWebContext
- * @languages: new list of spell checking languages separated by
- * commas
+ * @languages: (array zero-terminated=1) (transfer none): a %NULL-terminated list of spell checking languages
*
* Set the list of spell checking languages to be used for spell
- * checking, separated by commas.
+ * checking.
*
* The locale string typically is in the form lang_COUNTRY, where lang
* is an ISO-639 language code, and COUNTRY is an ISO-3166 country code.
@@ -536,7 +531,7 @@ const gchar* webkit_web_context_get_spell_checking_languages(WebKitWebContext* c
* least once in order to properly enable the spell checking feature
* in WebKit.
*/
-void webkit_web_context_set_spell_checking_languages(WebKitWebContext* context, const gchar* languages)
+void webkit_web_context_set_spell_checking_languages(WebKitWebContext* context, const gchar* const* languages)
{
g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context));
g_return_if_fail(languages);
@@ -549,23 +544,23 @@ void webkit_web_context_set_spell_checking_languages(WebKitWebContext* context,
/**
* webkit_web_context_set_preferred_languages:
* @context: a #WebKitWebContext
- * @languages: (element-type utf8): a #GList of language identifiers
+ * @languages: (allow-none) (array zero-terminated=1) (element-type utf8) (transfer none): a %NULL-terminated list of language identifiers
*
* Set the list of preferred languages, sorted from most desirable
* to least desirable. The list will be used to build the "Accept-Language"
* header that will be included in the network requests started by
* the #WebKitWebContext.
*/
-void webkit_web_context_set_preferred_languages(WebKitWebContext* context, GList* languageList)
+void webkit_web_context_set_preferred_languages(WebKitWebContext* context, const gchar* const* languageList)
{
g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context));
- if (!languageList)
+ if (!languageList || !g_strv_length(const_cast<char**>(languageList)))
return;
Vector<String> languages;
- for (GList* iter = languageList; iter; iter = g_list_next(iter))
- languages.append(String::fromUTF8(static_cast<char*>(iter->data)).lower().replace("_", "-"));
+ for (size_t i = 0; languageList[i]; ++i)
+ languages.append(String::fromUTF8(languageList[i]).lower().replace("_", "-"));
WebCore::overrideUserPreferredLanguages(languages);
WebCore::languageDidChange();
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h
index 3c97c71cb..a2bf573f5 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h
@@ -140,16 +140,16 @@ webkit_web_context_get_spell_checking_enabled (WebKitWebContext
WEBKIT_API void
webkit_web_context_set_spell_checking_enabled (WebKitWebContext *context,
gboolean enabled);
-WEBKIT_API const gchar *
+WEBKIT_API const gchar * const *
webkit_web_context_get_spell_checking_languages (WebKitWebContext *context);
WEBKIT_API void
webkit_web_context_set_spell_checking_languages (WebKitWebContext *context,
- const gchar *languages);
+ const gchar * const *languages);
WEBKIT_API void
webkit_web_context_set_preferred_languages (WebKitWebContext *context,
- GList *languages);
+ const gchar * const *languages);
G_END_DECLS
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp
index 27f6a5447..7c712244e 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp
@@ -210,26 +210,44 @@ static void testWebContextSpellChecker(Test* test, gconstpointer)
WebKitWebContext* webContext = webkit_web_context_get_default();
// Check what happens if no spell checking language has been set.
- const gchar* currentLanguage = webkit_web_context_get_spell_checking_languages(webContext);
+ const gchar* const* currentLanguage = webkit_web_context_get_spell_checking_languages(webContext);
g_assert(!currentLanguage);
// Set the language to a specific one.
- webkit_web_context_set_spell_checking_languages(webContext, "en_US");
+ GRefPtr<GPtrArray> languages = adoptGRef(g_ptr_array_new());
+ g_ptr_array_add(languages.get(), const_cast<gpointer>(static_cast<const void*>("en_US")));
+ g_ptr_array_add(languages.get(), 0);
+ webkit_web_context_set_spell_checking_languages(webContext, reinterpret_cast<const char* const*>(languages->pdata));
currentLanguage = webkit_web_context_get_spell_checking_languages(webContext);
- g_assert_cmpstr(currentLanguage, ==, "en_US");
+ g_assert_cmpuint(g_strv_length(const_cast<char**>(currentLanguage)), ==, 1);
+ g_assert_cmpstr(currentLanguage[0], ==, "en_US");
// Set the language string to list of valid languages.
- webkit_web_context_set_spell_checking_languages(webContext, "en_GB,en_US");
+ g_ptr_array_remove_index_fast(languages.get(), languages->len - 1);
+ g_ptr_array_add(languages.get(), const_cast<gpointer>(static_cast<const void*>("en_GB")));
+ g_ptr_array_add(languages.get(), 0);
+ webkit_web_context_set_spell_checking_languages(webContext, reinterpret_cast<const char* const*>(languages->pdata));
currentLanguage = webkit_web_context_get_spell_checking_languages(webContext);
- g_assert_cmpstr(currentLanguage, ==, "en_GB,en_US");
+ g_assert_cmpuint(g_strv_length(const_cast<char**>(currentLanguage)), ==, 2);
+ g_assert_cmpstr(currentLanguage[0], ==, "en_US");
+ g_assert_cmpstr(currentLanguage[1], ==, "en_GB");
// Try passing a wrong language along with good ones.
- webkit_web_context_set_spell_checking_languages(webContext, "bd_WR,en_US,en_GB");
+ g_ptr_array_remove_index_fast(languages.get(), languages->len - 1);
+ g_ptr_array_add(languages.get(), const_cast<gpointer>(static_cast<const void*>("bd_WR")));
+ g_ptr_array_add(languages.get(), 0);
+ webkit_web_context_set_spell_checking_languages(webContext, reinterpret_cast<const char* const*>(languages->pdata));
currentLanguage = webkit_web_context_get_spell_checking_languages(webContext);
- g_assert_cmpstr(currentLanguage, ==, "en_US,en_GB");
+ g_assert_cmpuint(g_strv_length(const_cast<char**>(currentLanguage)), ==, 2);
+ g_assert_cmpstr(currentLanguage[0], ==, "en_US");
+ g_assert_cmpstr(currentLanguage[1], ==, "en_GB");
// Try passing a list with only wrong languages.
- webkit_web_context_set_spell_checking_languages(webContext, "bd_WR,wr_BD");
+ languages = adoptGRef(g_ptr_array_new());
+ g_ptr_array_add(languages.get(), const_cast<gpointer>(static_cast<const void*>("bd_WR")));
+ g_ptr_array_add(languages.get(), const_cast<gpointer>(static_cast<const void*>("wr_BD")));
+ g_ptr_array_add(languages.get(), 0);
+ webkit_web_context_set_spell_checking_languages(webContext, reinterpret_cast<const char* const*>(languages->pdata));
currentLanguage = webkit_web_context_get_spell_checking_languages(webContext);
g_assert(!currentLanguage);
@@ -250,11 +268,12 @@ static void testWebContextLanguages(WebViewTest* test, gconstpointer)
g_assert_cmpuint(mainResourceDataSize, ==, strlen(expectedDefaultLanguage));
g_assert(!strncmp(mainResourceData, expectedDefaultLanguage, mainResourceDataSize));
- GList* languages = g_list_prepend(0, const_cast<gpointer>(static_cast<const void*>("dE")));
- languages = g_list_prepend(languages, const_cast<gpointer>(static_cast<const void*>("ES_es")));
- languages = g_list_prepend(languages, const_cast<gpointer>(static_cast<const void*>("en")));
- webkit_web_context_set_preferred_languages(webkit_web_context_get_default(), languages);
- g_list_free(languages);
+ GRefPtr<GPtrArray> languages = adoptGRef(g_ptr_array_new());
+ g_ptr_array_add(languages.get(), const_cast<gpointer>(static_cast<const void*>("en")));
+ g_ptr_array_add(languages.get(), const_cast<gpointer>(static_cast<const void*>("ES_es")));
+ g_ptr_array_add(languages.get(), const_cast<gpointer>(static_cast<const void*>("dE")));
+ g_ptr_array_add(languages.get(), 0);
+ webkit_web_context_set_preferred_languages(webkit_web_context_get_default(), reinterpret_cast<const char* const*>(languages->pdata));
static const char* expectedLanguages = "en, es-es;q=0.90, de;q=0.80";
test->loadURI(kServer->getURIForPath("/").data());
diff --git a/Source/WebKit2/UIProcess/WebBackForwardList.cpp b/Source/WebKit2/UIProcess/WebBackForwardList.cpp
index 00e8f4c01..763023d07 100644
--- a/Source/WebKit2/UIProcess/WebBackForwardList.cpp
+++ b/Source/WebKit2/UIProcess/WebBackForwardList.cpp
@@ -186,21 +186,21 @@ WebBackForwardListItem* WebBackForwardList::itemAtIndex(int index)
return m_entries[index + m_currentIndex].get();
}
-int WebBackForwardList::backListCount()
+int WebBackForwardList::backListCount() const
{
ASSERT(!m_hasCurrentIndex || m_currentIndex < m_entries.size());
return m_page && m_hasCurrentIndex ? m_currentIndex : 0;
}
-int WebBackForwardList::forwardListCount()
+int WebBackForwardList::forwardListCount() const
{
ASSERT(!m_hasCurrentIndex || m_currentIndex < m_entries.size());
return m_page && m_hasCurrentIndex ? m_entries.size() - (m_currentIndex + 1) : 0;
}
-PassRefPtr<ImmutableArray> WebBackForwardList::backListAsImmutableArrayWithLimit(unsigned limit)
+PassRefPtr<ImmutableArray> WebBackForwardList::backListAsImmutableArrayWithLimit(unsigned limit) const
{
ASSERT(!m_hasCurrentIndex || m_currentIndex < m_entries.size());
@@ -224,7 +224,7 @@ PassRefPtr<ImmutableArray> WebBackForwardList::backListAsImmutableArrayWithLimit
return ImmutableArray::adopt(vector);
}
-PassRefPtr<ImmutableArray> WebBackForwardList::forwardListAsImmutableArrayWithLimit(unsigned limit)
+PassRefPtr<ImmutableArray> WebBackForwardList::forwardListAsImmutableArrayWithLimit(unsigned limit) const
{
ASSERT(!m_hasCurrentIndex || m_currentIndex < m_entries.size());
diff --git a/Source/WebKit2/UIProcess/WebBackForwardList.h b/Source/WebKit2/UIProcess/WebBackForwardList.h
index 16a562d03..d78ed5a67 100644
--- a/Source/WebKit2/UIProcess/WebBackForwardList.h
+++ b/Source/WebKit2/UIProcess/WebBackForwardList.h
@@ -70,12 +70,12 @@ public:
const BackForwardListItemVector& entries() const { return m_entries; }
- uint32_t currentIndex() { return m_currentIndex; }
- int backListCount();
- int forwardListCount();
+ uint32_t currentIndex() const { return m_currentIndex; }
+ int backListCount() const;
+ int forwardListCount() const;
- PassRefPtr<ImmutableArray> backListAsImmutableArrayWithLimit(unsigned limit);
- PassRefPtr<ImmutableArray> forwardListAsImmutableArrayWithLimit(unsigned limit);
+ PassRefPtr<ImmutableArray> backListAsImmutableArrayWithLimit(unsigned limit) const;
+ PassRefPtr<ImmutableArray> forwardListAsImmutableArrayWithLimit(unsigned limit) const;
#if USE(CF)
CFDictionaryRef createCFDictionaryRepresentation(WebPageProxy::WebPageProxySessionStateFilterCallback, void* context) const;
diff --git a/Source/WebKit2/UIProcess/WebContext.cpp b/Source/WebKit2/UIProcess/WebContext.cpp
index e024f175e..b5bbea4cd 100644
--- a/Source/WebKit2/UIProcess/WebContext.cpp
+++ b/Source/WebKit2/UIProcess/WebContext.cpp
@@ -514,17 +514,19 @@ DownloadProxy* WebContext::download(WebPageProxy* initiatingPage, const Resource
void WebContext::postMessageToInjectedBundle(const String& messageName, APIObject* messageBody)
{
- if (m_processModel == ProcessModelSharedSecondaryProcess) {
- if (m_processes.isEmpty() || !m_processes[0]->canSendMessage()) {
+ if (m_processes.isEmpty()) {
+ m_pendingMessagesToPostToInjectedBundle.append(std::make_pair(messageName, messageBody));
+ return;
+ }
+
+ for (size_t i = 0; i < m_processes.size(); ++i) {
+ // FIXME (Multi-WebProcess): Evolve m_pendingMessagesToPostToInjectedBundle to work with multiple secondary processes.
+ if (!m_processes[i]->canSendMessage()) {
m_pendingMessagesToPostToInjectedBundle.append(std::make_pair(messageName, messageBody));
- return;
+ continue;
}
-
- // FIXME: We should consider returning false from this function if the messageBody cannot
- // be encoded.
- m_processes[0]->deprecatedSend(InjectedBundleMessage::PostMessage, 0, CoreIPC::In(messageName, WebContextUserMessageEncoder(messageBody)));
- } else {
- // FIXME (Multi-WebProcess): Implement.
+ // FIXME: We should consider returning false from this function if the messageBody cannot be encoded.
+ m_processes[i]->deprecatedSend(InjectedBundleMessage::PostMessage, 0, CoreIPC::In(messageName, WebContextUserMessageEncoder(messageBody)));
}
}
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index 8d5cc32df..c88c6655a 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -34,6 +34,7 @@
#include "DrawingAreaProxy.h"
#include "EventDispatcherMessages.h"
#include "FindIndicator.h"
+#include "InjectedBundleMessageKinds.h"
#include "Logging.h"
#include "MessageID.h"
#include "NativeWebKeyboardEvent.h"
@@ -182,7 +183,7 @@ WebPageProxy::WebPageProxy(PageClient* pageClient, PassRefPtr<WebProcessProxy> p
, m_drawsTransparentBackground(false)
, m_areMemoryCacheClientCallsEnabled(true)
, m_useFixedLayout(false)
- , m_paginationMode(Page::Pagination::Unpaginated)
+ , m_paginationMode(Pagination::Unpaginated)
, m_paginationBehavesLikeColumns(false)
, m_pageLength(0)
, m_gapBetweenPages(0)
@@ -1501,7 +1502,7 @@ void WebPageProxy::setFixedLayoutSize(const IntSize& size)
m_process->send(Messages::WebPage::SetFixedLayoutSize(size), m_pageID);
}
-void WebPageProxy::setPaginationMode(WebCore::Page::Pagination::Mode mode)
+void WebPageProxy::setPaginationMode(WebCore::Pagination::Mode mode)
{
if (mode == m_paginationMode)
return;
@@ -2887,6 +2888,12 @@ NativeWebMouseEvent* WebPageProxy::currentlyProcessedMouseDownEvent()
return m_currentlyProcessedMouseDownEvent.get();
}
+void WebPageProxy::postMessageToInjectedBundle(const String& messageName, APIObject* messageBody)
+{
+ // FIXME: We should consider returning false from this function if the messageBody cannot be encoded.
+ process()->deprecatedSend(InjectedBundleMessage::PostMessageToPage, m_pageID, CoreIPC::In(messageName, WebContextUserMessageEncoder(messageBody)));
+}
+
#if PLATFORM(GTK)
void WebPageProxy::failedToShowPopupMenu()
{
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h
index b88a5d498..9a19a566b 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.h
+++ b/Source/WebKit2/UIProcess/WebPageProxy.h
@@ -488,8 +488,8 @@ public:
bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
- void setPaginationMode(WebCore::Page::Pagination::Mode);
- WebCore::Page::Pagination::Mode paginationMode() const { return m_paginationMode; }
+ void setPaginationMode(WebCore::Pagination::Mode);
+ WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
void setPaginationBehavesLikeColumns(bool);
bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
void setPageLength(double);
@@ -715,6 +715,8 @@ public:
void setSuppressVisibilityUpdates(bool flag) { m_suppressVisibilityUpdates = flag; }
bool suppressVisibilityUpdates() { return m_suppressVisibilityUpdates; }
+ void postMessageToInjectedBundle(const String& messageName, APIObject* messageBody);
+
private:
WebPageProxy(PageClient*, PassRefPtr<WebProcessProxy>, WebPageGroup*, uint64_t pageID);
@@ -1093,7 +1095,7 @@ private:
bool m_useFixedLayout;
WebCore::IntSize m_fixedLayoutSize;
- WebCore::Page::Pagination::Mode m_paginationMode;
+ WebCore::Pagination::Mode m_paginationMode;
bool m_paginationBehavesLikeColumns;
double m_pageLength;
double m_gapBetweenPages;
diff --git a/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm b/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm
index b5fc012c9..238a67516 100644
--- a/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm
+++ b/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm
@@ -552,7 +552,12 @@ static NSRect windowFrameFromApparentFrames(NSRect screenFrame, NSRect initialFr
finalBounds.origin = [[self window] convertScreenToBase:finalBounds.origin];
WKWindowSetClipRect([self window], finalBounds);
- [[self window] makeKeyAndOrderFront:self];
+ NSWindow* window = [self window];
+ NSWindowCollectionBehavior behavior = [window collectionBehavior];
+ [window setCollectionBehavior:(behavior | NSWindowCollectionBehaviorCanJoinAllSpaces)];
+ [window makeKeyAndOrderFront:self];
+ [window setCollectionBehavior:behavior];
+
if (!_backgroundWindow)
_backgroundWindow = createBackgroundFullscreenWindow(screenFrame);
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.h
index 9e273bae3..86232e607 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.h
@@ -38,6 +38,7 @@ typedef void (*WKBundleDidCreatePageCallback)(WKBundleRef bundle, WKBundlePageRe
typedef void (*WKBundleWillDestroyPageCallback)(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo);
typedef void (*WKBundleDidInitializePageGroupCallback)(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, const void* clientInfo);
typedef void (*WKBundleDidReceiveMessageCallback)(WKBundleRef bundle, WKStringRef name, WKTypeRef messageBody, const void* clientInfo);
+typedef void (*WKBundleDidReceiveMessageToPageCallback)(WKBundleRef bundle, WKBundlePageRef page, WKStringRef name, WKTypeRef messageBody, const void* clientInfo);
struct WKBundleClient {
int version;
@@ -46,14 +47,17 @@ struct WKBundleClient {
WKBundleWillDestroyPageCallback willDestroyPage;
WKBundleDidInitializePageGroupCallback didInitializePageGroup;
WKBundleDidReceiveMessageCallback didReceiveMessage;
+
+ // Version 1.
+ WKBundleDidReceiveMessageToPageCallback didReceiveMessageToPage;
};
typedef struct WKBundleClient WKBundleClient;
-enum { kWKBundleClientCurrentVersion = 0 };
+enum { kWKBundleClientCurrentVersion = 1 };
WK_EXPORT WKTypeID WKBundleGetTypeID();
-WK_EXPORT void WKBundleSetClient(WKBundleRef bundle, WKBundleClient * client);
+WK_EXPORT void WKBundleSetClient(WKBundleRef bundle, WKBundleClient* client);
WK_EXPORT void WKBundlePostMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody);
WK_EXPORT void WKBundlePostSynchronousMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData);
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
index 127715c7a..1e8310729 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
@@ -478,6 +478,11 @@ void InjectedBundle::didReceiveMessage(const String& messageName, APIObject* mes
m_client.didReceiveMessage(this, messageName, messageBody);
}
+void InjectedBundle::didReceiveMessageToPage(WebPage* page, const String& messageName, APIObject* messageBody)
+{
+ m_client.didReceiveMessageToPage(this, page, messageName, messageBody);
+}
+
void InjectedBundle::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
switch (messageID.get<InjectedBundleMessage::Kind>()) {
@@ -491,6 +496,25 @@ void InjectedBundle::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC:
didReceiveMessage(messageName, messageBody.get());
return;
}
+
+ case InjectedBundleMessage::PostMessageToPage: {
+ uint64_t pageID = arguments->destinationID();
+ if (!pageID)
+ return;
+
+ WebPage* page = WebProcess::shared().webPage(pageID);
+ if (!page)
+ return;
+
+ String messageName;
+ RefPtr<APIObject> messageBody;
+ InjectedBundleUserMessageDecoder messageDecoder(messageBody);
+ if (!arguments->decode(CoreIPC::Out(messageName, messageDecoder)))
+ return;
+
+ didReceiveMessageToPage(page, messageName, messageBody.get());
+ return;
+ }
}
ASSERT_NOT_REACHED();
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
index 1e240503b..87f7ef3b0 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
@@ -152,6 +152,7 @@ public:
void willDestroyPage(WebPage*);
void didInitializePageGroup(WebPageGroupProxy*);
void didReceiveMessage(const String&, APIObject*);
+ void didReceiveMessageToPage(WebPage*, const String&, APIObject*);
void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.cpp b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.cpp
index f2e4f2b9f..8ebf89781 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.cpp
@@ -62,4 +62,12 @@ void InjectedBundleClient::didReceiveMessage(InjectedBundle* bundle, const Strin
m_client.didReceiveMessage(toAPI(bundle), toAPI(messageName.impl()), toAPI(messageBody), m_client.clientInfo);
}
+void InjectedBundleClient::didReceiveMessageToPage(InjectedBundle* bundle, WebPage* page, const String& messageName, APIObject* messageBody)
+{
+ if (!m_client.didReceiveMessageToPage)
+ return;
+
+ m_client.didReceiveMessageToPage(toAPI(bundle), toAPI(page), toAPI(messageName.impl()), toAPI(messageBody), m_client.clientInfo);
+}
+
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h
index 32be290c9..ef1414274 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h
@@ -43,6 +43,7 @@ public:
void willDestroyPage(InjectedBundle*, WebPage*);
void didInitializePageGroup(InjectedBundle*, WebPageGroupProxy*);
void didReceiveMessage(InjectedBundle*, const String& messageName, APIObject* messageBody);
+ void didReceiveMessageToPage(InjectedBundle*, WebPage*, const String& messageName, APIObject* messageBody);
};
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index 947a06a43..ecac12cf6 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -902,6 +902,10 @@ void WebPage::setResizesToContentsUsingLayoutSize(const IntSize& targetLayoutSiz
m_page->settings()->setAcceleratedCompositingForFixedPositionEnabled(true);
m_page->settings()->setFixedElementsLayoutRelativeToFrame(true);
m_page->settings()->setFixedPositionCreatesStackingContext(true);
+#if ENABLE(SMOOTH_SCROLLING)
+ // Ensure we don't do animated scrolling in the WebProcess when scrolling is delegated.
+ m_page->settings()->setEnableScrollAnimator(false);
+#endif
// Always reset even when empty. This also takes care of the relayout.
setFixedLayoutSize(targetLayoutSize);
@@ -1122,28 +1126,28 @@ void WebPage::setFixedLayoutSize(const IntSize& size)
void WebPage::setPaginationMode(uint32_t mode)
{
- Page::Pagination pagination = m_page->pagination();
- pagination.mode = static_cast<Page::Pagination::Mode>(mode);
+ Pagination pagination = m_page->pagination();
+ pagination.mode = static_cast<Pagination::Mode>(mode);
m_page->setPagination(pagination);
}
void WebPage::setPaginationBehavesLikeColumns(bool behavesLikeColumns)
{
- Page::Pagination pagination = m_page->pagination();
+ Pagination pagination = m_page->pagination();
pagination.behavesLikeColumns = behavesLikeColumns;
m_page->setPagination(pagination);
}
void WebPage::setPageLength(double pageLength)
{
- Page::Pagination pagination = m_page->pagination();
+ Pagination pagination = m_page->pagination();
pagination.pageLength = pageLength;
m_page->setPagination(pagination);
}
void WebPage::setGapBetweenPages(double gap)
{
- Page::Pagination pagination = m_page->pagination();
+ Pagination pagination = m_page->pagination();
pagination.gap = gap;
m_page->setPagination(pagination);
}
@@ -2059,6 +2063,9 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
settings->setMockScrollbarsEnabled(store.getBoolValueForKey(WebPreferencesKey::mockScrollbarsEnabledKey()));
settings->setHyperlinkAuditingEnabled(store.getBoolValueForKey(WebPreferencesKey::hyperlinkAuditingEnabledKey()));
settings->setRequestAnimationFrameEnabled(store.getBoolValueForKey(WebPreferencesKey::requestAnimationFrameEnabledKey()));
+#if ENABLE(SMOOTH_SCROLLING)
+ settings->setEnableScrollAnimator(store.getBoolValueForKey(WebPreferencesKey::scrollAnimatorEnabledKey()));
+#endif
// <rdar://problem/10697417>: It is necessary to force compositing when accelerate drawing
// is enabled on Mac so that scrollbars are always in their own layers.
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h
index ec5af0e96..789727ad3 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h
@@ -309,7 +309,7 @@ public:
bool useFixedLayout() const { return m_useFixedLayout; }
void setFixedLayoutSize(const WebCore::IntSize&);
- void setPaginationMode(uint32_t /* WebCore::Page::Pagination::Mode */);
+ void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */);
void setPaginationBehavesLikeColumns(bool);
void setPageLength(double);
void setGapBetweenPages(double);
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm b/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
index 43d381ecd..c2f016537 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
+++ b/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
@@ -55,6 +55,7 @@
#import <WebCore/RenderObject.h>
#import <WebCore/RenderStyle.h>
#import <WebCore/ScrollView.h>
+#import <WebCore/StyleInheritedData.h>
#import <WebCore/TextIterator.h>
#import <WebCore/WindowsKeyboardCodes.h>
#import <WebCore/visible_units.h>
diff --git a/Source/WebKit2/WebProcess/qt/QtBuiltinBundle.cpp b/Source/WebKit2/WebProcess/qt/QtBuiltinBundle.cpp
index a5a75d0c3..8847c8b99 100644
--- a/Source/WebKit2/WebProcess/qt/QtBuiltinBundle.cpp
+++ b/Source/WebKit2/WebProcess/qt/QtBuiltinBundle.cpp
@@ -58,7 +58,8 @@ void QtBuiltinBundle::initialize(WKBundleRef bundle)
didCreatePage,
willDestroyPage,
0, // didInitializePageGroup
- didReceiveMessage
+ didReceiveMessage,
+ 0 // didReceiveMessageToPage
};
WKBundleSetClient(m_bundle, &client);
}
diff --git a/Source/WebKit2/WebProcess/qt/WebProcessQt.cpp b/Source/WebKit2/WebProcess/qt/WebProcessQt.cpp
index 268c4b093..02a90ec43 100644
--- a/Source/WebKit2/WebProcess/qt/WebProcessQt.cpp
+++ b/Source/WebKit2/WebProcess/qt/WebProcessQt.cpp
@@ -160,11 +160,6 @@ void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters
}
#endif
- // Disable runtime enabled features that have no WebKit2 implementation yet.
-#if ENABLE(DEVICE_ORIENTATION)
- WebCore::RuntimeEnabledFeatures::setDeviceMotionEnabled(false);
- WebCore::RuntimeEnabledFeatures::setDeviceOrientationEnabled(false);
-#endif
#if ENABLE(SPEECH_INPUT)
WebCore::RuntimeEnabledFeatures::setSpeechInputEnabled(false);
#endif
diff --git a/Source/WebKit2/win/WebKit2.def b/Source/WebKit2/win/WebKit2.def
index 12c1f3033..5f68abc3a 100644
--- a/Source/WebKit2/win/WebKit2.def
+++ b/Source/WebKit2/win/WebKit2.def
@@ -221,7 +221,7 @@ EXPORTS
?setFixedFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
?setMockScrollbarsEnabled@Settings@WebCore@@SAX_N@Z
?setPageScaleFactor@Page@WebCore@@QAEXMABVIntPoint@2@@Z
- ?setPagination@Page@WebCore@@QAEXABUPagination@12@@Z
+ ?setPagination@Page@WebCore@@QAEXABUPagination@2@@Z
?setPictographFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
?setResourcesDataSizeLimitsFromInternals@InspectorController@WebCore@@QAEXHH@Z
?setSansSerifFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
diff --git a/Source/WebKit2/win/WebKit2CFLite.def b/Source/WebKit2/win/WebKit2CFLite.def
index 1a47d2f3a..b53c69e57 100644
--- a/Source/WebKit2/win/WebKit2CFLite.def
+++ b/Source/WebKit2/win/WebKit2CFLite.def
@@ -215,7 +215,7 @@ EXPORTS
?setFixedFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
?setMockScrollbarsEnabled@Settings@WebCore@@SAX_N@Z
?setPageScaleFactor@Page@WebCore@@QAEXMABVIntPoint@2@@Z
- ?setPagination@Page@WebCore@@QAEXABUPagination@12@@Z
+ ?setPagination@Page@WebCore@@QAEXABUPagination@2@@Z
?setPictographFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
?setResourcesDataSizeLimitsFromInternals@InspectorController@WebCore@@QAEXHH@Z
?setSansSerifFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z