diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
| commit | d6a599dbc9d824a462b2b206316e102bf8136446 (patch) | |
| tree | ecb257a5e55b2239d74b90fdad62fccd661cf286 /Source/WebKit/gtk/webkit | |
| parent | 3ccc3a85f09a83557b391aae380d3bf5f81a2911 (diff) | |
| download | qtwebkit-d6a599dbc9d824a462b2b206316e102bf8136446.tar.gz | |
Imported WebKit commit 8ff1f22783a32de82fee915abd55bd1b298f2644 (http://svn.webkit.org/repository/webkit/trunk@122325)
New snapshot that should work with the latest Qt build system changes
Diffstat (limited to 'Source/WebKit/gtk/webkit')
| -rw-r--r-- | Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp | 2 | ||||
| -rw-r--r-- | Source/WebKit/gtk/webkit/webkitglobals.cpp | 2 | ||||
| -rw-r--r-- | Source/WebKit/gtk/webkit/webkitspellcheckerenchant.cpp | 14 | ||||
| -rw-r--r-- | Source/WebKit/gtk/webkit/webkitviewportattributes.cpp | 2 | ||||
| -rw-r--r-- | Source/WebKit/gtk/webkit/webkitwebframe.cpp | 25 | ||||
| -rw-r--r-- | Source/WebKit/gtk/webkit/webkitwebframe.h | 3 | ||||
| -rw-r--r-- | Source/WebKit/gtk/webkit/webkitwebnavigationaction.cpp | 1 | ||||
| -rw-r--r-- | Source/WebKit/gtk/webkit/webkitwebview.cpp | 17 |
8 files changed, 49 insertions, 17 deletions
diff --git a/Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp b/Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp index a9c3e6557..6babfe4dd 100644 --- a/Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp +++ b/Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp @@ -407,7 +407,7 @@ static GdkPixbuf* getIconPixbufSynchronously(WebKitFaviconDatabase* database, co int pixbufWidth = gdk_pixbuf_get_width(pixbuf.get()); int pixbufHeight = gdk_pixbuf_get_height(pixbuf.get()); if (!iconSize.isZero() && (pixbufWidth != iconSize.width() || pixbufHeight != iconSize.height())) - pixbuf = gdk_pixbuf_scale_simple(pixbuf.get(), iconSize.width(), iconSize.height(), GDK_INTERP_BILINEAR); + pixbuf = adoptGRef(gdk_pixbuf_scale_simple(pixbuf.get(), iconSize.width(), iconSize.height(), GDK_INTERP_BILINEAR)); return pixbuf.leakRef(); } diff --git a/Source/WebKit/gtk/webkit/webkitglobals.cpp b/Source/WebKit/gtk/webkit/webkitglobals.cpp index 78a4949fb..42f7a1d93 100644 --- a/Source/WebKit/gtk/webkit/webkitglobals.cpp +++ b/Source/WebKit/gtk/webkit/webkitglobals.cpp @@ -504,7 +504,9 @@ void webkitInit() JSC::initializeThreading(); WTF::initializeMainThread(); +#if !LOG_DISABLED WebCore::initializeLoggingChannelsIfNecessary(); +#endif // !LOG_DISABLED PlatformStrategiesGtk::initialize(); // We make sure the text codecs have been initialized, because diff --git a/Source/WebKit/gtk/webkit/webkitspellcheckerenchant.cpp b/Source/WebKit/gtk/webkit/webkitspellcheckerenchant.cpp index f51a12f23..0eb4986d1 100644 --- a/Source/WebKit/gtk/webkit/webkitspellcheckerenchant.cpp +++ b/Source/WebKit/gtk/webkit/webkitspellcheckerenchant.cpp @@ -88,6 +88,18 @@ static void webkit_spell_checker_enchant_init(WebKitSpellCheckerEnchant* checker priv->enchantDicts = 0; } +static bool wordEndIsAContractionApostrophe(const char* string, long offset) +{ + if (g_utf8_get_char(g_utf8_offset_to_pointer(string, offset)) != g_utf8_get_char("'")) + return false; + + // If this is the last character in the string, it cannot be the apostrophe part of a contraction. + if (offset == g_utf8_strlen(string, -1)) + return false; + + return g_unichar_isalpha(g_utf8_get_char(g_utf8_offset_to_pointer(string, offset + 1))); +} + static void checkSpellingOfString(WebKitSpellChecker* checker, const char* string, int* misspellingLocation, int* misspellingLength) { WebKitSpellCheckerEnchantPrivate* priv = WEBKIT_SPELL_CHECKER_ENCHANT(checker)->priv; @@ -113,7 +125,7 @@ static void checkSpellingOfString(WebKitSpellChecker* checker, const char* strin int end = i; int wordLength; - while (attrs.get()[end].is_word_end < 1) + while (attrs.get()[end].is_word_end < 1 || wordEndIsAContractionApostrophe(string, end)) end++; wordLength = end - start; diff --git a/Source/WebKit/gtk/webkit/webkitviewportattributes.cpp b/Source/WebKit/gtk/webkit/webkitviewportattributes.cpp index c08191fae..138bdc321 100644 --- a/Source/WebKit/gtk/webkit/webkitviewportattributes.cpp +++ b/Source/WebKit/gtk/webkit/webkitviewportattributes.cpp @@ -534,7 +534,7 @@ void webkitViewportAttributesRecompute(WebKitViewportAttributes* viewportAttribu ViewportArguments arguments = webView->priv->corePage->mainFrame()->document()->viewportArguments(); - ViewportAttributes attributes = computeViewportAttributes(arguments, priv->desktopWidth, priv->deviceWidth, priv->deviceHeight, priv->deviceDPI, IntSize(priv->availableWidth, priv->availableHeight)); + ViewportAttributes attributes = computeViewportAttributes(arguments, priv->desktopWidth, priv->deviceWidth, priv->deviceHeight, priv->deviceDPI / ViewportArguments::deprecatedTargetDPI, IntSize(priv->availableWidth, priv->availableHeight)); restrictMinimumScaleFactorToViewportSize(attributes, IntSize(priv->availableWidth, priv->availableHeight)); restrictScaleFactorToInitialScaleIfNotUserScalable(attributes); diff --git a/Source/WebKit/gtk/webkit/webkitwebframe.cpp b/Source/WebKit/gtk/webkit/webkitwebframe.cpp index 77292213e..c1033e61d 100644 --- a/Source/WebKit/gtk/webkit/webkitwebframe.cpp +++ b/Source/WebKit/gtk/webkit/webkitwebframe.cpp @@ -56,6 +56,7 @@ #include "TextIterator.h" #include "WebKitAccessibleWrapperAtk.h" #include "markup.h" +#include "webkit/WebKitDOMDocumentPrivate.h" #include "webkit/WebKitDOMRangePrivate.h" #include "webkitenumtypes.h" #include "webkitglobalsprivate.h" @@ -1180,6 +1181,30 @@ WebKitDOMRange* webkit_web_frame_get_range_for_word_around_caret(WebKitWebFrame* return kit(visibleSelection.firstRange().get()); } +/** + * webkit_web_frame_get_dom_document: + * @frame: a #WebKitWebFrame + * + * Returns: (transfer none): the #WebKitDOMDocument currently loaded + * in the @frame or %NULL if no document is loaded + * + * Since: 1.10 + **/ +WebKitDOMDocument* webkit_web_frame_get_dom_document(WebKitWebFrame* frame) +{ + g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), 0); + + Frame* coreFrame = core(frame); + if (!coreFrame) + return 0; + + Document* doc = coreFrame->document(); + if (!doc) + return 0; + + return kit(doc); +} + namespace WebKit { WebKitWebView* getViewFromFrame(WebKitWebFrame* frame) diff --git a/Source/WebKit/gtk/webkit/webkitwebframe.h b/Source/WebKit/gtk/webkit/webkitwebframe.h index 012f8a8e9..1b5b8aca5 100644 --- a/Source/WebKit/gtk/webkit/webkitwebframe.h +++ b/Source/WebKit/gtk/webkit/webkitwebframe.h @@ -183,6 +183,9 @@ webkit_web_frame_replace_selection (WebKitWebFrame *frame, WEBKIT_API WebKitDOMRange* webkit_web_frame_get_range_for_word_around_caret (WebKitWebFrame *frame); +WEBKIT_API WebKitDOMDocument* +webkit_web_frame_get_dom_document (WebKitWebFrame *frame); + G_END_DECLS #endif diff --git a/Source/WebKit/gtk/webkit/webkitwebnavigationaction.cpp b/Source/WebKit/gtk/webkit/webkitwebnavigationaction.cpp index 72b9965ba..ca8a72518 100644 --- a/Source/WebKit/gtk/webkit/webkitwebnavigationaction.cpp +++ b/Source/WebKit/gtk/webkit/webkitwebnavigationaction.cpp @@ -123,6 +123,7 @@ static void webkit_web_navigation_action_finalize(GObject* obj) WebKitWebNavigationActionPrivate* priv = navigationAction->priv; g_free(priv->originalUri); + g_free(priv->targetFrame); G_OBJECT_CLASS(webkit_web_navigation_action_parent_class)->finalize(obj); } diff --git a/Source/WebKit/gtk/webkit/webkitwebview.cpp b/Source/WebKit/gtk/webkit/webkitwebview.cpp index aac487f23..3344bf84b 100644 --- a/Source/WebKit/gtk/webkit/webkitwebview.cpp +++ b/Source/WebKit/gtk/webkit/webkitwebview.cpp @@ -3438,10 +3438,6 @@ static void webkit_web_view_update_settings(WebKitWebView* webView) coreSettings->setWebAudioEnabled(settingsPrivate->enableWebAudio); #endif -#if ENABLE(WEB_SOCKETS) - coreSettings->setUseHixie76WebSocketProtocol(false); -#endif - #if ENABLE(SMOOTH_SCROLLING) coreSettings->setEnableScrollAnimator(settingsPrivate->enableSmoothScrolling); #endif @@ -5228,7 +5224,8 @@ GdkPixbuf* webkit_web_view_try_get_favicon_pixbuf(WebKitWebView* webView, guint * webkit_web_view_get_dom_document: * @web_view: a #WebKitWebView * - * Returns: (transfer none): the #WebKitDOMDocument currently loaded in the @web_view + * Returns: (transfer none): the #WebKitDOMDocument currently loaded in + * the main frame of the @web_view or %NULL if no document is loaded * * Since: 1.3.1 **/ @@ -5237,15 +5234,7 @@ webkit_web_view_get_dom_document(WebKitWebView* webView) { g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0); - Frame* coreFrame = core(webView)->mainFrame(); - if (!coreFrame) - return 0; - - Document* doc = coreFrame->document(); - if (!doc) - return 0; - - return kit(doc); + return webkit_web_frame_get_dom_document(webView->priv->mainFrame); } GtkMenu* webkit_web_view_get_context_menu(WebKitWebView* webView) |
