Title: [135227] trunk
Revision
135227
Author
t...@chromium.org
Date
2012-11-19 18:11:53 -0800 (Mon, 19 Nov 2012)

Log Message

Move more non-settings out of InternalSettings
https://bugs.webkit.org/show_bug.cgi?id=102711

Reviewed by Adam Barth.

Source/WebCore:

Remove userPreferredLanguages, setUserPreferredLanguages and allowRoundingHacks
from internal.settings since they are already exposed by window.internals (in
fact, no one calls the internal.settings version).

Move setUsesOverlayScrollbars from internals.settings to internals because it is
a global (static) setting and not tied to the lifetime of the Settings object.

No new tests, there should be no behavior change since this is a refactor.

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::reset): Remove custom reset code.
(WebCore::InternalSettings::setUsesOverlayScrollbars): Add exception code handling to make it more consistent with other settings setters.
* testing/InternalSettings.h:
* testing/InternalSettings.idl: Remove unnecessary methods.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState): Reset userPreferredLanguages, allowRoundingHacks and overlay scrollbars.
(WebCore::Internals::userPreferredLanguages): Don't go through InternalSettings.
(WebCore::Internals::setUserPreferredLanguages): Don't go through InternalSettings.
(WebCore::Internals::setUsesOverlayScrollbars): Moved from InternalsSettings.
(WebCore::Internals::allowRoundingHacks): Don't go through InternalSettings.

LayoutTests:

Move static values out of InternalSettings.

* fast/scrolling/scrollbar-tickmarks-hittest.html: Move setUsesOverlayScrollbars to internals.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (135226 => 135227)


--- trunk/LayoutTests/ChangeLog	2012-11-20 02:10:19 UTC (rev 135226)
+++ trunk/LayoutTests/ChangeLog	2012-11-20 02:11:53 UTC (rev 135227)
@@ -1,3 +1,14 @@
+2012-11-19  Tony Chang  <t...@chromium.org>
+
+        Move more non-settings out of InternalSettings
+        https://bugs.webkit.org/show_bug.cgi?id=102711
+
+        Reviewed by Adam Barth.
+
+        Move static values out of InternalSettings.
+
+        * fast/scrolling/scrollbar-tickmarks-hittest.html: Move setUsesOverlayScrollbars to internals.
+
 2012-11-19  David Grogan  <dgro...@chromium.org>
 
         IndexedDB: Complex series of opens/deleteDatabase fails an ASSERT

Modified: trunk/LayoutTests/fast/scrolling/scrollbar-tickmarks-hittest.html (135226 => 135227)


--- trunk/LayoutTests/fast/scrolling/scrollbar-tickmarks-hittest.html	2012-11-20 02:10:19 UTC (rev 135226)
+++ trunk/LayoutTests/fast/scrolling/scrollbar-tickmarks-hittest.html	2012-11-20 02:11:53 UTC (rev 135227)
@@ -13,7 +13,7 @@
     var elt = document.getElementById('elt');
     range.selectNodeContents(elt);
     if (window.internals) {
-        window.internals.settings.setUsesOverlayScrollbars(true);
+        window.internals.setUsesOverlayScrollbars(true);
         window.internals.addTextMatchMarker(range, true);
     }
     if (window.testRunner)

Modified: trunk/Source/WebCore/ChangeLog (135226 => 135227)


--- trunk/Source/WebCore/ChangeLog	2012-11-20 02:10:19 UTC (rev 135226)
+++ trunk/Source/WebCore/ChangeLog	2012-11-20 02:11:53 UTC (rev 135227)
@@ -1,3 +1,31 @@
+2012-11-19  Tony Chang  <t...@chromium.org>
+
+        Move more non-settings out of InternalSettings
+        https://bugs.webkit.org/show_bug.cgi?id=102711
+
+        Reviewed by Adam Barth.
+
+        Remove userPreferredLanguages, setUserPreferredLanguages and allowRoundingHacks
+        from internal.settings since they are already exposed by window.internals (in
+        fact, no one calls the internal.settings version).
+
+        Move setUsesOverlayScrollbars from internals.settings to internals because it is
+        a global (static) setting and not tied to the lifetime of the Settings object.
+
+        No new tests, there should be no behavior change since this is a refactor.
+
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::reset): Remove custom reset code.
+        (WebCore::InternalSettings::setUsesOverlayScrollbars): Add exception code handling to make it more consistent with other settings setters.
+        * testing/InternalSettings.h:
+        * testing/InternalSettings.idl: Remove unnecessary methods.
+        * testing/Internals.cpp:
+        (WebCore::Internals::resetToConsistentState): Reset userPreferredLanguages, allowRoundingHacks and overlay scrollbars.
+        (WebCore::Internals::userPreferredLanguages): Don't go through InternalSettings.
+        (WebCore::Internals::setUserPreferredLanguages): Don't go through InternalSettings.
+        (WebCore::Internals::setUsesOverlayScrollbars): Moved from InternalsSettings.
+        (WebCore::Internals::allowRoundingHacks): Don't go through InternalSettings.
+
 2012-11-19  David Grogan  <dgro...@chromium.org>
 
         IndexedDB: Complex series of opens/deleteDatabase fails an ASSERT

Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (135226 => 135227)


