~ubuntu-branches/ubuntu/lucid/webkit/lucid-updates

« back to all changes in this revision

Viewing changes to WebKit/gtk/webkit/webkitwebsettings.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-01-06 21:25:06 UTC
  • mfrom: (1.2.6 upstream) (4.3.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100106212506-gd0czn4zrwf1j19l
* New upstream release
- adds basic Content-Encoding support, thanks to soup
  (Closes: #529271)
- fixes over-advertising content types as supported by
  the media player (Closes: #559420)
* debian/control:
- updated libsoup build requirement (>= 2.28.2)
* debian/libwebkit-1.0-2.symbols:
- updated with new symbols
* debian/copyright:
- updated information since 1.1.17
* Imported patch from https://bugs.webkit.org/show_bug.cgi?id=30623
- I am shipping this patch because I believe it is correct, it is the
  way to go, it fixes a race, and it needs testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 * Copyright (C) 2008 Collabora Ltd.
5
5
 * Copyright (C) 2008 Holger Hans Peter Freyther
6
6
 * Copyright (C) 2009 Jan Michael Alonzo
 
7
 * Copyright (C) 2009 Movial Creative Technologies Inc.
 
8
 * Copyright (C) 2009 Igalia S.L.
7
9
 *
8
10
 * This library is free software; you can redistribute it and/or
9
11
 * modify it under the terms of the GNU Library General Public
35
37
#include "PlatformString.h"
36
38
 
37
39
#include <glib/gi18n-lib.h>
38
 
#if PLATFORM(UNIX)
 
40
#if OS(UNIX)
39
41
#include <sys/utsname.h>
40
42
#endif
41
43
 
98
100
    gboolean enable_universal_access_from_file_uris;
99
101
    gboolean enable_dom_paste;
100
102
    gboolean tab_key_cycles_through_elements;
 
103
    gboolean enable_default_context_menu;
 
104
    gboolean enable_site_specific_quirks;
 
105
    gboolean enable_page_cache;
101
106
};
102
107
 
103
108
#define WEBKIT_WEB_SETTINGS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsPrivate))
139
144
    PROP_EDITING_BEHAVIOR,
140
145
    PROP_ENABLE_UNIVERSAL_ACCESS_FROM_FILE_URIS,
141
146
    PROP_ENABLE_DOM_PASTE,
142
 
    PROP_TAB_KEY_CYCLES_THROUGH_ELEMENTS
 
147
    PROP_TAB_KEY_CYCLES_THROUGH_ELEMENTS,
 
148
    PROP_ENABLE_DEFAULT_CONTEXT_MENU,
 
149
    PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
 
150
    PROP_ENABLE_PAGE_CACHE
143
151
};
144
152
 
145
153
// Create a default user agent string
152
160
 
153
161
#if PLATFORM(X11)
154
162
    platform = g_strdup("X11");
155
 
#elif PLATFORM(WIN_OS)
 
163
#elif OS(WINDOWS)
156
164
    platform = g_strdup("Windows");
157
165
#elif PLATFORM(MAC)
158
166
    platform = g_strdup("Macintosh");
163
171
#endif
164
172
 
165
173
   // FIXME: platform/version detection can be shared.
166
 
#if PLATFORM(DARWIN)
 
174
#if OS(DARWIN)
167
175
 
168
 
#if PLATFORM(X86)
 
176
#if CPU(X86)
169
177
    osVersion = g_strdup("Intel Mac OS X");
170
178
#else
171
179
    osVersion = g_strdup("PPC Mac OS X");
172
180
#endif
173
181
 
174
 
#elif PLATFORM(UNIX)
 
182
#elif OS(UNIX)
175
183
    struct utsname name;
176
184
    if (uname(&name) != -1)
177
185
        osVersion = g_strdup_printf("%s %s", name.sysname, name.machine);
178
186
    else
179
187
        osVersion = g_strdup("Unknown");
180
188
 
181
 
#elif PLATFORM(WIN_OS)
 
189
#elif OS(WINDOWS)
182
190
    // FIXME: Compute the Windows version
183
191
    osVersion = g_strdup("Windows");
184
192
 
686
694
                                                         TRUE,
687
695
                                                         flags));
688
696
 
 
697
    /**
 
698
     * WebKitWebSettings:enable-default-context-menu:
 
699
     *
 
700
     * Whether right-clicks should be handled automatically to create,
 
701
     * and display the context menu. Turning this off will make
 
702
     * WebKitGTK+ not emit the populate-popup signal. Notice that the
 
703
     * default button press event handler may still handle right
 
704
     * clicks for other reasons, such as in-page context menus, or
 
705
     * right-clicks that are handled by the page itself.
 
706
     *
 
707
     * Since: 1.1.18
 
708
     */
 
709
    g_object_class_install_property(gobject_class,
 
710
                                    PROP_ENABLE_DEFAULT_CONTEXT_MENU,
 
711
                                    g_param_spec_boolean(
 
712
                                    "enable-default-context-menu",
 
713
                                    _("Enable Default Context Menu"),
 
714
                                    _("Enables the handling of right-clicks for the creation of the default context menu"),
 
715
                                    TRUE,
 
716
                                    flags));
 
