Unreviewed, rolling out r182511.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Apr 2015 01:51:10 +0000 (01:51 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Apr 2015 01:51:10 +0000 (01:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143507

caused debug test failures (Requested by alexchristensen on
#webkit).

Reverted changeset:

"Block popups from content extensions."
https://bugs.webkit.org/show_bug.cgi?id=143497
http://trac.webkit.org/changeset/182511

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

12 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/contentextensions/popups-expected.txt [deleted file]
LayoutTests/http/tests/contentextensions/popups.html [deleted file]
LayoutTests/http/tests/contentextensions/popups.html.json [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/loader/ResourceLoadInfo.cpp
Source/WebCore/loader/ResourceLoadInfo.h
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/UserContentController.cpp
Source/WebCore/page/UserContentController.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp

index 4b2365d75fab70eb2ac21c2ca47488bc00a8f4e6..264e6dcdc420897de72e11cb58eb00d1c9237f22 100644 (file)
@@ -1,3 +1,17 @@
+2015-04-07  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r182511.
+        https://bugs.webkit.org/show_bug.cgi?id=143507
+
+        caused debug test failures (Requested by alexchristensen on
+        #webkit).
+
+        Reverted changeset:
+
+        "Block popups from content extensions."
+        https://bugs.webkit.org/show_bug.cgi?id=143497
+        http://trac.webkit.org/changeset/182511
+
 2015-04-07  Alex Christensen  <achristensen@webkit.org>
 
         Block popups from content extensions.
diff --git a/LayoutTests/http/tests/contentextensions/popups-expected.txt b/LayoutTests/http/tests/contentextensions/popups-expected.txt
deleted file mode 100644 (file)
index 1997344..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-ALERT: about:blank successfully blocked
-ALERT: data url should not be blocked
-ALERT: data url should not be blocked
-
diff --git a/LayoutTests/http/tests/contentextensions/popups.html b/LayoutTests/http/tests/contentextensions/popups.html
deleted file mode 100644 (file)
index 613d5de..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<html> 
-<body>
-<script> 
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.setCanOpenWindows(true);
-    testRunner.setCloseRemainingWindowsWhenComplete(true);
-}
-
-win = window.open("about:blank");
-alert(win ? "FAIL" : "about:blank successfully blocked");
-win = window.open("data:text/html, hello");
-alert(win ? "data url should not be blocked" : "FAIL");
-win = window.open("data:text/html, about");
-alert(win ? "data url should not be blocked" : "FAIL");
-</script> 
-</body> 
-</html>
diff --git a/LayoutTests/http/tests/contentextensions/popups.html.json b/LayoutTests/http/tests/contentextensions/popups.html.json
deleted file mode 100644 (file)
index 9844ccd..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-[
-    {
-        "action": {
-            "type": "block"
-        },
-        "trigger": {
-            "url-filter": "about",
-            "resource-type":["popup"]
-        }
-    }
-]
index ee349b6dd087cc38aed67f5e5da3b68fa6efd0f4..1a5524398af48060080d5e8ced919ec38102df1e 100644 (file)
@@ -1,3 +1,17 @@
+2015-04-07  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r182511.
+        https://bugs.webkit.org/show_bug.cgi?id=143507
+
+        caused debug test failures (Requested by alexchristensen on
+        #webkit).
+
+        Reverted changeset:
+
+        "Block popups from content extensions."
+        https://bugs.webkit.org/show_bug.cgi?id=143497
+        http://trac.webkit.org/changeset/182511
+
 2015-04-07  Myles C. Maxfield  <mmaxfield@apple.com>
 
         [Cocoa] System fonts do not get correct tracking
index cbd59193b058fb65c901ef5cbd85937e1d7c3216..1673369a9c4f057c10ccf5c6d22e8629c9242f6b 100644 (file)
@@ -85,8 +85,6 @@ uint16_t readResourceType(const String& name)
         return static_cast<uint16_t>(ResourceType::SVGDocument);
     if (name == "media")
         return static_cast<uint16_t>(ResourceType::Media);
-    if (name == "popup")
-        return static_cast<uint16_t>(ResourceType::Popup);
     return static_cast<uint16_t>(ResourceType::Invalid);
 }
 
index f3dcd2e0e3156c90a50b24fcd9696e76364ad833..0d3f9557a355a2cd12cb612631d535695e51a757 100644 (file)
@@ -42,13 +42,12 @@ enum class ResourceType : uint16_t {
     SVGDocument = 0x0040,
     Media = 0x0080,
     PlugInStream = 0x0100,
-    Popup = 0x0200,
 };
 
 enum class LoadType : uint16_t {
     Invalid = 0x0000,
-    FirstParty = 0x0400,
-    ThirdParty = 0x0800,
+    FirstParty = 0x0200,
+    ThirdParty = 0x0400,
 };
 
 typedef uint16_t ResourceFlags;
index de3a3bade4e0e9701d851813875ffc2f728bdd3a..78294037fe709648b255bedd227e81c34aaee9f3 100644 (file)
@@ -35,8 +35,6 @@
 #include "CSSRuleList.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
-#include "ContentExtensionActions.h"
-#include "ContentExtensionRule.h"
 #include "Crypto.h"
 #include "DOMApplicationCache.h"
 #include "DOMSelection.h"
@@ -83,7 +81,6 @@
 #include "PageTransitionEvent.h"
 #include "Performance.h"
 #include "PlatformScreen.h"
-#include "ResourceLoadInfo.h"
 #include "RuntimeEnabledFeatures.h"
 #include "ScheduledAction.h"
 #include "Screen.h"
@@ -2124,38 +2121,24 @@ PassRefPtr<DOMWindow> DOMWindow::open(const String& urlString, const AtomicStrin
     DOMWindow& activeWindow, DOMWindow& firstWindow)
 {
     if (!isCurrentlyDisplayedInFrame())
-        return nullptr;
+        return 0;
     Document* activeDocument = activeWindow.document();
     if (!activeDocument)
-        return nullptr;
+        return 0;
     Frame* firstFrame = firstWindow.frame();
     if (!firstFrame)
-        return nullptr;
-
-#if ENABLE(CONTENT_EXTENSIONS)
-    if (firstFrame
-        && firstFrame->mainFrame().page()
-        && firstFrame->mainFrame().page()->userContentController()
-        && firstFrame->mainFrame().document()) {
-        ResourceLoadInfo resourceLoadInfo = {URL(ParsedURLString, urlString), firstFrame->mainFrame().document()->url(), ResourceType::Popup};
-        Vector<ContentExtensions::Action> actions = firstFrame->mainFrame().page()->userContentController()->actionsForResourceLoad(resourceLoadInfo);
-        for (const ContentExtensions::Action& action : actions) {
-            if (action.type() == ContentExtensions::ActionType::BlockLoad)
-                return nullptr;
-        }
-    }
-#endif
+        return 0;
 
     if (!firstWindow.allowPopUp()) {
         // Because FrameTree::find() returns true for empty strings, we must check for empty frame names.
         // Otherwise, illegitimate window.open() calls with no name will pass right through the popup blocker.
         if (frameName.isEmpty() || !m_frame->tree().find(frameName))
-            return nullptr;
+            return 0;
     }
 
     // Get the target frame for the special cases of _top and _parent.
     // In those cases, we schedule a location change right now and return early.
-    Frame* targetFrame = nullptr;
+    Frame* targetFrame = 0;
     if (frameName == "_top")
         targetFrame = &m_frame->tree().top();
     else if (frameName == "_parent") {
@@ -2166,7 +2149,7 @@ PassRefPtr<DOMWindow> DOMWindow::open(const String& urlString, const AtomicStrin
     }
     if (targetFrame) {
         if (!activeDocument->canNavigate(targetFrame))
-            return nullptr;
+            return 0;
 
         URL completedURL = firstFrame->document()->completeURL(urlString);
 
@@ -2186,7 +2169,7 @@ PassRefPtr<DOMWindow> DOMWindow::open(const String& urlString, const AtomicStrin
 
     WindowFeatures windowFeatures(windowFeaturesString);
     RefPtr<Frame> result = createWindow(urlString, frameName, windowFeatures, activeWindow, firstFrame, m_frame);
-    return result ? result->document()->domWindow() : nullptr;
+    return result ? result->document()->domWindow() : 0;
 }
 
 void DOMWindow::showModalDialog(const String& urlString, const String& dialogFeaturesString, DOMWindow& activeWindow, DOMWindow& firstWindow, std::function<void (DOMWindow&)> prepareDialogFunction)
index 3d6494ca2e3ac31f64cee4d490115409edc11dbb..9cadedb9cb4c38e01d017ec40c09f056c0af9335 100644 (file)
@@ -212,13 +212,6 @@ void UserContentController::processContentExtensionRulesForLoad(ResourceRequest&
     m_contentExtensionBackend->processContentExtensionRulesForLoad(request, resourceType, initiatingDocumentLoader);
 }
 
-Vector<ContentExtensions::Action> UserContentController::actionsForResourceLoad(const ResourceLoadInfo& resourceLoadInfo)
-{
-    if (!m_contentExtensionBackend)
-        return Vector<ContentExtensions::Action>();
-    
-    return m_contentExtensionBackend->actionsForResourceLoad(resourceLoadInfo);
-}
 #endif
 
 void UserContentController::removeAllUserContent()
index 663014e9e651e8101d66fc88d3f1db3be41b1d1f..ed5cebbde5bf757b0042d947e99999a34bdbfc19 100644 (file)
@@ -93,7 +93,6 @@ public:
     WEBCORE_EXPORT void removeAllUserContentExtensions();
 
     void processContentExtensionRulesForLoad(ResourceRequest&, ResourceType, DocumentLoader& initiatingDocumentLoader);
-    Vector<ContentExtensions::Action> actionsForResourceLoad(const ResourceLoadInfo&);
 #endif
 
 private:
index 8bf1ae0ecb8959fbd04ba16f0b81effcc4af603e..07b2e2e58ae348799e1e2624431be694e7d15231 100644 (file)
@@ -1,3 +1,17 @@
+2015-04-07  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r182511.
+        https://bugs.webkit.org/show_bug.cgi?id=143507
+
+        caused debug test failures (Requested by alexchristensen on
+        #webkit).
+
+        Reverted changeset:
+
+        "Block popups from content extensions."
+        https://bugs.webkit.org/show_bug.cgi?id=143497
+        http://trac.webkit.org/changeset/182511
+
 2015-04-07  Alex Christensen  <achristensen@webkit.org>
 
         Block popups from content extensions.
index 7e2c5ad7bc3106a19e30a8dd6fdd933300816c7d..3a36c82a162f13c3ddbd597fa58067cb9cb2c833 100644 (file)
@@ -457,7 +457,7 @@ TEST_F(ContentExtensionTest, LoadType)
 
 TEST_F(ContentExtensionTest, ResourceType)
 {
-    auto backend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"block_all_types.org\",\"resource-type\":[\"document\",\"image\",\"style-sheet\",\"script\",\"font\",\"raw\",\"svg-document\",\"media\",\"popup\"]}},"
+    auto backend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"block_all_types.org\",\"resource-type\":[\"document\",\"image\",\"style-sheet\",\"script\",\"font\",\"raw\",\"svg-document\",\"media\"]}},"
         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"block_only_images\",\"resource-type\":[\"image\"]}}]");
 
     testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Document), { ContentExtensions::ActionType::BlockLoad });
@@ -468,7 +468,6 @@ TEST_F(ContentExtensionTest, ResourceType)
     testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Raw), { ContentExtensions::ActionType::BlockLoad });
     testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::SVGDocument), { ContentExtensions::ActionType::BlockLoad });
     testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Media), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Popup), { ContentExtensions::ActionType::BlockLoad });
     testRequest(backend, mainDocumentRequest("http://block_only_images.org", ResourceType::Image), { ContentExtensions::ActionType::BlockLoad });
     testRequest(backend, mainDocumentRequest("http://block_only_images.org", ResourceType::Document), { });
 }