Title: [139202] trunk
Revision
139202
Author
t...@chromium.org
Date
2013-01-09 10:07:37 -0800 (Wed, 09 Jan 2013)

Log Message

Automatically generate Settings::unifiedTextCheckerEnabled
https://bugs.webkit.org/show_bug.cgi?id=106382

Reviewed by Adam Barth.

Source/WebCore:

No new tests, no change in behavior. This is covered by existing editing/spelling tests.

* page/Settings.cpp:
(WebCore): Move default value into a global so we can generate the initializer.
(WebCore::Settings::Settings): Remove initializer code that is now generated.
* page/Settings.h:
(Settings): Remove getters and setters.
* page/Settings.in: Add entry to be generated.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup): Remove backup since the generated code does this.
(WebCore::InternalSettings::Backup::restoreTo): Remove restore code since the generated code does this.
* testing/InternalSettings.h:
(InternalSettings): Remove member variable.
* testing/InternalSettings.idl: The getter was unused so it's being removed. The setter is now generated.

LayoutTests:

The InternalSettings.idl method didn't match the Settings' getter/setter. Now
that we're using the generated version, make the tests use the same name.

* editing/spelling/grammar-edit-word.html:
* editing/spelling/spellcheck-async-mutation.html:
* editing/spelling/spellcheck-async-remove-frame.html:
* editing/spelling/spellcheck-async.html:
* editing/spelling/spelling-marker-description.html:
* editing/spelling/spelling-unified-emulation.html:
* platform/chromium/editing/spelling/delete-misspelled-word.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (139201 => 139202)


--- trunk/LayoutTests/ChangeLog	2013-01-09 18:04:57 UTC (rev 139201)
+++ trunk/LayoutTests/ChangeLog	2013-01-09 18:07:37 UTC (rev 139202)
@@ -1,3 +1,21 @@
+2013-01-09  Tony Chang  <t...@chromium.org>
+
+        Automatically generate Settings::unifiedTextCheckerEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=106382
+
+        Reviewed by Adam Barth.
+
+        The InternalSettings.idl method didn't match the Settings' getter/setter. Now
+        that we're using the generated version, make the tests use the same name.
+
+        * editing/spelling/grammar-edit-word.html:
+        * editing/spelling/spellcheck-async-mutation.html:
+        * editing/spelling/spellcheck-async-remove-frame.html:
+        * editing/spelling/spellcheck-async.html:
+        * editing/spelling/spelling-marker-description.html:
+        * editing/spelling/spelling-unified-emulation.html:
+        * platform/chromium/editing/spelling/delete-misspelled-word.html:
+
 2013-01-09  Alexis Menard  <ale...@webkit.org>
 
         Implement CSS computed style value for transition shorthand

Modified: trunk/LayoutTests/editing/spelling/grammar-edit-word.html (139201 => 139202)


--- trunk/LayoutTests/editing/spelling/grammar-edit-word.html	2013-01-09 18:04:57 UTC (rev 139201)
+++ trunk/LayoutTests/editing/spelling/grammar-edit-word.html	2013-01-09 18:07:37 UTC (rev 139202)
@@ -9,7 +9,7 @@
 <script language="_javascript_">
 description('Test if WebKit removes grammar markers when we edit a grammatically-incorrect word. To test manually, type a grammatically-incorrect sentence "You has the right." and type a backspace key to delete the last character of "has". This test succeeds when "ha" does not have grammar markers.');
 
-internals.settings.setUnifiedTextCheckingEnabled(true);
+internals.settings.setUnifiedTextCheckerEnabled(true);
 var target = document.getElementById('src');
 target.focus();
 
@@ -21,7 +21,7 @@
     evalAndLog('testRunner.execCommand("DeleteBackward")');
 shouldBeFalse('internals.hasGrammarMarker(document, 4, 2)');
 
-internals.settings.setUnifiedTextCheckingEnabled(false);
+internals.settings.setUnifiedTextCheckerEnabled(false);
 </script>
 <script src=""
 </body>

Modified: trunk/LayoutTests/editing/spelling/spellcheck-async-mutation.html (139201 => 139202)


--- trunk/LayoutTests/editing/spelling/spellcheck-async-mutation.html	2013-01-09 18:04:57 UTC (rev 139201)
+++ trunk/LayoutTests/editing/spelling/spellcheck-async-mutation.html	2013-01-09 18:07:37 UTC (rev 139202)
@@ -36,7 +36,7 @@
 }
 
 if (window.internals)
-    internals.settings.setUnifiedTextCheckingEnabled(true);
+    internals.settings.setUnifiedTextCheckerEnabled(true);
 
 var sourceIds = ['source'];
 var destElems = ['textarea', 'input', 'contenteditable'];