--- trunk/Source/WebCore/testing/InternalSettings.cpp	2012-11-20 02:10:19 UTC (rev 135226)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp	2012-11-20 02:11:53 UTC (rev 135227)
@@ -184,11 +184,8 @@
 
 void InternalSettings::reset()
 {
-    TextRun::setAllowsRoundingHacks(false);
-    setUserPreferredLanguages(Vector<String>());
     page()->setPagination(Pagination());
     page()->setPageScaleFactor(1, IntPoint(0, 0));
-    setUsesOverlayScrollbars(false);
 #if ENABLE(PAGE_POPUP)
     m_pagePopupDriver.clear();
     if (page()->chrome())
@@ -242,11 +239,6 @@
     settings()->setMockScrollbarsEnabled(enabled);
 }
 
-void InternalSettings::setUsesOverlayScrollbars(bool flag)
-{
-    settings()->setUsesOverlayScrollbars(flag);
-}
-
 void InternalSettings::setPasswordEchoEnabled(bool enabled, ExceptionCode& ec)
 {
     InternalSettingsGuardForSettings();
@@ -527,21 +519,6 @@
 #endif
 }
 
-void InternalSettings::allowRoundingHacks() const
-{
-    TextRun::setAllowsRoundingHacks(true);
-}
-
-Vector<String> InternalSettings::userPreferredLanguages() const
-{
-    return WebCore::userPreferredLanguages();
-}
-
-void InternalSettings::setUserPreferredLanguages(const Vector<String>& languages)
-{
-    WebCore::overrideUserPreferredLanguages(languages);
-}
-
 void InternalSettings::setShouldDisplayTrackKind(const String& kind, bool enabled, ExceptionCode& ec)
 {
     InternalSettingsGuardForSettings();

Modified: trunk/Source/WebCore/testing/InternalSettings.h (135226 => 135227)


--- trunk/Source/WebCore/testing/InternalSettings.h	2012-11-20 02:10:19 UTC (rev 135226)
+++ trunk/Source/WebCore/testing/InternalSettings.h	2012-11-20 02:11:53 UTC (rev 135227)
@@ -86,6 +86,7 @@
         bool m_originalCompositingForScrollableFramesEnabled;
         bool m_originalAcceleratedDrawingEnabled;
         bool m_originalMockScrollbarsEnabled;
+        bool m_originalUsesOverlayScrollbars;
         bool m_langAttributeAwareFormControlUIEnabled;
         bool m_imagesEnabled;
 #if ENABLE(VIDEO_TRACK)
@@ -110,7 +111,7 @@
     void setAcceleratedDrawingEnabled(bool enabled, ExceptionCode&);
     void setAcceleratedFiltersEnabled(bool enabled, ExceptionCode&);
     void setMockScrollbarsEnabled(bool enabled, ExceptionCode&);
-    void setUsesOverlayScrollbars(bool);
+    void setUsesOverlayScrollbars(bool enabled, ExceptionCode&);
     void setPasswordEchoEnabled(bool enabled, ExceptionCode&);
     void setPasswordEchoDurationInSeconds(double durationInSeconds, ExceptionCode&);
     void setFixedElementsLayoutRelativeToFrame(bool, ExceptionCode&);
@@ -147,11 +148,8 @@
     void setSyncXHRInDocumentsEnabled(bool, ExceptionCode&);
     void setWindowFocusRestricted(bool, ExceptionCode&);
     void setDialogElementEnabled(bool, ExceptionCode&);
-    Vector<String> userPreferredLanguages() const;
-    void setUserPreferredLanguages(const Vector<String>&);
     void setPagination(const String& mode, int gap, ExceptionCode& ec) { setPagination(mode, gap, 0, ec); }
     void setPagination(const String& mode, int gap, int pageLength, ExceptionCode&);
-    void allowRoundingHacks() const;
     void setShouldDisplayTrackKind(const String& kind, bool enabled, ExceptionCode&);
     bool shouldDisplayTrackKind(const String& kind, ExceptionCode&);
     void setEnableMockPagePopup(bool, ExceptionCode&);

Modified: trunk/Source/WebCore/testing/InternalSettings.idl (135226 => 135227)


--- trunk/Source/WebCore/testing/InternalSettings.idl	2012-11-20 02:10:19 UTC (rev 135226)
+++ trunk/Source/WebCore/testing/InternalSettings.idl	2012-11-20 02:11:53 UTC (rev 135227)
@@ -32,7 +32,6 @@
     void setAcceleratedDrawingEnabled(in boolean enabled) raises(DOMException);
     void setAcceleratedFiltersEnabled(in boolean enabled) raises(DOMException);
     void setMockScrollbarsEnabled(in boolean enabled) raises(DOMException);
-    void setUsesOverlayScrollbars(in boolean flag);
     void setPasswordEchoEnabled(in boolean enabled) raises(DOMException);
     void setPasswordEchoDurationInSeconds(in double durationInSeconds) raises(DOMException);
     void setFixedElementsLayoutRelativeToFrame(in boolean enabled) raises(DOMException);
@@ -72,9 +71,6 @@
     void setLangAttributeAwareFormControlUIEnabled(in boolean enabled);
 
     void setPagination(in DOMString mode, in long gap, in [Optional] long pageLength) raises(DOMException);
-    sequence<String> userPreferredLanguages();
-    void setUserPreferredLanguages(in sequence<String> languages);
-    void allowRoundingHacks();
     void setEnableMockPagePopup(in boolean enabled) raises(DOMException);
     [Conditional=VIDEO_TRACK] void setShouldDisplayTrackKind(in DOMString kind, in boolean enabled) raises (DOMException);
     [Conditional=VIDEO_TRACK] boolean shouldDisplayTrackKind(in DOMString trackKind) raises (DOMException);

Modified: trunk/Source/WebCore/testing/Internals.cpp (135226 => 135227)


--- trunk/Source/WebCore/testing/Internals.cpp	2012-11-20 02:10:19 UTC (rev 135226)
+++ trunk/Source/WebCore/testing/Internals.cpp	2012-11-20 02:11:53 UTC (rev 135227)
@@ -212,6 +212,10 @@
 void Internals::resetToConsistentState(Page* page)
 {
     ASSERT(page);
+
+    TextRun::setAllowsRoundingHacks(false);
+    WebCore::overrideUserPreferredLanguages(Vector<String>());
+    WebCore::Settings::setUsesOverlayScrollbars(false);
 #if ENABLE(INSPECTOR) && ENABLE(_javascript__DEBUGGER)
     if (page->inspectorController())
         page->inspectorController()->setProfilerEnabled(false);
@@ -1098,12 +1102,12 @@
 
 Vector<String> Internals::userPreferredLanguages() const
 {
-    return settings()->userPreferredLanguages();
+    return WebCore::userPreferredLanguages();
 }
 
 void Internals::setUserPreferredLanguages(const Vector<String>& languages)
 {
-    settings()->setUserPreferredLanguages(languages);
+    WebCore::overrideUserPreferredLanguages(languages);
 }
 
 unsigned Internals::wheelEventHandlerCount(Document* document, ExceptionCode& ec)
@@ -1407,7 +1411,7 @@
 
 void Internals::allowRoundingHacks() const
 {
-    settings()->allowRoundingHacks();
+    TextRun::setAllowsRoundingHacks(true);
 }
 
 String Internals::counterValue(Element* element)
@@ -1640,4 +1644,9 @@
     return SerializedScriptValue::createFromWire(value);
 }
 
+void Internals::setUsesOverlayScrollbars(bool enabled)
+{
+    WebCore::Settings::setUsesOverlayScrollbars(enabled);
 }
+
+}

