Hook up the authorAndUserStylesEnabled preference on Windows
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Dec 2007 22:54:37 +0000 (22:54 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Dec 2007 22:54:37 +0000 (22:54 +0000)
 WebKit/win:

         Hook up the authorAndUserStylesEnabled preference

         This is the Windows counterpart of r28071.

         Reviewed by Maciej.

         * Interfaces/IWebPreferencesPrivate.idl: Added new method
         declarations.
         * WebPreferenceKeysPrivate.h: Added a new preference key.
         * WebPreferences.cpp:
         (WebPreferences::initializeDefaultSettings): Set the default for the
         new preference.
         (WebPreferences::setAuthorAndUserStylesEnabled): Added.
         (WebPreferences::authorAndUserStylesEnabled): Added.
         * WebPreferences.h:
         * WebView.cpp:
         (WebView::notifyPreferencesChanged): Communicate the new preference
         down to WebCore::Settings.

 WebKitTools:

         Fix <rdar://5614497> setAuthorAndUserStylesEnabled is not implemented in DRT

         Reviewed by Maciej.

         * DumpRenderTree/win/LayoutTestControllerWin.cpp:
         (LayoutTestController::setAuthorAndUserStylesEnabled): Implemented.

 LayoutTests:

         Remove a now-passing test from the Windows Skipped file

         Reviewed by Maciej.

         * platform/win/Skipped:

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

LayoutTests/ChangeLog
LayoutTests/platform/win/Skipped
WebKit/win/ChangeLog
WebKit/win/Interfaces/IWebPreferencesPrivate.idl
WebKit/win/WebPreferenceKeysPrivate.h
WebKit/win/WebPreferences.cpp
WebKit/win/WebPreferences.h
WebKit/win/WebView.cpp
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp

index 5a59f7e3a0ce067e2e6ea9972e992f58dcf7c3b4..e4548929152e48c2756cacabb5ad09fd0146c28e 100644 (file)
@@ -1,3 +1,11 @@
+2007-11-27  Adam Roben  <aroben@apple.com>
+
+        Remove a now-passing test from the Windows Skipped file
+
+        Reviewed by Maciej.
+
+        * platform/win/Skipped:
+
 2007-12-03  Antti Koivisto  <antti@apple.com>
 
         Reviewed by Adele.
index 93bbf6cef3c946ba9c50965f8a95869ccb11a11c..f666d9741542abd24c27afb803001f48f56d43f9 100644 (file)
@@ -306,8 +306,8 @@ svg/custom/text-hit-test.svg
 # Emacs bindings are used in LayoutTests which fail on boomer. <rdar://problem/5137352>
 fast/events/keydown-1.html
 
-# setAuthorAndUserStylesEnabled is not implemented in DRT <rdar://problem/5614497>
-fast/css/disabled-author-styles.html
+# fireKeyboardEventsToElement is not implemented in DRT <rdar://problem/5137198>
+fast/events/objc-keyboard-event-creation.html
 
 # The eqqivalent of option-tab doesn not exist in Boomer <rdar://problem/5137230>
 fast/events/frame-tab-focus.html
index 224725771072d5468513a5bc8fe5fd216b93f540..f726eac3dcfc841f3ba515fc9f65f748a244759c 100644 (file)
@@ -1,3 +1,24 @@
+2007-11-27  Adam Roben  <aroben@apple.com>
+
+        Hook up the authorAndUserStylesEnabled preference
+
+        This is the Windows counterpart of r28071.
+
+        Reviewed by Maciej.
+
+        * Interfaces/IWebPreferencesPrivate.idl: Added new method
+        declarations.
+        * WebPreferenceKeysPrivate.h: Added a new preference key.
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings): Set the default for the
+        new preference.
+        (WebPreferences::setAuthorAndUserStylesEnabled): Added.
+        (WebPreferences::authorAndUserStylesEnabled): Added.
+        * WebPreferences.h:
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged): Communicate the new preference
+        down to WebCore::Settings.
+
 2007-12-04  Jon Honeycutt  <jhoneycutt@apple.com>
 
         Reviewed by Ollie.
index e52402466c3fc910d7fddb73356f86c342ea1140..8bd43bf410db11609cf3a1ef63abb9ded8a0f3a6 100644 (file)
@@ -71,4 +71,7 @@ interface IWebPreferencesPrivate : IUnknown
 
     HRESULT setAutomaticallyDetectsCacheModel([in] BOOL automaticallyDetectsCacheModel);
     HRESULT automaticallyDetectsCacheModel([out, retval] BOOL* automaticallyDetectsCacheModel);
+
+    HRESULT setAuthorAndUserStylesEnabled([in] BOOL enabled);
+    HRESULT authorAndUserStylesEnabled([out, retval] BOOL* enabled);
 }
index 4e91f46c762d034fa2cbc89a0ad6c7386ac6a842..d71830598eb957f88d5250a9f97f70463bda36be 100644 (file)
 
 #define WebKitDeveloperExtrasEnabledPreferenceKey "WebKitDeveloperExtras"
 #define DisableWebKitDeveloperExtrasPreferenceKey "DisableWebKitDeveloperExtras"