@@ -77,7 +77,7 @@
     removeAllChildren(document.getElementById('move-target'));
 
     if (window.internals)
-        internals.settings.setUnifiedTextCheckingEnabled(false);
+        internals.settings.setUnifiedTextCheckerEnabled(false);
 
     if (window.testRunner) {
         testRunner.setAsynchronousSpellCheckingEnabled(false);

Modified: trunk/LayoutTests/editing/spelling/spellcheck-async-remove-frame.html (139201 => 139202)


--- trunk/LayoutTests/editing/spelling/spellcheck-async-remove-frame.html	2013-01-09 18:04:57 UTC (rev 139201)
+++ trunk/LayoutTests/editing/spelling/spellcheck-async-remove-frame.html	2013-01-09 18:07:37 UTC (rev 139202)
@@ -6,7 +6,7 @@
     testRunner.waitUntilDone();
     testRunner.dumpAsText();
     testRunner.setAsynchronousSpellCheckingEnabled(true);
-    internals.settings.setUnifiedTextCheckingEnabled(true);
+    internals.settings.setUnifiedTextCheckerEnabled(true);
 }
 
 function runTest() {

Modified: trunk/LayoutTests/editing/spelling/spellcheck-async.html (139201 => 139202)


--- trunk/LayoutTests/editing/spelling/spellcheck-async.html	2013-01-09 18:04:57 UTC (rev 139201)
+++ trunk/LayoutTests/editing/spelling/spellcheck-async.html	2013-01-09 18:07:37 UTC (rev 139202)
@@ -27,7 +27,7 @@
 }
 
 if (window.internals)
-    internals.settings.setUnifiedTextCheckingEnabled(true);
+    internals.settings.setUnifiedTextCheckerEnabled(true);
 
 var container = document.getElementById('container');
 function removeChildren(node) {
@@ -57,7 +57,7 @@
     // No more tests.
     removeChildren(container);
     if (window.internals)
-        internals.settings.setUnifiedTextCheckingEnabled(false);
+        internals.settings.setUnifiedTextCheckerEnabled(false);
 
     if (window.testRunner) {
         testRunner.setAsynchronousSpellCheckingEnabled(false);

Modified: trunk/LayoutTests/editing/spelling/spelling-marker-description.html (139201 => 139202)


--- trunk/LayoutTests/editing/spelling/spelling-marker-description.html	2013-01-09 18:04:57 UTC (rev 139201)
+++ trunk/LayoutTests/editing/spelling/spelling-marker-description.html	2013-01-09 18:07:37 UTC (rev 139202)
@@ -13,7 +13,7 @@
 function done()
 {
     testRunner.setAsynchronousSpellCheckingEnabled(false);
-    internals.settings.setUnifiedTextCheckingEnabled(false);
+    internals.settings.setUnifiedTextCheckerEnabled(false);
     finishJSTest()
 }
 
@@ -47,7 +47,7 @@
 function test()
 {
     jsTestIsAsync = true;
-    internals.settings.setUnifiedTextCheckingEnabled(true);
+    internals.settings.setUnifiedTextCheckerEnabled(true);
     testRunner.setAsynchronousSpellCheckingEnabled(true);
 
     var sel = window.getSelection();

Modified: trunk/LayoutTests/editing/spelling/spelling-unified-emulation.html (139201 => 139202)


--- trunk/LayoutTests/editing/spelling/spelling-unified-emulation.html	2013-01-09 18:04:57 UTC (rev 139201)
+++ trunk/LayoutTests/editing/spelling/spelling-unified-emulation.html	2013-01-09 18:07:37 UTC (rev 139202)
@@ -31,7 +31,7 @@
 }
 
 if (window.internals)
-    internals.settings.setUnifiedTextCheckingEnabled(true);
+    internals.settings.setUnifiedTextCheckerEnabled(true);
 
 var testData = [
     { text: 'zz', marked: ['zz'] },
@@ -85,7 +85,7 @@
 }
 
 if (window.internals)
-    internals.settings.setUnifiedTextCheckingEnabled(false);
+    internals.settings.setUnifiedTextCheckerEnabled(false);
 
 var successfullyParsed = true;
 </script>

Modified: trunk/LayoutTests/platform/chromium/editing/spelling/delete-misspelled-word.html (139201 => 139202)


--- trunk/LayoutTests/platform/chromium/editing/spelling/delete-misspelled-word.html	2013-01-09 18:04:57 UTC (rev 139201)
+++ trunk/LayoutTests/platform/chromium/editing/spelling/delete-misspelled-word.html	2013-01-09 18:07:37 UTC (rev 139202)
@@ -22,7 +22,7 @@
 
 debug('Enable asynchronous spellchecking, delete two characters, and insert a space');
 testRunner.setAsynchronousSpellCheckingEnabled(true);
-internals.settings.setUnifiedTextCheckingEnabled(true);
+internals.settings.setUnifiedTextCheckerEnabled(true);
 
 testRunner.execCommand("DeleteBackward");
 testRunner.execCommand("DeleteBackward");
@@ -36,7 +36,7 @@
         return;
     }
     shouldBeFalse('internals.hasSpellingMarker(document, 0, 1)');
-    internals.settings.setUnifiedTextCheckingEnabled(false);
+    internals.settings.setUnifiedTextCheckerEnabled(false);
     testRunner.setAsynchronousSpellCheckingEnabled(false);
     finishJSTest();
 }

