Drop support for cross-origin-window-policy header
[WebKit-https.git] / Source / WebKitLegacy / mac / WebView / WebPreferences.mm
1 /*
2  * Copyright (C) 2005-2017 Apple Inc. All rights reserved.
3  *           (C) 2006 Graham Dennis (graham.dennis@gmail.com)
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1.  Redistributions of source code must retain the above copyright
10  *     notice, this list of conditions and the following disclaimer. 
11  * 2.  Redistributions in binary form must reproduce the above copyright
12  *     notice, this list of conditions and the following disclaimer in the
13  *     documentation and/or other materials provided with the distribution. 
14  * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
15  *     its contributors may be used to endorse or promote products derived
16  *     from this software without specific prior written permission. 
17  *
18  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
19  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
22  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29
30 #import "WebPreferencesPrivate.h"
31 #import "WebPreferenceKeysPrivate.h"
32
33 #import "WebApplicationCache.h"
34 #import "WebFrameNetworkingContext.h"
35 #import "WebKitLogging.h"
36 #import "WebKitNSStringExtras.h"
37 #import "WebKitVersionChecks.h"
38 #import "WebNSDictionaryExtras.h"
39 #import "WebNSURLExtras.h"
40 #import <JavaScriptCore/InitializeThreading.h>
41 #import <WebCore/ApplicationCacheStorage.h>
42 #import <WebCore/AudioSession.h>
43 #import <WebCore/DeprecatedGlobalSettings.h>
44 #import <WebCore/NetworkStorageSession.h>
45 #import <WebCore/RuntimeApplicationChecks.h>
46 #import <WebCore/Settings.h>
47 #import <WebCore/TextEncodingRegistry.h>
48 #import <pal/spi/cf/CFNetworkSPI.h>
49 #import <wtf/MainThread.h>
50 #import <wtf/RetainPtr.h>
51 #import <wtf/RunLoop.h>
52
53 using namespace WebCore;
54
55 #if HAVE(AUDIO_TOOLBOX_AUDIO_SESSION)
56 #import <AudioToolbox/AudioSession.h>
57 #endif
58
59 #if PLATFORM(IOS)
60 #import <WebCore/Device.h>
61 #import <WebCore/GraphicsContext.h>
62 #import <WebCore/WebCoreThreadMessage.h>
63 #endif
64
65 NSString *WebPreferencesChangedNotification = @"WebPreferencesChangedNotification";
66 NSString *WebPreferencesRemovedNotification = @"WebPreferencesRemovedNotification";
67 NSString *WebPreferencesChangedInternalNotification = @"WebPreferencesChangedInternalNotification";
68 NSString *WebPreferencesCacheModelChangedInternalNotification = @"WebPreferencesCacheModelChangedInternalNotification";
69
70 #define KEY(x) (_private->identifier ? [_private->identifier.get() stringByAppendingString:(x)] : (x))
71
72 enum { WebPreferencesVersion = 1 };
73
74 static WebPreferences *_standardPreferences;
75 static NSMutableDictionary *webPreferencesInstances;
76
77 static unsigned webPreferencesInstanceCountWithPrivateBrowsingEnabled;
78
79 template<unsigned size> static bool contains(const char* const (&array)[size], const char* item)
80 {
81     if (!item)
82         return false;
83     for (auto* string : array) {
84         if (equalIgnoringASCIICase(string, item))
85             return true;
86     }
87     return false;
88 }
89
90 static WebCacheModel cacheModelForMainBundle(void)
91 {
92     @autoreleasepool {
93         // Apps that probably need the small setting
94         static const char* const documentViewerIDs[] = {
95             "Microsoft/com.microsoft.Messenger",
96             "com.adiumX.adiumX", 
97             "com.alientechnology.Proteus",
98             "com.apple.Dashcode",
99             "com.apple.iChat", 
100             "com.barebones.bbedit",
101             "com.barebones.textwrangler",
102             "com.barebones.yojimbo",
103             "com.equinux.iSale4",
104             "com.growl.growlframework",
105             "com.intrarts.PandoraMan",
106             "com.karelia.Sandvox",
107             "com.macromates.textmate",
108             "com.realmacsoftware.rapidweaverpro",
109             "com.red-sweater.marsedit",
110             "com.yahoo.messenger3",
111             "de.codingmonkeys.SubEthaEdit",
112             "fi.karppinen.Pyro",
113             "info.colloquy", 
114             "kungfoo.tv.ecto",
115         };
116
117         // Apps that probably need the medium setting
118         static const char* const documentBrowserIDs[] = {
119             "com.apple.Dictionary",
120             "com.apple.Xcode",
121             "com.apple.dashboard.client", 
122             "com.apple.helpviewer",
123             "com.culturedcode.xyle",
124             "com.macrabbit.CSSEdit",
125             "com.panic.Coda",
126             "com.ranchero.NetNewsWire",
127             "com.thinkmac.NewsLife",
128             "org.xlife.NewsFire",
129             "uk.co.opencommunity.vienna2",
130         };
131
132         // Apps that probably need the large setting
133         static const char* const primaryWebBrowserIDs[] = {
134             "com.app4mac.KidsBrowser"
135             "com.app4mac.wKiosk",
136             "com.freeverse.bumpercar",
137             "com.omnigroup.OmniWeb5",
138             "com.sunrisebrowser.Sunrise",
139             "net.hmdt-web.Shiira",
140         };
141
142         const char* bundleID = [[[NSBundle mainBundle] bundleIdentifier] UTF8String];
143         if (contains(documentViewerIDs, bundleID))
144             return WebCacheModelDocumentViewer;
145         if (contains(documentBrowserIDs, bundleID))
146             return WebCacheModelDocumentBrowser;
147         if (contains(primaryWebBrowserIDs, bundleID))
148             return WebCacheModelPrimaryWebBrowser;
149
150         bool isLinkedAgainstWebKit = WebKitLinkedOnOrAfter(0);
151         if (!isLinkedAgainstWebKit)
152             return WebCacheModelDocumentViewer; // Apps that don't link against WebKit probably aren't meant to be browsers.
153
154 #if !PLATFORM(IOS)
155         bool isLegacyApp = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_CACHE_MODEL_API);
156 #else
157         bool isLegacyApp = false;
158 #endif
159         if (isLegacyApp)
160             return WebCacheModelDocumentBrowser; // To avoid regressions in apps that depended on old WebKit's large cache.
161
162         return WebCacheModelDocumentViewer; // To save memory.
163     }
164 }
165
166 @interface WebPreferences ()
167 - (void)_postCacheModelChangedNotification;
168 @end
169
170 @interface WebPreferences (WebInternal)
171 + (NSString *)_concatenateKeyWithIBCreatorID:(NSString *)key;
172 + (NSString *)_IBCreatorID;
173 @end
174
175 struct WebPreferencesPrivate
176 {
177 public:
178     WebPreferencesPrivate()
179     : inPrivateBrowsing(NO)
180     , autosaves(NO)
181     , automaticallyDetectsCacheModel(NO)
182     , numWebViews(0)
183 #if PLATFORM(IOS)
184     , readWriteQueue(dispatch_queue_create("com.apple.WebPreferences.ReadWriteQueue", DISPATCH_QUEUE_CONCURRENT))
185 #endif
186     {
187     }
188
189 #if PLATFORM(IOS)
190     ~WebPreferencesPrivate()
191     {
192         dispatch_release(readWriteQueue);
193     }
194 #endif
195
196     RetainPtr<NSMutableDictionary> values;
197     BOOL inPrivateBrowsing;
198     RetainPtr<NSString> identifier;
199     BOOL autosaves;
200     BOOL automaticallyDetectsCacheModel;
201     unsigned numWebViews;
202 #if PLATFORM(IOS)
203     dispatch_queue_t readWriteQueue;
204 #endif
205 };
206
207 @interface WebPreferences (WebForwardDeclarations)
208 // This pseudo-category is needed so these methods can be used from within other category implementations
209 // without being in the public header file.
210 - (BOOL)_boolValueForKey:(NSString *)key;
211 - (void)_setBoolValue:(BOOL)value forKey:(NSString *)key;
212 - (int)_integerValueForKey:(NSString *)key;
213 - (void)_setIntegerValue:(int)value forKey:(NSString *)key;
214 - (float)_floatValueForKey:(NSString *)key;
215 - (void)_setFloatValue:(float)value forKey:(NSString *)key;
216 - (void)_setLongLongValue:(long long)value forKey:(NSString *)key;
217 - (long long)_longLongValueForKey:(NSString *)key;
218 - (void)_setUnsignedLongLongValue:(unsigned long long)value forKey:(NSString *)key;
219 - (unsigned long long)_unsignedLongLongValueForKey:(NSString *)key;
220 @end
221
222 #if PLATFORM(IOS)
223 @interface WebPreferences ()
224 - (id)initWithIdentifier:(NSString *)anIdentifier sendChangeNotification:(BOOL)sendChangeNotification;
225 @end
226 #endif
227
228 @implementation WebPreferences
229
230 - (instancetype)init
231 {
232     // Create fake identifier
233     static int instanceCount = 1;
234     NSString *fakeIdentifier;
235     
236     // At least ensure that identifier hasn't been already used.  
237     fakeIdentifier = [NSString stringWithFormat:@"WebPreferences%d", instanceCount++];
238     while ([[self class] _getInstanceForIdentifier:fakeIdentifier]){
239         fakeIdentifier = [NSString stringWithFormat:@"WebPreferences%d", instanceCount++];
240     }
241     
242     return [self initWithIdentifier:fakeIdentifier];
243 }
244
245 #if PLATFORM(IOS)
246 - (id)initWithIdentifier:(NSString *)anIdentifier
247 {
248     return [self initWithIdentifier:anIdentifier sendChangeNotification:YES];
249 }
250 #endif
251
252 #if PLATFORM(IOS)
253 - (instancetype)initWithIdentifier:(NSString *)anIdentifier sendChangeNotification:(BOOL)sendChangeNotification
254 #else
255 - (instancetype)initWithIdentifier:(NSString *)anIdentifier
256 #endif
257 {
258     WebPreferences *instance = [[self class] _getInstanceForIdentifier:anIdentifier];
259     if (instance) {
260         [self release];
261         return [instance retain];
262     }
263
264     self = [super init];
265     if (!self)
266         return nil;
267
268     _private = new WebPreferencesPrivate;
269     _private->values = adoptNS([[NSMutableDictionary alloc] init]);
270     _private->identifier = adoptNS([anIdentifier copy]);
271     _private->automaticallyDetectsCacheModel = YES;
272
273     [[self class] _setInstance:self forIdentifier:_private->identifier.get()];
274
275     [self _updatePrivateBrowsingStateTo:[self privateBrowsingEnabled]];
276
277 #if PLATFORM(IOS)
278     if (sendChangeNotification) {
279         [self _postPreferencesChangedNotification];
280         [self _postCacheModelChangedNotification];
281     }
282 #else
283     [self _postPreferencesChangedNotification];
284     [self _postCacheModelChangedNotification];
285 #endif
286
287     return self;
288 }
289
290 - (instancetype)initWithCoder:(NSCoder *)decoder
291 {
292     self = [super init];
293     if (!self)
294         return nil;
295
296     _private = new WebPreferencesPrivate;
297     _private->automaticallyDetectsCacheModel = YES;
298
299     @try {
300         id identifier = nil;
301         id values = nil;
302         if ([decoder allowsKeyedCoding]) {
303             identifier = [decoder decodeObjectForKey:@"Identifier"];
304             values = [decoder decodeObjectForKey:@"Values"];
305         } else {
306             int version;
307             [decoder decodeValueOfObjCType:@encode(int) at:&version];
308             if (version == 1) {
309                 identifier = [decoder decodeObject];
310                 values = [decoder decodeObject];
311             }
312         }
313
314         if ([identifier isKindOfClass:[NSString class]])
315             _private->identifier = adoptNS([identifier copy]);
316         if ([values isKindOfClass:[NSDictionary class]])
317             _private->values = adoptNS([values mutableCopy]); // ensure dictionary is mutable
318
319         LOG(Encoding, "Identifier = %@, Values = %@\n", _private->identifier.get(), _private->values.get());
320     } @catch(id) {
321         [self release];
322         return nil;
323     }
324
325     // If we load a nib multiple times, or have instances in multiple
326     // nibs with the same name, the first guy up wins.
327     WebPreferences *instance = [[self class] _getInstanceForIdentifier:_private->identifier.get()];
328     if (instance) {
329         [self release];
330         self = [instance retain];
331     } else {
332         [[self class] _setInstance:self forIdentifier:_private->identifier.get()];
333         [self _updatePrivateBrowsingStateTo:[self privateBrowsingEnabled]];
334     }
335
336     return self;
337 }
338
339 - (void)encodeWithCoder:(NSCoder *)encoder
340 {
341     if ([encoder allowsKeyedCoding]){
342         [encoder encodeObject:_private->identifier.get() forKey:@"Identifier"];
343 #if PLATFORM(IOS)
344         dispatch_sync(_private->readWriteQueue, ^{
345 #endif
346         [encoder encodeObject:_private->values.get() forKey:@"Values"];
347         LOG (Encoding, "Identifier = %@, Values = %@\n", _private->identifier.get(), _private->values.get());
348 #if PLATFORM(IOS)
349         });
350 #endif
351     }
352     else {
353         int version = WebPreferencesVersion;
354         [encoder encodeValueOfObjCType:@encode(int) at:&version];
355         [encoder encodeObject:_private->identifier.get()];
356 #if PLATFORM(IOS)
357         dispatch_sync(_private->readWriteQueue, ^{
358 #endif
359         [encoder encodeObject:_private->values.get()];
360 #if PLATFORM(IOS)
361         });
362 #endif
363     }
364 }
365
366 + (WebPreferences *)standardPreferences
367 {
368 #if !PLATFORM(IOS)
369     if (_standardPreferences == nil) {
370         _standardPreferences = [[WebPreferences alloc] initWithIdentifier:nil];
371         [_standardPreferences setAutosaves:YES];
372     }
373 #else
374     // FIXME: This check is necessary to avoid recursion (see <rdar://problem/9564337>), but it also makes _standardPreferences construction not thread safe.
375     if (_standardPreferences)
376         return _standardPreferences;
377
378     static dispatch_once_t pred;
379     dispatch_once(&pred, ^{
380         _standardPreferences = [[WebPreferences alloc] initWithIdentifier:nil sendChangeNotification:NO];
381         [_standardPreferences _postPreferencesChangedNotification];
382         [_standardPreferences setAutosaves:YES];
383     });
384 #endif
385
386     return _standardPreferences;
387 }
388
389 // if we ever have more than one WebPreferences object, this would move to init
390 + (void)initialize
391 {
392 #if !PLATFORM(IOS)
393     JSC::initializeThreading();
394     WTF::initializeMainThreadToProcessMainThread();
395     RunLoop::initializeMainRunLoop();
396     bool attachmentElementEnabled = MacApplication::isAppleMail();
397 #else
398     bool allowsInlineMediaPlayback = WebCore::deviceClass() == MGDeviceClassiPad;
399     bool allowsInlineMediaPlaybackAfterFullscreen = WebCore::deviceClass() != MGDeviceClassiPad;
400     bool requiresPlaysInlineAttribute = !allowsInlineMediaPlayback;
401     bool attachmentElementEnabled = IOSApplication::isMobileMail();
402 #endif
403
404     NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
405         @"Times",                       WebKitStandardFontPreferenceKey,
406         @"Courier",                     WebKitFixedFontPreferenceKey,
407         @"Times",                       WebKitSerifFontPreferenceKey,
408         @"Helvetica",                   WebKitSansSerifFontPreferenceKey,
409 #if !PLATFORM(IOS)
410         @"Apple Chancery",              WebKitCursiveFontPreferenceKey,
411 #else
412         @"Snell Roundhand",             WebKitCursiveFontPreferenceKey,
413 #endif
414         @"Papyrus",                     WebKitFantasyFontPreferenceKey,
415 #if PLATFORM(IOS)
416         @"AppleColorEmoji",             WebKitPictographFontPreferenceKey,
417 #else
418         @"Apple Color Emoji",           WebKitPictographFontPreferenceKey,
419 #endif
420         @"0",                           WebKitMinimumFontSizePreferenceKey,
421         @"9",                           WebKitMinimumLogicalFontSizePreferenceKey, 
422         @"16",                          WebKitDefaultFontSizePreferenceKey,
423         @"13",                          WebKitDefaultFixedFontSizePreferenceKey,
424         @"ISO-8859-1",                  WebKitDefaultTextEncodingNamePreferenceKey,
425         [NSNumber numberWithBool:NO],   WebKitUsesEncodingDetectorPreferenceKey,
426         [NSNumber numberWithBool:NO],   WebKitUserStyleSheetEnabledPreferenceKey,
427         @"",                            WebKitUserStyleSheetLocationPreferenceKey,
428 #if !PLATFORM(IOS)
429         [NSNumber numberWithBool:NO],   WebKitShouldPrintBackgroundsPreferenceKey,
430         [NSNumber numberWithBool:NO],   WebKitTextAreasAreResizablePreferenceKey,
431 #endif
432         [NSNumber numberWithBool:NO],   WebKitShrinksStandaloneImagesToFitPreferenceKey,
433 #if !PLATFORM(IOS)
434         [NSNumber numberWithBool:YES],  WebKitJavaEnabledPreferenceKey,
435 #endif
436         [NSNumber numberWithBool:YES],  WebKitJavaScriptEnabledPreferenceKey,
437         [NSNumber numberWithBool:YES],  WebKitJavaScriptMarkupEnabledPreferenceKey,
438         [NSNumber numberWithBool:YES],  WebKitWebSecurityEnabledPreferenceKey,
439         [NSNumber numberWithBool:YES],  WebKitAllowUniversalAccessFromFileURLsPreferenceKey,
440         [NSNumber numberWithBool:YES],  WebKitAllowFileAccessFromFileURLsPreferenceKey,
441 #if PLATFORM(IOS)
442         [NSNumber numberWithBool:NO],   WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
443 #else
444         [NSNumber numberWithBool:YES],  WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
445 #endif
446         [NSNumber numberWithBool:YES],  WebKitPluginsEnabledPreferenceKey,
447         [NSNumber numberWithBool:YES],  WebKitDatabasesEnabledPreferenceKey,
448         [NSNumber numberWithBool:YES],  WebKitHTTPEquivEnabledPreferenceKey,
449
450 #if PLATFORM(IOS)
451         [NSNumber numberWithBool:NO],   WebKitStorageTrackerEnabledPreferenceKey,
452 #endif
453         [NSNumber numberWithBool:YES],  WebKitLocalStorageEnabledPreferenceKey,
454         [NSNumber numberWithBool:NO],   WebKitExperimentalNotificationsEnabledPreferenceKey,
455         [NSNumber numberWithBool:YES],  WebKitAllowAnimatedImagesPreferenceKey,
456         [NSNumber numberWithBool:YES],  WebKitAllowAnimatedImageLoopingPreferenceKey,
457         [NSNumber numberWithBool:YES],  WebKitDisplayImagesKey,
458         [NSNumber numberWithBool:NO],   WebKitLoadSiteIconsKey,
459         @"1800",                        WebKitBackForwardCacheExpirationIntervalKey,
460 #if !PLATFORM(IOS)
461         [NSNumber numberWithBool:NO],   WebKitTabToLinksPreferenceKey,
462 #endif
463         [NSNumber numberWithBool:NO],   WebKitPrivateBrowsingEnabledPreferenceKey,
464 #if !PLATFORM(IOS)
465         [NSNumber numberWithBool:NO],   WebKitRespectStandardStyleKeyEquivalentsPreferenceKey,
466         [NSNumber numberWithBool:NO],   WebKitShowsURLsInToolTipsPreferenceKey,
467         [NSNumber numberWithBool:NO],   WebKitShowsToolTipOverTruncatedTextPreferenceKey,
468         @"1",                           WebKitPDFDisplayModePreferenceKey,
469         @"0",                           WebKitPDFScaleFactorPreferenceKey,
470 #endif
471         @"0",                           WebKitUseSiteSpecificSpoofingPreferenceKey,
472         [NSNumber numberWithInt:WebKitEditableLinkDefaultBehavior], WebKitEditableLinkBehaviorPreferenceKey,
473 #if !PLATFORM(IOS)
474         [NSNumber numberWithInt:WebTextDirectionSubmenuAutomaticallyIncluded],
475                                         WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey,
476         [NSNumber numberWithBool:NO],   WebKitDOMPasteAllowedPreferenceKey,
477 #endif
478         [NSNumber numberWithBool:YES],  WebKitUsesPageCachePreferenceKey,
479         [NSNumber numberWithInt:cacheModelForMainBundle()], WebKitCacheModelPreferenceKey,
480         [NSNumber numberWithBool:YES],  WebKitPageCacheSupportsPluginsPreferenceKey,
481         [NSNumber numberWithBool:NO],   WebKitDeveloperExtrasEnabledPreferenceKey,
482         [NSNumber numberWithUnsignedInt:0], WebKitJavaScriptRuntimeFlagsPreferenceKey,
483         [NSNumber numberWithBool:YES],  WebKitAuthorAndUserStylesEnabledPreferenceKey,
484         [NSNumber numberWithBool:YES],  WebKitDOMTimersThrottlingEnabledPreferenceKey,
485         [NSNumber numberWithBool:NO],   WebKitWebArchiveDebugModeEnabledPreferenceKey,
486         [NSNumber numberWithBool:NO],   WebKitLocalFileContentSniffingEnabledPreferenceKey,
487         [NSNumber numberWithBool:NO],   WebKitOfflineWebApplicationCacheEnabledPreferenceKey,
488         [NSNumber numberWithBool:YES],  WebKitZoomsTextOnlyPreferenceKey,
489         [NSNumber numberWithBool:NO],   WebKitJavaScriptCanAccessClipboardPreferenceKey,
490         [NSNumber numberWithBool:YES],  WebKitXSSAuditorEnabledPreferenceKey,
491         [NSNumber numberWithBool:YES],  WebKitAcceleratedCompositingEnabledPreferenceKey,
492
493 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
494 #define DEFAULT_SUBPIXEL_ANTIALIASED_LAYER_TEXT_ENABLED YES
495 #else
496 #define DEFAULT_SUBPIXEL_ANTIALIASED_LAYER_TEXT_ENABLED NO
497 #endif
498         [NSNumber numberWithBool:DEFAULT_SUBPIXEL_ANTIALIASED_LAYER_TEXT_ENABLED], WebKitSubpixelAntialiasedLayerTextEnabledPreferenceKey,
499
500         [NSNumber numberWithBool:NO],   WebKitDisplayListDrawingEnabledPreferenceKey,
501 #if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
502         [NSNumber numberWithBool:YES],  WebKitAcceleratedDrawingEnabledPreferenceKey,
503         [NSNumber numberWithBool:YES],  WebKitCanvasUsesAcceleratedDrawingPreferenceKey,
504 #else
505         [NSNumber numberWithBool:NO],  WebKitAcceleratedDrawingEnabledPreferenceKey,
506         [NSNumber numberWithBool:NO],  WebKitCanvasUsesAcceleratedDrawingPreferenceKey,
507 #endif
508         [NSNumber numberWithBool:NO],   WebKitShowDebugBordersPreferenceKey,
509         [NSNumber numberWithBool:YES],  WebKitSimpleLineLayoutEnabledPreferenceKey,
510         [NSNumber numberWithBool:NO],   WebKitSimpleLineLayoutDebugBordersEnabledPreferenceKey,
511         [NSNumber numberWithBool:NO],   WebKitShowRepaintCounterPreferenceKey,
512         [NSNumber numberWithBool:YES],  WebKitWebGLEnabledPreferenceKey,
513         [NSNumber numberWithBool:NO],  WebKitForceSoftwareWebGLRenderingPreferenceKey,
514         [NSNumber numberWithBool:YES],   WebKitForceWebGLUsesLowPowerPreferenceKey,
515         [NSNumber numberWithBool:NO],   WebKitAccelerated2dCanvasEnabledPreferenceKey,
516         [NSNumber numberWithBool:NO],  WebKitSubpixelCSSOMElementMetricsEnabledPreferenceKey,
517         [NSNumber numberWithBool:NO],  WebKitResourceLoadStatisticsEnabledPreferenceKey,
518         [NSNumber numberWithBool:YES],  WebKitLargeImageAsyncDecodingEnabledPreferenceKey,
519         [NSNumber numberWithBool:YES],  WebKitAnimatedImageAsyncDecodingEnabledPreferenceKey,
520 #if PLATFORM(IOS)
521         [NSNumber numberWithUnsignedInt:static_cast<uint32_t>(FrameFlattening::FullyEnabled)], WebKitFrameFlatteningPreferenceKey,
522 #else
523         [NSNumber numberWithUnsignedInt:static_cast<uint32_t>(FrameFlattening::Disabled)], WebKitFrameFlatteningPreferenceKey,
524 #endif
525         [NSNumber numberWithBool:NO], WebKitAsyncFrameScrollingEnabledPreferenceKey,
526         [NSNumber numberWithBool:NO],   WebKitSpatialNavigationEnabledPreferenceKey,
527         [NSNumber numberWithBool:NO],  WebKitDNSPrefetchingEnabledPreferenceKey,
528         [NSNumber numberWithBool:NO],   WebKitFullScreenEnabledPreferenceKey,
529         [NSNumber numberWithBool:NO],   WebKitAsynchronousSpellCheckingEnabledPreferenceKey,
530         [NSNumber numberWithBool:YES],  WebKitHyperlinkAuditingEnabledPreferenceKey,
531         [NSNumber numberWithBool:NO],   WebKitUsePreHTML5ParserQuirksKey,
532         [NSNumber numberWithBool:YES],  WebKitAVFoundationEnabledKey,
533         [NSNumber numberWithBool:YES],  WebKitAVFoundationNSURLSessionEnabledKey,
534         [NSNumber numberWithBool:NO],   WebKitSuppressesIncrementalRenderingKey,
535         [NSNumber numberWithBool:attachmentElementEnabled], WebKitAttachmentElementEnabledPreferenceKey,
536 #if !PLATFORM(IOS)
537         [NSNumber numberWithBool:YES],  WebKitAllowsInlineMediaPlaybackPreferenceKey,
538         [NSNumber numberWithBool:NO],   WebKitAllowsInlineMediaPlaybackAfterFullscreenPreferenceKey,
539         [NSNumber numberWithBool:NO],   WebKitInlineMediaPlaybackRequiresPlaysInlineAttributeKey,
540         [NSNumber numberWithBool:YES],  WebKitMediaControlsScaleWithPageZoomPreferenceKey,
541         [NSNumber numberWithBool:NO],   WebKitWebAudioEnabledPreferenceKey,
542         [NSNumber numberWithBool:YES],  WebKitBackspaceKeyNavigationEnabledKey,
543         [NSNumber numberWithBool:NO],   WebKitShouldDisplaySubtitlesPreferenceKey,
544         [NSNumber numberWithBool:NO],   WebKitShouldDisplayCaptionsPreferenceKey,
545         [NSNumber numberWithBool:NO],   WebKitShouldDisplayTextDescriptionsPreferenceKey,
546         [NSNumber numberWithBool:YES],  WebKitNotificationsEnabledKey,
547         [NSNumber numberWithBool:NO],   WebKitShouldRespectImageOrientationKey,
548         [NSNumber numberWithBool:YES],  WebKitMediaDataLoadsAutomaticallyPreferenceKey,
549 #else
550         [NSNumber numberWithBool:allowsInlineMediaPlayback],   WebKitAllowsInlineMediaPlaybackPreferenceKey,
551         [NSNumber numberWithBool:allowsInlineMediaPlaybackAfterFullscreen],   WebKitAllowsInlineMediaPlaybackAfterFullscreenPreferenceKey,
552         [NSNumber numberWithBool:requiresPlaysInlineAttribute], WebKitInlineMediaPlaybackRequiresPlaysInlineAttributeKey,
553         [NSNumber numberWithBool:NO],   WebKitMediaControlsScaleWithPageZoomPreferenceKey,
554         [NSNumber numberWithUnsignedInt:AudioSession::None],  WebKitAudioSessionCategoryOverride,
555         [NSNumber numberWithBool:NO],   WebKitMediaDataLoadsAutomaticallyPreferenceKey,
556 #if HAVE(AVKIT)
557         [NSNumber numberWithBool:YES],  WebKitAVKitEnabled,
558 #endif
559         [NSNumber numberWithBool:YES],  WebKitRequiresUserGestureForMediaPlaybackPreferenceKey,
560         [NSNumber numberWithBool:NO],   WebKitRequiresUserGestureForVideoPlaybackPreferenceKey,
561         [NSNumber numberWithBool:NO],   WebKitRequiresUserGestureForAudioPlaybackPreferenceKey,
562         [NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
563
564         // Per-Origin Quota on iOS is 25MB. When the quota is reached for a particular origin
565         // the quota for that origin can be increased. See also webView:exceededApplicationCacheOriginQuotaForSecurityOrigin:totalSpaceNeeded in WebUI/WebUIDelegate.m.
566         [NSNumber numberWithLongLong:(25 * 1024 * 1024)], WebKitApplicationCacheDefaultOriginQuota,
567
568         // Enable WebAudio by default in all iOS UIWebViews
569         [NSNumber numberWithBool:YES],   WebKitWebAudioEnabledPreferenceKey,
570
571         [NSNumber numberWithBool:YES],   WebKitShouldRespectImageOrientationKey,
572 #endif // PLATFORM(IOS)
573 #if ENABLE(WIRELESS_TARGET_PLAYBACK)
574         [NSNumber numberWithBool:YES],  WebKitAllowsAirPlayForMediaPlaybackPreferenceKey,
575 #endif
576         [NSNumber numberWithBool:YES],  WebKitAllowsPictureInPictureMediaPlaybackPreferenceKey,
577         [NSNumber numberWithBool:YES],  WebKitRequestAnimationFrameEnabledPreferenceKey,
578         [NSNumber numberWithBool:NO],   WebKitWantsBalancedSetDefersLoadingBehaviorKey,
579         [NSNumber numberWithBool:NO],   WebKitDiagnosticLoggingEnabledKey,
580         [NSNumber numberWithInt:WebAllowAllStorage], WebKitStorageBlockingPolicyKey,
581         [NSNumber numberWithBool:NO],   WebKitPlugInSnapshottingEnabledPreferenceKey,
582
583 #if PLATFORM(IOS)
584         [NSNumber numberWithBool:NO],   WebKitTelephoneParsingEnabledPreferenceKey,
585         [NSNumber numberWithInt:-1],      WebKitLayoutIntervalPreferenceKey,
586         [NSNumber numberWithFloat:-1.0f], WebKitMaxParseDurationPreferenceKey,
587         [NSNumber numberWithBool:NO],     WebKitAllowMultiElementImplicitFormSubmissionPreferenceKey,
588         [NSNumber numberWithBool:NO],     WebKitAlwaysRequestGeolocationPermissionPreferenceKey,
589         [NSNumber numberWithInt:InterpolationLow], WebKitInterpolationQualityPreferenceKey,
590         [NSNumber numberWithBool:YES],    WebKitPasswordEchoEnabledPreferenceKey,
591         [NSNumber numberWithFloat:2.0f],  WebKitPasswordEchoDurationPreferenceKey,
592         [NSNumber numberWithBool:NO],     WebKitNetworkDataUsageTrackingEnabledPreferenceKey,
593         @"",                              WebKitNetworkInterfaceNamePreferenceKey,
594 #endif
595 #if ENABLE(TEXT_AUTOSIZING)
596         [NSNumber numberWithFloat:Settings::defaultMinimumZoomFontSize()], WebKitMinimumZoomFontSizePreferenceKey,
597         [NSNumber numberWithBool:Settings::defaultTextAutosizingEnabled()], WebKitTextAutosizingEnabledPreferenceKey,
598 #endif
599         [NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
600         [NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
601         [NSNumber numberWithBool:NO], WebKitHiddenPageDOMTimerThrottlingEnabledPreferenceKey,
602         [NSNumber numberWithBool:NO], WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey,
603         [NSNumber numberWithBool:NO], WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey,
604         
605         [NSNumber numberWithBool:NO], WebKitUseLegacyTextAlignPositionedElementBehaviorPreferenceKey,
606 #if ENABLE(MEDIA_SOURCE)
607         [NSNumber numberWithBool:YES], WebKitMediaSourceEnabledPreferenceKey,
608         @YES, WebKitSourceBufferChangeTypeEnabledPreferenceKey,
609 #endif
610 #if ENABLE(SERVICE_CONTROLS)
611         [NSNumber numberWithBool:NO], WebKitImageControlsEnabledPreferenceKey,
612         [NSNumber numberWithBool:NO], WebKitServiceControlsEnabledPreferenceKey,
613 #endif
614         [NSNumber numberWithBool:NO], WebKitEnableInheritURIQueryComponentPreferenceKey,
615 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
616         @"~/Library/WebKit/MediaKeys", WebKitMediaKeysStorageDirectoryKey,
617 #endif
618 #if ENABLE(MEDIA_STREAM)
619         [NSNumber numberWithBool:NO], WebKitMockCaptureDevicesEnabledPreferenceKey,
620         [NSNumber numberWithBool:YES], WebKitMockCaptureDevicesPromptEnabledPreferenceKey,
621         [NSNumber numberWithBool:YES], WebKitMediaCaptureRequiresSecureConnectionPreferenceKey,
622 #endif
623         [NSNumber numberWithBool:YES], WebKitShadowDOMEnabledPreferenceKey,
624         [NSNumber numberWithBool:YES], WebKitCustomElementsEnabledPreferenceKey,
625         [NSNumber numberWithBool:YES], WebKitDataTransferItemsEnabledPreferenceKey,
626         [NSNumber numberWithBool:NO], WebKitCustomPasteboardDataEnabledPreferenceKey,
627         [NSNumber numberWithBool:YES], WebKitModernMediaControlsEnabledPreferenceKey,
628         [NSNumber numberWithBool:YES], WebKitWebAnimationsCSSIntegrationEnabledPreferenceKey,
629
630 #if ENABLE(WEBGL2)
631         [NSNumber numberWithBool:NO], WebKitWebGL2EnabledPreferenceKey,
632 #endif
633 #if ENABLE(WEBGPU)
634         [NSNumber numberWithBool:NO], WebKitWebGPUEnabledPreferenceKey,
635 #endif
636         [NSNumber numberWithBool:NO], WebKitCacheAPIEnabledPreferenceKey,
637         [NSNumber numberWithBool:YES], WebKitFetchAPIEnabledPreferenceKey,
638
639 #if ENABLE(STREAMS_API)
640         [NSNumber numberWithBool:NO], WebKitReadableByteStreamAPIEnabledPreferenceKey,
641         [NSNumber numberWithBool:NO], WebKitWritableStreamAPIEnabledPreferenceKey,
642 #endif
643 #if ENABLE(DOWNLOAD_ATTRIBUTE)
644         [NSNumber numberWithBool:NO], WebKitDownloadAttributeEnabledPreferenceKey,
645 #endif
646         [NSNumber numberWithBool:NO], WebKitDirectoryUploadEnabledPreferenceKey,
647         [NSNumber numberWithBool:YES], WebKitWebAnimationsEnabledPreferenceKey,
648
649 #if PLATFORM(IOS)
650         [NSNumber numberWithBool:NO], WebKitVisualViewportEnabledPreferenceKey,
651 #else
652         [NSNumber numberWithBool:YES], WebKitVisualViewportEnabledPreferenceKey,
653 #endif
654         [NSNumber numberWithBool:NO], WebKitVisualViewportAPIEnabledPreferenceKey,
655
656         [NSNumber numberWithBool:NO], WebKitCSSOMViewScrollingAPIEnabledPreferenceKey,
657         [NSNumber numberWithBool:YES], WebKitNeedsStorageAccessFromFileURLsQuirkKey,
658         [NSNumber numberWithBool:NO], WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey,
659 #if ENABLE(MEDIA_STREAM)
660         [NSNumber numberWithBool:NO], WebKitMediaDevicesEnabledPreferenceKey,
661         [NSNumber numberWithBool:YES], WebKitMediaStreamEnabledPreferenceKey,
662 #endif
663 #if ENABLE(WEB_RTC)
664         [NSNumber numberWithBool:YES], WebKitPeerConnectionEnabledPreferenceKey,
665 #endif
666         [NSNumber numberWithBool:NO], WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey,
667 #if ENABLE(INTERSECTION_OBSERVER)
668         @NO, WebKitIntersectionObserverEnabledPreferenceKey,
669 #endif
670         @YES, WebKitDisplayContentsEnabledPreferenceKey,
671         @NO, WebKitUserTimingEnabledPreferenceKey,
672         @NO, WebKitResourceTimingEnabledPreferenceKey,
673         @NO, WebKitWebAuthenticationEnabledPreferenceKey,
674         @NO, WebKitMediaUserGestureInheritsFromDocument,
675         @NO, WebKitIsSecureContextAttributeEnabledPreferenceKey,
676         @YES, WebKitLegacyEncryptedMediaAPIEnabledKey,
677         @NO, WebKitEncryptedMediaAPIEnabledKey,
678         @YES, WebKitViewportFitEnabledPreferenceKey,
679         @YES, WebKitConstantPropertiesEnabledPreferenceKey,
680         @NO, WebKitColorFilterEnabledPreferenceKey,
681         @NO, WebKitPunchOutWhiteBackgroundsInDarkModePreferenceKey,
682         @YES, WebKitAllowMediaContentTypesRequiringHardwareSupportAsFallbackKey,
683         @NO, WebKitInspectorAdditionsEnabledPreferenceKey,
684         (NSString *)Settings::defaultMediaContentTypesRequiringHardwareSupport(), WebKitMediaContentTypesRequiringHardwareSupportPreferenceKey,
685         @NO, WebKitAccessibilityObjectModelEnabledPreferenceKey,
686         @YES, WebKitAriaReflectionEnabledPreferenceKey,
687         @NO, WebKitMediaCapabilitiesEnabledPreferenceKey,
688         @NO, WebKitFetchAPIKeepAliveEnabledPreferenceKey,
689         @NO, WebKitServerTimingEnabledPreferenceKey,
690         nil];
691
692 #if !PLATFORM(IOS)
693     // This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above
694     ASSERT(kPDFDisplaySinglePageContinuous == 1);
695 #endif
696     [[NSUserDefaults standardUserDefaults] registerDefaults:dict];
697 }
698
699 - (void)dealloc
700 {
701     [self _updatePrivateBrowsingStateTo:NO];
702
703     delete _private;
704     [super dealloc];
705 }
706
707 - (NSString *)identifier
708 {
709     return _private->identifier.get();
710 }
711
712 - (id)_valueForKey:(NSString *)key
713 {
714     NSString *_key = KEY(key);
715 #if PLATFORM(IOS)
716     __block id o = nil;
717     dispatch_sync(_private->readWriteQueue, ^{
718         o = [_private->values.get() objectForKey:_key];
719     });
720 #else
721     id o = [_private->values.get() objectForKey:_key];
722 #endif
723     if (o)
724         return o;
725     o = [[NSUserDefaults standardUserDefaults] objectForKey:_key];
726     if (!o && key != _key)
727         o = [[NSUserDefaults standardUserDefaults] objectForKey:key];
728     return o;
729 }
730
731 - (NSString *)_stringValueForKey:(NSString *)key
732 {
733     id s = [self _valueForKey:key];
734     return [s isKindOfClass:[NSString class]] ? (NSString *)s : nil;
735 }
736
737 - (void)_setStringValue:(NSString *)value forKey:(NSString *)key
738 {
739     if ([[self _stringValueForKey:key] isEqualToString:value])
740         return;
741     NSString *_key = KEY(key);
742 #if PLATFORM(IOS)
743     dispatch_barrier_sync(_private->readWriteQueue, ^{
744 #endif
745     [_private->values.get() setObject:value forKey:_key];
746 #if PLATFORM(IOS)
747     });
748 #endif
749     if (_private->autosaves)
750         [[NSUserDefaults standardUserDefaults] setObject:value forKey:_key];
751     [self _postPreferencesChangedNotification];
752 }
753
754 - (int)_integerValueForKey:(NSString *)key
755 {
756     id o = [self _valueForKey:key];
757     return [o respondsToSelector:@selector(intValue)] ? [o intValue] : 0;
758 }
759
760 - (void)_setIntegerValue:(int)value forKey:(NSString *)key
761 {
762     if ([self _integerValueForKey:key] == value)
763         return;
764     NSString *_key = KEY(key);
765 #if PLATFORM(IOS)
766     dispatch_barrier_sync(_private->readWriteQueue, ^{
767 #endif
768     [_private->values.get() setObject:@(value) forKey:_key];
769 #if PLATFORM(IOS)
770     });
771 #endif
772     if (_private->autosaves)
773         [[NSUserDefaults standardUserDefaults] setInteger:value forKey:_key];
774     [self _postPreferencesChangedNotification];
775 }
776
777 - (unsigned int)_unsignedIntValueForKey:(NSString *)key
778 {
779     id o = [self _valueForKey:key];
780     return [o respondsToSelector:@selector(unsignedIntValue)] ? [o unsignedIntValue] : 0;
781 }
782
783 - (void)_setUnsignedIntValue:(unsigned int)value forKey:(NSString *)key
784 {
785     if ([self _unsignedIntValueForKey:key] == value)
786         return;
787     NSString *_key = KEY(key);
788 #if PLATFORM(IOS)
789     dispatch_barrier_sync(_private->readWriteQueue, ^{
790 #endif
791     [_private->values.get() setObject:@(value) forKey:_key];
792 #if PLATFORM(IOS)
793     });
794 #endif
795     if (_private->autosaves)
796         [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithUnsignedInt:value] forKey:_key];
797     [self _postPreferencesChangedNotification];
798 }
799
800 - (float)_floatValueForKey:(NSString *)key
801 {
802     id o = [self _valueForKey:key];
803     return [o respondsToSelector:@selector(floatValue)] ? [o floatValue] : 0.0f;
804 }
805
806 - (void)_setFloatValue:(float)value forKey:(NSString *)key
807 {
808     if ([self _floatValueForKey:key] == value)
809         return;
810     NSString *_key = KEY(key);
811 #if PLATFORM(IOS)
812     dispatch_barrier_sync(_private->readWriteQueue, ^{
813 #endif
814     [_private->values.get() setObject:@(value) forKey:_key];
815 #if PLATFORM(IOS)
816     });
817 #endif
818     if (_private->autosaves)
819         [[NSUserDefaults standardUserDefaults] setFloat:value forKey:_key];
820     [self _postPreferencesChangedNotification];
821 }
822
823 - (BOOL)_boolValueForKey:(NSString *)key
824 {
825     return [self _integerValueForKey:key] != 0;
826 }
827
828 - (void)_setBoolValue:(BOOL)value forKey:(NSString *)key
829 {
830     if ([self _boolValueForKey:key] == value)
831         return;
832     NSString *_key = KEY(key);
833 #if PLATFORM(IOS)
834     dispatch_barrier_sync(_private->readWriteQueue, ^{
835 #endif
836     [_private->values.get() setObject:@(value) forKey:_key];
837 #if PLATFORM(IOS)
838     });
839 #endif
840     if (_private->autosaves)
841         [[NSUserDefaults standardUserDefaults] setBool:value forKey:_key];
842     [self _postPreferencesChangedNotification];
843 }
844
845 - (long long)_longLongValueForKey:(NSString *)key
846 {
847     id o = [self _valueForKey:key];
848     return [o respondsToSelector:@selector(longLongValue)] ? [o longLongValue] : 0;
849 }
850
851 - (void)_setLongLongValue:(long long)value forKey:(NSString *)key
852 {
853     if ([self _longLongValueForKey:key] == value)
854         return;
855     NSString *_key = KEY(key);
856 #if PLATFORM(IOS)
857     dispatch_barrier_sync(_private->readWriteQueue, ^{
858 #endif
859     [_private->values.get() setObject:@(value) forKey:_key];
860 #if PLATFORM(IOS)
861     });
862 #endif
863     if (_private->autosaves)
864         [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithLongLong:value] forKey:_key];
865     [self _postPreferencesChangedNotification];
866 }
867
868 - (unsigned long long)_unsignedLongLongValueForKey:(NSString *)key
869 {
870     id o = [self _valueForKey:key];
871     return [o respondsToSelector:@selector(unsignedLongLongValue)] ? [o unsignedLongLongValue] : 0;
872 }
873
874 - (void)_setUnsignedLongLongValue:(unsigned long long)value forKey:(NSString *)key
875 {
876     if ([self _unsignedLongLongValueForKey:key] == value)
877         return;
878     NSString *_key = KEY(key);
879 #if PLATFORM(IOS)
880     dispatch_barrier_sync(_private->readWriteQueue, ^{
881 #endif
882     [_private->values.get() setObject:@(value) forKey:_key];
883 #if PLATFORM(IOS)
884     });
885 #endif
886     if (_private->autosaves)
887         [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithUnsignedLongLong:value] forKey:_key];
888     [self _postPreferencesChangedNotification];
889 }
890
891 - (NSString *)standardFontFamily
892 {
893     return [self _stringValueForKey: WebKitStandardFontPreferenceKey];
894 }
895
896 - (void)setStandardFontFamily:(NSString *)family
897 {
898     [self _setStringValue: family forKey: WebKitStandardFontPreferenceKey];
899 }
900
901 - (NSString *)fixedFontFamily
902 {
903     return [self _stringValueForKey: WebKitFixedFontPreferenceKey];
904 }
905
906 - (void)setFixedFontFamily:(NSString *)family
907 {
908     [self _setStringValue: family forKey: WebKitFixedFontPreferenceKey];
909 }
910
911 - (NSString *)serifFontFamily
912 {
913     return [self _stringValueForKey: WebKitSerifFontPreferenceKey];
914 }
915
916 - (void)setSerifFontFamily:(NSString *)family 
917 {
918     [self _setStringValue: family forKey: WebKitSerifFontPreferenceKey];
919 }
920
921 - (NSString *)sansSerifFontFamily
922 {
923     return [self _stringValueForKey: WebKitSansSerifFontPreferenceKey];
924 }
925
926 - (void)setSansSerifFontFamily:(NSString *)family
927 {
928     [self _setStringValue: family forKey: WebKitSansSerifFontPreferenceKey];
929 }
930
931 - (NSString *)cursiveFontFamily
932 {
933     return [self _stringValueForKey: WebKitCursiveFontPreferenceKey];
934 }
935
936 - (void)setCursiveFontFamily:(NSString *)family
937 {
938     [self _setStringValue: family forKey: WebKitCursiveFontPreferenceKey];
939 }
940
941 - (NSString *)fantasyFontFamily
942 {
943     return [self _stringValueForKey: WebKitFantasyFontPreferenceKey];
944 }
945
946 - (void)setFantasyFontFamily:(NSString *)family
947 {
948     [self _setStringValue: family forKey: WebKitFantasyFontPreferenceKey];
949 }
950
951 - (int)defaultFontSize
952 {
953     return [self _integerValueForKey: WebKitDefaultFontSizePreferenceKey];
954 }
955
956 - (void)setDefaultFontSize:(int)size
957 {
958     [self _setIntegerValue: size forKey: WebKitDefaultFontSizePreferenceKey];
959 }
960
961 - (int)defaultFixedFontSize
962 {
963     return [self _integerValueForKey: WebKitDefaultFixedFontSizePreferenceKey];
964 }
965
966 - (void)setDefaultFixedFontSize:(int)size
967 {
968     [self _setIntegerValue: size forKey: WebKitDefaultFixedFontSizePreferenceKey];
969 }
970
971 - (int)minimumFontSize
972 {
973     return [self _integerValueForKey: WebKitMinimumFontSizePreferenceKey];
974 }
975
976 - (void)setMinimumFontSize:(int)size
977 {
978     [self _setIntegerValue: size forKey: WebKitMinimumFontSizePreferenceKey];
979 }
980
981 - (int)minimumLogicalFontSize
982 {
983   return [self _integerValueForKey: WebKitMinimumLogicalFontSizePreferenceKey];
984 }
985
986 - (void)setMinimumLogicalFontSize:(int)size
987 {
988   [self _setIntegerValue: size forKey: WebKitMinimumLogicalFontSizePreferenceKey];
989 }
990
991 - (NSString *)defaultTextEncodingName
992 {
993     return [self _stringValueForKey: WebKitDefaultTextEncodingNamePreferenceKey];
994 }
995
996 - (void)setDefaultTextEncodingName:(NSString *)encoding
997 {
998     [self _setStringValue: encoding forKey: WebKitDefaultTextEncodingNamePreferenceKey];
999 }
1000
1001 #if !PLATFORM(IOS)
1002 - (BOOL)userStyleSheetEnabled
1003 {
1004     return [self _boolValueForKey: WebKitUserStyleSheetEnabledPreferenceKey];
1005 }
1006
1007 - (void)setUserStyleSheetEnabled:(BOOL)flag
1008 {
1009     [self _setBoolValue: flag forKey: WebKitUserStyleSheetEnabledPreferenceKey];
1010 }
1011
1012 - (NSURL *)userStyleSheetLocation
1013 {
1014     NSString *locationString = [self _stringValueForKey: WebKitUserStyleSheetLocationPreferenceKey];
1015     
1016     if ([locationString _webkit_looksLikeAbsoluteURL]) {
1017         return [NSURL _web_URLWithDataAsString:locationString];
1018     } else {
1019         locationString = [locationString stringByExpandingTildeInPath];
1020         return [NSURL fileURLWithPath:locationString isDirectory:NO];
1021     }
1022 }
1023
1024 - (void)setUserStyleSheetLocation:(NSURL *)URL
1025 {
1026     NSString *locationString;
1027     
1028     if ([URL isFileURL]) {
1029         locationString = [[URL path] _web_stringByAbbreviatingWithTildeInPath];
1030     } else {
1031         locationString = [URL _web_originalDataAsString];
1032     }
1033
1034     if (!locationString)
1035         locationString = @"";
1036
1037     [self _setStringValue:locationString forKey: WebKitUserStyleSheetLocationPreferenceKey];
1038 }
1039 #else
1040
1041 // These methods have had their implementations removed on iOS since it
1042 // is wrong to have such a setting stored in preferences that, when read,
1043 // is applied to all WebViews in a iOS process. Such a design might work
1044 // OK for an application like Safari on Mac OS X, where the only WebViews
1045 // in use display web content in a straightforward manner. However, it is
1046 // wrong for iOS, where WebViews are used for various purposes, like
1047 // text editing, text rendering, and displaying web content.
1048 // 
1049 // I have changed the user style sheet mechanism to be a per-WebView
1050 // setting, rather than a per-process preference. This seems to give the
1051 // behavior we want for iOS.
1052
1053 - (BOOL)userStyleSheetEnabled
1054 {
1055     return NO;
1056 }
1057
1058 - (void)setUserStyleSheetEnabled:(BOOL)flag
1059 {
1060     // no-op
1061 }
1062
1063 - (NSURL *)userStyleSheetLocation
1064 {
1065     return nil;
1066 }
1067
1068 - (void)setUserStyleSheetLocation:(NSURL *)URL
1069 {
1070     // no-op
1071 }
1072 #endif // PLATFORM(IOS)
1073
1074 #if !PLATFORM(IOS)
1075 - (BOOL)shouldPrintBackgrounds
1076 {
1077     return [self _boolValueForKey: WebKitShouldPrintBackgroundsPreferenceKey];
1078 }
1079
1080 - (void)setShouldPrintBackgrounds:(BOOL)flag
1081 {
1082     [self _setBoolValue: flag forKey: WebKitShouldPrintBackgroundsPreferenceKey];
1083 }
1084 #endif
1085
1086 - (BOOL)isJavaEnabled
1087 {
1088     return [self _boolValueForKey: WebKitJavaEnabledPreferenceKey];
1089 }
1090
1091 - (void)setJavaEnabled:(BOOL)flag
1092 {
1093     [self _setBoolValue: flag forKey: WebKitJavaEnabledPreferenceKey];
1094 }
1095
1096 - (BOOL)isJavaScriptEnabled
1097 {
1098     return [self _boolValueForKey: WebKitJavaScriptEnabledPreferenceKey];
1099 }
1100
1101 - (void)setJavaScriptEnabled:(BOOL)flag
1102 {
1103     [self _setBoolValue: flag forKey: WebKitJavaScriptEnabledPreferenceKey];
1104 }
1105
1106 - (BOOL)javaScriptCanOpenWindowsAutomatically
1107 {
1108     return [self _boolValueForKey: WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey];
1109 }
1110
1111 - (void)setJavaScriptCanOpenWindowsAutomatically:(BOOL)flag
1112 {
1113     [self _setBoolValue: flag forKey: WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey];
1114 }
1115
1116 - (BOOL)arePlugInsEnabled
1117 {
1118     return [self _boolValueForKey: WebKitPluginsEnabledPreferenceKey];
1119 }
1120
1121 - (void)setPlugInsEnabled:(BOOL)flag
1122 {
1123     [self _setBoolValue: flag forKey: WebKitPluginsEnabledPreferenceKey];
1124 }
1125
1126 - (BOOL)allowsAnimatedImages
1127 {
1128     return [self _boolValueForKey: WebKitAllowAnimatedImagesPreferenceKey];
1129 }
1130
1131 - (void)setAllowsAnimatedImages:(BOOL)flag
1132 {
1133     [self _setBoolValue: flag forKey: WebKitAllowAnimatedImagesPreferenceKey];
1134 }
1135
1136 - (BOOL)allowsAnimatedImageLooping
1137 {
1138     return [self _boolValueForKey: WebKitAllowAnimatedImageLoopingPreferenceKey];
1139 }
1140
1141 - (void)setAllowsAnimatedImageLooping: (BOOL)flag
1142 {
1143     [self _setBoolValue: flag forKey: WebKitAllowAnimatedImageLoopingPreferenceKey];
1144 }
1145
1146 - (void)setLoadsImagesAutomatically: (BOOL)flag
1147 {
1148     [self _setBoolValue: flag forKey: WebKitDisplayImagesKey];
1149 }
1150
1151 - (BOOL)loadsImagesAutomatically
1152 {
1153     return [self _boolValueForKey: WebKitDisplayImagesKey];
1154 }
1155
1156 - (void)setAutosaves:(BOOL)flag
1157 {
1158     _private->autosaves = flag;
1159 }
1160
1161 - (BOOL)autosaves
1162 {
1163     return _private->autosaves;
1164 }
1165
1166 #if !PLATFORM(IOS)
1167 - (void)setTabsToLinks:(BOOL)flag
1168 {
1169     [self _setBoolValue: flag forKey: WebKitTabToLinksPreferenceKey];
1170 }
1171
1172 - (BOOL)tabsToLinks
1173 {
1174     return [self _boolValueForKey:WebKitTabToLinksPreferenceKey];
1175 }
1176 #endif
1177
1178 - (void)setPrivateBrowsingEnabled:(BOOL)enabled
1179 {
1180     [self _updatePrivateBrowsingStateTo:enabled];
1181     [self _setBoolValue:enabled forKey:WebKitPrivateBrowsingEnabledPreferenceKey];
1182 }
1183
1184 - (BOOL)privateBrowsingEnabled
1185 {
1186     // Changes to private browsing defaults do not have effect on existing WebPreferences, and must be done through -setPrivateBrowsingEnabled.
1187     // This is needed to accurately track private browsing sessions in the process.
1188     return _private->inPrivateBrowsing;
1189 }
1190
1191 - (void)_updatePrivateBrowsingStateTo:(BOOL)enabled
1192 {
1193     if (!_private) {
1194         ASSERT(!enabled);
1195         return;
1196     }
1197
1198     if (enabled == _private->inPrivateBrowsing)
1199         return;
1200     if (enabled > _private->inPrivateBrowsing) {
1201         WebFrameNetworkingContext::ensurePrivateBrowsingSession();
1202         ++webPreferencesInstanceCountWithPrivateBrowsingEnabled;
1203     } else {
1204         ASSERT(webPreferencesInstanceCountWithPrivateBrowsingEnabled);
1205         --webPreferencesInstanceCountWithPrivateBrowsingEnabled;
1206         if (!webPreferencesInstanceCountWithPrivateBrowsingEnabled)
1207             WebFrameNetworkingContext::destroyPrivateBrowsingSession();
1208     }
1209     _private->inPrivateBrowsing = enabled;
1210 }
1211
1212 - (void)setUsesPageCache:(BOOL)usesPageCache
1213 {
1214     [self _setBoolValue:usesPageCache forKey:WebKitUsesPageCachePreferenceKey];
1215 }
1216
1217 - (BOOL)usesPageCache
1218 {
1219     return [self _boolValueForKey:WebKitUsesPageCachePreferenceKey];
1220 }
1221
1222 - (void)_postCacheModelChangedNotification
1223 {
1224 #if !PLATFORM(IOS)
1225     if (!pthread_main_np()) {
1226         [self performSelectorOnMainThread:_cmd withObject:nil waitUntilDone:NO];
1227         return;
1228     }
1229 #endif
1230
1231     [[NSNotificationCenter defaultCenter] postNotificationName:WebPreferencesCacheModelChangedInternalNotification object:self userInfo:nil];
1232 }
1233
1234 - (void)setCacheModel:(WebCacheModel)cacheModel
1235 {
1236     [self _setIntegerValue:cacheModel forKey:WebKitCacheModelPreferenceKey];
1237     [self setAutomaticallyDetectsCacheModel:NO];
1238     [self _postCacheModelChangedNotification];
1239 }
1240
1241 - (WebCacheModel)cacheModel
1242 {
1243     return (WebCacheModel)[self _integerValueForKey:WebKitCacheModelPreferenceKey];
1244 }
1245
1246
1247 - (void)setSuppressesIncrementalRendering:(BOOL)suppressesIncrementalRendering
1248 {
1249     [self _setBoolValue:suppressesIncrementalRendering forKey:WebKitSuppressesIncrementalRenderingKey];
1250 }
1251
1252 - (BOOL)suppressesIncrementalRendering
1253 {
1254     return [self _boolValueForKey:WebKitSuppressesIncrementalRenderingKey];
1255 }
1256
1257 - (BOOL)allowsAirPlayForMediaPlayback
1258 {
1259 #if ENABLE(WIRELESS_TARGET_PLAYBACK)
1260     return [self _boolValueForKey:WebKitAllowsAirPlayForMediaPlaybackPreferenceKey];
1261 #else
1262     return false;
1263 #endif
1264 }
1265
1266 - (void)setAllowsAirPlayForMediaPlayback:(BOOL)flag
1267 {
1268 #if ENABLE(WIRELESS_TARGET_PLAYBACK)
1269     [self _setBoolValue:flag forKey:WebKitAllowsAirPlayForMediaPlaybackPreferenceKey];
1270 #endif
1271 }
1272
1273 @end
1274
1275 @implementation WebPreferences (WebPrivate)
1276
1277 - (BOOL)isDNSPrefetchingEnabled
1278 {
1279     return [self _boolValueForKey:WebKitDNSPrefetchingEnabledPreferenceKey];
1280 }
1281
1282 - (void)setDNSPrefetchingEnabled:(BOOL)flag
1283 {
1284     [self _setBoolValue:flag forKey:WebKitDNSPrefetchingEnabledPreferenceKey];
1285 }
1286
1287 - (BOOL)developerExtrasEnabled
1288 {
1289     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
1290     if ([defaults boolForKey:@"DisableWebKitDeveloperExtras"])
1291         return NO;
1292 #ifdef NDEBUG
1293     if ([defaults boolForKey:@"WebKitDeveloperExtras"] || [defaults boolForKey:@"IncludeDebugMenu"])
1294         return YES;
1295     return [self _boolValueForKey:WebKitDeveloperExtrasEnabledPreferenceKey];
1296 #else
1297     return YES; // always enable in debug builds
1298 #endif
1299 }
1300
1301 - (WebKitJavaScriptRuntimeFlags)javaScriptRuntimeFlags
1302 {
1303     return static_cast<WebKitJavaScriptRuntimeFlags>([self _unsignedIntValueForKey:WebKitJavaScriptRuntimeFlagsPreferenceKey]);
1304 }
1305
1306 - (void)setJavaScriptRuntimeFlags:(WebKitJavaScriptRuntimeFlags)flags
1307 {
1308     [self _setUnsignedIntValue:flags forKey:WebKitJavaScriptRuntimeFlagsPreferenceKey];
1309 }
1310
1311 - (void)setDeveloperExtrasEnabled:(BOOL)flag
1312 {
1313     [self _setBoolValue:flag forKey:WebKitDeveloperExtrasEnabledPreferenceKey];
1314 }
1315
1316 - (BOOL)authorAndUserStylesEnabled
1317 {
1318     return [self _boolValueForKey:WebKitAuthorAndUserStylesEnabledPreferenceKey];
1319 }
1320
1321 - (void)setAuthorAndUserStylesEnabled:(BOOL)flag
1322 {
1323     [self _setBoolValue:flag forKey:WebKitAuthorAndUserStylesEnabledPreferenceKey];
1324 }
1325
1326 // FIXME: applicationChromeMode is no longer needed by ToT, but is still used in Safari 8.
1327 - (BOOL)applicationChromeModeEnabled
1328 {
1329     return NO;
1330 }
1331
1332 - (void)setApplicationChromeModeEnabled:(BOOL)flag
1333 {
1334 }
1335
1336 - (BOOL)domTimersThrottlingEnabled
1337 {
1338     return [self _boolValueForKey:WebKitDOMTimersThrottlingEnabledPreferenceKey];
1339 }
1340
1341 - (void)setDOMTimersThrottlingEnabled:(BOOL)flag
1342 {
1343     [self _setBoolValue:flag forKey:WebKitDOMTimersThrottlingEnabledPreferenceKey];
1344 }
1345
1346 - (BOOL)webArchiveDebugModeEnabled
1347 {
1348     return [self _boolValueForKey:WebKitWebArchiveDebugModeEnabledPreferenceKey];
1349 }
1350
1351 - (void)setWebArchiveDebugModeEnabled:(BOOL)flag
1352 {
1353     [self _setBoolValue:flag forKey:WebKitWebArchiveDebugModeEnabledPreferenceKey];
1354 }
1355
1356 - (BOOL)localFileContentSniffingEnabled
1357 {
1358     return [self _boolValueForKey:WebKitLocalFileContentSniffingEnabledPreferenceKey];
1359 }
1360
1361 - (void)setLocalFileContentSniffingEnabled:(BOOL)flag
1362 {
1363     [self _setBoolValue:flag forKey:WebKitLocalFileContentSniffingEnabledPreferenceKey];
1364 }
1365
1366 - (BOOL)offlineWebApplicationCacheEnabled
1367 {
1368     return [self _boolValueForKey:WebKitOfflineWebApplicationCacheEnabledPreferenceKey];
1369 }
1370
1371 - (void)setOfflineWebApplicationCacheEnabled:(BOOL)flag
1372 {
1373     [self _setBoolValue:flag forKey:WebKitOfflineWebApplicationCacheEnabledPreferenceKey];
1374 }
1375
1376 - (BOOL)zoomsTextOnly
1377 {
1378     return [self _boolValueForKey:WebKitZoomsTextOnlyPreferenceKey];
1379 }
1380
1381 - (void)setZoomsTextOnly:(BOOL)flag
1382 {
1383     [self _setBoolValue:flag forKey:WebKitZoomsTextOnlyPreferenceKey];
1384 }
1385
1386 - (BOOL)javaScriptCanAccessClipboard
1387 {
1388     return [self _boolValueForKey:WebKitJavaScriptCanAccessClipboardPreferenceKey];
1389 }
1390
1391 - (void)setJavaScriptCanAccessClipboard:(BOOL)flag
1392 {
1393     [self _setBoolValue:flag forKey:WebKitJavaScriptCanAccessClipboardPreferenceKey];
1394 }
1395
1396 - (BOOL)isXSSAuditorEnabled
1397 {
1398     return [self _boolValueForKey:WebKitXSSAuditorEnabledPreferenceKey];
1399 }
1400
1401 - (void)setXSSAuditorEnabled:(BOOL)flag
1402 {
1403     [self _setBoolValue:flag forKey:WebKitXSSAuditorEnabledPreferenceKey];
1404 }
1405
1406 #if !PLATFORM(IOS)
1407 - (BOOL)respectStandardStyleKeyEquivalents
1408 {
1409     return [self _boolValueForKey:WebKitRespectStandardStyleKeyEquivalentsPreferenceKey];
1410 }
1411
1412 - (void)setRespectStandardStyleKeyEquivalents:(BOOL)flag
1413 {
1414     [self _setBoolValue:flag forKey:WebKitRespectStandardStyleKeyEquivalentsPreferenceKey];
1415 }
1416
1417 - (BOOL)showsURLsInToolTips
1418 {
1419     return [self _boolValueForKey:WebKitShowsURLsInToolTipsPreferenceKey];
1420 }
1421
1422 - (void)setShowsURLsInToolTips:(BOOL)flag
1423 {
1424     [self _setBoolValue:flag forKey:WebKitShowsURLsInToolTipsPreferenceKey];
1425 }
1426
1427 - (BOOL)showsToolTipOverTruncatedText
1428 {
1429     return [self _boolValueForKey:WebKitShowsToolTipOverTruncatedTextPreferenceKey];
1430 }
1431
1432 - (void)setShowsToolTipOverTruncatedText:(BOOL)flag
1433 {
1434     [self _setBoolValue:flag forKey:WebKitShowsToolTipOverTruncatedTextPreferenceKey];
1435 }
1436
1437 - (BOOL)textAreasAreResizable
1438 {
1439     return [self _boolValueForKey: WebKitTextAreasAreResizablePreferenceKey];
1440 }
1441
1442 - (void)setTextAreasAreResizable:(BOOL)flag
1443 {
1444     [self _setBoolValue: flag forKey: WebKitTextAreasAreResizablePreferenceKey];
1445 }
1446 #endif // !PLATFORM(IOS)
1447
1448 - (BOOL)shrinksStandaloneImagesToFit
1449 {
1450     return [self _boolValueForKey:WebKitShrinksStandaloneImagesToFitPreferenceKey];
1451 }
1452
1453 - (void)setShrinksStandaloneImagesToFit:(BOOL)flag
1454 {
1455     [self _setBoolValue:flag forKey:WebKitShrinksStandaloneImagesToFitPreferenceKey];
1456 }
1457
1458 - (BOOL)automaticallyDetectsCacheModel
1459 {
1460     return _private->automaticallyDetectsCacheModel;
1461 }
1462
1463 - (void)setAutomaticallyDetectsCacheModel:(BOOL)automaticallyDetectsCacheModel
1464 {
1465     _private->automaticallyDetectsCacheModel = automaticallyDetectsCacheModel;
1466 }
1467
1468 - (BOOL)usesEncodingDetector
1469 {
1470     return [self _boolValueForKey: WebKitUsesEncodingDetectorPreferenceKey];
1471 }
1472
1473 - (void)setUsesEncodingDetector:(BOOL)flag
1474 {
1475     [self _setBoolValue: flag forKey: WebKitUsesEncodingDetectorPreferenceKey];
1476 }
1477
1478 - (BOOL)isWebSecurityEnabled
1479 {
1480     return [self _boolValueForKey: WebKitWebSecurityEnabledPreferenceKey];
1481 }
1482
1483 - (void)setWebSecurityEnabled:(BOOL)flag
1484 {
1485     [self _setBoolValue: flag forKey: WebKitWebSecurityEnabledPreferenceKey];
1486 }
1487
1488 - (BOOL)allowUniversalAccessFromFileURLs
1489 {
1490     return [self _boolValueForKey: WebKitAllowUniversalAccessFromFileURLsPreferenceKey];
1491 }
1492
1493 - (void)setAllowUniversalAccessFromFileURLs:(BOOL)flag
1494 {
1495     [self _setBoolValue: flag forKey: WebKitAllowUniversalAccessFromFileURLsPreferenceKey];
1496 }
1497
1498 - (BOOL)allowFileAccessFromFileURLs
1499 {
1500     return [self _boolValueForKey: WebKitAllowFileAccessFromFileURLsPreferenceKey];
1501 }
1502
1503 - (void)setAllowFileAccessFromFileURLs:(BOOL)flag
1504 {
1505     [self _setBoolValue: flag forKey: WebKitAllowFileAccessFromFileURLsPreferenceKey];
1506 }
1507
1508 - (BOOL)allowCrossOriginSubresourcesToAskForCredentials
1509 {
1510     return [self _boolValueForKey:WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey];
1511 }
1512
1513 - (void)setAllowCrossOriginSubresourcesToAskForCredentials:(BOOL)flag
1514 {
1515     [self _setBoolValue:flag forKey:WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey];
1516 }
1517
1518 - (BOOL)needsStorageAccessFromFileURLsQuirk
1519 {
1520     return [self _boolValueForKey: WebKitNeedsStorageAccessFromFileURLsQuirkKey];
1521 }
1522
1523 -(void)setNeedsStorageAccessFromFileURLsQuirk:(BOOL)flag
1524 {
1525     [self _setBoolValue: flag forKey: WebKitNeedsStorageAccessFromFileURLsQuirkKey];
1526 }
1527
1528 - (NSTimeInterval)_backForwardCacheExpirationInterval
1529 {
1530     return (NSTimeInterval)[self _floatValueForKey:WebKitBackForwardCacheExpirationIntervalKey];
1531 }
1532
1533 #if PLATFORM(IOS)
1534 - (BOOL)_standalone
1535 {
1536     return [self _boolValueForKey:WebKitStandalonePreferenceKey];
1537 }
1538
1539 - (void)_setStandalone:(BOOL)flag
1540 {
1541     [self _setBoolValue:flag forKey:WebKitStandalonePreferenceKey];
1542 }
1543
1544 - (void)_setTelephoneNumberParsingEnabled:(BOOL)flag
1545 {
1546     [self _setBoolValue:flag forKey:WebKitTelephoneParsingEnabledPreferenceKey];
1547 }
1548
1549 - (BOOL)_telephoneNumberParsingEnabled
1550 {
1551     return [self _boolValueForKey:WebKitTelephoneParsingEnabledPreferenceKey];
1552 }
1553 #endif
1554
1555 #if ENABLE(TEXT_AUTOSIZING)
1556 - (void)_setMinimumZoomFontSize:(float)size
1557 {
1558     [self _setFloatValue:size forKey:WebKitMinimumZoomFontSizePreferenceKey];
1559 }
1560
1561 - (float)_minimumZoomFontSize
1562 {
1563     return [self _floatValueForKey:WebKitMinimumZoomFontSizePreferenceKey];
1564 }
1565
1566 - (void)_setTextAutosizingEnabled:(BOOL)enabled
1567 {
1568     [self _setBoolValue:enabled forKey:WebKitTextAutosizingEnabledPreferenceKey];
1569 }
1570
1571 - (BOOL)_textAutosizingEnabled
1572 {
1573     return [self _boolValueForKey:WebKitTextAutosizingEnabledPreferenceKey];
1574 }
1575 #endif
1576
1577 #if PLATFORM(IOS)
1578 - (void)_setLayoutInterval:(int)l
1579 {
1580     [self _setIntegerValue:l forKey:WebKitLayoutIntervalPreferenceKey];
1581 }
1582
1583 - (int)_layoutInterval
1584 {
1585     return [self _integerValueForKey:WebKitLayoutIntervalPreferenceKey];
1586 }
1587
1588 - (void)_setMaxParseDuration:(float)d
1589 {
1590     [self _setFloatValue:d forKey:WebKitMaxParseDurationPreferenceKey];
1591 }
1592
1593 - (float)_maxParseDuration
1594 {
1595     return [self _floatValueForKey:WebKitMaxParseDurationPreferenceKey];
1596 }
1597
1598 - (void)_setAllowMultiElementImplicitFormSubmission:(BOOL)flag
1599 {
1600     [self _setBoolValue:flag forKey:WebKitAllowMultiElementImplicitFormSubmissionPreferenceKey];
1601 }
1602
1603 - (BOOL)_allowMultiElementImplicitFormSubmission
1604 {
1605     return [self _boolValueForKey:WebKitAllowMultiElementImplicitFormSubmissionPreferenceKey];
1606 }
1607
1608 - (void)_setAlwaysRequestGeolocationPermission:(BOOL)flag
1609 {
1610     [self _setBoolValue:flag forKey:WebKitAlwaysRequestGeolocationPermissionPreferenceKey];
1611 }
1612
1613 - (BOOL)_alwaysRequestGeolocationPermission
1614 {
1615     return [self _boolValueForKey:WebKitAlwaysRequestGeolocationPermissionPreferenceKey];
1616 }
1617
1618 - (void)_setAlwaysUseAcceleratedOverflowScroll:(BOOL)flag
1619 {
1620     [self _setBoolValue:flag forKey:WebKitAlwaysUseAcceleratedOverflowScrollPreferenceKey];
1621 }
1622
1623 - (BOOL)_alwaysUseAcceleratedOverflowScroll
1624 {
1625     return [self _boolValueForKey:WebKitAlwaysUseAcceleratedOverflowScrollPreferenceKey];
1626 }
1627
1628 - (void)_setInterpolationQuality:(int)quality
1629 {
1630     [self _setIntegerValue:quality forKey:WebKitInterpolationQualityPreferenceKey];
1631 }
1632
1633 - (int)_interpolationQuality
1634 {
1635     return [self _integerValueForKey:WebKitInterpolationQualityPreferenceKey];
1636 }
1637
1638 - (BOOL)_allowPasswordEcho
1639 {
1640     return [self _boolValueForKey:WebKitPasswordEchoEnabledPreferenceKey];
1641 }
1642
1643 - (float)_passwordEchoDuration
1644 {
1645     return [self _floatValueForKey:WebKitPasswordEchoDurationPreferenceKey];
1646 }
1647
1648 #endif // PLATFORM(IOS)
1649
1650 #if !PLATFORM(IOS)
1651 - (float)PDFScaleFactor
1652 {
1653     return [self _floatValueForKey:WebKitPDFScaleFactorPreferenceKey];
1654 }
1655
1656 - (void)setPDFScaleFactor:(float)factor
1657 {
1658     [self _setFloatValue:factor forKey:WebKitPDFScaleFactorPreferenceKey];
1659 }
1660 #endif
1661
1662 - (int64_t)applicationCacheTotalQuota
1663 {
1664     return [self _longLongValueForKey:WebKitApplicationCacheTotalQuota];
1665 }
1666
1667 - (void)setApplicationCacheTotalQuota:(int64_t)quota
1668 {
1669     [self _setLongLongValue:quota forKey:WebKitApplicationCacheTotalQuota];
1670
1671     // Application Cache Preferences are stored on the global cache storage manager, not in Settings.
1672     [WebApplicationCache setMaximumSize:quota];
1673 }
1674
1675 - (int64_t)applicationCacheDefaultOriginQuota
1676 {
1677     return [self _longLongValueForKey:WebKitApplicationCacheDefaultOriginQuota];
1678 }
1679
1680 - (void)setApplicationCacheDefaultOriginQuota:(int64_t)quota
1681 {
1682     [self _setLongLongValue:quota forKey:WebKitApplicationCacheDefaultOriginQuota];
1683 }
1684
1685 #if !PLATFORM(IOS)
1686 - (PDFDisplayMode)PDFDisplayMode
1687 {
1688     PDFDisplayMode value = static_cast<PDFDisplayMode>([self _integerValueForKey:WebKitPDFDisplayModePreferenceKey]);
1689     if (value != kPDFDisplaySinglePage && value != kPDFDisplaySinglePageContinuous && value != kPDFDisplayTwoUp && value != kPDFDisplayTwoUpContinuous) {
1690         // protect against new modes from future versions of OS X stored in defaults
1691         value = kPDFDisplaySinglePageContinuous;
1692     }
1693     return value;
1694 }
1695
1696 - (void)setPDFDisplayMode:(PDFDisplayMode)mode
1697 {
1698     [self _setIntegerValue:mode forKey:WebKitPDFDisplayModePreferenceKey];
1699 }
1700 #endif
1701
1702 - (WebKitEditableLinkBehavior)editableLinkBehavior
1703 {
1704     WebKitEditableLinkBehavior value = static_cast<WebKitEditableLinkBehavior> ([self _integerValueForKey:WebKitEditableLinkBehaviorPreferenceKey]);
1705     if (value != WebKitEditableLinkDefaultBehavior &&
1706         value != WebKitEditableLinkAlwaysLive &&
1707         value != WebKitEditableLinkNeverLive &&
1708         value != WebKitEditableLinkOnlyLiveWithShiftKey &&
1709         value != WebKitEditableLinkLiveWhenNotFocused) {
1710         // ensure that a valid result is returned
1711         value = WebKitEditableLinkDefaultBehavior;
1712     }
1713     
1714     return value;
1715 }
1716
1717 - (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior
1718 {
1719     [self _setIntegerValue:behavior forKey:WebKitEditableLinkBehaviorPreferenceKey];
1720 }
1721
1722 - (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior
1723 {
1724     WebTextDirectionSubmenuInclusionBehavior value = static_cast<WebTextDirectionSubmenuInclusionBehavior>([self _integerValueForKey:WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey]);
1725     if (value != WebTextDirectionSubmenuNeverIncluded &&
1726         value != WebTextDirectionSubmenuAutomaticallyIncluded &&
1727         value != WebTextDirectionSubmenuAlwaysIncluded) {
1728         // Ensure that a valid result is returned.
1729         value = WebTextDirectionSubmenuNeverIncluded;
1730     }
1731     return value;
1732 }
1733
1734 - (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior
1735 {
1736     [self _setIntegerValue:behavior forKey:WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey];
1737 }
1738
1739 - (BOOL)_useSiteSpecificSpoofing
1740 {
1741     return [self _boolValueForKey:WebKitUseSiteSpecificSpoofingPreferenceKey];
1742 }
1743
1744 - (void)_setUseSiteSpecificSpoofing:(BOOL)newValue
1745 {
1746     [self _setBoolValue:newValue forKey:WebKitUseSiteSpecificSpoofingPreferenceKey];
1747 }
1748
1749 - (BOOL)databasesEnabled
1750 {
1751     return [self _boolValueForKey:WebKitDatabasesEnabledPreferenceKey];
1752 }
1753
1754 - (void)setDatabasesEnabled:(BOOL)databasesEnabled
1755 {
1756     [self _setBoolValue:databasesEnabled forKey:WebKitDatabasesEnabledPreferenceKey];
1757 }
1758
1759 #if PLATFORM(IOS)
1760 - (BOOL)storageTrackerEnabled
1761 {
1762     return [self _boolValueForKey:WebKitStorageTrackerEnabledPreferenceKey];
1763 }
1764
1765 - (void)setStorageTrackerEnabled:(BOOL)storageTrackerEnabled
1766 {
1767     [self _setBoolValue:storageTrackerEnabled forKey:WebKitStorageTrackerEnabledPreferenceKey];
1768 }
1769 #endif
1770
1771 - (BOOL)localStorageEnabled
1772 {
1773     return [self _boolValueForKey:WebKitLocalStorageEnabledPreferenceKey];
1774 }
1775
1776 - (void)setLocalStorageEnabled:(BOOL)localStorageEnabled
1777 {
1778     [self _setBoolValue:localStorageEnabled forKey:WebKitLocalStorageEnabledPreferenceKey];
1779 }
1780
1781 - (BOOL)experimentalNotificationsEnabled
1782 {
1783     return [self _boolValueForKey:WebKitExperimentalNotificationsEnabledPreferenceKey];
1784 }
1785
1786 - (void)setExperimentalNotificationsEnabled:(BOOL)experimentalNotificationsEnabled
1787 {
1788     [self _setBoolValue:experimentalNotificationsEnabled forKey:WebKitExperimentalNotificationsEnabledPreferenceKey];
1789 }
1790
1791 + (WebPreferences *)_getInstanceForIdentifier:(NSString *)ident
1792 {
1793     LOG(Encoding, "requesting for %@\n", ident);
1794
1795     if (!ident)
1796         return _standardPreferences;
1797     
1798     WebPreferences *instance = [webPreferencesInstances objectForKey:[self _concatenateKeyWithIBCreatorID:ident]];
1799
1800     return instance;
1801 }
1802
1803 + (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)ident
1804 {
1805     if (!webPreferencesInstances)
1806         webPreferencesInstances = [[NSMutableDictionary alloc] init];
1807     if (ident) {
1808         [webPreferencesInstances setObject:instance forKey:[self _concatenateKeyWithIBCreatorID:ident]];
1809         LOG(Encoding, "recording %p for %@\n", instance, [self _concatenateKeyWithIBCreatorID:ident]);
1810     }
1811 }
1812
1813 + (void)_checkLastReferenceForIdentifier:(id)identifier
1814 {
1815     // FIXME: This won't work at all under garbage collection because retainCount returns a constant.
1816     // We may need to change WebPreferences API so there's an explicit way to end the lifetime of one.
1817     WebPreferences *instance = [webPreferencesInstances objectForKey:identifier];
1818     if ([instance retainCount] == 1)
1819         [webPreferencesInstances removeObjectForKey:identifier];
1820 }
1821
1822 + (void)_removeReferenceForIdentifier:(NSString *)ident
1823 {
1824     if (ident)
1825         [self performSelector:@selector(_checkLastReferenceForIdentifier:) withObject:[self _concatenateKeyWithIBCreatorID:ident] afterDelay:0.1];
1826 }
1827
1828 - (void)_postPreferencesChangedNotification
1829 {
1830 #if !PLATFORM(IOS)
1831     if (!pthread_main_np()) {
1832         [self performSelectorOnMainThread:_cmd withObject:nil waitUntilDone:NO];
1833         return;
1834     }
1835 #endif
1836
1837     [[NSNotificationCenter defaultCenter] postNotificationName:WebPreferencesChangedInternalNotification object:self userInfo:nil];
1838     [[NSNotificationCenter defaultCenter] postNotificationName:WebPreferencesChangedNotification object:self userInfo:nil];
1839 }
1840
1841 - (void)_postPreferencesChangedAPINotification
1842 {
1843     if (!pthread_main_np()) {
1844         [self performSelectorOnMainThread:_cmd withObject:nil waitUntilDone:NO];
1845         return;
1846     }
1847
1848     [[NSNotificationCenter defaultCenter] postNotificationName:WebPreferencesChangedNotification object:self userInfo:nil];
1849 }
1850
1851 + (CFStringEncoding)_systemCFStringEncoding
1852 {
1853     return webDefaultCFStringEncoding();
1854 }
1855
1856 + (void)_setInitialDefaultTextEncodingToSystemEncoding
1857 {
1858     [[NSUserDefaults standardUserDefaults] registerDefaults:
1859         [NSDictionary dictionaryWithObject:defaultTextEncodingNameForSystemLanguage() forKey:WebKitDefaultTextEncodingNamePreferenceKey]];
1860 }
1861
1862 static NSString *classIBCreatorID = nil;
1863
1864 + (void)_setIBCreatorID:(NSString *)string
1865 {
1866     NSString *old = classIBCreatorID;
1867     classIBCreatorID = [string copy];
1868     [old release];
1869 }
1870
1871 + (void)_switchNetworkLoaderToNewTestingSession
1872 {
1873 #if PLATFORM(IOS)
1874     WebThreadLock();
1875 #endif
1876     NetworkStorageSession::switchToNewTestingSession();
1877 }
1878
1879 + (void)_clearNetworkLoaderSession
1880 {
1881     NetworkStorageSession::defaultStorageSession().deleteAllCookies();
1882 }
1883
1884 + (void)_setCurrentNetworkLoaderSessionCookieAcceptPolicy:(NSHTTPCookieAcceptPolicy)policy
1885 {
1886     RetainPtr<CFHTTPCookieStorageRef> cookieStorage = NetworkStorageSession::defaultStorageSession().cookieStorage();
1887     ASSERT(cookieStorage); // Will fail when NetworkStorageSession::switchToNewTestingSession() was not called beforehand.
1888     CFHTTPCookieStorageSetCookieAcceptPolicy(cookieStorage.get(), policy);
1889 }
1890
1891 - (BOOL)isDOMPasteAllowed
1892 {
1893     return [self _boolValueForKey:WebKitDOMPasteAllowedPreferenceKey];
1894 }
1895
1896 - (void)setDOMPasteAllowed:(BOOL)DOMPasteAllowed
1897 {
1898     [self _setBoolValue:DOMPasteAllowed forKey:WebKitDOMPasteAllowedPreferenceKey];
1899 }
1900
1901 - (NSString *)_localStorageDatabasePath
1902 {
1903     return [[self _stringValueForKey:WebKitLocalStorageDatabasePathPreferenceKey] stringByStandardizingPath];
1904 }
1905
1906 - (void)_setLocalStorageDatabasePath:(NSString *)path
1907 {
1908     [self _setStringValue:[path stringByStandardizingPath] forKey:WebKitLocalStorageDatabasePathPreferenceKey];
1909 }
1910
1911 - (NSString *)_ftpDirectoryTemplatePath
1912 {
1913     return [[self _stringValueForKey:WebKitFTPDirectoryTemplatePath] stringByStandardizingPath];
1914 }
1915
1916 - (void)_setFTPDirectoryTemplatePath:(NSString *)path
1917 {
1918     [self _setStringValue:[path stringByStandardizingPath] forKey:WebKitFTPDirectoryTemplatePath];
1919 }
1920
1921 - (BOOL)_forceFTPDirectoryListings
1922 {
1923     return [self _boolValueForKey:WebKitForceFTPDirectoryListings];
1924 }
1925
1926 - (void)_setForceFTPDirectoryListings:(BOOL)force
1927 {
1928     [self _setBoolValue:force forKey:WebKitForceFTPDirectoryListings];
1929 }
1930
1931 - (BOOL)acceleratedDrawingEnabled
1932 {
1933     return [self _boolValueForKey:WebKitAcceleratedDrawingEnabledPreferenceKey];
1934 }
1935
1936 - (void)setAcceleratedDrawingEnabled:(BOOL)enabled
1937 {
1938     [self _setBoolValue:enabled forKey:WebKitAcceleratedDrawingEnabledPreferenceKey];
1939 }
1940
1941 - (BOOL)displayListDrawingEnabled
1942 {
1943     return [self _boolValueForKey:WebKitDisplayListDrawingEnabledPreferenceKey];
1944 }
1945
1946 - (void)setDisplayListDrawingEnabled:(BOOL)enabled
1947 {
1948     [self _setBoolValue:enabled forKey:WebKitDisplayListDrawingEnabledPreferenceKey];
1949 }
1950
1951 - (BOOL)resourceLoadStatisticsEnabled
1952 {
1953     return [self _boolValueForKey:WebKitResourceLoadStatisticsEnabledPreferenceKey];
1954 }
1955
1956 - (void)setResourceLoadStatisticsEnabled:(BOOL)enabled
1957 {
1958     [self _setBoolValue:enabled forKey:WebKitResourceLoadStatisticsEnabledPreferenceKey];
1959 }
1960
1961 - (BOOL)largeImageAsyncDecodingEnabled
1962 {
1963     return [self _boolValueForKey:WebKitLargeImageAsyncDecodingEnabledPreferenceKey];
1964 }
1965
1966 - (void)setLargeImageAsyncDecodingEnabled:(BOOL)enabled
1967 {
1968     [self _setBoolValue:enabled forKey:WebKitLargeImageAsyncDecodingEnabledPreferenceKey];
1969 }
1970
1971 - (BOOL)animatedImageAsyncDecodingEnabled
1972 {
1973     return [self _boolValueForKey:WebKitAnimatedImageAsyncDecodingEnabledPreferenceKey];
1974 }
1975
1976 - (void)setAnimatedImageAsyncDecodingEnabled:(BOOL)enabled
1977 {
1978     [self _setBoolValue:enabled forKey:WebKitAnimatedImageAsyncDecodingEnabledPreferenceKey];
1979 }
1980
1981 - (BOOL)canvasUsesAcceleratedDrawing
1982 {
1983     return [self _boolValueForKey:WebKitCanvasUsesAcceleratedDrawingPreferenceKey];
1984 }
1985
1986 - (void)setCanvasUsesAcceleratedDrawing:(BOOL)enabled
1987 {
1988     [self _setBoolValue:enabled forKey:WebKitCanvasUsesAcceleratedDrawingPreferenceKey];
1989 }
1990
1991 - (BOOL)acceleratedCompositingEnabled
1992 {
1993     return [self _boolValueForKey:WebKitAcceleratedCompositingEnabledPreferenceKey];
1994 }
1995
1996 - (void)setAcceleratedCompositingEnabled:(BOOL)enabled
1997 {
1998     [self _setBoolValue:enabled forKey:WebKitAcceleratedCompositingEnabledPreferenceKey];
1999 }
2000
2001 - (BOOL)showDebugBorders
2002 {
2003     return [self _boolValueForKey:WebKitShowDebugBordersPreferenceKey];
2004 }
2005
2006 - (void)setShowDebugBorders:(BOOL)enabled
2007 {
2008     [self _setBoolValue:enabled forKey:WebKitShowDebugBordersPreferenceKey];
2009 }
2010
2011 - (BOOL)subpixelAntialiasedLayerTextEnabled
2012 {
2013     return [self _boolValueForKey:WebKitSubpixelAntialiasedLayerTextEnabledPreferenceKey];
2014 }
2015
2016 - (void)setSubpixelAntialiasedLayerTextEnabled:(BOOL)enabled
2017 {
2018     [self _setBoolValue:enabled forKey:WebKitSubpixelAntialiasedLayerTextEnabledPreferenceKey];
2019 }
2020
2021 - (BOOL)simpleLineLayoutEnabled
2022 {
2023     return [self _boolValueForKey:WebKitSimpleLineLayoutEnabledPreferenceKey];
2024 }
2025
2026 - (void)setSimpleLineLayoutEnabled:(BOOL)enabled
2027 {
2028     [self _setBoolValue:enabled forKey:WebKitSimpleLineLayoutEnabledPreferenceKey];
2029 }
2030
2031 - (BOOL)simpleLineLayoutDebugBordersEnabled
2032 {
2033     return [self _boolValueForKey:WebKitSimpleLineLayoutDebugBordersEnabledPreferenceKey];
2034 }
2035
2036 - (void)setSimpleLineLayoutDebugBordersEnabled:(BOOL)enabled
2037 {
2038     [self _setBoolValue:enabled forKey:WebKitSimpleLineLayoutDebugBordersEnabledPreferenceKey];
2039 }
2040
2041 - (BOOL)showRepaintCounter
2042 {
2043     return [self _boolValueForKey:WebKitShowRepaintCounterPreferenceKey];
2044 }
2045
2046 - (void)setShowRepaintCounter:(BOOL)enabled
2047 {
2048     [self _setBoolValue:enabled forKey:WebKitShowRepaintCounterPreferenceKey];
2049 }
2050
2051 - (BOOL)webAudioEnabled
2052 {
2053     return [self _boolValueForKey:WebKitWebAudioEnabledPreferenceKey];
2054 }
2055
2056 - (void)setWebAudioEnabled:(BOOL)enabled
2057 {
2058     [self _setBoolValue:enabled forKey:WebKitWebAudioEnabledPreferenceKey];
2059 }
2060
2061 - (BOOL)subpixelCSSOMElementMetricsEnabled
2062 {
2063     return [self _boolValueForKey:WebKitSubpixelCSSOMElementMetricsEnabledPreferenceKey];
2064 }
2065
2066 - (void)setSubpixelCSSOMElementMetricsEnabled:(BOOL)enabled
2067 {
2068     [self _setBoolValue:enabled forKey:WebKitSubpixelCSSOMElementMetricsEnabledPreferenceKey];
2069 }
2070
2071 - (BOOL)webGLEnabled
2072 {
2073     return [self _boolValueForKey:WebKitWebGLEnabledPreferenceKey];
2074 }
2075
2076 - (void)setWebGLEnabled:(BOOL)enabled
2077 {
2078     [self _setBoolValue:enabled forKey:WebKitWebGLEnabledPreferenceKey];
2079 }
2080
2081 - (BOOL)webGL2Enabled
2082 {
2083     return [self _boolValueForKey:WebKitWebGL2EnabledPreferenceKey];
2084 }
2085
2086 - (void)setWebGL2Enabled:(BOOL)enabled
2087 {
2088     [self _setBoolValue:enabled forKey:WebKitWebGL2EnabledPreferenceKey];
2089 }
2090
2091 - (BOOL)forceSoftwareWebGLRendering
2092 {
2093     return [self _boolValueForKey:WebKitForceSoftwareWebGLRenderingPreferenceKey];
2094 }
2095
2096 - (void)setForceSoftwareWebGLRendering:(BOOL)forced
2097 {
2098     [self _setBoolValue:forced forKey:WebKitForceSoftwareWebGLRenderingPreferenceKey];
2099 }
2100
2101 - (BOOL)forceLowPowerGPUForWebGL
2102 {
2103     return [self _boolValueForKey:WebKitForceWebGLUsesLowPowerPreferenceKey];
2104 }
2105
2106 - (void)setForceWebGLUsesLowPower:(BOOL)forceLowPower
2107 {
2108     [self _setBoolValue:forceLowPower forKey:WebKitForceWebGLUsesLowPowerPreferenceKey];
2109 }
2110
2111 - (BOOL)webGPUEnabled
2112 {
2113     return [self _boolValueForKey:WebKitWebGPUEnabledPreferenceKey];
2114 }
2115
2116 - (void)setWebGPUEnabled:(BOOL)enabled
2117 {
2118     [self _setBoolValue:enabled forKey:WebKitWebGPUEnabledPreferenceKey];
2119 }
2120
2121 - (BOOL)accelerated2dCanvasEnabled
2122 {
2123     return [self _boolValueForKey:WebKitAccelerated2dCanvasEnabledPreferenceKey];
2124 }
2125
2126 - (void)setAccelerated2dCanvasEnabled:(BOOL)enabled
2127 {
2128     [self _setBoolValue:enabled forKey:WebKitAccelerated2dCanvasEnabledPreferenceKey];
2129 }
2130
2131 - (void)setDiskImageCacheEnabled:(BOOL)enabled
2132 {
2133     // Staging. Can be removed once there are no more callers.
2134 }
2135
2136 - (BOOL)isFrameFlatteningEnabled
2137 {
2138     return [self _unsignedIntValueForKey:WebKitFrameFlatteningPreferenceKey] != WebKitFrameFlatteningDisabled;
2139 }
2140
2141 - (void)setFrameFlatteningEnabled:(BOOL)flattening
2142 {
2143     WebKitFrameFlattening value = flattening ? WebKitFrameFlatteningFullyEnabled : WebKitFrameFlatteningDisabled;
2144     [self _setUnsignedIntValue:value forKey:WebKitFrameFlatteningPreferenceKey];
2145 }
2146
2147 - (WebKitFrameFlattening)frameFlattening
2148 {
2149     return static_cast<WebKitFrameFlattening>([self _unsignedIntValueForKey:WebKitFrameFlatteningPreferenceKey]);
2150 }
2151
2152 - (void)setFrameFlattening:(WebKitFrameFlattening)flattening
2153 {
2154     [self _setUnsignedIntValue:flattening forKey:WebKitFrameFlatteningPreferenceKey];
2155 }
2156
2157 - (BOOL)asyncFrameScrollingEnabled
2158 {
2159     return [self _boolValueForKey:WebKitAsyncFrameScrollingEnabledPreferenceKey];
2160 }
2161
2162 - (void)setAsyncFrameScrollingEnabled:(BOOL)enabled
2163 {
2164     [self _setBoolValue:enabled forKey:WebKitAsyncFrameScrollingEnabledPreferenceKey];
2165 }
2166
2167 - (BOOL)isSpatialNavigationEnabled
2168 {
2169     return [self _boolValueForKey:WebKitSpatialNavigationEnabledPreferenceKey];
2170 }
2171
2172 - (void)setSpatialNavigationEnabled:(BOOL)flag
2173 {
2174     [self _setBoolValue:flag forKey:WebKitSpatialNavigationEnabledPreferenceKey];
2175 }
2176
2177 - (BOOL)paginateDuringLayoutEnabled
2178 {
2179     return [self _boolValueForKey:WebKitPaginateDuringLayoutEnabledPreferenceKey];
2180 }
2181
2182 - (void)setPaginateDuringLayoutEnabled:(BOOL)flag
2183 {
2184     [self _setBoolValue:flag forKey:WebKitPaginateDuringLayoutEnabledPreferenceKey];
2185 }
2186
2187 - (BOOL)hyperlinkAuditingEnabled
2188 {
2189     return [self _boolValueForKey:WebKitHyperlinkAuditingEnabledPreferenceKey];
2190 }
2191
2192 - (void)setHyperlinkAuditingEnabled:(BOOL)flag
2193 {
2194     [self _setBoolValue:flag forKey:WebKitHyperlinkAuditingEnabledPreferenceKey];
2195 }
2196
2197 - (BOOL)usePreHTML5ParserQuirks
2198 {
2199     return [self _boolValueForKey:WebKitUsePreHTML5ParserQuirksKey];
2200 }
2201
2202 - (void)setUsePreHTML5ParserQuirks:(BOOL)flag
2203 {
2204     [self _setBoolValue:flag forKey:WebKitUsePreHTML5ParserQuirksKey];
2205 }
2206
2207 - (void)didRemoveFromWebView
2208 {
2209     ASSERT(_private->numWebViews);
2210     if (--_private->numWebViews == 0)
2211         [[NSNotificationCenter defaultCenter]
2212             postNotificationName:WebPreferencesRemovedNotification
2213                           object:self
2214                         userInfo:nil];
2215 }
2216
2217 - (void)willAddToWebView
2218 {
2219     ++_private->numWebViews;
2220 }
2221
2222 - (void)_setPreferenceForTestWithValue:(NSString *)value forKey:(NSString *)key
2223 {
2224     [self _setStringValue:value forKey:key];
2225 }
2226
2227 - (void)setFullScreenEnabled:(BOOL)flag
2228 {
2229     [self _setBoolValue:flag forKey:WebKitFullScreenEnabledPreferenceKey];
2230 }
2231
2232 - (BOOL)fullScreenEnabled
2233 {
2234     return [self _boolValueForKey:WebKitFullScreenEnabledPreferenceKey];
2235 }
2236
2237 - (void)setAsynchronousSpellCheckingEnabled:(BOOL)flag
2238 {
2239     [self _setBoolValue:flag forKey:WebKitAsynchronousSpellCheckingEnabledPreferenceKey];
2240 }
2241
2242 - (BOOL)asynchronousSpellCheckingEnabled
2243 {
2244     return [self _boolValueForKey:WebKitAsynchronousSpellCheckingEnabledPreferenceKey];
2245 }
2246
2247 + (void)setWebKitLinkTimeVersion:(int)version
2248 {
2249     setWebKitLinkTimeVersion(version);
2250 }
2251
2252 - (void)setLoadsSiteIconsIgnoringImageLoadingPreference: (BOOL)flag
2253 {
2254     [self _setBoolValue: flag forKey: WebKitLoadSiteIconsKey];
2255 }
2256
2257 - (BOOL)loadsSiteIconsIgnoringImageLoadingPreference
2258 {
2259     return [self _boolValueForKey: WebKitLoadSiteIconsKey];
2260 }
2261
2262 - (void)setAVFoundationEnabled:(BOOL)flag
2263 {
2264     [self _setBoolValue:flag forKey:WebKitAVFoundationEnabledKey];
2265 }
2266
2267 - (BOOL)isAVFoundationEnabled
2268 {
2269     return [self _boolValueForKey:WebKitAVFoundationEnabledKey];
2270 }
2271
2272 - (void)setAVFoundationNSURLSessionEnabled:(BOOL)flag
2273 {
2274     [self _setBoolValue:flag forKey:WebKitAVFoundationNSURLSessionEnabledKey];
2275 }
2276
2277 - (BOOL)isAVFoundationNSURLSessionEnabled
2278 {
2279     return [self _boolValueForKey:WebKitAVFoundationNSURLSessionEnabledKey];
2280 }
2281
2282 - (void)setVideoPluginProxyEnabled:(BOOL)flag
2283 {
2284     // No-op, left for SPI compatibility.
2285 }
2286
2287 - (BOOL)isVideoPluginProxyEnabled
2288 {
2289     return NO;
2290 }
2291
2292 - (void)setHixie76WebSocketProtocolEnabled:(BOOL)flag
2293 {
2294 }
2295
2296 - (BOOL)isHixie76WebSocketProtocolEnabled
2297 {
2298     return false;
2299 }
2300
2301 - (BOOL)isInheritURIQueryComponentEnabled
2302 {
2303     return [self _boolValueForKey: WebKitEnableInheritURIQueryComponentPreferenceKey];
2304 }
2305
2306 - (void)setEnableInheritURIQueryComponent:(BOOL)flag
2307 {
2308     [self _setBoolValue:flag forKey: WebKitEnableInheritURIQueryComponentPreferenceKey];
2309 }
2310
2311 #if PLATFORM(IOS)
2312 - (BOOL)mediaPlaybackAllowsAirPlay
2313 {
2314     return [self _boolValueForKey:WebKitAllowsAirPlayForMediaPlaybackPreferenceKey];
2315 }
2316
2317 - (void)setMediaPlaybackAllowsAirPlay:(BOOL)flag
2318 {
2319     [self _setBoolValue:flag forKey:WebKitAllowsAirPlayForMediaPlaybackPreferenceKey];
2320 }
2321
2322 - (unsigned)audioSessionCategoryOverride
2323 {
2324     return [self _unsignedIntValueForKey:WebKitAudioSessionCategoryOverride];
2325 }
2326
2327 - (void)setAudioSessionCategoryOverride:(unsigned)override
2328 {
2329 #if HAVE(AUDIO_TOOLBOX_AUDIO_SESSION)
2330     if (override > AudioSession::AudioProcessing) {
2331         // Clients are passing us OSTypes values from AudioToolbox/AudioSession.h,
2332         // which need to be translated into AudioSession::CategoryType:
2333         switch (override) {
2334         case kAudioSessionCategory_AmbientSound:
2335             override = AudioSession::AmbientSound;
2336             break;
2337         case kAudioSessionCategory_SoloAmbientSound:
2338             override = AudioSession::SoloAmbientSound;
2339             break;
2340         case kAudioSessionCategory_MediaPlayback:
2341             override = AudioSession::MediaPlayback;
2342             break;
2343         case kAudioSessionCategory_RecordAudio:
2344             override = AudioSession::RecordAudio;
2345             break;
2346         case kAudioSessionCategory_PlayAndRecord:
2347             override = AudioSession::PlayAndRecord;
2348             break;
2349         case kAudioSessionCategory_AudioProcessing:
2350             override = AudioSession::AudioProcessing;
2351             break;
2352         default:
2353             override = AudioSession::None;
2354             break;
2355         }
2356     }
2357 #endif
2358
2359     [self _setUnsignedIntValue:override forKey:WebKitAudioSessionCategoryOverride];
2360 }
2361
2362 - (BOOL)avKitEnabled
2363 {
2364     return [self _boolValueForKey:WebKitAVKitEnabled];
2365 }
2366
2367 - (void)setAVKitEnabled:(bool)flag
2368 {
2369 #if HAVE(AVKIT)
2370     [self _setBoolValue:flag forKey:WebKitAVKitEnabled];
2371 #endif
2372 }
2373
2374 - (BOOL)networkDataUsageTrackingEnabled
2375 {
2376     return [self _boolValueForKey:WebKitNetworkDataUsageTrackingEnabledPreferenceKey];
2377 }
2378
2379 - (void)setNetworkDataUsageTrackingEnabled:(bool)trackingEnabled
2380 {
2381     [self _setBoolValue:trackingEnabled forKey:WebKitNetworkDataUsageTrackingEnabledPreferenceKey];
2382 }
2383
2384 - (NSString *)networkInterfaceName
2385 {
2386     return [self _stringValueForKey:WebKitNetworkInterfaceNamePreferenceKey];
2387 }
2388
2389 - (void)setNetworkInterfaceName:(NSString *)name
2390 {
2391     [self _setStringValue:name forKey:WebKitNetworkInterfaceNamePreferenceKey];
2392 }
2393 #endif // PLATFORM(IOS)
2394
2395 // Deprecated. Use -videoPlaybackRequiresUserGesture and -audioPlaybackRequiresUserGesture instead.
2396 - (BOOL)mediaPlaybackRequiresUserGesture
2397 {
2398     return [self _boolValueForKey:WebKitRequiresUserGestureForMediaPlaybackPreferenceKey];
2399 }
2400
2401 // Deprecated. Use -setVideoPlaybackRequiresUserGesture and -setAudioPlaybackRequiresUserGesture instead.
2402 - (void)setMediaPlaybackRequiresUserGesture:(BOOL)flag
2403 {
2404     [self _setBoolValue:flag forKey:WebKitRequiresUserGestureForMediaPlaybackPreferenceKey];
2405 }
2406
2407 - (BOOL)videoPlaybackRequiresUserGesture
2408 {
2409     return [self _boolValueForKey:WebKitRequiresUserGestureForVideoPlaybackPreferenceKey];
2410 }
2411
2412 - (void)setVideoPlaybackRequiresUserGesture:(BOOL)flag
2413 {
2414     [self _setBoolValue:flag forKey:WebKitRequiresUserGestureForVideoPlaybackPreferenceKey];
2415 }
2416
2417 - (BOOL)audioPlaybackRequiresUserGesture
2418 {
2419     return [self _boolValueForKey:WebKitRequiresUserGestureForAudioPlaybackPreferenceKey];
2420 }
2421
2422 - (void)setAudioPlaybackRequiresUserGesture:(BOOL)flag
2423 {
2424     [self _setBoolValue:flag forKey:WebKitRequiresUserGestureForAudioPlaybackPreferenceKey];
2425 }
2426
2427 - (BOOL)overrideUserGestureRequirementForMainContent
2428 {
2429     return [self _boolValueForKey:WebKitMainContentUserGestureOverrideEnabledPreferenceKey];
2430 }
2431
2432 - (void)setOverrideUserGestureRequirementForMainContent:(BOOL)flag
2433 {
2434     [self _setBoolValue:flag forKey:WebKitMainContentUserGestureOverrideEnabledPreferenceKey];
2435 }
2436
2437 - (BOOL)mediaPlaybackAllowsInline
2438 {
2439     return [self _boolValueForKey:WebKitAllowsInlineMediaPlaybackPreferenceKey];
2440 }
2441
2442 - (void)setMediaPlaybackAllowsInline:(BOOL)flag
2443 {
2444     [self _setBoolValue:flag forKey:WebKitAllowsInlineMediaPlaybackPreferenceKey];
2445 }
2446
2447 - (BOOL)inlineMediaPlaybackRequiresPlaysInlineAttribute
2448 {
2449     return [self _boolValueForKey:WebKitInlineMediaPlaybackRequiresPlaysInlineAttributeKey];
2450 }
2451
2452 - (void)setInlineMediaPlaybackRequiresPlaysInlineAttribute:(BOOL)flag
2453 {
2454     [self _setBoolValue:flag forKey:WebKitInlineMediaPlaybackRequiresPlaysInlineAttributeKey];
2455 }
2456
2457 - (BOOL)invisibleAutoplayNotPermitted
2458 {
2459     return [self _boolValueForKey:WebKitInvisibleAutoplayNotPermittedKey];
2460 }
2461
2462 - (void)setInvisibleAutoplayNotPermitted:(BOOL)flag
2463 {
2464     [self _setBoolValue:flag forKey:WebKitInvisibleAutoplayNotPermittedKey];
2465 }
2466
2467 - (BOOL)mediaControlsScaleWithPageZoom
2468 {
2469     return [self _boolValueForKey:WebKitMediaControlsScaleWithPageZoomPreferenceKey];
2470 }
2471
2472 - (void)setMediaControlsScaleWithPageZoom:(BOOL)flag
2473 {
2474     [self _setBoolValue:flag forKey:WebKitMediaControlsScaleWithPageZoomPreferenceKey];
2475 }
2476
2477 - (BOOL)allowsAlternateFullscreen
2478 {
2479     return [self allowsPictureInPictureMediaPlayback];
2480 }
2481
2482 - (void)setAllowsAlternateFullscreen:(BOOL)flag
2483 {
2484     [self setAllowsPictureInPictureMediaPlayback:flag];
2485 }
2486
2487 - (BOOL)allowsPictureInPictureMediaPlayback
2488 {
2489     return [self _boolValueForKey:WebKitAllowsPictureInPictureMediaPlaybackPreferenceKey];
2490 }
2491
2492 - (void)setAllowsPictureInPictureMediaPlayback:(BOOL)flag
2493 {
2494     [self _setBoolValue:flag forKey:WebKitAllowsPictureInPictureMediaPlaybackPreferenceKey];
2495 }
2496
2497 - (BOOL)mockScrollbarsEnabled
2498 {
2499     return [self _boolValueForKey:WebKitMockScrollbarsEnabledPreferenceKey];
2500 }
2501
2502 - (void)setMockScrollbarsEnabled:(BOOL)flag
2503 {
2504     [self _setBoolValue:flag forKey:WebKitMockScrollbarsEnabledPreferenceKey];
2505 }
2506
2507 - (NSString *)pictographFontFamily
2508 {
2509     return [self _stringValueForKey: WebKitPictographFontPreferenceKey];
2510 }
2511
2512 - (void)setPictographFontFamily:(NSString *)family
2513 {
2514     [self _setStringValue: family forKey: WebKitPictographFontPreferenceKey];
2515 }
2516
2517 - (BOOL)pageCacheSupportsPlugins
2518 {
2519     return [self _boolValueForKey:WebKitPageCacheSupportsPluginsPreferenceKey];
2520 }
2521
2522 - (void)setPageCacheSupportsPlugins:(BOOL)flag
2523 {
2524     [self _setBoolValue:flag forKey:WebKitPageCacheSupportsPluginsPreferenceKey];
2525
2526 }
2527
2528 #if PLATFORM(IOS)
2529 - (void)_invalidateCachedPreferences
2530 {
2531     dispatch_barrier_sync(_private->readWriteQueue, ^{
2532         if (_private->values)
2533             _private->values = adoptNS([[NSMutableDictionary alloc] init]);
2534     });
2535
2536     [self _updatePrivateBrowsingStateTo:[self privateBrowsingEnabled]];
2537
2538     // Tell any live WebViews to refresh their preferences
2539     [self _postPreferencesChangedNotification];
2540 }
2541
2542 - (void)_synchronizeWebStoragePolicyWithCookiePolicy
2543 {
2544     // FIXME: This should be done in clients, WebKit shouldn't be making such policy decisions.
2545
2546     NSHTTPCookieAcceptPolicy cookieAcceptPolicy = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookieAcceptPolicy];
2547     WebStorageBlockingPolicy storageBlockingPolicy;
2548     switch (static_cast<unsigned>(cookieAcceptPolicy)) {
2549     case NSHTTPCookieAcceptPolicyAlways:
2550         storageBlockingPolicy = WebAllowAllStorage;
2551         break;
2552     case NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain:
2553     case NSHTTPCookieAcceptPolicyExclusivelyFromMainDocumentDomain:
2554         storageBlockingPolicy = WebBlockThirdPartyStorage;
2555         break;
2556     case NSHTTPCookieAcceptPolicyNever:
2557         storageBlockingPolicy = WebBlockAllStorage;
2558         break;
2559     default:
2560         ASSERT_NOT_REACHED();
2561         storageBlockingPolicy = WebBlockAllStorage;
2562         break;
2563     }    
2564
2565     [self setStorageBlockingPolicy:storageBlockingPolicy];
2566 }
2567 #endif
2568
2569 - (void)setBackspaceKeyNavigationEnabled:(BOOL)flag
2570 {
2571     [self _setBoolValue:flag forKey:WebKitBackspaceKeyNavigationEnabledKey];
2572 }
2573
2574 - (BOOL)backspaceKeyNavigationEnabled
2575 {
2576     return [self _boolValueForKey:WebKitBackspaceKeyNavigationEnabledKey];
2577 }
2578
2579 - (void)setWantsBalancedSetDefersLoadingBehavior:(BOOL)flag
2580 {
2581     [self _setBoolValue:flag forKey:WebKitWantsBalancedSetDefersLoadingBehaviorKey];
2582 }
2583
2584 - (BOOL)wantsBalancedSetDefersLoadingBehavior
2585 {
2586     return [self _boolValueForKey:WebKitWantsBalancedSetDefersLoadingBehaviorKey];
2587 }
2588
2589 - (void)setShouldDisplaySubtitles:(BOOL)flag
2590 {
2591     [self _setBoolValue:flag forKey:WebKitShouldDisplaySubtitlesPreferenceKey];
2592 }
2593
2594 - (BOOL)shouldDisplaySubtitles
2595 {
2596     return [self _boolValueForKey:WebKitShouldDisplaySubtitlesPreferenceKey];
2597 }
2598
2599 - (void)setShouldDisplayCaptions:(BOOL)flag
2600 {
2601     [self _setBoolValue:flag forKey:WebKitShouldDisplayCaptionsPreferenceKey];
2602 }
2603
2604 - (BOOL)shouldDisplayCaptions
2605 {
2606     return [self _boolValueForKey:WebKitShouldDisplayCaptionsPreferenceKey];
2607 }
2608
2609 - (void)setShouldDisplayTextDescriptions:(BOOL)flag
2610 {
2611     [self _setBoolValue:flag forKey:WebKitShouldDisplayTextDescriptionsPreferenceKey];
2612 }
2613
2614 - (BOOL)shouldDisplayTextDescriptions
2615 {
2616     return [self _boolValueForKey:WebKitShouldDisplayTextDescriptionsPreferenceKey];
2617 }
2618
2619 - (void)setNotificationsEnabled:(BOOL)flag
2620 {
2621     [self _setBoolValue:flag forKey:WebKitNotificationsEnabledKey];
2622 }
2623
2624 - (BOOL)notificationsEnabled
2625 {
2626     return [self _boolValueForKey:WebKitNotificationsEnabledKey];
2627 }
2628
2629 - (void)setShouldRespectImageOrientation:(BOOL)flag
2630 {
2631     [self _setBoolValue:flag forKey:WebKitShouldRespectImageOrientationKey];
2632 }
2633
2634 - (BOOL)shouldRespectImageOrientation
2635 {
2636     return [self _boolValueForKey:WebKitShouldRespectImageOrientationKey];
2637 }
2638
2639 - (BOOL)requestAnimationFrameEnabled
2640 {
2641     return [self _boolValueForKey:WebKitRequestAnimationFrameEnabledPreferenceKey];
2642 }
2643
2644 - (void)setRequestAnimationFrameEnabled:(BOOL)enabled
2645 {
2646     [self _setBoolValue:enabled forKey:WebKitRequestAnimationFrameEnabledPreferenceKey];
2647 }
2648
2649 - (void)setIncrementalRenderingSuppressionTimeoutInSeconds:(NSTimeInterval)timeout
2650 {
2651     [self _setFloatValue:timeout forKey:WebKitIncrementalRenderingSuppressionTimeoutInSecondsKey];
2652 }
2653
2654 - (NSTimeInterval)incrementalRenderingSuppressionTimeoutInSeconds
2655 {
2656     return [self _floatValueForKey:WebKitIncrementalRenderingSuppressionTimeoutInSecondsKey];
2657 }
2658
2659 - (BOOL)diagnosticLoggingEnabled
2660 {
2661     return [self _boolValueForKey:WebKitDiagnosticLoggingEnabledKey];
2662 }
2663
2664 - (void)setDiagnosticLoggingEnabled:(BOOL)enabled
2665 {
2666     [self _setBoolValue:enabled forKey:WebKitDiagnosticLoggingEnabledKey];
2667 }
2668
2669 - (void)setStorageBlockingPolicy:(WebStorageBlockingPolicy)storageBlockingPolicy
2670 {
2671 #if PLATFORM(IOS)
2672     // We don't want to write the setting out, so we just reset the default instead of storing the new setting.
2673     // FIXME: This code removes any defaults previously registered by client process, which is not appropriate for this method to do.
2674     NSDictionary *dict = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:storageBlockingPolicy] forKey:WebKitStorageBlockingPolicyKey];
2675     [[NSUserDefaults standardUserDefaults] registerDefaults:dict];
2676 #else
2677     [self _setIntegerValue:storageBlockingPolicy forKey:WebKitStorageBlockingPolicyKey];
2678 #endif
2679 }
2680
2681 - (WebStorageBlockingPolicy)storageBlockingPolicy
2682 {
2683     return static_cast<WebStorageBlockingPolicy>([self _integerValueForKey:WebKitStorageBlockingPolicyKey]);
2684 }
2685
2686 - (BOOL)plugInSnapshottingEnabled
2687 {
2688     return [self _boolValueForKey:WebKitPlugInSnapshottingEnabledPreferenceKey];
2689 }
2690
2691 - (void)setPlugInSnapshottingEnabled:(BOOL)enabled
2692 {
2693     [self _setBoolValue:enabled forKey:WebKitPlugInSnapshottingEnabledPreferenceKey];
2694 }
2695
2696 - (BOOL)hiddenPageDOMTimerThrottlingEnabled
2697 {
2698     return [self _boolValueForKey:WebKitHiddenPageDOMTimerThrottlingEnabledPreferenceKey];
2699 }
2700
2701 - (void)setHiddenPageDOMTimerThrottlingEnabled:(BOOL)enabled
2702 {
2703     [self _setBoolValue:enabled forKey:WebKitHiddenPageDOMTimerThrottlingEnabledPreferenceKey];
2704 }
2705
2706 - (BOOL)hiddenPageCSSAnimationSuspensionEnabled
2707 {
2708     return [self _boolValueForKey:WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey];
2709 }
2710
2711 - (void)setHiddenPageCSSAnimationSuspensionEnabled:(BOOL)enabled
2712 {
2713     [self _setBoolValue:enabled forKey:WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey];
2714 }
2715
2716 - (BOOL)lowPowerVideoAudioBufferSizeEnabled
2717 {
2718     return [self _boolValueForKey:WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey];
2719 }
2720
2721 - (void)setLowPowerVideoAudioBufferSizeEnabled:(BOOL)enabled
2722 {
2723     [self _setBoolValue:enabled forKey:WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey];
2724 }
2725
2726 - (BOOL)useLegacyTextAlignPositionedElementBehavior
2727 {
2728     return [self _boolValueForKey:WebKitUseLegacyTextAlignPositionedElementBehaviorPreferenceKey];
2729 }
2730
2731 - (void)setUseLegacyTextAlignPositionedElementBehavior:(BOOL)enabled
2732 {
2733     [self _setBoolValue:enabled forKey:WebKitUseLegacyTextAlignPositionedElementBehaviorPreferenceKey];
2734 }
2735
2736 - (BOOL)mediaSourceEnabled
2737 {
2738     return [self _boolValueForKey:WebKitMediaSourceEnabledPreferenceKey];
2739 }
2740
2741 - (void)setMediaSourceEnabled:(BOOL)enabled
2742 {
2743     [self _setBoolValue:enabled forKey:WebKitMediaSourceEnabledPreferenceKey];
2744 }
2745
2746 - (BOOL)sourceBufferChangeTypeEnabled
2747 {
2748     return [self _boolValueForKey:WebKitSourceBufferChangeTypeEnabledPreferenceKey];
2749 }
2750
2751 - (void)setSourceBufferChangeTypeEnabled:(BOOL)enabled
2752 {
2753     [self _setBoolValue:enabled forKey:WebKitSourceBufferChangeTypeEnabledPreferenceKey];
2754 }
2755
2756 - (BOOL)imageControlsEnabled
2757 {
2758     return [self _boolValueForKey:WebKitImageControlsEnabledPreferenceKey];
2759 }
2760
2761 - (void)setImageControlsEnabled:(BOOL)enabled
2762 {
2763     [self _setBoolValue:enabled forKey:WebKitImageControlsEnabledPreferenceKey];
2764 }
2765
2766 - (BOOL)serviceControlsEnabled
2767 {
2768     return [self _boolValueForKey:WebKitServiceControlsEnabledPreferenceKey];
2769 }
2770
2771 - (void)setServiceControlsEnabled:(BOOL)enabled
2772 {
2773     [self _setBoolValue:enabled forKey:WebKitServiceControlsEnabledPreferenceKey];
2774 }
2775
2776 - (BOOL)gamepadsEnabled
2777 {
2778     return [self _boolValueForKey:WebKitGamepadsEnabledPreferenceKey];
2779 }
2780
2781 - (void)setGamepadsEnabled:(BOOL)flag
2782 {
2783     [self _setBoolValue:flag forKey:WebKitGamepadsEnabledPreferenceKey];
2784 }
2785
2786 - (BOOL)shouldConvertPositionStyleOnCopy
2787 {
2788     return [self _boolValueForKey:WebKitShouldConvertPositionStyleOnCopyPreferenceKey];
2789 }
2790
2791 - (void)setShouldConvertPositionStyleOnCopy:(BOOL)enabled
2792 {
2793     [self _setBoolValue:enabled forKey:WebKitShouldConvertPositionStyleOnCopyPreferenceKey];
2794 }
2795
2796 - (NSString *)mediaKeysStorageDirectory
2797 {
2798     return [[self _stringValueForKey:WebKitMediaKeysStorageDirectoryKey] stringByStandardizingPath];
2799 }
2800
2801 - (void)setMediaKeysStorageDirectory:(NSString *)directory
2802 {
2803     [self _setStringValue:directory forKey:WebKitMediaKeysStorageDirectoryKey];
2804 }
2805
2806 - (BOOL)mediaDevicesEnabled
2807 {
2808     return [self _boolValueForKey:WebKitMediaDevicesEnabledPreferenceKey];
2809 }
2810
2811 - (void)setMediaDevicesEnabled:(BOOL)flag
2812 {
2813     [self _setBoolValue:flag forKey:WebKitMediaDevicesEnabledPreferenceKey];
2814 }
2815
2816 - (BOOL)mediaStreamEnabled
2817 {
2818     return [self _boolValueForKey:WebKitMediaStreamEnabledPreferenceKey];
2819 }
2820
2821 - (void)setMediaStreamEnabled:(BOOL)flag
2822 {
2823     [self _setBoolValue:flag forKey:WebKitMediaStreamEnabledPreferenceKey];
2824 }
2825
2826 - (BOOL)peerConnectionEnabled
2827 {
2828     return [self _boolValueForKey:WebKitPeerConnectionEnabledPreferenceKey];
2829 }
2830
2831 - (void)setPeerConnectionEnabled:(BOOL)flag
2832 {
2833     [self _setBoolValue:flag forKey:WebKitPeerConnectionEnabledPreferenceKey];
2834 }
2835
2836 - (BOOL)linkPreloadEnabled
2837 {
2838     return [self _boolValueForKey:WebKitLinkPreloadEnabledPreferenceKey];
2839 }
2840
2841 - (void)setLinkPreloadEnabled:(BOOL)flag
2842 {
2843     [self _setBoolValue:flag forKey:WebKitLinkPreloadEnabledPreferenceKey];
2844 }
2845
2846 - (BOOL)mediaPreloadingEnabled
2847 {
2848     return [self _boolValueForKey:WebKitMediaPreloadingEnabledPreferenceKey];
2849 }
2850
2851 - (void)setMediaPreloadingEnabled:(BOOL)flag
2852 {
2853     [self _setBoolValue:flag forKey:WebKitMediaPreloadingEnabledPreferenceKey];
2854 }
2855
2856 - (void)setMetaRefreshEnabled:(BOOL)enabled
2857 {
2858     [self setHTTPEquivEnabled:enabled];
2859 }
2860
2861 - (BOOL)metaRefreshEnabled
2862 {
2863     return [self httpEquivEnabled];
2864 }
2865
2866 - (void)setHTTPEquivEnabled:(BOOL)enabled
2867 {
2868     [self _setBoolValue:enabled forKey:WebKitHTTPEquivEnabledPreferenceKey];
2869 }
2870
2871 - (BOOL)httpEquivEnabled
2872 {
2873     return [self _boolValueForKey:WebKitHTTPEquivEnabledPreferenceKey];
2874 }
2875
2876 - (BOOL)javaScriptMarkupEnabled
2877 {
2878     return [self _boolValueForKey:WebKitJavaScriptMarkupEnabledPreferenceKey];
2879 }
2880
2881 - (void)setJavaScriptMarkupEnabled:(BOOL)flag
2882 {
2883     [self _setBoolValue:flag forKey:WebKitJavaScriptMarkupEnabledPreferenceKey];
2884 }
2885
2886 - (BOOL)mediaDataLoadsAutomatically
2887 {
2888     return [self _boolValueForKey:WebKitMediaDataLoadsAutomaticallyPreferenceKey];
2889 }
2890
2891 - (void)setMediaDataLoadsAutomatically:(BOOL)flag
2892 {
2893     [self _setBoolValue:flag forKey:WebKitMediaDataLoadsAutomaticallyPreferenceKey];
2894 }
2895
2896 - (BOOL)attachmentElementEnabled
2897 {
2898     return [self _boolValueForKey:WebKitAttachmentElementEnabledPreferenceKey];
2899 }
2900
2901 - (void)setAttachmentElementEnabled:(BOOL)flag
2902 {
2903     [self _setBoolValue:flag forKey:WebKitAttachmentElementEnabledPreferenceKey];
2904 }
2905
2906 - (BOOL)allowsInlineMediaPlaybackAfterFullscreen
2907 {
2908     return [self _boolValueForKey:WebKitAllowsInlineMediaPlaybackAfterFullscreenPreferenceKey];
2909 }
2910
2911 - (void)setAllowsInlineMediaPlaybackAfterFullscreen:(BOOL)flag
2912 {
2913     [self _setBoolValue:flag forKey:WebKitAllowsInlineMediaPlaybackAfterFullscreenPreferenceKey];
2914 }
2915
2916 - (BOOL)mockCaptureDevicesEnabled
2917 {
2918     return [self _boolValueForKey:WebKitMockCaptureDevicesEnabledPreferenceKey];
2919 }
2920
2921 - (void)setMockCaptureDevicesEnabled:(BOOL)flag
2922 {
2923     [self _setBoolValue:flag forKey:WebKitMockCaptureDevicesEnabledPreferenceKey];
2924 }
2925
2926 - (BOOL)mockCaptureDevicesPromptEnabled
2927 {
2928     return [self _boolValueForKey:WebKitMockCaptureDevicesPromptEnabledPreferenceKey];
2929 }
2930
2931 - (void)setMockCaptureDevicesPromptEnabled:(BOOL)flag
2932 {
2933     [self _setBoolValue:flag forKey:WebKitMockCaptureDevicesPromptEnabledPreferenceKey];
2934 }
2935
2936 - (BOOL)enumeratingAllNetworkInterfacesEnabled
2937 {
2938     return [self _boolValueForKey:WebKitEnumeratingAllNetworkInterfacesEnabledPreferenceKey];
2939 }
2940
2941 - (void)setEnumeratingAllNetworkInterfacesEnabled:(BOOL)flag
2942 {
2943     [self _setBoolValue:flag forKey:WebKitEnumeratingAllNetworkInterfacesEnabledPreferenceKey];
2944 }
2945
2946 - (BOOL)iceCandidateFilteringEnabled
2947 {
2948     return [self _boolValueForKey:WebKitICECandidateFilteringEnabledPreferenceKey];
2949 }
2950
2951 - (void)setIceCandidateFilteringEnabled:(BOOL)flag
2952 {
2953     [self _setBoolValue:flag forKey:WebKitICECandidateFilteringEnabledPreferenceKey];
2954 }
2955
2956 - (BOOL)mediaCaptureRequiresSecureConnection
2957 {
2958     return [self _boolValueForKey:WebKitMediaCaptureRequiresSecureConnectionPreferenceKey];
2959 }
2960
2961 - (void)setMediaCaptureRequiresSecureConnection:(BOOL)flag
2962 {
2963     [self _setBoolValue:flag forKey:WebKitMediaCaptureRequiresSecureConnectionPreferenceKey];
2964 }
2965
2966 - (BOOL)shadowDOMEnabled
2967 {
2968     return [self _boolValueForKey:WebKitShadowDOMEnabledPreferenceKey];
2969 }
2970
2971 - (void)setShadowDOMEnabled:(BOOL)flag
2972 {
2973     [self _setBoolValue:flag forKey:WebKitShadowDOMEnabledPreferenceKey];
2974 }
2975
2976 - (BOOL)customElementsEnabled
2977 {
2978     return [self _boolValueForKey:WebKitCustomElementsEnabledPreferenceKey];
2979 }
2980
2981 - (void)setCustomElementsEnabled:(BOOL)flag
2982 {
2983     [self _setBoolValue:flag forKey:WebKitCustomElementsEnabledPreferenceKey];
2984 }
2985
2986 - (BOOL)dataTransferItemsEnabled
2987 {
2988     return [self _boolValueForKey:WebKitDataTransferItemsEnabledPreferenceKey];
2989 }
2990
2991 - (void)setDataTransferItemsEnabled:(BOOL)flag
2992 {
2993     [self _setBoolValue:flag forKey:WebKitDataTransferItemsEnabledPreferenceKey];
2994 }
2995
2996 - (BOOL)customPasteboardDataEnabled
2997 {
2998     return [self _boolValueForKey:WebKitCustomPasteboardDataEnabledPreferenceKey];
2999 }
3000
3001 - (void)setCustomPasteboardDataEnabled:(BOOL)flag
3002 {
3003     [self _setBoolValue:flag forKey:WebKitCustomPasteboardDataEnabledPreferenceKey];
3004 }
3005
3006 - (BOOL)cacheAPIEnabled
3007 {
3008     return [self _boolValueForKey:WebKitCacheAPIEnabledPreferenceKey];
3009 }
3010
3011 - (void)setCacheAPIEnabled:(BOOL)flag
3012 {
3013     [self _setBoolValue:flag forKey:WebKitCacheAPIEnabledPreferenceKey];
3014 }
3015
3016 - (BOOL)fetchAPIEnabled
3017 {
3018     return [self _boolValueForKey:WebKitFetchAPIEnabledPreferenceKey];
3019 }
3020
3021 - (void)setFetchAPIEnabled:(BOOL)flag
3022 {
3023     [self _setBoolValue:flag forKey:WebKitFetchAPIEnabledPreferenceKey];
3024 }
3025
3026 - (BOOL)readableByteStreamAPIEnabled
3027 {
3028     return [self _boolValueForKey:WebKitReadableByteStreamAPIEnabledPreferenceKey];
3029 }
3030
3031 - (void)setReadableByteStreamAPIEnabled:(BOOL)flag
3032 {
3033     [self _setBoolValue:flag forKey:WebKitReadableByteStreamAPIEnabledPreferenceKey];
3034 }
3035
3036 - (BOOL)writableStreamAPIEnabled
3037 {
3038     return [self _boolValueForKey:WebKitWritableStreamAPIEnabledPreferenceKey];
3039 }
3040
3041 - (void)setWritableStreamAPIEnabled:(BOOL)flag
3042 {
3043     [self _setBoolValue:flag forKey:WebKitWritableStreamAPIEnabledPreferenceKey];
3044 }
3045
3046 - (BOOL)downloadAttributeEnabled
3047 {
3048     return [self _boolValueForKey:WebKitDownloadAttributeEnabledPreferenceKey];
3049 }
3050
3051 - (void)setDownloadAttributeEnabled:(BOOL)flag
3052 {
3053     [self _setBoolValue:flag forKey:WebKitDownloadAttributeEnabledPreferenceKey];
3054 }
3055
3056 - (void)setDirectoryUploadEnabled:(BOOL)flag
3057 {
3058     [self _setBoolValue:flag forKey:WebKitDirectoryUploadEnabledPreferenceKey];
3059 }
3060
3061 - (BOOL)directoryUploadEnabled
3062 {
3063     return [self _boolValueForKey:WebKitDirectoryUploadEnabledPreferenceKey];
3064 }
3065
3066 - (BOOL)visualViewportEnabled
3067 {
3068     return [self _boolValueForKey:WebKitVisualViewportEnabledPreferenceKey];
3069 }
3070
3071 - (void)setVisualViewportEnabled:(BOOL)flag
3072 {
3073     [self _setBoolValue:flag forKey:WebKitVisualViewportEnabledPreferenceKey];
3074 }
3075
3076 - (BOOL)visualViewportAPIEnabled
3077 {
3078     return [self _boolValueForKey:WebKitVisualViewportAPIEnabledPreferenceKey];
3079 }
3080
3081 - (void)setVisualViewportAPIEnabled:(BOOL)flag
3082 {
3083     [self _setBoolValue:flag forKey:WebKitVisualViewportAPIEnabledPreferenceKey];
3084 }
3085
3086 - (BOOL)CSSOMViewScrollingAPIEnabled
3087 {
3088     return [self _boolValueForKey:WebKitCSSOMViewScrollingAPIEnabledPreferenceKey];
3089 }
3090
3091 - (void)setCSSOMViewScrollingAPIEnabled:(BOOL)flag
3092 {
3093     [self _setBoolValue:flag forKey:WebKitCSSOMViewScrollingAPIEnabledPreferenceKey];
3094 }
3095
3096 - (BOOL)webAnimationsEnabled
3097 {
3098     return [self _boolValueForKey:WebKitWebAnimationsEnabledPreferenceKey];
3099 }
3100
3101 - (void)setWebAnimationsEnabled:(BOOL)flag
3102 {
3103     [self _setBoolValue:flag forKey:WebKitWebAnimationsEnabledPreferenceKey];
3104 }
3105
3106 - (BOOL)fetchAPIKeepAliveEnabled
3107 {
3108     return [self _boolValueForKey:WebKitFetchAPIEnabledPreferenceKey];
3109 }
3110
3111 - (void)setFetchAPIKeepAliveEnabled:(BOOL)flag
3112 {
3113     [self _setBoolValue:flag forKey:WebKitFetchAPIEnabledPreferenceKey];
3114 }
3115
3116 - (BOOL)modernMediaControlsEnabled
3117 {
3118     return [self _boolValueForKey:WebKitModernMediaControlsEnabledPreferenceKey];
3119 }
3120
3121 - (void)setModernMediaControlsEnabled:(BOOL)flag
3122 {
3123     [self _setBoolValue:flag forKey:WebKitModernMediaControlsEnabledPreferenceKey];
3124 }
3125
3126 - (BOOL)webAnimationsCSSIntegrationEnabled
3127 {
3128     return [self _boolValueForKey:WebKitWebAnimationsCSSIntegrationEnabledPreferenceKey];
3129 }
3130
3131 - (void)setWebAnimationsCSSIntegrationEnabled:(BOOL)flag
3132 {
3133     [self _setBoolValue:flag forKey:WebKitWebAnimationsCSSIntegrationEnabledPreferenceKey];
3134 }
3135
3136 - (BOOL)intersectionObserverEnabled
3137 {
3138     return [self _boolValueForKey:WebKitIntersectionObserverEnabledPreferenceKey];
3139 }
3140
3141 - (void)setIntersectionObserverEnabled:(BOOL)flag
3142 {
3143     [self _setBoolValue:flag forKey:WebKitIntersectionObserverEnabledPreferenceKey];
3144 }
3145
3146 - (BOOL)menuItemElementEnabled
3147 {
3148     return [self _boolValueForKey:WebKitMenuItemElementEnabledPreferenceKey];
3149 }
3150
3151 - (void)setMenuItemElementEnabled:(BOOL)flag
3152 {
3153     [self _setBoolValue:flag forKey:WebKitMenuItemElementEnabledPreferenceKey];
3154 }
3155
3156 - (BOOL)displayContentsEnabled
3157 {
3158     return [self _boolValueForKey:WebKitDisplayContentsEnabledPreferenceKey];
3159 }
3160
3161 - (void)setDisplayContentsEnabled:(BOOL)flag
3162 {
3163     [self _setBoolValue:flag forKey:WebKitDisplayContentsEnabledPreferenceKey];
3164 }
3165
3166 - (BOOL)userTimingEnabled
3167 {
3168     return [self _boolValueForKey:WebKitUserTimingEnabledPreferenceKey];
3169 }
3170
3171 - (void)setUserTimingEnabled:(BOOL)flag
3172 {
3173     [self _setBoolValue:flag forKey:WebKitUserTimingEnabledPreferenceKey];
3174 }
3175
3176 - (BOOL)resourceTimingEnabled
3177 {
3178     return [self _boolValueForKey:WebKitResourceTimingEnabledPreferenceKey];
3179 }
3180
3181 - (void)setResourceTimingEnabled:(BOOL)flag
3182 {
3183     [self _setBoolValue:flag forKey:WebKitResourceTimingEnabledPreferenceKey];
3184 }
3185
3186 - (BOOL)webAuthenticationEnabled
3187 {
3188     return [self _boolValueForKey:WebKitWebAuthenticationEnabledPreferenceKey];
3189 }
3190
3191 - (void)setWebAuthenticationEnabled:(BOOL)flag
3192 {
3193     [self _setBoolValue:flag forKey:WebKitWebAuthenticationEnabledPreferenceKey];
3194 }
3195
3196 - (BOOL)mediaUserGestureInheritsFromDocument
3197 {
3198     return [self _boolValueForKey:WebKitMediaUserGestureInheritsFromDocument];
3199 }
3200
3201 - (void)setMediaUserGestureInheritsFromDocument:(BOOL)flag
3202 {
3203     [self _setBoolValue:flag forKey:WebKitMediaUserGestureInheritsFromDocument];
3204 }
3205
3206 #if PLATFORM(IOS)
3207 - (BOOL)quickLookDocumentSavingEnabled
3208 {
3209     return [self _boolValueForKey:WebKitQuickLookDocumentSavingPreferenceKey];
3210 }
3211
3212 - (void)setQuickLookDocumentSavingEnabled:(BOOL)flag
3213 {
3214     [self _setBoolValue:flag forKey:WebKitQuickLookDocumentSavingPreferenceKey];
3215 }
3216 #endif
3217
3218 - (NSString *)mediaContentTypesRequiringHardwareSupport
3219 {
3220     return [self _stringValueForKey:WebKitMediaContentTypesRequiringHardwareSupportPreferenceKey];
3221 }
3222
3223 - (void)setMediaContentTypesRequiringHardwareSupport:(NSString *)value
3224 {
3225     [self _setStringValue:value forKey:WebKitMediaContentTypesRequiringHardwareSupportPreferenceKey];
3226 }
3227
3228 - (BOOL)isSecureContextAttributeEnabled
3229 {
3230     return [self _boolValueForKey:WebKitIsSecureContextAttributeEnabledPreferenceKey];
3231 }
3232
3233 - (void)setIsSecureContextAttributeEnabled:(BOOL)flag
3234 {
3235     [self _setBoolValue:flag forKey:WebKitIsSecureContextAttributeEnabledPreferenceKey];
3236 }
3237
3238 - (BOOL)legacyEncryptedMediaAPIEnabled
3239 {
3240     return [self _boolValueForKey:WebKitLegacyEncryptedMediaAPIEnabledKey];
3241 }
3242
3243 - (void)setLegacyEncryptedMediaAPIEnabled:(BOOL)flag
3244 {
3245     [self _setBoolValue:flag forKey:WebKitLegacyEncryptedMediaAPIEnabledKey];
3246 }
3247
3248 - (BOOL)encryptedMediaAPIEnabled
3249 {
3250     return [self _boolValueForKey:WebKitEncryptedMediaAPIEnabledKey];
3251 }
3252
3253 - (void)setEncryptedMediaAPIEnabled:(BOOL)flag
3254 {
3255     [self _setBoolValue:flag forKey:WebKitEncryptedMediaAPIEnabledKey];
3256 }
3257
3258 - (BOOL)viewportFitEnabled
3259 {
3260     return [self _boolValueForKey:WebKitViewportFitEnabledPreferenceKey];
3261 }
3262
3263 - (void)setViewportFitEnabled:(BOOL)flag
3264 {
3265     [self _setBoolValue:flag forKey:WebKitViewportFitEnabledPreferenceKey];
3266 }
3267
3268 - (BOOL)constantPropertiesEnabled
3269 {
3270     return [self _boolValueForKey:WebKitConstantPropertiesEnabledPreferenceKey];
3271 }
3272
3273 - (void)setConstantPropertiesEnabled:(BOOL)flag
3274 {
3275     [self _setBoolValue:flag forKey:WebKitConstantPropertiesEnabledPreferenceKey];
3276 }
3277
3278 - (BOOL)colorFilterEnabled
3279 {
3280     return [self _boolValueForKey:WebKitColorFilterEnabledPreferenceKey];
3281 }
3282
3283 - (void)setColorFilterEnabled:(BOOL)flag
3284 {
3285     [self _setBoolValue:flag forKey:WebKitColorFilterEnabledPreferenceKey];
3286 }
3287
3288 - (BOOL)punchOutWhiteBackgroundsInDarkMode
3289 {
3290     return [self _boolValueForKey:WebKitPunchOutWhiteBackgroundsInDarkModePreferenceKey];
3291 }
3292
3293 - (void)setPunchOutWhiteBackgroundsInDarkMode:(BOOL)flag
3294 {
3295     [self _setBoolValue:flag forKey:WebKitPunchOutWhiteBackgroundsInDarkModePreferenceKey];
3296 }
3297
3298 - (BOOL)allowMediaContentTypesRequiringHardwareSupportAsFallback
3299 {
3300     return [self _boolValueForKey:WebKitAllowMediaContentTypesRequiringHardwareSupportAsFallbackKey];
3301 }
3302
3303 - (void)setAllowMediaContentTypesRequiringHardwareSupportAsFallback:(BOOL)flag
3304 {
3305     [self _setBoolValue:flag forKey:WebKitAllowMediaContentTypesRequiringHardwareSupportAsFallbackKey];
3306 }
3307
3308 - (BOOL)inspectorAdditionsEnabled
3309 {
3310     return [self _boolValueForKey:WebKitInspectorAdditionsEnabledPreferenceKey];
3311 }
3312
3313 - (void)setInspectorAdditionsEnabled:(BOOL)flag
3314 {
3315     [self _setBoolValue:flag forKey:WebKitInspectorAdditionsEnabledPreferenceKey];
3316 }
3317
3318 - (BOOL)accessibilityObjectModelEnabled
3319 {
3320     return [self _boolValueForKey:WebKitAccessibilityObjectModelEnabledPreferenceKey];
3321 }
3322
3323 - (void)setAccessibilityObjectModelEnabled:(BOOL)flag
3324 {
3325     [self _setBoolValue:flag forKey:WebKitAccessibilityObjectModelEnabledPreferenceKey];
3326 }
3327
3328 - (BOOL)ariaReflectionEnabled
3329 {
3330     return [self _boolValueForKey:WebKitAriaReflectionEnabledPreferenceKey];
3331 }
3332
3333 - (void)setAriaReflectionEnabled:(BOOL)flag
3334 {
3335     [self _setBoolValue:flag forKey:WebKitAriaReflectionEnabledPreferenceKey];
3336 }
3337
3338 - (BOOL)mediaCapabilitiesEnabled
3339 {
3340     return [self _boolValueForKey:WebKitMediaCapabilitiesEnabledPreferenceKey];
3341 }
3342
3343 - (void)setMediaCapabilitiesEnabled:(BOOL)flag
3344 {
3345     [self _setBoolValue:flag forKey:WebKitMediaCapabilitiesEnabledPreferenceKey];
3346 }
3347
3348 - (BOOL)serverTimingEnabled
3349 {
3350     return [self _boolValueForKey:WebKitServerTimingEnabledPreferenceKey];
3351 }
3352
3353 - (void)setServerTimingEnabled:(BOOL)flag
3354 {
3355     [self _setBoolValue:flag forKey:WebKitServerTimingEnabledPreferenceKey];
3356 }
3357
3358 - (BOOL)selectionAcrossShadowBoundariesEnabled
3359 {
3360     return [self _boolValueForKey:WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey];
3361 }
3362
3363 - (void)setSelectionAcrossShadowBoundariesEnabled:(BOOL)flag
3364 {
3365     [self _setBoolValue:flag forKey:WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey];
3366 }
3367
3368 @end
3369
3370 @implementation WebPreferences (WebInternal)
3371
3372 + (NSString *)_IBCreatorID
3373 {
3374     return classIBCreatorID;
3375 }
3376
3377 + (NSString *)_concatenateKeyWithIBCreatorID:(NSString *)key
3378 {
3379     NSString *IBCreatorID = [WebPreferences _IBCreatorID];
3380     if (!IBCreatorID)
3381         return key;
3382     return [IBCreatorID stringByAppendingString:key];
3383 }
3384
3385 @end