717
 
 
718
    /**
 
719
     * WebKitWebSettings::enable-site-specific-quirks
 
720
     *
 
721
     * Whether to turn on site-specific hacks.  Turning this on will
 
722
     * tell WebKitGTK+ to use some site-specific workarounds for
 
723
     * better web compatibility.  For example, older versions of
 
724
     * MediaWiki will incorrectly send WebKit a css file with KHTML
 
725
     * workarounds.  By turning on site-specific quirks, WebKit will
 
726
     * special-case this and other cases to make the sites work.
 
727
     *
 
728
     * Since: 1.1.18
 
729
     */
 
730
    g_object_class_install_property(gobject_class,
 
731
                                    PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
 
732
                                    g_param_spec_boolean(
 
733
                                    "enable-site-specific-quirks",
 
734
                                    _("Enable Site Specific Quirks"),
 
735
                                    _("Enables the site-specific compatibility workarounds"),
 
736
                                    FALSE,
 
737
                                    flags));
 
738
 
 
739
    /**
 
740
    * WebKitWebSettings:enable-page-cache:
 
741
    *
 
742
    * Enable or disable the page cache. Disabling the page cache is
 
743
    * generally only useful for special circumstances like low-memory
 
744
    * scenarios or special purpose applications like static HTML
 
745
    * viewers. This setting only controls the Page Cache, this cache
 
746
    * is different than the disk-based or memory-based traditional
 
747
    * resource caches, its point is to make going back and forth
 
748
    * between pages much faster. For details about the different types
 
749
    * of caches and their purposes see:
 
750
    * http://webkit.org/blog/427/webkit-page-cache-i-the-basics/
 
751
    *
 
752
    * Since: 1.1.18
 
753
    */
 
754
    g_object_class_install_property(gobject_class,
 
755
                                    PROP_ENABLE_PAGE_CACHE,
 
756
                                    g_param_spec_boolean("enable-page-cache",
 
757
                                                         _("Enable page cache"),
 
758
                                                         _("Whether the page cache should be used"),
 
759
                                                         FALSE,
 
760
                                                         flags));
 
761
 
689
762
    g_type_class_add_private(klass, sizeof(WebKitWebSettingsPrivate));
690
763
}
691
764
 
883
956
        priv->enable_dom_paste = g_value_get_boolean(value);
884
957
        break;
885
958
    case PROP_TAB_KEY_CYCLES_THROUGH_ELEMENTS:
886
 
        priv->tab_key_cycles_through_elements =  g_value_get_boolean(value);
 
959
        priv->tab_key_cycles_through_elements = g_value_get_boolean(value);
 
960
        break;
 
961
    case PROP_ENABLE_DEFAULT_CONTEXT_MENU:
 
962
        priv->enable_default_context_menu = g_value_get_boolean(value);
 
963
        break;
 
964
    case PROP_ENABLE_SITE_SPECIFIC_QUIRKS:
 
965
        priv->enable_site_specific_quirks = g_value_get_boolean(value);
 
966
        break;
 
967
    case PROP_ENABLE_PAGE_CACHE:
 
968
        priv->enable_page_cache = g_value_get_boolean(value);
887
969
        break;
888
970
    default:
889
971
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
1002
1084
    case PROP_TAB_KEY_CYCLES_THROUGH_ELEMENTS:
1003
1085
        g_value_set_boolean(value, priv->tab_key_cycles_through_elements);
1004
1086
        break;
1005
 
   default:
 
1087
    case PROP_ENABLE_DEFAULT_CONTEXT_MENU:
 
1088
        g_value_set_boolean(value, priv->enable_default_context_menu);
 
1089
        break;
 
1090
    case PROP_ENABLE_SITE_SPECIFIC_QUIRKS:
 
1091
        g_value_set_boolean(value, priv->enable_site_specific_quirks);
 
1092
        break;
 
1093
    case PROP_ENABLE_PAGE_CACHE:
 
1094
        g_value_set_boolean(value, priv->enable_page_cache);
 
1095
        break;
 
1096
    default:
1006
1097
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
1007
1098
        break;
1008
1099
    }
1067
1158
                 "editing-behavior", priv->editing_behavior,
1068
1159
                 "enable-universal-access-from-file-uris", priv->enable_universal_access_from_file_uris,
1069
1160
                 "enable-dom-paste", priv->enable_dom_paste,
 
1161
                 "tab-key-cycles-through-elements", priv->tab_key_cycles_through_elements,
 
1162
                 "enable-default-context-menu", priv->enable_default_context_menu,
 
1163
                 "enable-site-specific-quirks", priv->enable_site_specific_quirks,
 
1164
                 "enable-page-cache", priv->enable_page_cache,
1070
1165
                 NULL));
1071
1166
 
1072
1167
    return copy;