2011-05-26 Qi Zhang <qi.2.zhang@nokia.com>
authorqi.2.zhang@nokia.com <qi.2.zhang@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2011 00:00:42 +0000 (00:00 +0000)
committerqi.2.zhang@nokia.com <qi.2.zhang@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2011 00:00:42 +0000 (00:00 +0000)
        Reviewed by Andreas Kling.

        WebKitTestRunner needs layoutTestController.setAuthorAndUserStylesEnabled
        https://bugs.webkit.org/show_bug.cgi?id=42676

        Implemented layoutTestController.setAuthorAndUserStylesEnabled for WebKitTestRunner.

        * platform/mac-wk2/Skipped:
        * platform/qt-wk2/Skipped:
2011-05-26  Qi Zhang  <qi.2.zhang@nokia.com>

        Reviewed by Andreas Kling.

        WebKitTestRunner needs layoutTestController.setAuthorAndUserStylesEnabled
        https://bugs.webkit.org/show_bug.cgi?id=42676

        Implemented layoutTestController.setAuthorAndUserStylesEnabled for WebKitTestRunner.

        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleSetAuthorAndUserStylesEnabled):
        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::setAuthorAndUserStylesEnabled):
        * WebProcess/InjectedBundle/InjectedBundle.h:
2011-05-26  Qi Zhang  <qi.2.zhang@nokia.com>

        Reviewed by Andreas Kling.

        WebKitTestRunner needs layoutTestController.setAuthorAndUserStylesEnabled
        https://bugs.webkit.org/show_bug.cgi?id=42676

        Implemented layoutTestController.setAuthorAndUserStylesEnabled for WebKitTestRunner.

        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
        (WTR::InjectedBundle::beginTesting):
        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
        (WTR::LayoutTestController::setAuthorAndUserStylesEnabled):
        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:

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

13 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/Skipped
LayoutTests/platform/qt-wk2/Skipped
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h

index 9a7657e..e16cac5 100644 (file)
@@ -1,3 +1,15 @@
+2011-05-26  Qi Zhang  <qi.2.zhang@nokia.com>
+
+        Reviewed by Andreas Kling.
+
+        WebKitTestRunner needs layoutTestController.setAuthorAndUserStylesEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=42676
+
+        Implemented layoutTestController.setAuthorAndUserStylesEnabled for WebKitTestRunner.
+
+        * platform/mac-wk2/Skipped:
+        * platform/qt-wk2/Skipped:
+
 2011-05-26  Adam Klein  <adamk@chromium.org>
 
         Unreviewed.  Add Leopard rebaseline.
index b09b959..61d5793 100644 (file)
@@ -1314,10 +1314,6 @@ http/tests/navigation/timerredirect-subframeload.html
 # <https://bugs.webkit.org/show_bug.cgi?id=42675>
 http/tests/cache/subresource-failover-to-network.html
 
-# WebKitTestRunner needs layoutTestController.setAuthorAndUserStylesEnabled
-# <https://bugs.webkit.org/show_bug.cgi?id=42676>
-fast/css/disabled-author-styles.html
-
 # WebKitTestRunner needs layoutTestController.setUserStyleSheetLocation
 # <https://bugs.webkit.org/show_bug.cgi?id=42678>
 http/tests/security/local-user-CSS-from-remote.html
index f5163c6..c358d98 100644 (file)
@@ -1607,10 +1607,6 @@ http/tests/navigation/reload-subframe-object.html
 # <https://bugs.webkit.org/show_bug.cgi?id=42675>
 http/tests/cache/subresource-failover-to-network.html
 
-# WebKitTestRunner needs layoutTestController.setAuthorAndUserStylesEnabled
-# <https://bugs.webkit.org/show_bug.cgi?id=42676>
-fast/css/disabled-author-styles.html
-
 # WebKitTestRunner needs layoutTestController.setUserStyleSheetLocation
 # <https://bugs.webkit.org/show_bug.cgi?id=42678>
 http/tests/security/local-user-CSS-from-remote.html
index f287f42..e029046 100644 (file)
@@ -1,3 +1,19 @@
+2011-05-26  Qi Zhang  <qi.2.zhang@nokia.com>
+
+        Reviewed by Andreas Kling.
+
+        WebKitTestRunner needs layoutTestController.setAuthorAndUserStylesEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=42676
+
+        Implemented layoutTestController.setAuthorAndUserStylesEnabled for WebKitTestRunner.
+
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        (WKBundleSetAuthorAndUserStylesEnabled):
+        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::setAuthorAndUserStylesEnabled):
+        * WebProcess/InjectedBundle/InjectedBundle.h:
+
 2011-05-25  Brian Weinstein  <bweinstein@apple.com>
 
         Reviewed by Adam Roben.
index 562c8bf..7b02e77 100644 (file)
@@ -153,6 +153,11 @@ void WKBundleSetPrivateBrowsingEnabled(WKBundleRef bundleRef, WKBundlePageGroupR
     toImpl(bundleRef)->setPrivateBrowsingEnabled(toImpl(pageGroupRef), enabled);
 }
 
+void WKBundleSetAuthorAndUserStylesEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)
+{
+    toImpl(bundleRef)->setAuthorAndUserStylesEnabled(toImpl(pageGroupRef), enabled);
+}
+
 void WKBundleAddOriginAccessWhitelistEntry(WKBundleRef bundleRef, WKStringRef sourceOrigin, WKStringRef destinationProtocol, WKStringRef destinationHost, bool allowDestinationSubdomains)
 {
     toImpl(bundleRef)->addOriginAccessWhitelistEntry(toImpl(sourceOrigin)->string(), toImpl(destinationProtocol)->string(), toImpl(destinationHost)->string(), allowDestinationSubdomains);
index 8aece4e..77484b7 100644 (file)
@@ -70,6 +70,7 @@ WK_EXPORT void WKBundleSetAllowFileAccessFromFileURLs(WKBundleRef bundle, WKBund
 WK_EXPORT void WKBundleSetFrameFlatteningEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
 WK_EXPORT void WKBundleSetJavaScriptCanAccessClipboard(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
 WK_EXPORT void WKBundleSetPrivateBrowsingEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
+WK_EXPORT void WKBundleSetAuthorAndUserStylesEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
 WK_EXPORT void WKBundleClearAllDatabases(WKBundleRef bundle);
 WK_EXPORT void WKBundleSetDatabaseQuota(WKBundleRef bundle, uint64_t);
 WK_EXPORT int WKBundleNumberOfPages(WKBundleRef bundle, WKBundleFrameRef frameRef, double pageWidthInPixels, double pageHeightInPixels);
index d2f2cc8..a3bf744 100644 (file)
@@ -150,6 +150,13 @@ void InjectedBundle::setPrivateBrowsingEnabled(WebPageGroupProxy* pageGroup, boo
         (*iter)->settings()->setPrivateBrowsingEnabled(enabled);
 }
 
+void InjectedBundle::setAuthorAndUserStylesEnabled(WebPageGroupProxy* pageGroup, bool enabled)
+{
+    const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages();
+    for (HashSet<Page*>::iterator iter = pages.begin(); iter != pages.end(); ++iter)
+        (*iter)->settings()->setAuthorAndUserStylesEnabled(enabled);
+}
+
 void InjectedBundle::addOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains)
 {
     SecurityOrigin::addOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
index 431968c..0cc5820 100644 (file)
@@ -96,6 +96,7 @@ public:
     void setFrameFlatteningEnabled(WebPageGroupProxy*, bool);
     void setJavaScriptCanAccessClipboard(WebPageGroupProxy*, bool);
     void setPrivateBrowsingEnabled(WebPageGroupProxy*, bool);
+    void setAuthorAndUserStylesEnabled(WebPageGroupProxy*, bool);
     void addOriginAccessWhitelistEntry(const String&, const String&, const String&, bool);
     void removeOriginAccessWhitelistEntry(const String&, const String&, const String&, bool);
     void resetOriginAccessWhitelists();
index 74fc294..f01aebc 100644 (file)
@@ -1,3 +1,19 @@
+2011-05-26  Qi Zhang  <qi.2.zhang@nokia.com>
+
+        Reviewed by Andreas Kling.
+
+        WebKitTestRunner needs layoutTestController.setAuthorAndUserStylesEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=42676
+
+        Implemented layoutTestController.setAuthorAndUserStylesEnabled for WebKitTestRunner.
+
+        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::beginTesting):
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+        (WTR::LayoutTestController::setAuthorAndUserStylesEnabled):
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+
 2011-05-26  Ademar de Souza Reis Jr.  <ademar.reis@openbossa.org>
 
         Reviewed by Andreas Kling.
index e3688d7..3bde099 100644 (file)
@@ -52,6 +52,7 @@ module WTR {
         void setFrameFlatteningEnabled(in boolean value);
         void setJavaScriptCanAccessClipboard(in boolean value);
         void setPrivateBrowsingEnabled(in boolean value);
+        void setAuthorAndUserStylesEnabled(in boolean value);
         void addOriginAccessWhitelistEntry(in DOMString sourceOrigin, in DOMString destinationProtocol, in DOMString destinationHost, in boolean allowDestinationSubdomains);
         void removeOriginAccessWhitelistEntry(in DOMString sourceOrigin, in DOMString destinationProtocol, in DOMString destinationHost, in boolean allowDestinationSubdomains);
 
index a622437..49ca866 100644 (file)
@@ -180,6 +180,7 @@ void InjectedBundle::beginTesting()
     WKBundleSetAllowUniversalAccessFromFileURLs(m_bundle, m_pageGroup, true);
     WKBundleSetJavaScriptCanAccessClipboard(m_bundle, m_pageGroup, true);
     WKBundleSetPrivateBrowsingEnabled(m_bundle, m_pageGroup, false);
+    WKBundleSetAuthorAndUserStylesEnabled(m_bundle, m_pageGroup, true);
 
     WKBundleRemoveAllUserContent(m_bundle, m_pageGroup);
 
index c4c9e9e..87e4910 100644 (file)
@@ -349,6 +349,11 @@ void LayoutTestController::setPrivateBrowsingEnabled(bool enabled)
      WKBundleSetPrivateBrowsingEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
 }
 
+void LayoutTestController::setAuthorAndUserStylesEnabled(bool enabled)
+{
+     WKBundleSetAuthorAndUserStylesEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
+}
+
 void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
 {
     WKBundleAddOriginAccessWhitelistEntry(InjectedBundle::shared().bundle(), toWK(sourceOrigin).get(), toWK(destinationProtocol).get(), toWK(destinationHost).get(), allowDestinationSubdomains);
index c231ef7..a9f8021 100644 (file)
@@ -81,6 +81,7 @@ public:
     void setFrameFlatteningEnabled(bool);
     void setJavaScriptCanAccessClipboard(bool);
     void setPrivateBrowsingEnabled(bool);
+    void setAuthorAndUserStylesEnabled(bool);
     void addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);
     void removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);