+
+#define WebKitAuthorAndUserStylesEnabledPreferenceKey "WebKitAuthorAndUserStylesEnabled"
index 6cfcb1d830095456c48223aff949fe44384828d0..c7cf4bd0f7e480d1a9ff4810590c8534fd7f5493 100644 (file)
@@ -192,6 +192,8 @@ void WebPreferences::initializeDefaultSettings()
     RetainPtr<CFStringRef> cacheModelRef(AdoptCF, CFStringCreateWithFormat(0, 0, CFSTR("%d"), WebCacheModelDocumentViewer));
     CFDictionaryAddValue(defaults, CFSTR(WebKitCacheModelPreferenceKey), cacheModelRef.get());
 
+    CFDictionaryAddValue(defaults, CFSTR(WebKitAuthorAndUserStylesEnabledPreferenceKey), kCFBooleanTrue);
+
     s_defaultSettings = defaults;
 }
 
@@ -1093,6 +1095,21 @@ HRESULT WebPreferences::automaticallyDetectsCacheModel(BOOL* automaticallyDetect
     return S_OK;
 }
 
+HRESULT STDMETHODCALLTYPE WebPreferences::setAuthorAndUserStylesEnabled(BOOL enabled)
+{
+    setBoolValue(CFSTR(WebKitAuthorAndUserStylesEnabledPreferenceKey), enabled);
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebPreferences::authorAndUserStylesEnabled(BOOL* enabled)
+{
+    if (!enabled)
+        return E_POINTER;
+
+    *enabled = boolValueForKey(CFSTR(WebKitAuthorAndUserStylesEnabledPreferenceKey));
+    return S_OK;
+}
+
 void WebPreferences::willAddToWebView()
 {
     ++m_numWebViews;
index 5a81f8ca54198008f84d81dee0d85fd2f6a132e0..a9cd7e82a3660e7d8c942e602ac9919d5b91ce77 100644 (file)
@@ -288,6 +288,9 @@ public:
      virtual HRESULT STDMETHODCALLTYPE automaticallyDetectsCacheModel(
          /* [out, retval] */ BOOL* automaticallyDetectsCacheModel);
 
+    virtual HRESULT STDMETHODCALLTYPE setAuthorAndUserStylesEnabled(BOOL);
+    virtual HRESULT STDMETHODCALLTYPE authorAndUserStylesEnabled(BOOL*);
+
     // WebPreferences
 
     // This method accesses a different preference key than developerExtrasEnabled.
index 9e0c6d28e682ca90c6d53fd2594ef43e32d651e4..01a23814b47203ce1042dae68d5832ff59e324b8 100644 (file)
@@ -3784,6 +3784,14 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
     settings->setForceFTPDirectoryListings(true);
     settings->setDeveloperExtrasEnabled(developerExtrasEnabled());
 
+    COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences);
+    if (prefsPrivate) {
+        hr = prefsPrivate->authorAndUserStylesEnabled(&enabled);
+        if (FAILED(hr))
+            return hr;
+        settings->setAuthorAndUserStylesEnabled(enabled);
+    }
+
     m_mainFrame->invalidate(); // FIXME
 
     hr = updateSharedSettingsFromPreferencesIfNeeded(preferences.get());
index 6fa857167d604315482cd20531d3d5d6c290b493..d5e586edb9758e8babd54ebc7a51667880d85c1e 100644 (file)
@@ -1,3 +1,12 @@
+2007-11-27  Adam Roben  <aroben@apple.com>
+
+        Fix <rdar://5614497> setAuthorAndUserStylesEnabled is not implemented in DRT
+
+        Reviewed by Maciej.
+
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::setAuthorAndUserStylesEnabled): Implemented.
+
 2007-12-04  Alp Toker  <alp@atoker.com>
 
         Prospective Win DRT build fix.
index d9da808ba73261f996189fb4cf67a6f4f5ee5708..1fc943185c38e5942f3ad4b094ed2e77d9fbf5c3 100644 (file)
@@ -41,6 +41,7 @@
 #include <JavaScriptCore/JavaScriptCore.h>
 #include <JavaScriptCore/JSRetainPtr.h>
 #include <WebKit/IWebHistory.h>
+#include <WebKit/IWebPreferencesPrivate.h>
 #include <WebKit/IWebViewPrivate.h>
 #include <WebKit/WebKit.h>
 #include <string>
@@ -224,7 +225,19 @@ void LayoutTestController::setAcceptsEditing(bool acceptsEditing)
 
 void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
 {
-    // FIXME: Implement!
+    COMPtr<IWebView> webView;
+    if (FAILED(frame->webView(&webView)))
+        return;
+
+    COMPtr<IWebPreferences> preferences;
+    if (FAILED(webView->preferences(&preferences)))
+        return;
+
+    COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences);
+    if (!prefsPrivate)
+        return;
+
+    prefsPrivate->setAuthorAndUserStylesEnabled(flag);
 }
 
 void LayoutTestController::setCustomPolicyDelegate(bool setDelegate)