Modified: trunk/Source/WebCore/ChangeLog (139201 => 139202)


--- trunk/Source/WebCore/ChangeLog	2013-01-09 18:04:57 UTC (rev 139201)
+++ trunk/Source/WebCore/ChangeLog	2013-01-09 18:07:37 UTC (rev 139202)
@@ -1,3 +1,25 @@
+2013-01-09  Tony Chang  <t...@chromium.org>
+
+        Automatically generate Settings::unifiedTextCheckerEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=106382
+
+        Reviewed by Adam Barth.
+
+        No new tests, no change in behavior. This is covered by existing editing/spelling tests.
+
+        * page/Settings.cpp:
+        (WebCore): Move default value into a global so we can generate the initializer.
+        (WebCore::Settings::Settings): Remove initializer code that is now generated.
+        * page/Settings.h:
+        (Settings): Remove getters and setters.
+        * page/Settings.in: Add entry to be generated.
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::Backup::Backup): Remove backup since the generated code does this.
+        (WebCore::InternalSettings::Backup::restoreTo): Remove restore code since the generated code does this.
+        * testing/InternalSettings.h:
+        (InternalSettings): Remove member variable.
+        * testing/InternalSettings.idl: The getter was unused so it's being removed. The setter is now generated.
+
 2013-01-09  Alexis Menard  <ale...@webkit.org>
 
         Implement CSS computed style value for transition shorthand

Modified: trunk/Source/WebCore/page/Settings.cpp (139201 => 139202)


--- trunk/Source/WebCore/page/Settings.cpp	2013-01-09 18:04:57 UTC (rev 139201)
+++ trunk/Source/WebCore/page/Settings.cpp	2013-01-09 18:07:37 UTC (rev 139202)
@@ -126,6 +126,11 @@
 }
 
 static const double defaultIncrementalRenderingSuppressionTimeoutInSeconds = 5;
+#if USE(UNIFIED_TEXT_CHECKING)
+static const double defaultUnifiedTextCheckerEnabled = true;
+#else
+static const double defaultUnifiedTextCheckerEnabled = false;
+#endif
 
 Settings::Settings(Page* page)
     : m_page(0)
@@ -174,11 +179,6 @@
     , m_showTiledScrollingIndicator(false)
     , m_tiledBackingStoreEnabled(false)
     , m_dnsPrefetchingEnabled(false)
-#if USE(UNIFIED_TEXT_CHECKING)
-    , m_unifiedTextCheckerEnabled(true)
-#else
-    , m_unifiedTextCheckerEnabled(false)
-#endif
 #if ENABLE(SMOOTH_SCROLLING)
     , m_scrollAnimatorEnabled(true)
 #endif

Modified: trunk/Source/WebCore/page/Settings.h (139201 => 139202)


--- trunk/Source/WebCore/page/Settings.h	2013-01-09 18:04:57 UTC (rev 139201)
+++ trunk/Source/WebCore/page/Settings.h	2013-01-09 18:07:37 UTC (rev 139202)
@@ -260,9 +260,6 @@
         static bool isAVFoundationEnabled() { return gAVFoundationEnabled; }
 #endif
 
-        void setUnifiedTextCheckerEnabled(bool flag) { m_unifiedTextCheckerEnabled = flag; }
-        bool unifiedTextCheckerEnabled() const { return m_unifiedTextCheckerEnabled; }
-
         static const unsigned defaultMaximumHTMLParserDOMTreeDepth = 512;
 
 #if ENABLE(SMOOTH_SCROLLING)
@@ -360,7 +357,6 @@
         bool m_showTiledScrollingIndicator : 1;
         bool m_tiledBackingStoreEnabled : 1;
         bool m_dnsPrefetchingEnabled : 1;
-        bool m_unifiedTextCheckerEnabled : 1;
 #if ENABLE(SMOOTH_SCROLLING)
         bool m_scrollAnimatorEnabled : 1;
 #endif

