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 5a59f7e..e454892 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 93bbf6c..f666d97 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 2247257..f726eac 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 e524024..8bd43bf 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 4e91f46..d718305 100644 (file)
 
 #define WebKitDeveloperExtrasEnabledPreferenceKey "WebKitDeveloperExtras"
 #define DisableWebKitDeveloperExtrasPreferenceKey "DisableWebKitDeveloperExtras"
+
+#define WebKitAuthorAndUserStylesEnabledPreferenceKey "WebKitAuthorAndUserStylesEnabled"
index 6cfcb1d..c7cf4bd 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 5a81f8c..a9cd7e8 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 9e0c6d2..01a2381 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 6fa8571..d5e586e 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 d9da808..1fc9431 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)