| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "bindings/v8/ExceptionState.h" | 31 #include "bindings/v8/ExceptionState.h" |
| 32 #include "core/dom/ExceptionCode.h" | 32 #include "core/dom/ExceptionCode.h" |
| 33 #include "core/page/Page.h" | 33 #include "core/page/Page.h" |
| 34 #include "core/page/Settings.h" | 34 #include "core/page/Settings.h" |
| 35 #include "core/platform/ColorChooser.h" | 35 #include "core/platform/ColorChooser.h" |
| 36 #include "core/platform/Supplementable.h" | 36 #include "core/platform/Supplementable.h" |
| 37 #include "core/platform/text/LocaleToScriptMapping.h" | 37 #include "core/platform/text/LocaleToScriptMapping.h" |
| 38 | 38 |
| 39 #define InternalSettingsGuardForSettingsReturn(returnValue) \ | 39 #define InternalSettingsGuardForSettingsReturn(returnValue) \ |
| 40 if (!settings()) { \ | 40 if (!settings()) { \ |
| 41 es.throwDOMException(InvalidAccessError); \ | 41 es.throwUninformativeAndGenericDOMException(InvalidAccessError); \ |
| 42 return returnValue; \ | 42 return returnValue; \ |
| 43 } | 43 } |
| 44 | 44 |
| 45 #define InternalSettingsGuardForSettings() \ | 45 #define InternalSettingsGuardForSettings() \ |
| 46 if (!settings()) { \ | 46 if (!settings()) { \ |
| 47 es.throwDOMException(InvalidAccessError); \ | 47 es.throwUninformativeAndGenericDOMException(InvalidAccessError); \ |
| 48 return; \ | 48 return; \ |
| 49 } | 49 } |
| 50 | 50 |
| 51 #define InternalSettingsGuardForPage() \ | 51 #define InternalSettingsGuardForPage() \ |
| 52 if (!page()) { \ | 52 if (!page()) { \ |
| 53 es.throwDOMException(InvalidAccessError); \ | 53 es.throwUninformativeAndGenericDOMException(InvalidAccessError); \ |
| 54 return; \ | 54 return; \ |
| 55 } | 55 } |
| 56 | 56 |
| 57 namespace WebCore { | 57 namespace WebCore { |
| 58 | 58 |
| 59 InternalSettings::Backup::Backup(Settings* settings) | 59 InternalSettings::Backup::Backup(Settings* settings) |
| 60 : m_originalCSSExclusionsEnabled(RuntimeEnabledFeatures::cssExclusionsEnable
d()) | 60 : m_originalCSSExclusionsEnabled(RuntimeEnabledFeatures::cssExclusionsEnable
d()) |
| 61 , m_originalAuthorShadowDOMForAnyElementEnabled(RuntimeEnabledFeatures::auth
orShadowDOMForAnyElementEnabled()) | 61 , m_originalAuthorShadowDOMForAnyElementEnabled(RuntimeEnabledFeatures::auth
orShadowDOMForAnyElementEnabled()) |
| 62 , m_originalExperimentalWebSocketEnabled(settings->experimentalWebSocketEnab
led()) | 62 , m_originalExperimentalWebSocketEnabled(settings->experimentalWebSocketEnab
led()) |
| 63 , m_originalStyleScoped(RuntimeEnabledFeatures::styleScopedEnabled()) | 63 , m_originalStyleScoped(RuntimeEnabledFeatures::styleScopedEnabled()) |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 InternalSettingsGuardForSettings(); | 287 InternalSettingsGuardForSettings(); |
| 288 if (equalIgnoringCase(editingBehavior, "win")) | 288 if (equalIgnoringCase(editingBehavior, "win")) |
| 289 settings()->setEditingBehaviorType(EditingWindowsBehavior); | 289 settings()->setEditingBehaviorType(EditingWindowsBehavior); |
| 290 else if (equalIgnoringCase(editingBehavior, "mac")) | 290 else if (equalIgnoringCase(editingBehavior, "mac")) |
| 291 settings()->setEditingBehaviorType(EditingMacBehavior); | 291 settings()->setEditingBehaviorType(EditingMacBehavior); |
| 292 else if (equalIgnoringCase(editingBehavior, "unix")) | 292 else if (equalIgnoringCase(editingBehavior, "unix")) |
| 293 settings()->setEditingBehaviorType(EditingUnixBehavior); | 293 settings()->setEditingBehaviorType(EditingUnixBehavior); |
| 294 else if (equalIgnoringCase(editingBehavior, "android")) | 294 else if (equalIgnoringCase(editingBehavior, "android")) |
| 295 settings()->setEditingBehaviorType(EditingAndroidBehavior); | 295 settings()->setEditingBehaviorType(EditingAndroidBehavior); |
| 296 else | 296 else |
| 297 es.throwDOMException(SyntaxError); | 297 es.throwUninformativeAndGenericDOMException(SyntaxError); |
| 298 } | 298 } |
| 299 | 299 |
| 300 void InternalSettings::setLangAttributeAwareFormControlUIEnabled(bool enabled) | 300 void InternalSettings::setLangAttributeAwareFormControlUIEnabled(bool enabled) |
| 301 { | 301 { |
| 302 RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(enabled); | 302 RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(enabled); |
| 303 } | 303 } |
| 304 | 304 |
| 305 void InternalSettings::setImagesEnabled(bool enabled, ExceptionState& es) | 305 void InternalSettings::setImagesEnabled(bool enabled, ExceptionState& es) |
| 306 { | 306 { |
| 307 InternalSettingsGuardForSettings(); | 307 InternalSettingsGuardForSettings(); |
| 308 settings()->setImagesEnabled(enabled); | 308 settings()->setImagesEnabled(enabled); |
| 309 } | 309 } |
| 310 | 310 |
| 311 void InternalSettings::setDefaultVideoPosterURL(const String& url, ExceptionStat
e& es) | 311 void InternalSettings::setDefaultVideoPosterURL(const String& url, ExceptionStat
e& es) |
| 312 { | 312 { |
| 313 InternalSettingsGuardForSettings(); | 313 InternalSettingsGuardForSettings(); |
| 314 settings()->setDefaultVideoPosterURL(url); | 314 settings()->setDefaultVideoPosterURL(url); |
| 315 } | 315 } |
| 316 | 316 |
| 317 } | 317 } |
| OLD | NEW |