Modified: trunk/Source/WebCore/testing/Internals.h (135226 => 135227)


--- trunk/Source/WebCore/testing/Internals.h	2012-11-20 02:10:19 UTC (rev 135226)
+++ trunk/Source/WebCore/testing/Internals.h	2012-11-20 02:11:53 UTC (rev 135227)
@@ -251,6 +251,8 @@
     PassRefPtr<ArrayBuffer> serializeObject(PassRefPtr<SerializedScriptValue>) const;
     PassRefPtr<SerializedScriptValue> deserializeBuffer(PassRefPtr<ArrayBuffer>) const;
 
+    void setUsesOverlayScrollbars(bool enabled);
+
     String getCurrentCursorInfo(Document*, ExceptionCode&);
 
 private:

Modified: trunk/Source/WebCore/testing/Internals.idl (135226 => 135227)


--- trunk/Source/WebCore/testing/Internals.idl	2012-11-20 02:10:19 UTC (rev 135226)
+++ trunk/Source/WebCore/testing/Internals.idl	2012-11-20 02:11:53 UTC (rev 135227)
@@ -220,4 +220,6 @@
 
     SerializedScriptValue deserializeBuffer(in ArrayBuffer buffer);
     ArrayBuffer serializeObject(in SerializedScriptValue obj);
+
+    void setUsesOverlayScrollbars(in boolean enabled);
 };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to