Convert 3 settings to use Settings.in
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Feb 2013 23:38:15 +0000 (23:38 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Feb 2013 23:38:15 +0000 (23:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=109875

Reviewed by Ryosuke Niwa.

Source/WebCore:

Convert mediaEnabled, applicationChromeMode and DOMPasteAllowed to
use Settings.in. They previously had inconsistently named setters.

No new tests, this is a refactoring.

* Source/WebCore/WebCore.exp.in: Remove symbols that are now inlined from exports.
* Source/WebCore/WebCore.order: Remove symbols that no longer exist.
* dom/make_names.pl:
(printConstructorInterior): Rename isMediaEnabled to mediaEnabled.
(printWrapperFunctions): Rename isMediaEnabled to mediaEnabled.
* editing/EditorCommand.cpp:
(WebCore::supportedPaste): Rename isDOMPasteAllowed to DOMPasteAllowed.
* page/Settings.cpp:
(WebCore::Settings::Settings): Remove custom code.
* page/Settings.h:
(Settings): Remove custom code.
* page/Settings.in: Add entries for mediaEnabled, applicationChromeMode and DOMPasteAllowed.
* page/make_settings.pl:
(setterFunctionName): Expand uppercase rules to include DOM.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::isDefault): Rename inApplicationChromeMode to applicationChromeMode.
* rendering/RenderThemeWin.cpp:
(WebCore::documentIsInApplicationChromeMode): Rename inApplicationChromeMode to applicationChromeMode.

Source/WebKit/efl:

* ewk/ewk_view.cpp:
(_ewk_view_priv_new): Rename isDOMPasteAllowed to DOMPasteAllowed.

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

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.order
Source/WebCore/dom/make_names.pl
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/page/Settings.in
Source/WebCore/page/make_settings.pl
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderThemeWin.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/ewk/ewk_view.cpp

index abe31bc..fd4beeb 100644 (file)
@@ -1,3 +1,34 @@
+2013-02-19  Tony Chang  <tony@chromium.org>
+
+        Convert 3 settings to use Settings.in
+        https://bugs.webkit.org/show_bug.cgi?id=109875
+
+        Reviewed by Ryosuke Niwa.
+
+        Convert mediaEnabled, applicationChromeMode and DOMPasteAllowed to
+        use Settings.in. They previously had inconsistently named setters.
+
+        No new tests, this is a refactoring.
+
+        * Source/WebCore/WebCore.exp.in: Remove symbols that are now inlined from exports.
+        * Source/WebCore/WebCore.order: Remove symbols that no longer exist.
+        * dom/make_names.pl:
+        (printConstructorInterior): Rename isMediaEnabled to mediaEnabled.
+        (printWrapperFunctions): Rename isMediaEnabled to mediaEnabled.
+        * editing/EditorCommand.cpp:
+        (WebCore::supportedPaste): Rename isDOMPasteAllowed to DOMPasteAllowed.
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings): Remove custom code.
+        * page/Settings.h:
+        (Settings): Remove custom code.
+        * page/Settings.in: Add entries for mediaEnabled, applicationChromeMode and DOMPasteAllowed.
+        * page/make_settings.pl:
+        (setterFunctionName): Expand uppercase rules to include DOM.
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::isDefault): Rename inApplicationChromeMode to applicationChromeMode.
+        * rendering/RenderThemeWin.cpp:
+        (WebCore::documentIsInApplicationChromeMode): Rename inApplicationChromeMode to applicationChromeMode.
+
 2013-02-19  Julien Chaffraix  <jchaffraix@webkit.org>
 
         [CSS Grid Layout] Refactor the code in preparation of auto placement support
index 684384d..1889584 100644 (file)
@@ -982,7 +982,6 @@ __ZN7WebCore8Settings16setImagesEnabledEb
 __ZN7WebCore8Settings16setScriptEnabledEb
 __ZN7WebCore8Settings16setUsesPageCacheEb
 __ZN7WebCore8Settings17setPluginsEnabledEb
-__ZN7WebCore8Settings18setDOMPasteAllowedEb
 __ZN7WebCore8Settings18setDefaultFontSizeEi
 __ZN7WebCore8Settings18setFixedFontFamilyERKN3WTF12AtomicStringE11UScriptCode
 __ZN7WebCore8Settings18setMinimumFontSizeEi
