LayoutTests/imported/w3c:
[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         [NSNumber numberWithBool:YES], WebKitMediaRecorderEnabledPreferenceKey,
663 #endif
664 #if ENABLE(WEB_RTC)
665         [NSNumber numberWithBool:YES], WebKitPeerConnectionEnabledPreferenceKey,
666 #endif
667         [NSNumber numberWithBool:YES], WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey,
668 #if ENABLE(INTERSECTION_OBSERVER)
669         @NO, WebKitIntersectionObserverEnabledPreferenceKey,
670 #endif
671         @YES, WebKitDisplayContentsEnabledPreferenceKey,
672         @NO, WebKitUserTimingEnabledPreferenceKey,
673         @NO, WebKitResourceTimingEnabledPreferenceKey,
674         @NO, WebKitWebAuthenticationEnabledPreferenceKey,
675         @NO, WebKitMediaUserGestureInheritsFromDocument,
676         @NO, WebKitIsSecureContextAttributeEnabledPreferenceKey,
677         @YES, WebKitLegacyEncryptedMediaAPIEnabledKey,
678         @NO, WebKitEncryptedMediaAPIEnabledKey,
679         @YES, WebKitViewportFitEnabledPreferenceKey,
680         @YES, WebKitConstantPropertiesEnabledPreferenceKey,
681         @NO, WebKitColorFilterEnabledPreferenceKey,
682         @NO, WebKitPunchOutWhiteBackgroundsInDarkModePreferenceKey,
683         @YES, WebKitAllowMediaContentTypesRequiringHardwareSupportAsFallbackKey,
684         @NO, WebKitInspectorAdditionsEnabledPreferenceKey,
685         (NSString *)Settings::defaultMediaContentTypesRequiringHardwareSupport(), WebKitMediaContentTypesRequiringHardwareSupportPreferenceKey,
686         @NO, WebKitAccessibilityObjectModelEnabledPreferenceKey,
687         @YES, WebKitAriaReflectionEnabledPreferenceKey,
688         @NO, WebKitMediaCapabilitiesEnabledPreferenceKey,
689         @NO, WebKitFetchAPIKeepAliveEnabledPreferenceKey,
690         @NO, WebKitServerTimingEnabledPreferenceKey,
691         nil];
692
693 #if !PLATFORM(IOS)
694     // This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above
695     ASSERT(kPDFDisplaySinglePageContinuous == 1);
696 #endif
697     [[NSUserDefaults standardUserDefaults] registerDefaults:dict];
698 }
699
700 - (void)dealloc
701 {
702     [self _updatePrivateBrowsingStateTo:NO];
703
704     delete _private;
705     [super dealloc];
706 }
707
708 - (NSString *)identifier
709 {
710     return _private->identifier.get();
711 }
712
713 - (id)_valueForKey:(NSString *)key
714 {
715     NSString *_key = KEY(key);
716 #if PLATFORM(IOS)
717     __block id o = nil;
718     dispatch_sync(_private->readWriteQueue, ^{
719         o = [_private->values.get() objectForKey:_key];
720     });
721 #else
722     id o = [_private->values.get() objectForKey:_key];
723 #endif
724     if (o)
725         return o;
726     o = [[NSUserDefaults standardUserDefaults] objectForKey:_key];
727     if (!o && key != _key)
728         o = [[NSUserDefaults standardUserDefaults] objectForKey:key];
729     return o;
730 }
731
732 - (NSString *)_stringValueForKey:(NSString *)key
733 {
734     id s = [self _valueForKey:key];
735     return [s isKindOfClass:[NSString class]] ? (NSString *)s : nil;
736 }
737
738 - (void)_setStringValue:(NSString *)value forKey:(NSString *)key
739 {
740     if ([[self _stringValueForKey:key] isEqualToString:value])
741         return;
742     NSString *_key = KEY(key);
743 #if PLATFORM(IOS)
744     dispatch_barrier_sync(_private->readWriteQueue, ^{
745 #endif
746     [_private->values.get() setObject:value forKey:_key];
747 #if PLATFORM(IOS)
748     });
749 #endif
750     if (_private->autosaves)
751         [[NSUserDefaults standardUserDefaults] setObject:value forKey:_key];
752     [self _postPreferencesChangedNotification];
753 }
754
755 - (int)_integerValueForKey:(NSString *)key
756 {
757     id o = [self _valueForKey:key];
758     return [o respondsToSelector:@selector(intValue)] ? [o intValue] : 0;
759 }
760
761 - (void)_setIntegerValue:(int)value forKey:(NSString *)key
762 {
763     if ([self _integerValueForKey:key] == value)
764         return;
765     NSString *_key = KEY(key);
766 #if PLATFORM(IOS)
767     dispatch_barrier_sync(_private->readWriteQueue, ^{
768 #endif
769     [_private->values.get() setObject:@(value) forKey:_key];
770 #if PLATFORM(IOS)
771     });
772 #endif
773     if (_private->autosaves)
774         [[NSUserDefaults standardUserDefaults] setInteger:value forKey:_key];
775     [self _postPreferencesChangedNotification];
776 }
777
778 - (unsigned int)_unsignedIntValueForKey:(NSString *)key
779 {
780     id o = [self _valueForKey:key];
781     return [o respondsToSelector:@selector(unsignedIntValue)] ? [o unsignedIntValue] : 0;
782 }
783
784 - (void)_setUnsignedIntValue:(unsigned int)value forKey:(NSString *)key
785 {
786     if ([self _unsignedIntValueForKey:key] == value)
787         return;
788     NSString *_key = KEY(key);
789 #if PLATFORM(IOS)
790     dispatch_barrier_sync(_private->readWriteQueue, ^{
791 #endif
792     [_private->values.get() setObject:@(value) forKey:_key];
793 #if PLATFORM(IOS)
794     });
795 #endif
796     if (_private->autosaves)
797         [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithUnsignedInt:value] forKey:_key];
798     [self _postPreferencesChangedNotification];
799 }
800
801 - (float)_floatValueForKey:(NSString *)key
802 {
803     id o = [self _valueForKey:key];
804     return [o respondsToSelector:@selector(floatValue)] ? [o floatValue] : 0.0f;
805 }
806
807 - (void)_setFloatValue:(float)value forKey:(NSString *)key
808 {
809     if ([self _floatValueForKey:key] == value)
810         return;
811     NSString *_key = KEY(key);
812 #if PLATFORM(IOS)
813     dispatch_barrier_sync(_private->readWriteQueue, ^{
814 #endif
815     [_private->values.get() setObject:@(value) forKey:_key];
816 #if PLATFORM(IOS)
817     });
818 #endif
819     if (_private->autosaves)
820         [[NSUserDefaults standardUserDefaults] setFloat:value forKey:_key];
821     [self _postPreferencesChangedNotification];
822 }
823
824 - (BOOL)_boolValueForKey:(NSString *)key
825 {
826     return [self _integerValueForKey:key] != 0;
827 }
828
829 - (void)_setBoolValue:(BOOL)value forKey:(NSString *)key
830 {
831     if ([self _boolValueForKey:key] == value)
832         return;
833     NSString *_key = KEY(key);
834 #if PLATFORM(IOS)
835     dispatch_barrier_sync(_private->readWriteQueue, ^{
836 #endif
837     [_private->values.get() setObject:@(value) forKey:_key];
838 #if PLATFORM(IOS)
839     });
840 #endif
841     if (_private->autosaves)
842         [[NSUserDefaults standardUserDefaults] setBool:value forKey:_key];
843     [self _postPreferencesChangedNotification];
844 }
845
846 - (long long)_longLongValueForKey:(NSString *)key
847 {
848     id o = [self _valueForKey:key];
849     return [o respondsToSelector:@selector(longLongValue)] ? [o longLongValue] : 0;
850 }
851
852 - (void)_setLongLongValue:(long long)value forKey:(NSString *)key
853 {
854     if ([self _longLongValueForKey:key] == value)
855         return;
856     NSString *_key = KEY(key);
857 #if PLATFORM(IOS)
858     dispatch_barrier_sync(_private->readWriteQueue, ^{
859 #endif
860     [_private->values.get() setObject:@(value) forKey:_key];
861 #if PLATFORM(IOS)
862     });
863 #endif
864     if (_private->autosaves)
865         [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithLongLong:value] forKey:_key];
866     [self _postPreferencesChangedNotification];
867 }
868
869 - (unsigned long long)_unsignedLongLongValueForKey:(NSString *)key
870 {
871     id o = [self _valueForKey:key];
872     return [o respondsToSelector:@selector(unsignedLongLongValue)] ? [o unsignedLongLongValue] : 0;
873 }
874
875 - (void)_setUnsignedLongLongValue:(unsigned long long)value forKey:(NSString *)key
876 {
877     if ([self _unsignedLongLongValueForKey:key] == value)
878         return;
879     NSString *_key = KEY(key);
880 #if PLATFORM(IOS)
881     dispatch_barrier_sync(_private->readWriteQueue, ^{
882 #endif
883     [_private->values.get() setObject:@(value) forKey:_key];
884 #if PLATFORM(IOS)
885     });
886 #endif
887     if (_private->autosaves)
888         [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithUnsignedLongLong:value] forKey:_key];
889     [self _postPreferencesChangedNotification];
890 }
891
892 - (NSString *)standardFontFamily
893 {
894     return [self _stringValueForKey: WebKitStandardFontPreferenceKey];
895 }
896
897 - (void)setStandardFontFamily:(NSString *)family
898 {
899     [self _setStringValue: family forKey: WebKitStandardFontPreferenceKey];
900 }
901
902 - (NSString *)fixedFontFamily
903 {
904     return [self _stringValueForKey: WebKitFixedFontPreferenceKey];
905 }
906
907 - (void)setFixedFontFamily:(NSString *)family
908 {
909     [self _setStringValue: family forKey: WebKitFixedFontPreferenceKey];
910 }
911
912 - (NSString *)serifFontFamily
913 {
914     return [self _stringValueForKey: WebKitSerifFontPreferenceKey];
915 }
916
917 - (void)setSerifFontFamily:(NSString *)family 
918 {
919     [self _setStringValue: family forKey: WebKitSerifFontPreferenceKey];
920 }
921
922 - (NSString *)sansSerifFontFamily
923 {
924     return [self _stringValueForKey: WebKitSansSerifFontPreferenceKey];
925 }
926
927 - (void)setSansSerifFontFamily:(NSString *)family
928 {
929     [self _setStringValue: family forKey: WebKitSansSerifFontPreferenceKey];
930 }
931
932 - (NSString *)cursiveFontFamily
933 {
934     return [self _stringValueForKey: WebKitCursiveFontPreferenceKey];
935 }
936
937 - (void)setCursiveFontFamily:(NSString *)family
938 {
939     [self _setStringValue: family forKey: WebKitCursiveFontPreferenceKey];
940 }
941
942 - (NSString *)fantasyFontFamily
943 {
944     return [self _stringValueForKey: WebKitFantasyFontPreferenceKey];
945 }
946
947 - (void)setFantasyFontFamily:(NSString *)family
948 {
949     [self _setStringValue: family forKey: WebKitFantasyFontPreferenceKey];
950 }
951
952 - (int)defaultFontSize
953 {
954     return [self _integerValueForKey: WebKitDefaultFontSizePreferenceKey];
955 }
956
957 - (void)setDefaultFontSize:(int)size
958 {
959     [self _setIntegerValue: size forKey: WebKitDefaultFontSizePreferenceKey];
960 }
961
962 - (int)defaultFixedFontSize
963 {
964     return [self _integerValueForKey: WebKitDefaultFixedFontSizePreferenceKey];
965 }
966
967 - (void)setDefaultFixedFontSize:(int)size
968 {
969     [self _setIntegerValue: size forKey: WebKitDefaultFixedFontSizePreferenceKey];
970 }
971
972 - (int)minimumFontSize
973 {
974     return [self _integerValueForKey: WebKitMinimumFontSizePreferenceKey];
975 }
976
977 - (void)setMinimumFontSize:(int)size
978 {
979     [self _setIntegerValue: size forKey: WebKitMinimumFontSizePreferenceKey];
980 }
981
982 - (int)minimumLogicalFontSize
983 {
984   return [self _integerValueForKey: WebKitMinimumLogicalFontSizePreferenceKey];
985 }
986
987 - (void)setMinimumLogicalFontSize:(int)size
988 {
989   [self _setIntegerValue: size forKey: WebKitMinimumLogicalFontSizePreferenceKey];
990 }
991
992 - (NSString *)defaultTextEncodingName
993 {
994     return [self _stringValueForKey: WebKitDefaultTextEncodingNamePreferenceKey];
995 }
996
997 - (void)setDefaultTextEncodingName:(NSString *)encoding
998 {
999     [self _setStringValue: encoding forKey: WebKitDefaultTextEncodingNamePreferenceKey];
1000 }
1001
1002 #if !PLATFORM(IOS)
1003 - (BOOL)userStyleSheetEnabled
1004 {
1005     return [self _boolValueForKey: WebKitUserStyleSheetEnabledPreferenceKey];
1006 }
1007
1008 - (void)setUserStyleSheetEnabled:(BOOL)flag
1009 {
1010     [self _setBoolValue: flag forKey: WebKitUserStyleSheetEnabledPreferenceKey];
1011 }
1012
1013 - (NSURL *)userStyleSheetLocation
1014 {
1015     NSString *locationString = [self _stringValueForKey: WebKitUserStyleSheetLocationPreferenceKey];
1016     
1017     if ([locationString _webkit_looksLikeAbsoluteURL]) {
1018         return [NSURL _web_URLWithDataAsString:locationString];
1019     } else {
1020         locationString = [locationString stringByExpandingTildeInPath];
1021         return [NSURL fileURLWithPath:locationString isDirectory:NO];
1022     }
1023 }
1024
1025 - (void)setUserStyleSheetLocation:(NSURL *)URL
1026 {
1027     NSString *locationString;
1028     
1029     if ([URL isFileURL]) {
1030         locationString = [[URL path] _web_stringByAbbreviatingWithTildeInPath];
1031     } else {
1032         locationString = [URL _web_originalDataAsString];
1033     }
1034
1035     if (!locationString)
1036         locationString = @"";
1037
1038     [self _setStringValue:locationString forKey: WebKitUserStyleSheetLocationPreferenceKey];
1039 }
1040 #else
1041
1042 // These methods have had their implementations removed on iOS since it
1043 // is wrong to have such a setting stored in preferences that, when read,
1044 // is applied to all WebViews in a iOS process. Such a design might work
1045 // OK for an application like Safari on Mac OS X, where the only WebViews
1046 // in use display web content in a straightforward manner. However, it is
1047 // wrong for iOS, where WebViews are used for various purposes, like
1048 // text editing, text rendering, and displaying web content.
1049 // 
1050 // I have changed the user style sheet mechanism to be a per-WebView
1051 // setting, rather than a per-process preference. This seems to give the
1052 // behavior we want for iOS.
1053
1054 - (BOOL)userStyleSheetEnabled
1055 {
1056     return NO;
1057 }
1058
1059 - (void)setUserStyleSheetEnabled:(BOOL)flag
1060 {
1061     // no-op
1062 }
1063
1064 - (NSURL *)userStyleSheetLocation
1065 {
1066     return nil;
1067 }
1068
1069 - (void)setUserStyleSheetLocation:(NSURL *)URL
1070 {
1071     // no-op
1072 }
1073 #endif // PLATFORM(IOS)
1074
1075 #if !PLATFORM(IOS)
1076 - (BOOL)shouldPrintBackgrounds
1077 {
1078     return [self _boolValueForKey: WebKitShouldPrintBackgroundsPreferenceKey];
1079 }
1080
1081 - (void)setShouldPrintBackgrounds:(BOOL)flag
1082 {
1083     [self _setBoolValue: flag forKey: WebKitShouldPrintBackgroundsPreferenceKey];
1084 }
1085 #endif
1086
1087 - (BOOL)isJavaEnabled
1088 {
1089     return [self _boolValueForKey: WebKitJavaEnabledPreferenceKey];
1090 }
1091
1092 - (void)setJavaEnabled:(BOOL)flag
1093 {
1094     [self _setBoolValue: flag forKey: WebKitJavaEnabledPreferenceKey];
1095 }
1096
1097 - (BOOL)isJavaScriptEnabled
1098 {
1099     return [self _boolValueForKey: WebKitJavaScriptEnabledPreferenceKey];
1100 }
1101
1102 - (void)setJavaScriptEnabled:(BOOL)flag
1103 {
1104     [self _setBoolValue: flag forKey: WebKitJavaScriptEnabledPreferenceKey];
1105 }
1106
1107 - (BOOL)javaScriptCanOpenWindowsAutomatically
1108 {
1109     return [self _boolValueForKey: WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey];
1110 }
1111
1112 - (void)setJavaScriptCanOpenWindowsAutomatically:(BOOL)flag
1113 {
1114     [self _setBoolValue: flag forKey: WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey];
1115 }
1116
1117 - (BOOL)arePlugInsEnabled
1118 {
1119     return [self _boolValueForKey: WebKitPluginsEnabledPreferenceKey];
1120 }
1121
1122 - (void)setPlugInsEnabled:(BOOL)flag
1123 {
1124     [self _setBoolValue: flag forKey: WebKitPluginsEnabledPreferenceKey];
1125 }
1126
1127 - (BOOL)allowsAnimatedImages
1128 {
1129     return [self _boolValueForKey: WebKitAllowAnimatedImagesPreferenceKey];
1130 }
1131
1132 - (void)setAllowsAnimatedImages:(BOOL)flag
1133 {
1134     [self _setBoolValue: flag forKey: WebKitAllowAnimatedImagesPreferenceKey];
1135 }
1136
1137 - (BOOL)allowsAnimatedImageLooping
1138 {
1139     return [self _boolValueForKey: WebKitAllowAnimatedImageLoopingPreferenceKey];
1140 }
1141
1142 - (void)setAllowsAnimatedImageLooping: (BOOL)flag
1143 {
1144     [self _setBoolValue: flag forKey: WebKitAllowAnimatedImageLoopingPreferenceKey];
1145 }
1146
1147 - (void)setLoadsImagesAutomatically: (BOOL)flag
1148 {
1149     [self _setBoolValue: flag forKey: WebKitDisplayImagesKey];
1150 }
1151
1152 - (BOOL)loadsImagesAutomatically
1153 {
1154     return [self _boolValueForKey: WebKitDisplayImagesKey];
1155 }
1156
1157 - (void)setAutosaves:(BOOL)flag
1158 {
1159     _private->autosaves = flag;
1160 }
1161
1162 - (BOOL)autosaves
1163 {
1164     return _private->autosaves;
1165 }
1166
1167 #if !PLATFORM(IOS)
1168 - (void)setTabsToLinks:(BOOL)flag
1169 {
1170     [self _setBoolValue: flag forKey: WebKitTabToLinksPreferenceKey];
1171 }
1172
1173 - (BOOL)tabsToLinks
1174 {
1175     return [self _boolValueForKey:WebKitTabToLinksPreferenceKey];
1176 }
1177 #endif
1178
1179 - (void)setPrivateBrowsingEnabled:(BOOL)enabled
1180 {
1181     [self _updatePrivateBrowsingStateTo:enabled];
1182     [self _setBoolValue:enabled forKey:WebKitPrivateBrowsingEnabledPreferenceKey];
1183 }
1184
1185 - (BOOL)privateBrowsingEnabled
1186 {
1187     // Changes to private browsing defaults do not have effect on existing WebPreferences, and must be done through -setPrivateBrowsingEnabled.
1188     // This is needed to accurately track private browsing sessions in the process.
1189     return _private->inPrivateBrowsing;
1190 }
1191
1192 - (void)_updatePrivateBrowsingStateTo:(BOOL)enabled
1193 {
1194     if (!_private) {
1195         ASSERT(!enabled);
1196         return;
1197     }
1198
1199     if (enabled == _private->inPrivateBrowsing)
1200         return;
1201     if (enabled > _private->inPrivateBrowsing) {
1202         WebFrameNetworkingContext::ensurePrivateBrowsingSession();
1203         ++webPreferencesInstanceCountWithPrivateBrowsingEnabled;
1204     } else {
1205         ASSERT(webPreferencesInstanceCountWithPrivateBrowsingEnabled);
1206         --webPreferencesInstanceCountWithPrivateBrowsingEnabled;
1207         if (!webPreferencesInstanceCountWithPrivateBrowsingEnabled)
1208             WebFrameNetworkingContext::destroyPrivateBrowsingSession();
1209     }
1210     _private->inPrivateBrowsing = enabled;
1211 }
1212
1213 - (void)setUsesPageCache:(BOOL)usesPageCache
1214 {
1215     [self _setBoolValue:usesPageCache forKey:WebKitUsesPageCachePreferenceKey];
1216 }
1217
1218 - (BOOL)usesPageCache
1219 {
1220     return [self _boolValueForKey:WebKitUsesPageCachePreferenceKey];
1221 }
1222
1223 - (void)_postCacheModelChangedNotification
1224 {
1225 #if !PLATFORM(IOS)
1226     if (!pthread_main_np()) {
1227         [self performSelectorOnMainThread:_cmd withObject:nil waitUntilDone:NO];
1228         return;
1229     }
1230 #endif
1231
1232     [[NSNotificationCenter defaultCenter] postNotificationName:WebPreferencesCacheModelChangedInternalNotification object:self userInfo:nil];
1233 }
1234
1235 - (void)setCacheModel:(WebCacheModel)cacheModel
1236 {
1237     [self _setIntegerValue:cacheModel forKey:WebKitCacheModelPreferenceKey];
1238     [self setAutomaticallyDetectsCacheModel:NO];
1239     [self _postCacheModelChangedNotification];
1240 }
1241
1242 - (WebCacheModel)cacheModel
1243 {
1244     return (WebCacheModel)[self _integerValueForKey:WebKitCacheModelPreferenceKey];
1245 }
1246
1247
1248 - (void)setSuppressesIncrementalRendering:(BOOL)suppressesIncrementalRendering
1249 {
1250     [self _setBoolValue:suppressesIncrementalRendering forKey:WebKitSuppressesIncrementalRenderingKey];
1251 }
1252
1253 - (BOOL)suppressesIncrementalRendering
1254 {
1255     return [self _boolValueForKey:WebKitSuppressesIncrementalRenderingKey];
1256 }
1257
1258 - (BOOL)allowsAirPlayForMediaPlayback
1259 {
1260 #if ENABLE(WIRELESS_TARGET_PLAYBACK)
1261     return [self _boolValueForKey:WebKitAllowsAirPlayForMediaPlaybackPreferenceKey];
1262 #else
1263     return false;
1264 #endif
1265 }
1266
1267 - (void)setAllowsAirPlayForMediaPlayback:(BOOL)flag
1268 {
1269 #if ENABLE(WIRELESS_TARGET_PLAYBACK)
1270     [self _setBoolValue:flag forKey:WebKitAllowsAirPlayForMediaPlaybackPreferenceKey];
1271 #endif
1272 }
1273
1274 @end
1275
1276 @implementation WebPreferences (WebPrivate)
1277
1278 - (BOOL)isDNSPrefetchingEnabled
1279 {
1280     return [self _boolValueForKey:WebKitDNSPrefetchingEnabledPreferenceKey];
1281 }
1282
1283 - (void)setDNSPrefetchingEnabled:(BOOL)flag
1284 {
1285     [self _setBoolValue:flag forKey:WebKitDNSPrefetchingEnabledPreferenceKey];
1286 }
1287
1288 - (BOOL)developerExtrasEnabled
1289 {
1290     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
1291     if ([defaults boolForKey:@"DisableWebKitDeveloperExtras"])
1292         return NO;
1293 #ifdef NDEBUG
1294     if ([defaults boolForKey:@"WebKitDeveloperExtras"] || [defaults boolForKey:@"IncludeDebugMenu"])
1295         return YES;
1296     return [self _boolValueForKey:WebKitDeveloperExtrasEnabledPreferenceKey];
1297 #else
1298     return YES; // always enable in debug builds
1299 #endif
1300 }
1301
1302 - (WebKitJavaScriptRuntimeFlags)javaScriptRuntimeFlags
1303 {
1304     return static_cast<WebKitJavaScriptRuntimeFlags>([self _unsignedIntValueForKey:WebKitJavaScriptRuntimeFlagsPreferenceKey]);
1305 }
1306
1307 - (void)setJavaScriptRuntimeFlags:(WebKitJavaScriptRuntimeFlags)flags
1308 {
1309     [self _setUnsignedIntValue:flags forKey:WebKitJavaScriptRuntimeFlagsPreferenceKey];
1310 }
1311
1312 - (void)setDeveloperExtrasEnabled:(BOOL)flag
1313 {
1314     [self _setBoolValue:flag forKey:WebKitDeveloperExtrasEnabledPreferenceKey];
1315 }
1316
1317 - (BOOL)authorAndUserStylesEnabled
1318 {
1319     return [self _boolValueForKey:WebKitAuthorAndUserStylesEnabledPreferenceKey];
1320 }
1321
1322 - (void)setAuthorAndUserStylesEnabled:(BOOL)flag
1323 {
1324     [self _setBoolValue:flag forKey:WebKitAuthorAndUserStylesEnabledPreferenceKey];
1325 }
1326
1327 // FIXME: applicationChromeMode is no longer needed by ToT, but is still used in Safari 8.
1328 - (BOOL)applicationChromeModeEnabled
1329 {
1330     return NO;
1331 }
1332
1333 - (void)setApplicationChromeModeEnabled:(BOOL)flag
1334 {
1335 }
1336
1337 - (BOOL)domTimersThrottlingEnabled
1338 {
1339     return [self _boolValueForKey:WebKitDOMTimersThrottlingEnabledPreferenceKey];
1340 }
1341
1342 - (void)setDOMTimersThrottlingEnabled:(BOOL)flag
1343 {
1344     [self _setBoolValue:flag forKey:WebKitDOMTimersThrottlingEnabledPreferenceKey];
1345 }
1346
1347 - (BOOL)webArchiveDebugModeEnabled
1348 {
1349     return [self _boolValueForKey:WebKitWebArchiveDebugModeEnabledPreferenceKey];
1350 }
1351
1352 - (void)setWebArchiveDebugModeEnabled:(BOOL)flag
1353 {
1354     [self _setBoolValue:flag forKey:WebKitWebArchiveDebugModeEnabledPreferenceKey];
1355 }
1356
1357 - (BOOL)localFileContentSniffingEnabled
1358 {
1359     return [self _boolValueForKey:WebKitLocalFileContentSniffingEnabledPreferenceKey];
1360 }
1361
1362 - (void)setLocalFileContentSniffingEnabled:(BOOL)flag
1363 {
1364     [self _setBoolValue:flag forKey:WebKitLocalFileContentSniffingEnabledPreferenceKey];
1365 }
1366
1367 - (BOOL)offlineWebApplicationCacheEnabled
1368 {
1369     return [self _boolValueForKey:WebKitOfflineWebApplicationCacheEnabledPreferenceKey];
1370 }
1371
1372 - (void)setOfflineWebApplicationCacheEnabled:(BOOL)flag
1373 {
1374     [self _setBoolValue:flag forKey:WebKitOfflineWebApplicationCacheEnabledPreferenceKey];
1375 }
1376
1377 - (BOOL)zoomsTextOnly
1378 {
1379     return [self _boolValueForKey:WebKitZoomsTextOnlyPreferenceKey];
1380 }
1381
1382 - (void)setZoomsTextOnly:(BOOL)flag
1383 {
1384     [self _setBoolValue:flag forKey:WebKitZoomsTextOnlyPreferenceKey];
1385 }
1386
1387 - (BOOL)javaScriptCanAccessClipboard
1388 {
1389     return [self _boolValueForKey:WebKitJavaScriptCanAccessClipboardPreferenceKey];
1390 }
1391
1392 - (void)setJavaScriptCanAccessClipboard:(BOOL)flag
1393 {
1394     [self _setBoolValue:flag forKey:WebKitJavaScriptCanAccessClipboardPreferenceKey];
1395 }
1396
1397 - (BOOL)isXSSAuditorEnabled
1398 {
1399     return [self _boolValueForKey:WebKitXSSAuditorEnabledPreferenceKey];
1400 }
1401
1402 - (void)setXSSAuditorEnabled:(BOOL)flag
1403 {
1404     [self _setBoolValue:flag forKey:WebKitXSSAuditorEnabledPreferenceKey];
1405 }
1406
1407 #if !PLATFORM(IOS)
1408 - (BOOL)respectStandardStyleKeyEquivalents
1409 {
1410     return [self _boolValueForKey:WebKitRespectStandardStyleKeyEquivalentsPreferenceKey];
1411 }
1412
1413 - (void)setRespectStandardStyleKeyEquivalents:(BOOL)flag
1414 {
1415     [self _setBoolValue:flag forKey:WebKitRespectStandardStyleKeyEquivalentsPreferenceKey];
1416 }
1417
1418 - (BOOL)showsURLsInToolTips
1419 {
1420     return [self _boolValueForKey:WebKitShowsURLsInToolTipsPreferenceKey];
1421 }
1422
1423 - (void)setShowsURLsInToolTips:(BOOL)flag
1424 {
1425     [self _setBoolValue:flag forKey:WebKitShowsURLsInToolTipsPreferenceKey];
1426 }
1427
1428 - (BOOL)showsToolTipOverTruncatedText
1429 {
1430     return [self _boolValueForKey:WebKitShowsToolTipOverTruncatedTextPreferenceKey];
1431 }
1432
1433 - (void)setShowsToolTipOverTruncatedText:(BOOL)flag
1434 {
1435     [self _setBoolValue:flag forKey:WebKitShowsToolTipOverTruncatedTextPreferenceKey];
1436 }
1437
1438 - (BOOL)textAreasAreResizable
1439 {
1440     return [self _boolValueForKey: WebKitTextAreasAreResizablePreferenceKey];
1441 }
1442
1443 - (void)setTextAreasAreResizable:(BOOL)flag
1444 {
1445     [self _setBoolValue: flag forKey: WebKitTextAreasAreResizablePreferenceKey];
1446 }
1447 #endif // !PLATFORM(IOS)
1448
1449 - (BOOL)shrinksStandaloneImagesToFit
1450 {
1451     return [self _boolValueForKey:WebKitShrinksStandaloneImagesToFitPreferenceKey];
1452 }
1453
1454 - (void)setShrinksStandaloneImagesToFit:(BOOL)flag
1455 {
1456     [self _setBoolValue:flag forKey:WebKitShrinksStandaloneImagesToFitPreferenceKey];
1457 }
1458
1459 - (BOOL)automaticallyDetectsCacheModel
1460 {
1461     return _private->automaticallyDetectsCacheModel;
1462 }
1463
1464 - (void)setAutomaticallyDetectsCacheModel:(BOOL)automaticallyDetectsCacheModel
1465 {
1466     _private->automaticallyDetectsCacheModel = automaticallyDetectsCacheModel;
1467 }
1468
1469 - (BOOL)usesEncodingDetector
1470 {
1471     return [self _boolValueForKey: WebKitUsesEncodingDetectorPreferenceKey];
1472 }
1473
1474 - (void)setUsesEncodingDetector:(BOOL)flag
1475 {
1476     [self _setBoolValue: flag forKey: WebKitUsesEncodingDetectorPreferenceKey];
1477 }
1478
1479 - (BOOL)isWebSecurityEnabled
1480 {
1481     return [self _boolValueForKey: WebKitWebSecurityEnabledPreferenceKey];
1482 }
1483
1484 - (void)setWebSecurityEnabled:(BOOL)flag
1485 {
1486     [self _setBoolValue: flag forKey: WebKitWebSecurityEnabledPreferenceKey];
1487 }
1488
1489 - (BOOL)allowUniversalAccessFromFileURLs
1490 {
1491     return [self _boolValueForKey: WebKitAllowUniversalAccessFromFileURLsPreferenceKey];
1492 }
1493
1494 - (void)setAllowUniversalAccessFromFileURLs:(BOOL)flag
1495 {
1496     [self _setBoolValue: flag forKey: WebKitAllowUniversalAccessFromFileURLsPreferenceKey];
1497 }
1498
1499 - (BOOL)allowFileAccessFromFileURLs
1500 {
1501     return [self _boolValueForKey: WebKitAllowFileAccessFromFileURLsPreferenceKey];
1502 }
1503
1504 - (void)setAllowFileAccessFromFileURLs:(BOOL)flag
1505 {
1506     [self _setBoolValue: flag forKey: WebKitAllowFileAccessFromFileURLsPreferenceKey];
1507 }
1508
1509 - (BOOL)allowCrossOriginSubresourcesToAskForCredentials
1510 {
1511     return [self _boolValueForKey:WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey];
1512 }
1513
1514 - (void)setAllowCrossOriginSubresourcesToAskForCredentials:(BOOL)flag
1515 {
1516     [self _setBoolValue:flag forKey:WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey];
1517 }
1518
1519 - (BOOL)needsStorageAccessFromFileURLsQuirk
1520 {
1521     return [self _boolValueForKey: WebKitNeedsStorageAccessFromFileURLsQuirkKey];
1522 }
1523
1524 -(void)setNeedsStorageAccessFromFileURLsQuirk:(BOOL)flag
1525 {
1526     [self _setBoolValue: flag forKey: WebKitNeedsStorageAccessFromFileURLsQuirkKey];
1527 }
1528
1529 - (NSTimeInterval)_backForwardCacheExpirationInterval
1530 {
1531     return (NSTimeInterval)[self _floatValueForKey:WebKitBackForwardCacheExpirationIntervalKey];
1532 }
1533
1534 #if PLATFORM(IOS)
1535 - (BOOL)_standalone
1536 {
1537     return [self _boolValueForKey:WebKitStandalonePreferenceKey];
1538 }
1539
1540 - (void)_setStandalone:(BOOL)flag
1541 {
1542     [self _setBoolValue:flag forKey:WebKitStandalonePreferenceKey];
1543 }
1544
1545 - (void)_setTelephoneNumberParsingEnabled:(BOOL)flag
1546 {
1547     [self _setBoolValue:flag forKey:WebKitTelephoneParsingEnabledPreferenceKey];
1548 }
1549
1550 - (BOOL)_telephoneNumberParsingEnabled
1551 {
1552     return [self _boolValueForKey:WebKitTelephoneParsingEnabledPreferenceKey];
1553 }
1554 #endif
1555
1556 #if ENABLE(TEXT_AUTOSIZING)
1557 - (void)_setMinimumZoomFontSize:(float)size
1558 {
1559     [self _setFloatValue:size forKey:WebKitMinimumZoomFontSizePreferenceKey];
1560 }
1561
1562 - (float)_minimumZoomFontSize
1563 {
1564     return [self _floatValueForKey:WebKitMinimumZoomFontSizePreferenceKey];
1565 }
1566
1567 - (void)_setTextAutosizingEnabled:(BOOL)enabled
1568 {
1569     [self _setBoolValue:enabled forKey:WebKitTextAutosizingEnabledPreferenceKey];
1570 }
1571
1572 - (BOOL)_textAutosizingEnabled
1573 {
1574     return [self _boolValueForKey:WebKitTextAutosizingEnabledPreferenceKey];
1575 }
1576 #endif
1577
1578 #if PLATFORM(IOS)
1579 - (void)_setLayoutInterval:(int)l
1580 {
1581     [self _setIntegerValue:l forKey:WebKitLayoutIntervalPreferenceKey];
1582 }
1583
1584 - (int)_layoutInterval
1585 {
1586     return [self _integerValueForKey:WebKitLayoutIntervalPreferenceKey];
1587 }
1588
1589 - (void)_setMaxParseDuration:(float)d
1590 {
1591     [self _setFloatValue:d forKey:WebKitMaxParseDurationPreferenceKey];
1592 }
1593
1594 - (float)_maxParseDuration
1595 {
1596     return [self _floatValueForKey:WebKitMaxParseDurationPreferenceKey];
1597 }
1598
1599 - (void)_setAllowMultiElementImplicitFormSubmission:(BOOL)flag
1600 {
1601     [self _setBoolValue:flag forKey:WebKitAllowMultiElementImplicitFormSubmissionPreferenceKey];
1602 }
1603
1604 - (BOOL)_allowMultiElementImplicitFormSubmission
1605 {
1606     return [self _boolValueForKey:WebKitAllowMultiElementImplicitFormSubmissionPreferenceKey];
1607 }
1608
1609 - (void)_setAlwaysRequestGeolocationPermission:(BOOL)flag
1610 {
1611     [self _setBoolValue:flag forKey:WebKitAlwaysRequestGeolocationPermissionPreferenceKey];
1612 }
1613
1614 - (BOOL)_alwaysRequestGeolocationPermission
1615 {
1616     return [self _boolValueForKey:WebKitAlwaysRequestGeolocationPermissionPreferenceKey];
1617 }
1618
1619 - (void)_setAlwaysUseAcceleratedOverflowScroll:(BOOL)flag
1620 {
1621     [self _setBoolValue:flag forKey:WebKitAlwaysUseAcceleratedOverflowScrollPreferenceKey];
1622 }
1623
1624 - (BOOL)_alwaysUseAcceleratedOverflowScroll
1625 {
1626     return [self _boolValueForKey:WebKitAlwaysUseAcceleratedOverflowScrollPreferenceKey];
1627 }
1628
1629 - (void)_setInterpolationQuality:(int)quality
1630 {
1631     [self _setIntegerValue:quality forKey:WebKitInterpolationQualityPreferenceKey];
1632 }
1633
1634 - (int)_interpolationQuality
1635 {
1636     return [self _integerValueForKey:WebKitInterpolationQualityPreferenceKey];
1637 }
1638
1639 - (BOOL)_allowPasswordEcho
1640 {
1641     return [self _boolValueForKey:WebKitPasswordEchoEnabledPreferenceKey];
1642 }
1643
1644 - (float)_passwordEchoDuration
1645 {
1646     return [self _floatValueForKey:WebKitPasswordEchoDurationPreferenceKey];
1647 }
1648
1649 #endif // PLATFORM(IOS)
1650
1651 #if !PLATFORM(IOS)
1652 - (float)PDFScaleFactor
1653 {
1654     return [self _floatValueForKey:WebKitPDFScaleFactorPreferenceKey];
1655 }
1656
1657 - (void)setPDFScaleFactor:(float)factor
1658 {
1659     [self _setFloatValue:factor forKey:WebKitPDFScaleFactorPreferenceKey];
1660 }
1661 #endif
1662
1663 - (int64_t)applicationCacheTotalQuota
1664 {
1665     return [self _longLongValueForKey:WebKitApplicationCacheTotalQuota];
1666 }
1667
1668 - (void)setApplicationCacheTotalQuota:(int64_t)quota
1669 {
1670     [self _setLongLongValue:quota forKey:WebKitApplicationCacheTotalQuota];
1671
1672     // Application Cache Preferences are stored on the global cache storage manager, not in Settings.
1673     [WebApplicationCache setMaximumSize:quota];
1674 }
1675
1676 - (int64_t)applicationCacheDefaultOriginQuota
1677 {
1678     return [self _longLongValueForKey:WebKitApplicationCacheDefaultOriginQuota];
1679 }
1680
1681 - (void)setApplicationCacheDefaultOriginQuota:(int64_t)quota
1682 {
1683     [self _setLongLongValue:quota forKey:WebKitApplicationCacheDefaultOriginQuota];
1684 }
1685
1686 #if !PLATFORM(IOS)
1687 - (PDFDisplayMode)PDFDisplayMode
1688 {
1689     PDFDisplayMode value = static_cast<PDFDisplayMode>([self _integerValueForKey:WebKitPDFDisplayModePreferenceKey]);
1690     if (value != kPDFDisplaySinglePage && value != kPDFDisplaySinglePageContinuous && value != kPDFDisplayTwoUp && value != kPDFDisplayTwoUpContinuous) {
1691         // protect against new modes from future versions of OS X stored in defaults
1692         value = kPDFDisplaySinglePageContinuous;
1693     }
1694     return value;
1695 }
1696
1697 - (void)setPDFDisplayMode:(PDFDisplayMode)mode
1698 {
1699     [self _setIntegerValue:mode forKey:WebKitPDFDisplayModePreferenceKey];
1700 }
1701 #endif
1702
1703 - (WebKitEditableLinkBehavior)editableLinkBehavior
1704 {
1705     WebKitEditableLinkBehavior value = static_cast<WebKitEditableLinkBehavior> ([self _integerValueForKey:WebKitEditableLinkBehaviorPreferenceKey]);
1706     if (value != WebKitEditableLinkDefaultBehavior &&
1707         value != WebKitEditableLinkAlwaysLive &&
1708         value != WebKitEditableLinkNeverLive &&
1709         value != WebKitEditableLinkOnlyLiveWithShiftKey &&
1710         value != WebKitEditableLinkLiveWhenNotFocused) {
1711         // ensure that a valid result is returned
1712         value = WebKitEditableLinkDefaultBehavior;
1713     }
1714     
1715     return value;
1716 }
1717
1718 - (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior
1719 {
1720     [self _setIntegerValue:behavior forKey:WebKitEditableLinkBehaviorPreferenceKey];
1721 }
1722
1723 - (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior
1724 {
1725     WebTextDirectionSubmenuInclusionBehavior value = static_cast<WebTextDirectionSubmenuInclusionBehavior>([self _integerValueForKey:WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey]);
1726     if (value != WebTextDirectionSubmenuNeverIncluded &&
1727         value != WebTextDirectionSubmenuAutomaticallyIncluded &&
1728         value != WebTextDirectionSubmenuAlwaysIncluded) {
1729         // Ensure that a valid result is returned.
1730         value = WebTextDirectionSubmenuNeverIncluded;
1731     }
1732     return value;
1733 }
1734
1735 - (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior
1736 {
1737     [self _setIntegerValue:behavior forKey:WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey];
1738 }
1739
1740 - (BOOL)_useSiteSpecificSpoofing
1741 {
1742     return [self _boolValueForKey:WebKitUseSiteSpecificSpoofingPreferenceKey];
1743 }
1744
1745 - (void)_setUseSiteSpecificSpoofing:(BOOL)newValue
1746 {
1747     [self _setBoolValue:newValue forKey:WebKitUseSiteSpecificSpoofingPreferenceKey];
1748 }
1749
1750 - (BOOL)databasesEnabled
1751 {
1752     return [self _boolValueForKey:WebKitDatabasesEnabledPreferenceKey];
1753 }
1754
1755 - (void)setDatabasesEnabled:(BOOL)databasesEnabled
1756 {
1757     [self _setBoolValue:databasesEnabled forKey:WebKitDatabasesEnabledPreferenceKey];
1758 }
1759
1760 #if PLATFORM(IOS)
1761 - (BOOL)storageTrackerEnabled
1762 {
1763     return [self _boolValueForKey:WebKitStorageTrackerEnabledPreferenceKey];
1764 }
1765
1766 - (void)setStorageTrackerEnabled:(BOOL)storageTrackerEnabled
1767 {
1768     [self _setBoolValue:storageTrackerEnabled forKey:WebKitStorageTrackerEnabledPreferenceKey];
1769 }
1770 #endif
1771
1772 - (BOOL)localStorageEnabled
1773 {
1774     return [self _boolValueForKey:WebKitLocalStorageEnabledPreferenceKey];
1775 }
1776
1777 - (void)setLocalStorageEnabled:(BOOL)localStorageEnabled
1778 {
1779     [self _setBoolValue:localStorageEnabled forKey:WebKitLocalStorageEnabledPreferenceKey];
1780 }
1781
1782 - (BOOL)experimentalNotificationsEnabled
1783 {
1784     return [self _boolValueForKey:WebKitExperimentalNotificationsEnabledPreferenceKey];
1785 }
1786
1787 - (void)setExperimentalNotificationsEnabled:(BOOL)experimentalNotificationsEnabled
1788 {
1789     [self _setBoolValue:experimentalNotificationsEnabled forKey:WebKitExperimentalNotificationsEnabledPreferenceKey];
1790 }
1791
1792 + (WebPreferences *)_getInstanceForIdentifier:(NSString *)ident
1793 {
1794     LOG(Encoding, "requesting for %@\n", ident);
1795
1796     if (!ident)
1797         return _standardPreferences;
1798     
1799     WebPreferences *instance = [webPreferencesInstances objectForKey:[self _concatenateKeyWithIBCreatorID:ident]];
1800
1801     return instance;
1802 }
1803
1804 + (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)ident
1805 {
1806     if (!webPreferencesInstances)
1807         webPreferencesInstances = [[NSMutableDictionary alloc] init];
1808     if (ident) {
1809         [webPreferencesInstances setObject:instance forKey:[self _concatenateKeyWithIBCreatorID:ident]];
1810         LOG(Encoding, "recording %p for %@\n", instance, [self _concatenateKeyWithIBCreatorID:ident]);
1811     }
1812 }
1813
1814 + (void)_checkLastReferenceForIdentifier:(id)identifier
1815 {
1816     // FIXME: This won't work at all under garbage collection because retainCount returns a constant.
1817     // We may need to change WebPreferences API so there's an explicit way to end the lifetime of one.
1818     WebPreferences *instance = [webPreferencesInstances objectForKey:identifier];
1819     if ([instance retainCount] == 1)
1820         [webPreferencesInstances removeObjectForKey:identifier];
1821 }
1822
1823 + (void)_removeReferenceForIdentifier:(NSString *)ident
1824 {
1825     if (ident)
1826         [self performSelector:@selector(_checkLastReferenceForIdentifier:) withObject:[self _concatenateKeyWithIBCreatorID:ident] afterDelay:0.1];
1827 }
1828
1829 - (void)_postPreferencesChangedNotification
1830 {
1831 #if !PLATFORM(IOS)
1832     if (!pthread_main_np()) {
1833         [self performSelectorOnMainThread:_cmd withObject:nil waitUntilDone:NO];
1834         return;
1835     }
1836 #endif
1837
1838     [[NSNotificationCenter defaultCenter] postNotificationName:WebPreferencesChangedInternalNotification object:self userInfo:nil];
1839     [[NSNotificationCenter defaultCenter] postNotificationName:WebPreferencesChangedNotification object:self userInfo:nil];
1840 }
1841
1842 - (void)_postPreferencesChangedAPINotification
1843 {
1844     if (!pthread_main_np()) {
1845         [self performSelectorOnMainThread:_cmd withObject:nil waitUntilDone:NO];
1846         return;
1847     }
1848
1849     [[NSNotificationCenter defaultCenter] postNotificationName:WebPreferencesChangedNotification object:self userInfo:nil];
1850 }
1851
1852 + (CFStringEncoding)_systemCFStringEncoding
1853 {
1854     return webDefaultCFStringEncoding();
1855 }
1856
1857 + (void)_setInitialDefaultTextEncodingToSystemEncoding
1858 {
1859     [[NSUserDefaults standardUserDefaults] registerDefaults:
1860         [NSDictionary dictionaryWithObject:defaultTextEncodingNameForSystemLanguage() forKey:WebKitDefaultTextEncodingNamePreferenceKey]];
1861 }
1862
1863 static NSString *classIBCreatorID = nil;
1864
1865 + (void)_setIBCreatorID:(NSString *)string
1866 {
1867     NSString *old = classIBCreatorID;
1868     classIBCreatorID = [string copy];
1869     [old release];
1870 }
1871
1872 + (void)_switchNetworkLoaderToNewTestingSession
1873 {
1874 #if PLATFORM(IOS)
1875     WebThreadLock();
1876 #endif
1877     NetworkStorageSession::switchToNewTestingSession();
1878 }
1879
1880 + (void)_clearNetworkLoaderSession
1881 {
1882     NetworkStorageSession::defaultStorageSession().deleteAllCookies();
1883 }
1884
1885 + (void)_setCurrentNetworkLoaderSessionCookieAcceptPolicy:(NSHTTPCookieAcceptPolicy)policy
1886 {
1887     RetainPtr<CFHTTPCookieStorageRef> cookieStorage = NetworkStorageSession::defaultStorageSession().cookieStorage();
1888     ASSERT(cookieStorage); // Will fail when NetworkStorageSession::switchToNewTestingSession() was not called beforehand.
1889     CFHTTPCookieStorageSetCookieAcceptPolicy(cookieStorage.get(), policy);
1890 }
1891
1892 - (BOOL)isDOMPasteAllowed
1893 {
1894     return [self _boolValueForKey:WebKitDOMPasteAllowedPreferenceKey];
1895 }
1896
1897 - (void)setDOMPasteAllowed:(BOOL)DOMPasteAllowed
1898 {
1899     [self _setBoolValue:DOMPasteAllowed forKey:WebKitDOMPasteAllowedPreferenceKey];
1900 }
1901
1902 - (NSString *)_localStorageDatabasePath
1903 {
1904     return [[self _stringValueForKey:WebKitLocalStorageDatabasePathPreferenceKey] stringByStandardizingPath];
1905 }
1906
1907 - (void)_setLocalStorageDatabasePath:(NSString *)path
1908 {
1909     [self _setStringValue:[path stringByStandardizingPath] forKey:WebKitLocalStorageDatabasePathPreferenceKey];
1910 }
1911
1912 - (NSString *)_ftpDirectoryTemplatePath
1913 {
1914     return [[self _stringValueForKey:WebKitFTPDirectoryTemplatePath] stringByStandardizingPath];
1915 }
1916
1917 - (void)_setFTPDirectoryTemplatePath:(NSString *)path
1918 {
1919     [self _setStringValue:[path stringByStandardizingPath] forKey:WebKitFTPDirectoryTemplatePath];
1920 }
1921
1922 - (BOOL)_forceFTPDirectoryListings
1923 {
1924     return [self _boolValueForKey:WebKitForceFTPDirectoryListings];
1925 }
1926
1927 - (void)_setForceFTPDirectoryListings:(BOOL)force
1928 {
1929     [self _setBoolValue:force forKey:WebKitForceFTPDirectoryListings];
1930 }
1931
1932 - (BOOL)acceleratedDrawingEnabled
1933 {
1934     return [self _boolValueForKey:WebKitAcceleratedDrawingEnabledPreferenceKey];
1935 }
1936
1937 - (void)setAcceleratedDrawingEnabled:(BOOL)enabled
1938 {
1939     [self _setBoolValue:enabled forKey:WebKitAcceleratedDrawingEnabledPreferenceKey];
1940 }
1941
1942 - (BOOL)displayListDrawingEnabled
1943 {
1944     return [self _boolValueForKey:WebKitDisplayListDrawingEnabledPreferenceKey];
1945 }
1946
1947 - (void)setDisplayListDrawingEnabled:(BOOL)enabled
1948 {
1949     [self _setBoolValue:enabled forKey:WebKitDisplayListDrawingEnabledPreferenceKey];
1950 }
1951
1952 - (BOOL)resourceLoadStatisticsEnabled
1953 {
1954     return [self _boolValueForKey:WebKitResourceLoadStatisticsEnabledPreferenceKey];
1955 }
1956
1957 - (void)setResourceLoadStatisticsEnabled:(BOOL)enabled
1958 {
1959     [self _setBoolValue:enabled forKey:WebKitResourceLoadStatisticsEnabledPreferenceKey];
1960 }
1961
1962 - (BOOL)largeImageAsyncDecodingEnabled
1963 {
1964     return [self _boolValueForKey:WebKitLargeImageAsyncDecodingEnabledPreferenceKey];
1965 }
1966
1967 - (void)setLargeImageAsyncDecodingEnabled:(BOOL)enabled
1968 {
1969     [self _setBoolValue:enabled forKey:WebKitLargeImageAsyncDecodingEnabledPreferenceKey];
1970 }
1971
1972 - (BOOL)animatedImageAsyncDecodingEnabled
1973 {
1974     return [self _boolValueForKey:WebKitAnimatedImageAsyncDecodingEnabledPreferenceKey];
1975 }
1976
1977 - (void)setAnimatedImageAsyncDecodingEnabled:(BOOL)enabled
1978 {
1979     [self _setBoolValue:enabled forKey:WebKitAnimatedImageAsyncDecodingEnabledPreferenceKey];
1980 }
1981
1982 - (BOOL)canvasUsesAcceleratedDrawing
1983 {
1984     return [self _boolValueForKey:WebKitCanvasUsesAcceleratedDrawingPreferenceKey];
1985 }
1986
1987 - (void)setCanvasUsesAcceleratedDrawing:(BOOL)enabled
1988 {
1989     [self _setBoolValue:enabled forKey:WebKitCanvasUsesAcceleratedDrawingPreferenceKey];
1990 }
1991
1992 - (BOOL)acceleratedCompositingEnabled
1993 {
1994     return [self _boolValueForKey:WebKitAcceleratedCompositingEnabledPreferenceKey];
1995 }
1996
1997 - (void)setAcceleratedCompositingEnabled:(BOOL)enabled
1998 {
1999     [self _setBoolValue:enabled forKey:WebKitAcceleratedCompositingEnabledPreferenceKey];
2000 }
2001
2002 - (BOOL)showDebugBorders
2003 {
2004     return [self _boolValueForKey:WebKitShowDebugBordersPreferenceKey];
2005 }
2006
2007 - (void)setShowDebugBorders:(BOOL)enabled
2008 {
2009     [self _setBoolValue:enabled forKey:WebKitShowDebugBordersPreferenceKey];
2010 }
2011
2012 - (BOOL)subpixelAntialiasedLayerTextEnabled
2013 {
2014     return [self _boolValueForKey:WebKitSubpixelAntialiasedLayerTextEnabledPreferenceKey];
2015 }
2016
2017 - (void)setSubpixelAntialiasedLayerTextEnabled:(BOOL)enabled
2018 {
2019     [self _setBoolValue:enabled forKey:WebKitSubpixelAntialiasedLayerTextEnabledPreferenceKey];
2020 }
2021
2022 - (BOOL)simpleLineLayoutEnabled
2023 {
2024     return [self _boolValueForKey:WebKitSimpleLineLayoutEnabledPreferenceKey];
2025 }
2026
2027 - (void)setSimpleLineLayoutEnabled:(BOOL)enabled
2028 {
2029     [self _setBoolValue:enabled forKey:WebKitSimpleLineLayoutEnabledPreferenceKey];
2030 }
2031
2032 - (BOOL)simpleLineLayoutDebugBordersEnabled
2033 {
2034     return [self _boolValueForKey:WebKitSimpleLineLayoutDebugBordersEnabledPreferenceKey];
2035 }
2036
2037 - (void)setSimpleLineLayoutDebugBordersEnabled:(BOOL)enabled
2038 {
2039     [self _setBoolValue:enabled forKey:WebKitSimpleLineLayoutDebugBordersEnabledPreferenceKey];
2040 }
2041
2042 - (BOOL)showRepaintCounter
2043 {
2044     return [self _boolValueForKey:WebKitShowRepaintCounterPreferenceKey];
2045 }
2046
2047 - (void)setShowRepaintCounter:(BOOL)enabled
2048 {
2049     [self _setBoolValue:enabled forKey:WebKitShowRepaintCounterPreferenceKey];
2050 }
2051
2052 - (BOOL)webAudioEnabled
2053 {
2054     return [self _boolValueForKey:WebKitWebAudioEnabledPreferenceKey];
2055 }
2056
2057 - (void)setWebAudioEnabled:(BOOL)enabled
2058 {
2059     [self _setBoolValue:enabled forKey:WebKitWebAudioEnabledPreferenceKey];
2060 }
2061
2062 - (BOOL)subpixelCSSOMElementMetricsEnabled
2063 {
2064     return [self _boolValueForKey:WebKitSubpixelCSSOMElementMetricsEnabledPreferenceKey];
2065 }
2066
2067 - (void)setSubpixelCSSOMElementMetricsEnabled:(BOOL)enabled
2068 {
2069     [self _setBoolValue:enabled forKey:WebKitSubpixelCSSOMElementMetricsEnabledPreferenceKey];
2070 }
2071
2072 - (BOOL)webGLEnabled
2073 {
2074     return [self _boolValueForKey:WebKitWebGLEnabledPreferenceKey];
2075 }
2076
2077 - (void)setWebGLEnabled:(BOOL)enabled
2078 {
2079     [self _setBoolValue:enabled forKey:WebKitWebGLEnabledPreferenceKey];
2080 }
2081
2082 - (BOOL)webGL2Enabled
2083 {
2084     return [self _boolValueForKey:WebKitWebGL2EnabledPreferenceKey];
2085 }
2086
2087 - (void)setWebGL2Enabled:(BOOL)enabled
2088 {
2089     [self _setBoolValue:enabled forKey:WebKitWebGL2EnabledPreferenceKey];
2090 }
2091
2092 - (BOOL)forceSoftwareWebGLRendering
2093 {
2094     return [self _boolValueForKey:WebKitForceSoftwareWebGLRenderingPreferenceKey];
2095 }
2096
2097 - (void)setForceSoftwareWebGLRendering:(BOOL)forced
2098 {
2099     [self _setBoolValue:forced forKey:WebKitForceSoftwareWebGLRenderingPreferenceKey];
2100 }
2101
2102 - (BOOL)forceLowPowerGPUForWebGL
2103 {
2104     return [self _boolValueForKey:WebKitForceWebGLUsesLowPowerPreferenceKey];
2105 }
2106
2107 - (void)setForceWebGLUsesLowPower:(BOOL)forceLowPower
2108 {
2109     [self _setBoolValue:forceLowPower forKey:WebKitForceWebGLUsesLowPowerPreferenceKey];
2110 }
2111
2112 - (BOOL)webGPUEnabled
2113 {
2114     return [self _boolValueForKey:WebKitWebGPUEnabledPreferenceKey];
2115 }
2116
2117 - (void)setWebGPUEnabled:(BOOL)enabled
2118 {
2119     [self _setBoolValue:enabled forKey:WebKitWebGPUEnabledPreferenceKey];
2120 }
2121
2122 - (BOOL)accelerated2dCanvasEnabled
2123 {
2124     return [self _boolValueForKey:WebKitAccelerated2dCanvasEnabledPreferenceKey];
2125 }
2126
2127 - (void)setAccelerated2dCanvasEnabled:(BOOL)enabled
2128 {
2129     [self _setBoolValue:enabled forKey:WebKitAccelerated2dCanvasEnabledPreferenceKey];
2130 }
2131
2132 - (void)setDiskImageCacheEnabled:(BOOL)enabled
2133 {
2134     // Staging. Can be removed once there are no more callers.
2135 }
2136
2137 - (BOOL)isFrameFlatteningEnabled
2138 {
2139     return [self _unsignedIntValueForKey:WebKitFrameFlatteningPreferenceKey] != WebKitFrameFlatteningDisabled;
2140 }
2141
2142 - (void)setFrameFlatteningEnabled:(BOOL)flattening
2143 {
2144     WebKitFrameFlattening value = flattening ? WebKitFrameFlatteningFullyEnabled : WebKitFrameFlatteningDisabled;
2145     [self _setUnsignedIntValue:value forKey:WebKitFrameFlatteningPreferenceKey];
2146 }
2147
2148 - (WebKitFrameFlattening)frameFlattening
2149 {
2150     return static_cast<WebKitFrameFlattening>([self _unsignedIntValueForKey:WebKitFrameFlatteningPreferenceKey]);
2151 }
2152
2153 - (void)setFrameFlattening:(WebKitFrameFlattening)flattening
2154 {
2155     [self _setUnsignedIntValue:flattening forKey:WebKitFrameFlatteningPreferenceKey];
2156 }
2157
2158 - (BOOL)asyncFrameScrollingEnabled
2159 {
2160     return [self _boolValueForKey:WebKitAsyncFrameScrollingEnabledPreferenceKey];
2161 }
2162
2163 - (void)setAsyncFrameScrollingEnabled:(BOOL)enabled
2164 {
2165     [self _setBoolValue:enabled forKey:WebKitAsyncFrameScrollingEnabledPreferenceKey];
2166 }
2167
2168 - (BOOL)isSpatialNavigationEnabled
2169 {
2170     return [self _boolValueForKey:WebKitSpatialNavigationEnabledPreferenceKey];
2171 }
2172
2173 - (void)setSpatialNavigationEnabled:(BOOL)flag
2174 {
2175     [self _setBoolValue:flag forKey:WebKitSpatialNavigationEnabledPreferenceKey];
2176 }
2177
2178 - (BOOL)paginateDuringLayoutEnabled
2179 {
2180     return [self _boolValueForKey:WebKitPaginateDuringLayoutEnabledPreferenceKey];
2181 }
2182
2183 - (void)setPaginateDuringLayoutEnabled:(BOOL)flag
2184 {
2185     [self _setBoolValue:flag forKey:WebKitPaginateDuringLayoutEnabledPreferenceKey];
2186 }
2187
2188 - (BOOL)hyperlinkAuditingEnabled
2189 {
2190     return [self _boolValueForKey:WebKitHyperlinkAuditingEnabledPreferenceKey];
2191 }
2192
2193 - (void)setHyperlinkAuditingEnabled:(BOOL)flag
2194 {
2195     [self _setBoolValue:flag forKey:WebKitHyperlinkAuditingEnabledPreferenceKey];
2196 }
2197
2198 - (BOOL)usePreHTML5ParserQuirks
2199 {
2200     return [self _boolValueForKey:WebKitUsePreHTML5ParserQuirksKey];
2201 }
2202
2203 - (void)setUsePreHTML5ParserQuirks:(BOOL)flag
2204 {
2205     [self _setBoolValue:flag forKey:WebKitUsePreHTML5ParserQuirksKey];
2206 }
2207
2208 - (void)didRemoveFromWebView
2209 {
2210     ASSERT(_private->numWebViews);
2211     if (--_private->numWebViews == 0)
2212         [[NSNotificationCenter defaultCenter]
2213             postNotificationName:WebPreferencesRemovedNotification
2214                           object:self
2215                         userInfo:nil];
2216 }
2217
2218 - (void)willAddToWebView
2219 {
2220     ++_private->numWebViews;
2221 }
2222
2223 - (void)_setPreferenceForTestWithValue:(NSString *)value forKey:(NSString *)key
2224 {
2225     [self _setStringValue:value forKey:key];
2226 }
2227
2228 - (void)setFullScreenEnabled:(BOOL)flag
2229 {
2230     [self _setBoolValue:flag forKey:WebKitFullScreenEnabledPreferenceKey];
2231 }
2232
2233 - (BOOL)fullScreenEnabled
2234 {
2235     return [self _boolValueForKey:WebKitFullScreenEnabledPreferenceKey];
2236 }
2237
2238 - (void)setAsynchronousSpellCheckingEnabled:(BOOL)flag
2239 {
2240     [self _setBoolValue:flag forKey:WebKitAsynchronousSpellCheckingEnabledPreferenceKey];
2241 }
2242
2243 - (BOOL)asynchronousSpellCheckingEnabled
2244 {
2245     return [self _boolValueForKey:WebKitAsynchronousSpellCheckingEnabledPreferenceKey];
2246 }
2247
2248 + (void)setWebKitLinkTimeVersion:(int)version
2249 {
2250     setWebKitLinkTimeVersion(version);
2251 }
2252
2253 - (void)setLoadsSiteIconsIgnoringImageLoadingPreference: (BOOL)flag
2254 {
2255     [self _setBoolValue: flag forKey: WebKitLoadSiteIconsKey];
2256 }
2257
2258 - (BOOL)loadsSiteIconsIgnoringImageLoadingPreference
2259 {
2260     return [self _boolValueForKey: WebKitLoadSiteIconsKey];
2261 }
2262
2263 - (void)setAVFoundationEnabled:(BOOL)flag
2264 {
2265     [self _setBoolValue:flag forKey:WebKitAVFoundationEnabledKey];
2266 }
2267
2268 - (BOOL)isAVFoundationEnabled
2269 {
2270     return [self _boolValueForKey:WebKitAVFoundationEnabledKey];
2271 }
2272
2273 - (void)setAVFoundationNSURLSessionEnabled:(BOOL)flag
2274 {
2275     [self _setBoolValue:flag forKey:WebKitAVFoundationNSURLSessionEnabledKey];
2276 }
2277
2278 - (BOOL)isAVFoundationNSURLSessionEnabled
2279 {
2280     return [self _boolValueForKey:WebKitAVFoundationNSURLSessionEnabledKey];
2281 }
2282
2283 - (void)setVideoPluginProxyEnabled:(BOOL)flag
2284 {
2285     // No-op, left for SPI compatibility.
2286 }
2287
2288 - (BOOL)isVideoPluginProxyEnabled
2289 {
2290     return NO;
2291 }
2292
2293 - (void)setHixie76WebSocketProtocolEnabled:(BOOL)flag
2294 {
2295 }
2296
2297 - (BOOL)isHixie76WebSocketProtocolEnabled
2298 {
2299     return false;
2300 }
2301
2302 - (BOOL)isInheritURIQueryComponentEnabled
2303 {
2304     return [self _boolValueForKey: WebKitEnableInheritURIQueryComponentPreferenceKey];
2305 }
2306
2307 - (void)setEnableInheritURIQueryComponent:(BOOL)flag
2308 {
2309     [self _setBoolValue:flag forKey: WebKitEnableInheritURIQueryComponentPreferenceKey];
2310 }
2311
2312 #if PLATFORM(IOS)
2313 - (BOOL)mediaPlaybackAllowsAirPlay
2314 {
2315     return [self _boolValueForKey:WebKitAllowsAirPlayForMediaPlaybackPreferenceKey];
2316 }
2317
2318 - (void)setMediaPlaybackAllowsAirPlay:(BOOL)flag
2319 {
2320     [self _setBoolValue:flag forKey:WebKitAllowsAirPlayForMediaPlaybackPreferenceKey];
2321 }
2322
2323 - (unsigned)audioSessionCategoryOverride
2324 {
2325     return [self _unsignedIntValueForKey:WebKitAudioSessionCategoryOverride];
2326 }
2327
2328 - (void)setAudioSessionCategoryOverride:(unsigned)override
2329 {
2330 #if HAVE(AUDIO_TOOLBOX_AUDIO_SESSION)
2331     if (override > AudioSession::AudioProcessing) {
2332         // Clients are passing us OSTypes values from AudioToolbox/AudioSession.h,
2333         // which need to be translated into AudioSession::CategoryType:
2334         switch (override) {
2335         case kAudioSessionCategory_AmbientSound:
2336             override = AudioSession::AmbientSound;
2337             break;
2338         case kAudioSessionCategory_SoloAmbientSound:
2339             override = AudioSession::SoloAmbientSound;
2340             break;
2341         case kAudioSessionCategory_MediaPlayback:
2342             override = AudioSession::MediaPlayback;
2343             break;
2344         case kAudioSessionCategory_RecordAudio:
2345             override = AudioSession::RecordAudio;
2346             break;
2347         case kAudioSessionCategory_PlayAndRecord:
2348             override = AudioSession::PlayAndRecord;
2349             break;
2350         case kAudioSessionCategory_AudioProcessing:
2351             override = AudioSession::AudioProcessing;
2352             break;
2353         default:
2354             override = AudioSession::None;
2355             break;
2356         }
2357     }
2358 #endif
2359
2360     [self _setUnsignedIntValue:override forKey:WebKitAudioSessionCategoryOverride];
2361 }
2362
2363 - (BOOL)avKitEnabled
2364 {
2365     return [self _boolValueForKey:WebKitAVKitEnabled];
2366 }
2367
2368 - (void)setAVKitEnabled:(bool)flag
2369 {
2370 #if HAVE(AVKIT)
2371     [self _setBoolValue:flag forKey:WebKitAVKitEnabled];
2372 #endif
2373 }
2374
2375 - (BOOL)networkDataUsageTrackingEnabled
2376 {
2377     return [self _boolValueForKey:WebKitNetworkDataUsageTrackingEnabledPreferenceKey];
2378 }
2379
2380 - (void)setNetworkDataUsageTrackingEnabled:(bool)trackingEnabled
2381 {
2382     [self _setBoolValue:trackingEnabled forKey:WebKitNetworkDataUsageTrackingEnabledPreferenceKey];
2383 }
2384
2385 - (NSString *)networkInterfaceName
2386 {
2387     return [self _stringValueForKey:WebKitNetworkInterfaceNamePreferenceKey];
2388 }
2389
2390 - (void)setNetworkInterfaceName:(NSString *)name
2391 {
2392     [self _setStringValue:name forKey:WebKitNetworkInterfaceNamePreferenceKey];
2393 }
2394 #endif // PLATFORM(IOS)
2395
2396 // Deprecated. Use -videoPlaybackRequiresUserGesture and -audioPlaybackRequiresUserGesture instead.
2397 - (BOOL)mediaPlaybackRequiresUserGesture
2398 {
2399     return [self _boolValueForKey:WebKitRequiresUserGestureForMediaPlaybackPreferenceKey];
2400 }
2401
2402 // Deprecated. Use -setVideoPlaybackRequiresUserGesture and -setAudioPlaybackRequiresUserGesture instead.
2403 - (void)setMediaPlaybackRequiresUserGesture:(BOOL)flag
2404 {
2405     [self _setBoolValue:flag forKey:WebKitRequiresUserGestureForMediaPlaybackPreferenceKey];
2406 }
2407
2408 - (BOOL)videoPlaybackRequiresUserGesture
2409 {
2410     return [self _boolValueForKey:WebKitRequiresUserGestureForVideoPlaybackPreferenceKey];
2411 }
2412
2413 - (void)setVideoPlaybackRequiresUserGesture:(BOOL)flag
2414 {
2415     [self _setBoolValue:flag forKey:WebKitRequiresUserGestureForVideoPlaybackPreferenceKey];
2416 }
2417
2418 - (BOOL)audioPlaybackRequiresUserGesture
2419 {
2420     return [self _boolValueForKey:WebKitRequiresUserGestureForAudioPlaybackPreferenceKey];
2421 }
2422
2423 - (void)setAudioPlaybackRequiresUserGesture:(BOOL)flag
2424 {
2425     [self _setBoolValue:flag forKey:WebKitRequiresUserGestureForAudioPlaybackPreferenceKey];
2426 }
2427
2428 - (BOOL)overrideUserGestureRequirementForMainContent
2429 {
2430     return [self _boolValueForKey:WebKitMainContentUserGestureOverrideEnabledPreferenceKey];
2431 }
2432
2433 - (void)setOverrideUserGestureRequirementForMainContent:(BOOL)flag
2434 {
2435     [self _setBoolValue:flag forKey:WebKitMainContentUserGestureOverrideEnabledPreferenceKey];
2436 }
2437
2438 - (BOOL)mediaPlaybackAllowsInline
2439 {
2440     return [self _boolValueForKey:WebKitAllowsInlineMediaPlaybackPreferenceKey];
2441 }
2442
2443 - (void)setMediaPlaybackAllowsInline:(BOOL)flag
2444 {
2445     [self _setBoolValue:flag forKey:WebKitAllowsInlineMediaPlaybackPreferenceKey];
2446 }
2447
2448 - (BOOL)inlineMediaPlaybackRequiresPlaysInlineAttribute
2449 {
2450     return [self _boolValueForKey:WebKitInlineMediaPlaybackRequiresPlaysInlineAttributeKey];
2451 }
2452
2453 - (void)setInlineMediaPlaybackRequiresPlaysInlineAttribute:(BOOL)flag
2454 {
2455     [self _setBoolValue:flag forKey:WebKitInlineMediaPlaybackRequiresPlaysInlineAttributeKey];
2456 }
2457
2458 - (BOOL)invisibleAutoplayNotPermitted
2459 {
2460     return [self _boolValueForKey:WebKitInvisibleAutoplayNotPermittedKey];
2461 }
2462
2463 - (void)setInvisibleAutoplayNotPermitted:(BOOL)flag
2464 {
2465     [self _setBoolValue:flag forKey:WebKitInvisibleAutoplayNotPermittedKey];
2466 }
2467
2468 - (BOOL)mediaControlsScaleWithPageZoom
2469 {
2470     return [self _boolValueForKey:WebKitMediaControlsScaleWithPageZoomPreferenceKey];
2471 }
2472
2473 - (void)setMediaControlsScaleWithPageZoom:(BOOL)flag
2474 {
2475     [self _setBoolValue:flag forKey:WebKitMediaControlsScaleWithPageZoomPreferenceKey];
2476 }
2477
2478 - (BOOL)allowsAlternateFullscreen
2479 {
2480     return [self allowsPictureInPictureMediaPlayback];
2481 }
2482
2483 - (void)setAllowsAlternateFullscreen:(BOOL)flag
2484 {
2485     [self setAllowsPictureInPictureMediaPlayback:flag];
2486 }
2487
2488 - (BOOL)allowsPictureInPictureMediaPlayback
2489 {
2490     return [self _boolValueForKey:WebKitAllowsPictureInPictureMediaPlaybackPreferenceKey];
2491 }
2492
2493 - (void)setAllowsPictureInPictureMediaPlayback:(BOOL)flag
2494 {
2495     [self _setBoolValue:flag forKey:WebKitAllowsPictureInPictureMediaPlaybackPreferenceKey];
2496 }
2497
2498 - (BOOL)mockScrollbarsEnabled
2499 {
2500     return [self _boolValueForKey:WebKitMockScrollbarsEnabledPreferenceKey];
2501 }
2502
2503 - (void)setMockScrollbarsEnabled:(BOOL)flag
2504 {
2505     [self _setBoolValue:flag forKey:WebKitMockScrollbarsEnabledPreferenceKey];
2506 }
2507
2508 - (NSString *)pictographFontFamily
2509 {
2510     return [self _stringValueForKey: WebKitPictographFontPreferenceKey];
2511 }
2512
2513 - (void)setPictographFontFamily:(NSString *)family
2514 {
2515     [self _setStringValue: family forKey: WebKitPictographFontPreferenceKey];
2516 }
2517
2518 - (BOOL)pageCacheSupportsPlugins
2519 {
2520     return [self _boolValueForKey:WebKitPageCacheSupportsPluginsPreferenceKey];
2521 }
2522
2523 - (void)setPageCacheSupportsPlugins:(BOOL)flag
2524 {
2525     [self _setBoolValue:flag forKey:WebKitPageCacheSupportsPluginsPreferenceKey];
2526
2527 }
2528
2529 #if PLATFORM(IOS)
2530 - (void)_invalidateCachedPreferences
2531 {
2532     dispatch_barrier_sync(_private->readWriteQueue, ^{
2533         if (_private->values)
2534             _private->values = adoptNS([[NSMutableDictionary alloc] init]);
2535     });
2536
2537     [self _updatePrivateBrowsingStateTo:[self privateBrowsingEnabled]];
2538
2539     // Tell any live WebViews to refresh their preferences
2540     [self _postPreferencesChangedNotification];
2541 }
2542
2543 - (void)_synchronizeWebStoragePolicyWithCookiePolicy
2544 {
2545     // FIXME: This should be done in clients, WebKit shouldn't be making such policy decisions.
2546
2547     NSHTTPCookieAcceptPolicy cookieAcceptPolicy = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookieAcceptPolicy];
2548     WebStorageBlockingPolicy storageBlockingPolicy;
2549     switch (static_cast<unsigned>(cookieAcceptPolicy)) {
2550     case NSHTTPCookieAcceptPolicyAlways:
2551         storageBlockingPolicy = WebAllowAllStorage;
2552         break;
2553     case NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain:
2554     case NSHTTPCookieAcceptPolicyExclusivelyFromMainDocumentDomain:
2555         storageBlockingPolicy = WebBlockThirdPartyStorage;
2556         break;
2557     case NSHTTPCookieAcceptPolicyNever:
2558         storageBlockingPolicy = WebBlockAllStorage;
2559         break;
2560     default:
2561         ASSERT_NOT_REACHED();
2562         storageBlockingPolicy = WebBlockAllStorage;
2563         break;
2564     }    
2565
2566     [self setStorageBlockingPolicy:storageBlockingPolicy];
2567 }
2568 #endif
2569
2570 - (void)setBackspaceKeyNavigationEnabled:(BOOL)flag
2571 {
2572     [self _setBoolValue:flag forKey:WebKitBackspaceKeyNavigationEnabledKey];
2573 }
2574
2575 - (BOOL)backspaceKeyNavigationEnabled
2576 {
2577     return [self _boolValueForKey:WebKitBackspaceKeyNavigationEnabledKey];
2578 }
2579
2580 - (void)setWantsBalancedSetDefersLoadingBehavior:(BOOL)flag
2581 {
2582     [self _setBoolValue:flag forKey:WebKitWantsBalancedSetDefersLoadingBehaviorKey];
2583 }
2584
2585 - (BOOL)wantsBalancedSetDefersLoadingBehavior
2586 {
2587     return [self _boolValueForKey:WebKitWantsBalancedSetDefersLoadingBehaviorKey];
2588 }
2589
2590 - (void)setShouldDisplaySubtitles:(BOOL)flag
2591 {
2592     [self _setBoolValue:flag forKey:WebKitShouldDisplaySubtitlesPreferenceKey];
2593 }
2594
2595 - (BOOL)shouldDisplaySubtitles
2596 {
2597     return [self _boolValueForKey:WebKitShouldDisplaySubtitlesPreferenceKey];
2598 }
2599
2600 - (void)setShouldDisplayCaptions:(BOOL)flag
2601 {
2602     [self _setBoolValue:flag forKey:WebKitShouldDisplayCaptionsPreferenceKey];
2603 }
2604
2605 - (BOOL)shouldDisplayCaptions
2606 {
2607     return [self _boolValueForKey:WebKitShouldDisplayCaptionsPreferenceKey];
2608 }
2609
2610 - (void)setShouldDisplayTextDescriptions:(BOOL)flag
2611 {
2612     [self _setBoolValue:flag forKey:WebKitShouldDisplayTextDescriptionsPreferenceKey];
2613 }
2614
2615 - (BOOL)shouldDisplayTextDescriptions
2616 {
2617     return [self _boolValueForKey:WebKitShouldDisplayTextDescriptionsPreferenceKey];
2618 }
2619
2620 - (void)setNotificationsEnabled:(BOOL)flag
2621 {
2622     [self _setBoolValue:flag forKey:WebKitNotificationsEnabledKey];
2623 }
2624
2625 - (BOOL)notificationsEnabled
2626 {
2627     return [self _boolValueForKey:WebKitNotificationsEnabledKey];
2628 }
2629
2630 - (void)setShouldRespectImageOrientation:(BOOL)flag
2631 {
2632     [self _setBoolValue:flag forKey:WebKitShouldRespectImageOrientationKey];
2633 }
2634
2635 - (BOOL)shouldRespectImageOrientation
2636 {
2637     return [self _boolValueForKey:WebKitShouldRespectImageOrientationKey];
2638 }
2639
2640 - (BOOL)requestAnimationFrameEnabled
2641 {
2642     return [self _boolValueForKey:WebKitRequestAnimationFrameEnabledPreferenceKey];
2643 }
2644
2645 - (void)setRequestAnimationFrameEnabled:(BOOL)enabled
2646 {
2647     [self _setBoolValue:enabled forKey:WebKitRequestAnimationFrameEnabledPreferenceKey];
2648 }
2649
2650 - (void)setIncrementalRenderingSuppressionTimeoutInSeconds:(NSTimeInterval)timeout
2651 {
2652     [self _setFloatValue:timeout forKey:WebKitIncrementalRenderingSuppressionTimeoutInSecondsKey];
2653 }
2654
2655 - (NSTimeInterval)incrementalRenderingSuppressionTimeoutInSeconds
2656 {
2657     return [self _floatValueForKey:WebKitIncrementalRenderingSuppressionTimeoutInSecondsKey];
2658 }
2659
2660 - (BOOL)diagnosticLoggingEnabled
2661 {
2662     return [self _boolValueForKey:WebKitDiagnosticLoggingEnabledKey];
2663 }
2664
2665 - (void)setDiagnosticLoggingEnabled:(BOOL)enabled
2666 {
2667     [self _setBoolValue:enabled forKey:WebKitDiagnosticLoggingEnabledKey];
2668 }
2669
2670 - (void)setStorageBlockingPolicy:(WebStorageBlockingPolicy)storageBlockingPolicy
2671 {
2672 #if PLATFORM(IOS)
2673     // We don't want to write the setting out, so we just reset the default instead of storing the new setting.
2674     // FIXME: This code removes any defaults previously registered by client process, which is not appropriate for this method to do.
2675     NSDictionary *dict = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:storageBlockingPolicy] forKey:WebKitStorageBlockingPolicyKey];
2676     [[NSUserDefaults standardUserDefaults] registerDefaults:dict];
2677 #else
2678     [self _setIntegerValue:storageBlockingPolicy forKey:WebKitStorageBlockingPolicyKey];
2679 #endif
2680 }
2681
2682 - (WebStorageBlockingPolicy)storageBlockingPolicy
2683 {
2684     return static_cast<WebStorageBlockingPolicy>([self _integerValueForKey:WebKitStorageBlockingPolicyKey]);
2685 }
2686
2687 - (BOOL)plugInSnapshottingEnabled
2688 {
2689     return [self _boolValueForKey:WebKitPlugInSnapshottingEnabledPreferenceKey];
2690 }
2691
2692 - (void)setPlugInSnapshottingEnabled:(BOOL)enabled
2693 {
2694     [self _setBoolValue:enabled forKey:WebKitPlugInSnapshottingEnabledPreferenceKey];
2695 }
2696
2697 - (BOOL)hiddenPageDOMTimerThrottlingEnabled
2698 {
2699     return [self _boolValueForKey:WebKitHiddenPageDOMTimerThrottlingEnabledPreferenceKey];
2700 }
2701
2702 - (void)setHiddenPageDOMTimerThrottlingEnabled:(BOOL)enabled
2703 {
2704     [self _setBoolValue:enabled forKey:WebKitHiddenPageDOMTimerThrottlingEnabledPreferenceKey];
2705 }
2706
2707 - (BOOL)hiddenPageCSSAnimationSuspensionEnabled
2708 {
2709     return [self _boolValueForKey:WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey];
2710 }
2711
2712 - (void)setHiddenPageCSSAnimationSuspensionEnabled:(BOOL)enabled
2713 {
2714     [self _setBoolValue:enabled forKey:WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey];
2715 }
2716
2717 - (BOOL)lowPowerVideoAudioBufferSizeEnabled
2718 {
2719     return [self _boolValueForKey:WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey];
2720 }
2721
2722 - (void)setLowPowerVideoAudioBufferSizeEnabled:(BOOL)enabled
2723 {
2724     [self _setBoolValue:enabled forKey:WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey];
2725 }
2726
2727 - (BOOL)useLegacyTextAlignPositionedElementBehavior
2728 {
2729     return [self _boolValueForKey:WebKitUseLegacyTextAlignPositionedElementBehaviorPreferenceKey];
2730 }
2731
2732 - (void)setUseLegacyTextAlignPositionedElementBehavior:(BOOL)enabled
2733 {
2734     [self _setBoolValue:enabled forKey:WebKitUseLegacyTextAlignPositionedElementBehaviorPreferenceKey];
2735 }
2736
2737 - (BOOL)mediaSourceEnabled
2738 {
2739     return [self _boolValueForKey:WebKitMediaSourceEnabledPreferenceKey];
2740 }
2741
2742 - (void)setMediaSourceEnabled:(BOOL)enabled
2743 {
2744     [self _setBoolValue:enabled forKey:WebKitMediaSourceEnabledPreferenceKey];
2745 }
2746
2747 - (BOOL)sourceBufferChangeTypeEnabled
2748 {
2749     return [self _boolValueForKey:WebKitSourceBufferChangeTypeEnabledPreferenceKey];
2750 }
2751
2752 - (void)setSourceBufferChangeTypeEnabled:(BOOL)enabled
2753 {
2754     [self _setBoolValue:enabled forKey:WebKitSourceBufferChangeTypeEnabledPreferenceKey];
2755 }
2756
2757 - (BOOL)imageControlsEnabled
2758 {
2759     return [self _boolValueForKey:WebKitImageControlsEnabledPreferenceKey];
2760 }
2761
2762 - (void)setImageControlsEnabled:(BOOL)enabled
2763 {
2764     [self _setBoolValue:enabled forKey:WebKitImageControlsEnabledPreferenceKey];
2765 }
2766
2767 - (BOOL)serviceControlsEnabled
2768 {
2769     return [self _boolValueForKey:WebKitServiceControlsEnabledPreferenceKey];
2770 }
2771
2772 - (void)setServiceControlsEnabled:(BOOL)enabled
2773 {
2774     [self _setBoolValue:enabled forKey:WebKitServiceControlsEnabledPreferenceKey];
2775 }
2776
2777 - (BOOL)gamepadsEnabled
2778 {
2779     return [self _boolValueForKey:WebKitGamepadsEnabledPreferenceKey];
2780 }
2781
2782 - (void)setGamepadsEnabled:(BOOL)flag
2783 {
2784     [self _setBoolValue:flag forKey:WebKitGamepadsEnabledPreferenceKey];
2785 }
2786
2787 - (BOOL)shouldConvertPositionStyleOnCopy
2788 {
2789     return [self _boolValueForKey:WebKitShouldConvertPositionStyleOnCopyPreferenceKey];
2790 }
2791
2792 - (void)setShouldConvertPositionStyleOnCopy:(BOOL)enabled
2793 {
2794     [self _setBoolValue:enabled forKey:WebKitShouldConvertPositionStyleOnCopyPreferenceKey];
2795 }
2796
2797 - (NSString *)mediaKeysStorageDirectory
2798 {
2799     return [[self _stringValueForKey:WebKitMediaKeysStorageDirectoryKey] stringByStandardizingPath];
2800 }
2801
2802 - (void)setMediaKeysStorageDirectory:(NSString *)directory
2803 {
2804     [self _setStringValue:directory forKey:WebKitMediaKeysStorageDirectoryKey];
2805 }
2806
2807 - (BOOL)mediaDevicesEnabled
2808 {
2809     return [self _boolValueForKey:WebKitMediaDevicesEnabledPreferenceKey];
2810 }
2811
2812 - (void)setMediaDevicesEnabled:(BOOL)flag
2813 {
2814     [self _setBoolValue:flag forKey:WebKitMediaDevicesEnabledPreferenceKey];
2815 }
2816
2817 - (BOOL)mediaStreamEnabled
2818 {
2819     return [self _boolValueForKey:WebKitMediaStreamEnabledPreferenceKey];
2820 }
2821
2822 - (void)setMediaStreamEnabled:(BOOL)flag
2823 {
2824     [self _setBoolValue:flag forKey:WebKitMediaStreamEnabledPreferenceKey];
2825 }
2826
2827 - (BOOL)peerConnectionEnabled
2828 {
2829     return [self _boolValueForKey:WebKitPeerConnectionEnabledPreferenceKey];
2830 }
2831
2832 - (void)setPeerConnectionEnabled:(BOOL)flag
2833 {
2834     [self _setBoolValue:flag forKey:WebKitPeerConnectionEnabledPreferenceKey];
2835 }
2836
2837 - (BOOL)linkPreloadEnabled
2838 {
2839     return [self _boolValueForKey:WebKitLinkPreloadEnabledPreferenceKey];
2840 }
2841
2842 - (void)setLinkPreloadEnabled:(BOOL)flag
2843 {
2844     [self _setBoolValue:flag forKey:WebKitLinkPreloadEnabledPreferenceKey];
2845 }
2846
2847 - (BOOL)mediaPreloadingEnabled
2848 {
2849     return [self _boolValueForKey:WebKitMediaPreloadingEnabledPreferenceKey];
2850 }
2851
2852 - (void)setMediaPreloadingEnabled:(BOOL)flag
2853 {
2854     [self _setBoolValue:flag forKey:WebKitMediaPreloadingEnabledPreferenceKey];
2855 }
2856
2857 - (void)setMetaRefreshEnabled:(BOOL)enabled
2858 {
2859     [self setHTTPEquivEnabled:enabled];
2860 }
2861
2862 - (BOOL)metaRefreshEnabled
2863 {
2864     return [self httpEquivEnabled];
2865 }
2866
2867 - (void)setHTTPEquivEnabled:(BOOL)enabled
2868 {
2869     [self _setBoolValue:enabled forKey:WebKitHTTPEquivEnabledPreferenceKey];
2870 }
2871
2872 - (BOOL)httpEquivEnabled
2873 {
2874     return [self _boolValueForKey:WebKitHTTPEquivEnabledPreferenceKey];
2875 }
2876
2877 - (BOOL)javaScriptMarkupEnabled
2878 {
2879     return [self _boolValueForKey:WebKitJavaScriptMarkupEnabledPreferenceKey];
2880 }
2881
2882 - (void)setJavaScriptMarkupEnabled:(BOOL)flag
2883 {
2884     [self _setBoolValue:flag forKey:WebKitJavaScriptMarkupEnabledPreferenceKey];
2885 }
2886
2887 - (BOOL)mediaDataLoadsAutomatically
2888 {
2889     return [self _boolValueForKey:WebKitMediaDataLoadsAutomaticallyPreferenceKey];
2890 }
2891
2892 - (void)setMediaDataLoadsAutomatically:(BOOL)flag
2893 {
2894     [self _setBoolValue:flag forKey:WebKitMediaDataLoadsAutomaticallyPreferenceKey];
2895 }
2896
2897 - (BOOL)attachmentElementEnabled
2898 {
2899     return [self _boolValueForKey:WebKitAttachmentElementEnabledPreferenceKey];
2900 }
2901
2902 - (void)setAttachmentElementEnabled:(BOOL)flag
2903 {
2904     [self _setBoolValue:flag forKey:WebKitAttachmentElementEnabledPreferenceKey];
2905 }
2906
2907 - (BOOL)allowsInlineMediaPlaybackAfterFullscreen
2908 {
2909     return [self _boolValueForKey:WebKitAllowsInlineMediaPlaybackAfterFullscreenPreferenceKey];
2910 }
2911
2912 - (void)setAllowsInlineMediaPlaybackAfterFullscreen:(BOOL)flag
2913 {
2914     [self _setBoolValue:flag forKey:WebKitAllowsInlineMediaPlaybackAfterFullscreenPreferenceKey];
2915 }
2916
2917 - (BOOL)mockCaptureDevicesEnabled
2918 {
2919     return [self _boolValueForKey:WebKitMockCaptureDevicesEnabledPreferenceKey];
2920 }
2921
2922 - (void)setMockCaptureDevicesEnabled:(BOOL)flag
2923 {
2924     [self _setBoolValue:flag forKey:WebKitMockCaptureDevicesEnabledPreferenceKey];
2925 }
2926
2927 - (BOOL)mockCaptureDevicesPromptEnabled
2928 {
2929     return [self _boolValueForKey:WebKitMockCaptureDevicesPromptEnabledPreferenceKey];
2930 }
2931
2932 - (void)setMockCaptureDevicesPromptEnabled:(BOOL)flag
2933 {
2934     [self _setBoolValue:flag forKey:WebKitMockCaptureDevicesPromptEnabledPreferenceKey];
2935 }
2936
2937 - (BOOL)enumeratingAllNetworkInterfacesEnabled
2938 {
2939     return [self _boolValueForKey:WebKitEnumeratingAllNetworkInterfacesEnabledPreferenceKey];
2940 }
2941
2942 - (void)setEnumeratingAllNetworkInterfacesEnabled:(BOOL)flag
2943 {
2944     [self _setBoolValue:flag forKey:WebKitEnumeratingAllNetworkInterfacesEnabledPreferenceKey];
2945 }
2946
2947 - (BOOL)iceCandidateFilteringEnabled
2948 {
2949     return [self _boolValueForKey:WebKitICECandidateFilteringEnabledPreferenceKey];
2950 }
2951
2952 - (void)setIceCandidateFilteringEnabled:(BOOL)flag
2953 {
2954     [self _setBoolValue:flag forKey:WebKitICECandidateFilteringEnabledPreferenceKey];
2955 }
2956
2957 - (BOOL)mediaCaptureRequiresSecureConnection
2958 {
2959     return [self _boolValueForKey:WebKitMediaCaptureRequiresSecureConnectionPreferenceKey];
2960 }
2961
2962 - (void)setMediaCaptureRequiresSecureConnection:(BOOL)flag
2963 {
2964     [self _setBoolValue:flag forKey:WebKitMediaCaptureRequiresSecureConnectionPreferenceKey];
2965 }
2966
2967 - (BOOL)shadowDOMEnabled
2968 {
2969     return [self _boolValueForKey:WebKitShadowDOMEnabledPreferenceKey];
2970 }
2971
2972 - (void)setShadowDOMEnabled:(BOOL)flag
2973 {
2974     [self _setBoolValue:flag forKey:WebKitShadowDOMEnabledPreferenceKey];
2975 }
2976
2977 - (BOOL)customElementsEnabled
2978 {
2979     return [self _boolValueForKey:WebKitCustomElementsEnabledPreferenceKey];
2980 }
2981
2982 - (void)setCustomElementsEnabled:(BOOL)flag
2983 {
2984     [self _setBoolValue:flag forKey:WebKitCustomElementsEnabledPreferenceKey];
2985 }
2986
2987 - (BOOL)dataTransferItemsEnabled
2988 {
2989     return [self _boolValueForKey:WebKitDataTransferItemsEnabledPreferenceKey];
2990 }
2991
2992 - (void)setDataTransferItemsEnabled:(BOOL)flag
2993 {
2994     [self _setBoolValue:flag forKey:WebKitDataTransferItemsEnabledPreferenceKey];
2995 }
2996
2997 - (BOOL)customPasteboardDataEnabled
2998 {
2999     return [self _boolValueForKey:WebKitCustomPasteboardDataEnabledPreferenceKey];
3000 }
3001
3002 - (void)setCustomPasteboardDataEnabled:(BOOL)flag
3003 {
3004     [self _setBoolValue:flag forKey:WebKitCustomPasteboardDataEnabledPreferenceKey];
3005 }
3006
3007 - (BOOL)cacheAPIEnabled
3008 {
3009     return [self _boolValueForKey:WebKitCacheAPIEnabledPreferenceKey];
3010 }
3011
3012 - (void)setCacheAPIEnabled:(BOOL)flag
3013 {
3014     [self _setBoolValue:flag forKey:WebKitCacheAPIEnabledPreferenceKey];
3015 }
3016
3017 - (BOOL)fetchAPIEnabled
3018 {
3019     return [self _boolValueForKey:WebKitFetchAPIEnabledPreferenceKey];
3020 }
3021
3022 - (void)setFetchAPIEnabled:(BOOL)flag
3023 {
3024     [self _setBoolValue:flag forKey:WebKitFetchAPIEnabledPreferenceKey];
3025 }
3026
3027 - (BOOL)readableByteStreamAPIEnabled
3028 {
3029     return [self _boolValueForKey:WebKitReadableByteStreamAPIEnabledPreferenceKey];
3030 }
3031
3032 - (void)setReadableByteStreamAPIEnabled:(BOOL)flag
3033 {
3034     [self _setBoolValue:flag forKey:WebKitReadableByteStreamAPIEnabledPreferenceKey];
3035 }
3036
3037 - (BOOL)writableStreamAPIEnabled
3038 {
3039     return [self _boolValueForKey:WebKitWritableStreamAPIEnabledPreferenceKey];
3040 }
3041
3042 - (void)setWritableStreamAPIEnabled:(BOOL)flag
3043 {
3044     [self _setBoolValue:flag forKey:WebKitWritableStreamAPIEnabledPreferenceKey];
3045 }
3046
3047 - (BOOL)downloadAttributeEnabled
3048 {
3049     return [self _boolValueForKey:WebKitDownloadAttributeEnabledPreferenceKey];
3050 }
3051
3052 - (void)setDownloadAttributeEnabled:(BOOL)flag
3053 {
3054     [self _setBoolValue:flag forKey:WebKitDownloadAttributeEnabledPreferenceKey];
3055 }
3056
3057 - (void)setDirectoryUploadEnabled:(BOOL)flag
3058 {
3059     [self _setBoolValue:flag forKey:WebKitDirectoryUploadEnabledPreferenceKey];
3060 }
3061
3062 - (BOOL)directoryUploadEnabled
3063 {
3064     return [self _boolValueForKey:WebKitDirectoryUploadEnabledPreferenceKey];
3065 }
3066
3067 - (BOOL)visualViewportEnabled
3068 {
3069     return [self _boolValueForKey:WebKitVisualViewportEnabledPreferenceKey];
3070 }
3071
3072 - (void)setVisualViewportEnabled:(BOOL)flag
3073 {
3074     [self _setBoolValue:flag forKey:WebKitVisualViewportEnabledPreferenceKey];
3075 }
3076
3077 - (BOOL)visualViewportAPIEnabled
3078 {
3079     return [self _boolValueForKey:WebKitVisualViewportAPIEnabledPreferenceKey];
3080 }
3081
3082 - (void)setVisualViewportAPIEnabled:(BOOL)flag
3083 {
3084     [self _setBoolValue:flag forKey:WebKitVisualViewportAPIEnabledPreferenceKey];
3085 }
3086
3087 - (BOOL)CSSOMViewScrollingAPIEnabled
3088 {
3089     return [self _boolValueForKey:WebKitCSSOMViewScrollingAPIEnabledPreferenceKey];
3090 }
3091
3092 - (void)setCSSOMViewScrollingAPIEnabled:(BOOL)flag
3093 {
3094     [self _setBoolValue:flag forKey:WebKitCSSOMViewScrollingAPIEnabledPreferenceKey];
3095 }
3096
3097 - (BOOL)webAnimationsEnabled
3098 {
3099     return [self _boolValueForKey:WebKitWebAnimationsEnabledPreferenceKey];
3100 }
3101
3102 - (void)setWebAnimationsEnabled:(BOOL)flag
3103 {
3104     [self _setBoolValue:flag forKey:WebKitWebAnimationsEnabledPreferenceKey];
3105 }
3106
3107 - (BOOL)fetchAPIKeepAliveEnabled
3108 {
3109     return [self _boolValueForKey:WebKitFetchAPIEnabledPreferenceKey];
3110 }
3111
3112 - (void)setFetchAPIKeepAliveEnabled:(BOOL)flag
3113 {
3114     [self _setBoolValue:flag forKey:WebKitFetchAPIEnabledPreferenceKey];
3115 }
3116
3117 - (BOOL)modernMediaControlsEnabled
3118 {
3119     return [self _boolValueForKey:WebKitModernMediaControlsEnabledPreferenceKey];
3120 }
3121
3122 - (void)setModernMediaControlsEnabled:(BOOL)flag
3123 {
3124     [self _setBoolValue:flag forKey:WebKitModernMediaControlsEnabledPreferenceKey];
3125 }
3126
3127 - (BOOL)webAnimationsCSSIntegrationEnabled
3128 {
3129     return [self _boolValueForKey:WebKitWebAnimationsCSSIntegrationEnabledPreferenceKey];
3130 }
3131
3132 - (void)setWebAnimationsCSSIntegrationEnabled:(BOOL)flag
3133 {
3134     [self _setBoolValue:flag forKey:WebKitWebAnimationsCSSIntegrationEnabledPreferenceKey];
3135 }
3136
3137 - (BOOL)intersectionObserverEnabled
3138 {
3139     return [self _boolValueForKey:WebKitIntersectionObserverEnabledPreferenceKey];
3140 }
3141
3142 - (void)setIntersectionObserverEnabled:(BOOL)flag
3143 {
3144     [self _setBoolValue:flag forKey:WebKitIntersectionObserverEnabledPreferenceKey];
3145 }
3146
3147 - (BOOL)menuItemElementEnabled
3148 {
3149     return [self _boolValueForKey:WebKitMenuItemElementEnabledPreferenceKey];
3150 }
3151
3152 - (void)setMenuItemElementEnabled:(BOOL)flag
3153 {
3154     [self _setBoolValue:flag forKey:WebKitMenuItemElementEnabledPreferenceKey];
3155 }
3156
3157 - (BOOL)displayContentsEnabled
3158 {
3159     return [self _boolValueForKey:WebKitDisplayContentsEnabledPreferenceKey];
3160 }
3161
3162 - (void)setDisplayContentsEnabled:(BOOL)flag
3163 {
3164     [self _setBoolValue:flag forKey:WebKitDisplayContentsEnabledPreferenceKey];
3165 }
3166
3167 - (BOOL)userTimingEnabled
3168 {
3169     return [self _boolValueForKey:WebKitUserTimingEnabledPreferenceKey];
3170 }
3171
3172 - (void)setUserTimingEnabled:(BOOL)flag
3173 {
3174     [self _setBoolValue:flag forKey:WebKitUserTimingEnabledPreferenceKey];
3175 }
3176
3177 - (BOOL)resourceTimingEnabled
3178 {
3179     return [self _boolValueForKey:WebKitResourceTimingEnabledPreferenceKey];
3180 }
3181
3182 - (void)setResourceTimingEnabled:(BOOL)flag
3183 {
3184     [self _setBoolValue:flag forKey:WebKitResourceTimingEnabledPreferenceKey];
3185 }
3186
3187 - (BOOL)webAuthenticationEnabled
3188 {
3189     return [self _boolValueForKey:WebKitWebAuthenticationEnabledPreferenceKey];
3190 }
3191
3192 - (void)setWebAuthenticationEnabled:(BOOL)flag
3193 {
3194     [self _setBoolValue:flag forKey:WebKitWebAuthenticationEnabledPreferenceKey];
3195 }
3196
3197 - (BOOL)mediaUserGestureInheritsFromDocument
3198 {
3199     return [self _boolValueForKey:WebKitMediaUserGestureInheritsFromDocument];
3200 }
3201
3202 - (void)setMediaUserGestureInheritsFromDocument:(BOOL)flag
3203 {
3204     [self _setBoolValue:flag forKey:WebKitMediaUserGestureInheritsFromDocument];
3205 }
3206
3207 #if PLATFORM(IOS)
3208 - (BOOL)quickLookDocumentSavingEnabled
3209 {
3210     return [self _boolValueForKey:WebKitQuickLookDocumentSavingPreferenceKey];
3211 }
3212
3213 - (void)setQuickLookDocumentSavingEnabled:(BOOL)flag
3214 {
3215     [self _setBoolValue:flag forKey:WebKitQuickLookDocumentSavingPreferenceKey];
3216 }
3217 #endif
3218
3219 - (NSString *)mediaContentTypesRequiringHardwareSupport
3220 {
3221     return [self _stringValueForKey:WebKitMediaContentTypesRequiringHardwareSupportPreferenceKey];
3222 }
3223
3224 - (void)setMediaContentTypesRequiringHardwareSupport:(NSString *)value
3225 {
3226     [self _setStringValue:value forKey:WebKitMediaContentTypesRequiringHardwareSupportPreferenceKey];
3227 }
3228
3229 - (BOOL)isSecureContextAttributeEnabled
3230 {
3231     return [self _boolValueForKey:WebKitIsSecureContextAttributeEnabledPreferenceKey];
3232 }
3233
3234 - (void)setIsSecureContextAttributeEnabled:(BOOL)flag
3235 {
3236     [self _setBoolValue:flag forKey:WebKitIsSecureContextAttributeEnabledPreferenceKey];
3237 }
3238
3239 - (BOOL)legacyEncryptedMediaAPIEnabled
3240 {
3241     return [self _boolValueForKey:WebKitLegacyEncryptedMediaAPIEnabledKey];
3242 }
3243
3244 - (void)setLegacyEncryptedMediaAPIEnabled:(BOOL)flag
3245 {
3246     [self _setBoolValue:flag forKey:WebKitLegacyEncryptedMediaAPIEnabledKey];
3247 }
3248
3249 - (BOOL)encryptedMediaAPIEnabled
3250 {
3251     return [self _boolValueForKey:WebKitEncryptedMediaAPIEnabledKey];
3252 }
3253
3254 - (void)setEncryptedMediaAPIEnabled:(BOOL)flag
3255 {
3256     [self _setBoolValue:flag forKey:WebKitEncryptedMediaAPIEnabledKey];
3257 }
3258
3259 - (BOOL)viewportFitEnabled
3260 {
3261     return [self _boolValueForKey:WebKitViewportFitEnabledPreferenceKey];
3262 }
3263
3264 - (void)setViewportFitEnabled:(BOOL)flag
3265 {
3266     [self _setBoolValue:flag forKey:WebKitViewportFitEnabledPreferenceKey];
3267 }
3268
3269 - (BOOL)constantPropertiesEnabled
3270 {
3271     return [self _boolValueForKey:WebKitConstantPropertiesEnabledPreferenceKey];
3272 }
3273
3274 - (void)setConstantPropertiesEnabled:(BOOL)flag
3275 {
3276     [self _setBoolValue:flag forKey:WebKitConstantPropertiesEnabledPreferenceKey];
3277 }
3278
3279 - (BOOL)colorFilterEnabled
3280 {
3281     return [self _boolValueForKey:WebKitColorFilterEnabledPreferenceKey];
3282 }
3283
3284 - (void)setColorFilterEnabled:(BOOL)flag
3285 {
3286     [self _setBoolValue:flag forKey:WebKitColorFilterEnabledPreferenceKey];
3287 }
3288
3289 - (BOOL)punchOutWhiteBackgroundsInDarkMode
3290 {
3291     return [self _boolValueForKey:WebKitPunchOutWhiteBackgroundsInDarkModePreferenceKey];
3292 }
3293
3294 - (void)setPunchOutWhiteBackgroundsInDarkMode:(BOOL)flag
3295 {
3296     [self _setBoolValue:flag forKey:WebKitPunchOutWhiteBackgroundsInDarkModePreferenceKey];
3297 }
3298
3299 - (BOOL)allowMediaContentTypesRequiringHardwareSupportAsFallback
3300 {
3301     return [self _boolValueForKey:WebKitAllowMediaContentTypesRequiringHardwareSupportAsFallbackKey];
3302 }
3303
3304 - (void)setAllowMediaContentTypesRequiringHardwareSupportAsFallback:(BOOL)flag
3305 {
3306     [self _setBoolValue:flag forKey:WebKitAllowMediaContentTypesRequiringHardwareSupportAsFallbackKey];
3307 }
3308
3309 - (BOOL)inspectorAdditionsEnabled
3310 {
3311     return [self _boolValueForKey:WebKitInspectorAdditionsEnabledPreferenceKey];
3312 }
3313
3314 - (void)setInspectorAdditionsEnabled:(BOOL)flag
3315 {
3316     [self _setBoolValue:flag forKey:WebKitInspectorAdditionsEnabledPreferenceKey];
3317 }
3318
3319 - (BOOL)accessibilityObjectModelEnabled
3320 {
3321     return [self _boolValueForKey:WebKitAccessibilityObjectModelEnabledPreferenceKey];
3322 }
3323
3324 - (void)setAccessibilityObjectModelEnabled:(BOOL)flag
3325 {
3326     [self _setBoolValue:flag forKey:WebKitAccessibilityObjectModelEnabledPreferenceKey];
3327 }
3328
3329 - (BOOL)ariaReflectionEnabled
3330 {
3331     return [self _boolValueForKey:WebKitAriaReflectionEnabledPreferenceKey];
3332 }
3333
3334 - (void)setAriaReflectionEnabled:(BOOL)flag
3335 {
3336     [self _setBoolValue:flag forKey:WebKitAriaReflectionEnabledPreferenceKey];
3337 }
3338
3339 - (BOOL)mediaCapabilitiesEnabled
3340 {
3341     return [self _boolValueForKey:WebKitMediaCapabilitiesEnabledPreferenceKey];
3342 }
3343
3344 - (void)setMediaCapabilitiesEnabled:(BOOL)flag
3345 {
3346     [self _setBoolValue:flag forKey:WebKitMediaCapabilitiesEnabledPreferenceKey];
3347 }
3348
3349 - (BOOL)mediaRecorderEnabled
3350 {
3351     return [self _boolValueForKey:WebKitMediaRecorderEnabledPreferenceKey];
3352 }
3353
3354 - (void)setMediaRecorderEnabled:(BOOL)flag
3355 {
3356     [self _setBoolValue:flag forKey:WebKitMediaRecorderEnabledPreferenceKey];
3357 }
3358
3359 - (BOOL)serverTimingEnabled
3360 {
3361     return [self _boolValueForKey:WebKitServerTimingEnabledPreferenceKey];
3362 }
3363
3364 - (void)setServerTimingEnabled:(BOOL)flag
3365 {
3366     [self _setBoolValue:flag forKey:WebKitServerTimingEnabledPreferenceKey];
3367 }
3368
3369 - (BOOL)selectionAcrossShadowBoundariesEnabled
3370 {
3371     return [self _boolValueForKey:WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey];
3372 }
3373
3374 - (void)setSelectionAcrossShadowBoundariesEnabled:(BOOL)flag
3375 {
3376     [self _setBoolValue:flag forKey:WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey];
3377 }
3378
3379 @end
3380
3381 @implementation WebPreferences (WebInternal)
3382
3383 + (NSString *)_IBCreatorID
3384 {
3385     return classIBCreatorID;
3386 }
3387
3388 + (NSString *)_concatenateKeyWithIBCreatorID:(NSString *)key
3389 {
3390     NSString *IBCreatorID = [WebPreferences _IBCreatorID];
3391     if (!IBCreatorID)
3392         return key;
3393     return [IBCreatorID stringByAppendingString:key];
3394 }
3395
3396 @end