Modified: trunk/Source/WebCore/page/Settings.in (139201 => 139202)


--- trunk/Source/WebCore/page/Settings.in	2013-01-09 18:04:57 UTC (rev 139201)
+++ trunk/Source/WebCore/page/Settings.in	2013-01-09 18:07:37 UTC (rev 139202)
@@ -171,3 +171,5 @@
 # This setting adds a means to enable/disable touch initiated drag & drop. If
 # enabled, the user can initiate drag using long press.
 touchDragDropEnabled initial=false
+
+unifiedTextCheckerEnabled initial=defaultUnifiedTextCheckerEnabled

Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (139201 => 139202)


--- trunk/Source/WebCore/testing/InternalSettings.cpp	2013-01-09 18:04:57 UTC (rev 139201)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp	2013-01-09 18:07:37 UTC (rev 139202)
@@ -73,7 +73,6 @@
     , m_originalStyleScoped(RuntimeEnabledFeatures::styleScopedEnabled())
 #endif
     , m_originalEditingBehavior(settings->editingBehaviorType())
-    , m_originalUnifiedSpellCheckerEnabled(settings->unifiedTextCheckerEnabled())
 #if ENABLE(TEXT_AUTOSIZING)
     , m_originalTextAutosizingEnabled(settings->textAutosizingEnabled())
     , m_originalTextAutosizingWindowSizeOverride(settings->textAutosizingWindowSizeOverride())
@@ -108,7 +107,6 @@
     RuntimeEnabledFeatures::setStyleScopedEnabled(m_originalStyleScoped);
 #endif
     settings->setEditingBehaviorType(m_originalEditingBehavior);
-    settings->setUnifiedTextCheckerEnabled(m_originalUnifiedSpellCheckerEnabled);
 #if ENABLE(TEXT_AUTOSIZING)
     settings->setTextAutosizingEnabled(m_originalTextAutosizingEnabled);
     settings->setTextAutosizingWindowSizeOverride(m_originalTextAutosizingWindowSizeOverride);
@@ -190,18 +188,6 @@
     settings()->setMockScrollbarsEnabled(enabled);
 }
 
-void InternalSettings::setUnifiedTextCheckingEnabled(bool enabled, ExceptionCode& ec)
-{
-    InternalSettingsGuardForSettings();
-    settings()->setUnifiedTextCheckerEnabled(enabled);
-}
-
-bool InternalSettings::unifiedTextCheckingEnabled(ExceptionCode& ec)
-{
-    InternalSettingsGuardForSettingsReturn(false);
-    return settings()->unifiedTextCheckerEnabled();
-}
-
 void InternalSettings::setShadowDOMEnabled(bool enabled, ExceptionCode& ec)
 {
 #if ENABLE(SHADOW_DOM)

Modified: trunk/Source/WebCore/testing/InternalSettings.h (139201 => 139202)


--- trunk/Source/WebCore/testing/InternalSettings.h	2013-01-09 18:04:57 UTC (rev 139201)
+++ trunk/Source/WebCore/testing/InternalSettings.h	2013-01-09 18:07:37 UTC (rev 139202)
@@ -94,8 +94,6 @@
 
     void setMockScrollbarsEnabled(bool enabled, ExceptionCode&);
     void setUsesOverlayScrollbars(bool enabled, ExceptionCode&);
-    void setUnifiedTextCheckingEnabled(bool, ExceptionCode&);
-    bool unifiedTextCheckingEnabled(ExceptionCode&);
     void setTouchEventEmulationEnabled(bool enabled, ExceptionCode&);
     void setShadowDOMEnabled(bool enabled, ExceptionCode&);
     void setAuthorShadowDOMForAnyElementEnabled(bool);

Modified: trunk/Source/WebCore/testing/InternalSettings.idl (139201 => 139202)


--- trunk/Source/WebCore/testing/InternalSettings.idl	2013-01-09 18:04:57 UTC (rev 139201)
+++ trunk/Source/WebCore/testing/InternalSettings.idl	2013-01-09 18:07:37 UTC (rev 139202)
@@ -28,8 +28,6 @@
     JSGenerateToJSObject
 ] interface InternalSettings : InternalSettingsGenerated {
     void setMockScrollbarsEnabled(in boolean enabled) raises(DOMException);
-    void setUnifiedTextCheckingEnabled(in boolean enabled) raises (DOMException);
-    boolean unifiedTextCheckingEnabled() raises (DOMException);
     void setTouchEventEmulationEnabled(in boolean enabled) raises(DOMException);
     void setShadowDOMEnabled(in boolean enabled) raises(DOMException);
     void setAuthorShadowDOMForAnyElementEnabled(in boolean isEnabled);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to