@@ -998,7 +997,6 @@ __ZN7WebCore8Settings22setMinDOMTimerIntervalEd
 __ZN7WebCore8Settings22setSansSerifFontFamilyERKN3WTF12AtomicStringE11UScriptCode
 __ZN7WebCore8Settings23setDefaultFixedFontSizeEi
 __ZN7WebCore8Settings23setPictographFontFamilyERKN3WTF12AtomicStringE11UScriptCode
-__ZN7WebCore8Settings24setApplicationChromeModeEb
 __ZN7WebCore8Settings24setDNSPrefetchingEnabledEb
 __ZN7WebCore8Settings24setMockScrollbarsEnabledEb
 __ZN7WebCore8Settings24setUsesOverlayScrollbarsEb
index daa2d20..9558abb 100644 (file)
@@ -1448,10 +1448,8 @@ __ZN7WebCore8Settings21setStandardFontFamilyERKN3WTF12AtomicStringE
 __ZN7WebCore8Settings27setLoadsImagesAutomaticallyEb
 __ZN7WebCore8Settings24setUsesOverlayScrollbarsEb
 __ZN7WebCore8Settings24setTextAreasAreResizableEb
-__ZN7WebCore8Settings18setDOMPasteAllowedEb
 __ZN7WebCore8Settings16setUsesPageCacheEb
 __ZN7WebCore8Settings29setAuthorAndUserStylesEnabledEb
-__ZN7WebCore8Settings24setApplicationChromeModeEb
 __ZN7WebCore8Settings25setUserStyleSheetLocationERKNS_4KURLE
 __ZN7WebCore4Page29userStyleSheetLocationChangedEv
 __ZNK7WebCore4KURL10protocolIsEPKc
index 201f45f..7233e32 100755 (executable)
@@ -369,7 +369,7 @@ sub printConstructorInterior
     if ($enabledTags{$tagName}{wrapperOnlyIfMediaIsAvailable}) {
         print F <<END
     Settings* settings = document->settings();
-    if (!MediaPlayer::isAvailable() || (settings && !settings->isMediaEnabled()))
+    if (!MediaPlayer::isAvailable() || (settings && !settings->mediaEnabled()))
         return 0;
     
 END
@@ -1018,7 +1018,7 @@ sub printWrapperFunctions
 static JSDOMWrapper* create${JSInterfaceName}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element)
 {
     Settings* settings = element->document()->settings();
-    if (!MediaPlayer::isAvailable() || (settings && !settings->isMediaEnabled()))
+    if (!MediaPlayer::isAvailable() || (settings && !settings->mediaEnabled()))
         return CREATE_DOM_WRAPPER(exec, globalObject, $parameters{namespace}Element, element.get());
     return CREATE_DOM_WRAPPER(exec, globalObject, ${JSInterfaceName}, element.get());
 }
@@ -1069,7 +1069,7 @@ END
 static v8::Handle<v8::Object> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     Settings* settings = element->document()->settings();
-    if (!MediaPlayer::isAvailable() || (settings && !settings->isMediaEnabled()))
+    if (!MediaPlayer::isAvailable() || (settings && !settings->mediaEnabled()))
         return createV8$parameters{namespace}DirectWrapper(element, creationContext, isolate);
     return wrap(static_cast<${JSInterfaceName}*>(element), creationContext, isolate);
 }
index 8ba36cd..45be3d9 100644 (file)
@@ -1179,7 +1179,7 @@ static bool supportedPaste(Frame* frame)
         return false;
 
     Settings* settings = frame->settings();
-    bool defaultValue = settings && settings->javaScriptCanAccessClipboard() && settings->isDOMPasteAllowed();
+    bool defaultValue = settings && settings->javaScriptCanAccessClipboard() && settings->DOMPasteAllowed();
 
     EditorClient* client = frame->editor()->client();
     return client ? client->canPaste(frame, defaultValue) : defaultValue;
index e88a075..4072c4a 100644 (file)
@@ -166,16 +166,13 @@ Settings::Settings(Page* page)
     , m_loadsImagesAutomatically(false)
     , m_privateBrowsingEnabled(false)
     , m_areImagesEnabled(true)
