[GTK] Expose "ShouldRespectImageOrientation" setting into WebKitWebSettings
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2013 14:22:48 +0000 (14:22 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2013 14:22:48 +0000 (14:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111414

Patch by Tomas Popela <tpopela@redhat.com> on 2013-03-07
Reviewed by Carlos Garcia Campos.

We should expose ShouldRespectImageOrientation setting into
WebKitWebSettings. When it is enabled, the images are shown with right
orientation regarding to images EXIF data.

* webkit/webkitwebsettings.cpp:
(webkit_web_settings_class_init):
(webkit_web_settings_set_property):
(webkit_web_settings_get_property):
* webkit/webkitwebsettingsprivate.h:
* webkit/webkitwebview.cpp:
(webkit_web_view_update_settings):
(webkit_web_view_settings_notify):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145070 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/webkit/webkitwebsettings.cpp
Source/WebKit/gtk/webkit/webkitwebsettingsprivate.h
Source/WebKit/gtk/webkit/webkitwebview.cpp

index 3f8b54a..36b63fe 100644 (file)
@@ -1,3 +1,23 @@
+2013-03-07  Tomas Popela  <tpopela@redhat.com>
+
+        [GTK] Expose "ShouldRespectImageOrientation" setting into WebKitWebSettings
+        https://bugs.webkit.org/show_bug.cgi?id=111414
+
+        Reviewed by Carlos Garcia Campos.
+
+        We should expose ShouldRespectImageOrientation setting into
+        WebKitWebSettings. When it is enabled, the images are shown with right
+        orientation regarding to images EXIF data.
+
+        * webkit/webkitwebsettings.cpp:
+        (webkit_web_settings_class_init):
+        (webkit_web_settings_set_property):
+        (webkit_web_settings_get_property):
+        * webkit/webkitwebsettingsprivate.h:
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_update_settings):
+        (webkit_web_view_settings_notify):
+
 2013-03-06  Benjamin Poulain  <benjamin@webkit.org>
 
         WebKitTestRunner needs layoutTestController.elementDoesAutoCompleteForElementWithId
index ff51ebc..30a7be7 100644 (file)
@@ -79,6 +79,7 @@ enum {
     PROP_ENFORCE_96_DPI,
     PROP_AUTO_LOAD_IMAGES,
     PROP_AUTO_SHRINK_IMAGES,
+    PROP_RESPECT_IMAGE_ORIENTATION,
     PROP_PRINT_BACKGROUNDS,
     PROP_ENABLE_SCRIPTS,
     PROP_ENABLE_PLUGINS,
@@ -280,6 +281,15 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
                                     flags));
 
     g_object_class_install_property(gobject_class,
+                                    PROP_RESPECT_IMAGE_ORIENTATION,
+                                    g_param_spec_boolean(
+                                    "respect-image-orientation",
+                                    _("Respect Image Orientation"),
+                                    _("Whether WebKit should respect image orientation."),
+                                    FALSE,
+                                    flags));
+
+    g_object_class_install_property(gobject_class,
                                     PROP_PRINT_BACKGROUNDS,
                                     g_param_spec_boolean(
                                     "print-backgrounds",
@@ -1075,6 +1085,9 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con
     case PROP_AUTO_SHRINK_IMAGES:
         priv->autoShrinkImages = g_value_get_boolean(value);
         break;
+    case PROP_RESPECT_IMAGE_ORIENTATION:
+        priv->respectImageOrientation = g_value_get_boolean(value);
+        break;
     case PROP_PRINT_BACKGROUNDS:
         priv->printBackgrounds = g_value_get_boolean(value);
         break;
@@ -1264,6 +1277,9 @@ static void webkit_web_settings_get_property(GObject* object, guint prop_id, GVa
     case PROP_AUTO_SHRINK_IMAGES:
         g_value_set_boolean(value, priv->autoShrinkImages);
         break;
+    case PROP_RESPECT_IMAGE_ORIENTATION:
+        g_value_set_boolean(value, priv->respectImageOrientation);
+        break;
     case PROP_PRINT_BACKGROUNDS:
         g_value_set_boolean(value, priv->printBackgrounds);
         break;
index 387cb05..70b8865 100644 (file)
@@ -43,6 +43,7 @@ struct _WebKitWebSettingsPrivate {
     gboolean enforce96DPI;
     gboolean autoLoadImages;
     gboolean autoShrinkImages;
+    gboolean respectImageOrientation;
     gboolean printBackgrounds;
     gboolean enableScripts;
     gboolean enablePlugins;
index 8579e18..12a61a1 100644 (file)
@@ -3385,6 +3385,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
     coreSettings->setSerifFontFamily(settingsPrivate->serifFontFamily.data());
     coreSettings->setLoadsImagesAutomatically(settingsPrivate->autoLoadImages);
     coreSettings->setShrinksStandaloneImagesToFit(settingsPrivate->autoShrinkImages);
+    coreSettings->setShouldRespectImageOrientation(settingsPrivate->respectImageOrientation);
     coreSettings->setShouldPrintBackgrounds(settingsPrivate->printBackgrounds);
     coreSettings->setScriptEnabled(settingsPrivate->enableScripts);
     coreSettings->setPluginsEnabled(settingsPrivate->enablePlugins);
@@ -3504,6 +3505,8 @@ static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar
         settings->setLoadsImagesAutomatically(g_value_get_boolean(&value));
     else if (name == g_intern_string("auto-shrink-images"))
         settings->setShrinksStandaloneImagesToFit(g_value_get_boolean(&value));
+    else if (name == g_intern_string("respect-image-orientation"))
+        settings->setShouldRespectImageOrientation(g_value_get_boolean(&value));
     else if (name == g_intern_string("print-backgrounds"))
         settings->setShouldPrintBackgrounds(g_value_get_boolean(&value));
     else if (name == g_intern_string("enable-scripts"))