-    , m_isMediaEnabled(true)
     , m_arePluginsEnabled(false)
     , m_isScriptEnabled(false)
     , m_textAreasAreResizable(false)
     , m_needsAdobeFrameReloadingQuirk(false)
-    , m_isDOMPasteAllowed(false)
     , m_usesPageCache(false)
     , m_authorAndUserStylesEnabled(true)
     , m_fontRenderingMode(0)
-    , m_inApplicationChromeMode(false)
     , m_isCSSCustomFilterEnabled(false)
 #if ENABLE(CSS_STICKY_POSITION)
     , m_cssStickyPositionEnabled(true)
@@ -443,11 +440,6 @@ void Settings::setImagesEnabled(bool areImagesEnabled)
     m_setImageLoadingSettingsTimer.startOneShot(0);
 }
 
-void Settings::setMediaEnabled(bool isMediaEnabled)
-{
-    m_isMediaEnabled = isMediaEnabled;
-}
-
 void Settings::setPluginsEnabled(bool arePluginsEnabled)
 {
     m_arePluginsEnabled = arePluginsEnabled;
@@ -488,11 +480,6 @@ void Settings::setNeedsAdobeFrameReloadingQuirk(bool shouldNotReloadIFramesForUn
     m_needsAdobeFrameReloadingQuirk = shouldNotReloadIFramesForUnchangedSRC;
 }
 
-void Settings::setDOMPasteAllowed(bool DOMPasteAllowed)
-{
-    m_isDOMPasteAllowed = DOMPasteAllowed;
-}
-
 void Settings::setDefaultMinDOMTimerInterval(double interval)
 {
     gDefaultMinDOMTimerInterval = interval;
@@ -570,11 +557,6 @@ FontRenderingMode Settings::fontRenderingMode() const
     return static_cast<FontRenderingMode>(m_fontRenderingMode);
 }
 
-void Settings::setApplicationChromeMode(bool mode)
-{
-    m_inApplicationChromeMode = mode;
-}
-
 #if USE(SAFARI_THEME)
 void Settings::setShouldPaintNativeControls(bool shouldPaintNativeControls)
 {
index 1aaa286..3a5815a 100644 (file)
@@ -152,9 +152,6 @@ namespace WebCore {
         void setImagesEnabled(bool);
         bool areImagesEnabled() const { return m_areImagesEnabled; }
 
-        void setMediaEnabled(bool);
-        bool isMediaEnabled() const { return m_isMediaEnabled; }
-
         void setPluginsEnabled(bool);
         bool arePluginsEnabled() const { return m_arePluginsEnabled; }
 
@@ -186,9 +183,6 @@ namespace WebCore {
         void setNeedsAdobeFrameReloadingQuirk(bool);
         bool needsAcrobatFrameReloadingQuirk() const { return m_needsAdobeFrameReloadingQuirk; }
 
-        void setDOMPasteAllowed(bool);
-        bool isDOMPasteAllowed() const { return m_isDOMPasteAllowed; }
-        
         static void setDefaultMinDOMTimerInterval(double); // Interval specified in seconds.
         static double defaultMinDOMTimerInterval();
         
@@ -213,9 +207,6 @@ namespace WebCore {
         void setFontRenderingMode(FontRenderingMode mode);
         FontRenderingMode fontRenderingMode() const;
 
-        void setApplicationChromeMode(bool);
-        bool inApplicationChromeMode() const { return m_inApplicationChromeMode; }
-
         void setCSSCustomFilterEnabled(bool enabled) { m_isCSSCustomFilterEnabled = enabled; }
         bool isCSSCustomFilterEnabled() const { return m_isCSSCustomFilterEnabled; }
 
@@ -339,16 +330,13 @@ namespace WebCore {
         bool m_loadsImagesAutomatically : 1;
         bool m_privateBrowsingEnabled : 1;
         bool m_areImagesEnabled : 1;
-        bool m_isMediaEnabled : 1;
         bool m_arePluginsEnabled : 1;
         bool m_isScriptEnabled : 1;
         bool m_textAreasAreResizable : 1;
         bool m_needsAdobeFrameReloadingQuirk : 1;
-        bool m_isDOMPasteAllowed : 1;
         bool m_usesPageCache : 1;
         bool m_authorAndUserStylesEnabled : 1;
         unsigned m_fontRenderingMode : 1;
-        bool m_inApplicationChromeMode : 1;
         bool m_isCSSCustomFilterEnabled : 1;
 #if ENABLE(CSS_STICKY_POSITION)
         bool m_cssStickyPositionEnabled : 1;
index d2904d0..6e715a2 100644 (file)
@@ -153,6 +153,9 @@ needsDidFinishLoadOrderQuirk initial=false
 fixedPositionCreatesStackingContext initial=false
 syncXHRInDocumentsEnabled initial=true
 cookieEnabled initial=true
+mediaEnabled initial=true
+applicationChromeMode initial=false
+DOMPasteAllowed initial=false
 
 threadedHTMLParser initial=false, conditional=THREADED_HTML_PARSER
 
index c8db267..13318b5 100755 (executable)
@@ -216,8 +216,12 @@ sub setterFunctionName($)
     my $settingName = shift;
     my $setterFunctionName = "set" . $settingName;
     substr($setterFunctionName, 3, 1) = uc(substr($setterFunctionName, 3, 1));
-    if (substr($settingName, 0, 3) eq "css" || substr($settingName, 0, 3) eq "xss" || substr($settingName, 0, 3) eq "ftp") {
-        substr($setterFunctionName, 3, 3) = uc(substr($setterFunctionName, 3, 3));
+    my @prefixesToUpperCase = ("css", "xss", "ftp", "dom");
+    foreach my $prefix (@prefixesToUpperCase) {
+        my $prefixLength = length($prefix);
+        if (substr($settingName, 0, $prefixLength) eq $prefix) {
+            substr($setterFunctionName, $prefixLength, $prefixLength) = uc(substr($setterFunctionName, 3, 3));
+        }
     }
     return $setterFunctionName;
 }
index 75974e6..41f0dc9 100644 (file)
@@ -854,7 +854,7 @@ bool RenderTheme::isDefault(const RenderObject* o) const
         return false;
 
     Settings* settings = o->document()->settings();
-    if (!settings || !settings->inApplicationChromeMode())
+    if (!settings || !settings->applicationChromeMode())
         return false;
     
     return o->style()->appearance() == DefaultButtonPart;
index 4ef34ab..6e9fe2d 100644 (file)
@@ -145,7 +145,7 @@ static bool gWebKitIsBeingUnloaded;
 static bool documentIsInApplicationChromeMode(const Document* document)
 {
     Settings* settings = document->settings();
-    return settings && settings->inApplicationChromeMode();
+    return settings && settings->applicationChromeMode();
 }
 
 void RenderThemeWin::setWebKitIsBeingUnloaded()
index 14152ce..19d7df9 100644 (file)
@@ -1,3 +1,13 @@
+2013-02-19  Tony Chang  <tony@chromium.org>
+
+        Convert 3 settings to use Settings.in
+        https://bugs.webkit.org/show_bug.cgi?id=109875
+
+        Reviewed by Ryosuke Niwa.
+
+        * ewk/ewk_view.cpp:
+        (_ewk_view_priv_new): Rename isDOMPasteAllowed to DOMPasteAllowed.
+
 2013-02-18  Simon Fraser  <simon.fraser@apple.com>
 
         Clean up the boolean argument to visibleContentRect
index 5b6ca75..145f8dd 100644 (file)
@@ -897,7 +897,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData)
     priv->settings.shouldDisplaySubtitles = priv->pageSettings->shouldDisplaySubtitles();
     priv->settings.shouldDisplayTextDescriptions = priv->pageSettings->shouldDisplayTextDescriptions();
 #endif
-    priv->settings.scriptsCanAccessClipboard = priv->pageSettings->javaScriptCanAccessClipboard() && priv->pageSettings->isDOMPasteAllowed();
+    priv->settings.scriptsCanAccessClipboard = priv->pageSettings->javaScriptCanAccessClipboard() && priv->pageSettings->DOMPasteAllowed();
     priv->settings.resizableTextareas = priv->pageSettings->textAreasAreResizable();
     priv->settings.privateBrowsing = priv->pageSettings->privateBrowsingEnabled();
     priv->settings.caretBrowsing = priv->pageSettings->caretBrowsingEnabled();