[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

yurys at chromium.org yurys at chromium.org
Wed Dec 22 18:32:07 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e42c177c1bab2e5b7d8d3661414b5396627e2296
Author: yurys at chromium.org <yurys at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 13 19:54:12 2010 +0000

    2010-12-13  Yury Semikhatsky  <yurys at chromium.org>
    
            Unreviewed. Rollout 73914, 73915, 73917, 73920 and 73921.
    
            REGRESSION(r73914): "Chromium page_cycler_morejs fails" (Requested by yurys on #webkit).
            https://bugs.webkit.org/show_bug.cgi?id=50950
    
            * fast/events/resources/window-onerror.js: Removed.
            * fast/events/window-onerror1-expected.txt: Removed.
            * fast/events/window-onerror1.html: Removed.
            * fast/events/window-onerror10-expected.txt: Removed.
            * fast/events/window-onerror10.html: Removed.
            * fast/events/window-onerror11-expected.txt: Removed.
            * fast/events/window-onerror11.html: Removed.
            * fast/events/window-onerror2-expected.txt: Removed.
            * fast/events/window-onerror2.html: Removed.
            * fast/events/window-onerror3-expected.txt: Removed.
            * fast/events/window-onerror3.html: Removed.
            * fast/events/window-onerror4-expected.txt: Removed.
            * fast/events/window-onerror4.html: Removed.
            * fast/events/window-onerror5-expected.txt: Removed.
            * fast/events/window-onerror5.html: Removed.
            * fast/events/window-onerror6-expected.txt: Removed.
            * fast/events/window-onerror6.html: Removed.
            * fast/events/window-onerror7-expected.txt: Removed.
            * fast/events/window-onerror7.html: Removed.
            * fast/events/window-onerror8-expected.txt: Removed.
            * fast/events/window-onerror8.html: Removed.
            * fast/events/window-onerror9-expected.txt: Removed.
            * fast/events/window-onerror9.html: Removed.
            * fast/workers/worker-script-error-expected.txt:
            * http/tests/security/resources/onerror-iframe.html: Removed.
            * http/tests/security/window-onerror-exception-in-iframe-expected.txt: Removed.
            * http/tests/security/window-onerror-exception-in-iframe.html: Removed.
            * platform/chromium-win/fast/workers/worker-script-error-expected.txt:
            * platform/chromium/fast/events/window-onerror1-expected.txt: Removed.
            * platform/chromium/fast/events/window-onerror10-expected.txt: Removed.
            * platform/chromium/fast/events/window-onerror11-expected.txt: Removed.
            * platform/chromium/fast/events/window-onerror2-expected.txt: Removed.
            * platform/chromium/fast/events/window-onerror3-expected.txt: Removed.
            * platform/chromium/fast/events/window-onerror4-expected.txt: Removed.
            * platform/chromium/fast/events/window-onerror5-expected.txt: Removed.
            * platform/chromium/fast/events/window-onerror6-expected.txt: Removed.
            * platform/chromium/fast/events/window-onerror7-expected.txt: Removed.
            * platform/chromium/fast/events/window-onerror8-expected.txt: Removed.
            * platform/chromium/fast/events/window-onerror9-expected.txt: Removed.
            * platform/chromium/http/tests/security/window-onerror-exception-in-iframe-expected.txt: Removed.
            * platform/chromium/userscripts/window-onerror-for-isolated-world-1-expected.txt: Removed.
            * platform/chromium/userscripts/window-onerror-for-isolated-world-2-expected.txt: Removed.
            * platform/gtk/Skipped:
            * userscripts/window-onerror-for-isolated-world-1-expected.txt: Removed.
            * userscripts/window-onerror-for-isolated-world-1.html: Removed.
            * userscripts/window-onerror-for-isolated-world-2-expected.txt: Removed.
            * userscripts/window-onerror-for-isolated-world-2.html: Removed.
    2010-12-13  Yury Semikhatsky  <yurys at chromium.org>
    
            Unreviewed. Rollout 73914, 73915, 73917, 73920 and 73921.
    
            REGRESSION(r73914): "Chromium page_cycler_morejs fails" (Requested by yurys on #webkit).
            https://bugs.webkit.org/show_bug.cgi?id=50950
    
            * Android.jscbindings.mk:
            * CMakeLists.txt:
            * GNUmakefile.am:
            * WebCore.gypi:
            * WebCore.order:
            * WebCore.pro:
            * WebCore.vcproj/WebCore.vcproj:
            * WebCore.xcodeproj/project.pbxproj:
            * bindings/js/JSBindingsAllInOne.cpp:
            * bindings/js/JSDOMBinding.cpp:
            (WebCore::reportException):
            * bindings/js/JSWorkerContextErrorHandler.cpp: Renamed from WebCore/bindings/js/JSErrorHandler.cpp.
            (WebCore::JSWorkerContextErrorHandler::JSWorkerContextErrorHandler):
            (WebCore::JSWorkerContextErrorHandler::~JSWorkerContextErrorHandler):
            (WebCore::JSWorkerContextErrorHandler::handleEvent):
            * bindings/js/JSWorkerContextErrorHandler.h: Renamed from WebCore/bindings/js/JSErrorHandler.h.
            (WebCore::JSWorkerContextErrorHandler::create):
            (WebCore::createJSWorkerContextErrorHandler):
            * bindings/scripts/CodeGeneratorJS.pm:
            * bindings/scripts/CodeGeneratorV8.pm:
            * bindings/v8/V8ConsoleMessage.cpp:
            (WebCore::V8ConsoleMessage::dispatchNow):
            (WebCore::V8ConsoleMessage::handler):
            * bindings/v8/V8ConsoleMessage.h:
            * bindings/v8/V8WindowErrorHandler.cpp: Removed.
            * bindings/v8/V8WindowErrorHandler.h: Removed.
            * bindings/v8/WorkerContextExecutionProxy.cpp:
            (WebCore::v8MessageHandler):
            * bindings/v8/WorkerScriptController.cpp:
            (WebCore::WorkerScriptController::evaluate):
            * dom/Document.cpp:
            (WebCore::Document::reportException):
            (WebCore::Document::addMessage):
            * dom/Document.h:
            * dom/ErrorEvent.cpp:
            * dom/ErrorEvent.h:
            * dom/Event.cpp:
            * dom/Event.h:
            * dom/ScriptExecutionContext.cpp:
            (WebCore::ScriptExecutionContext::ScriptExecutionContext):
            * dom/ScriptExecutionContext.h:
            * websockets/WebSocket.cpp:
            (WebCore::WebSocket::connect):
            * websockets/WebSocketChannel.cpp:
            (WebCore::WebSocketChannel::didOpen):
            (WebCore::WebSocketChannel::appendToBuffer):
            * websockets/WebSocketHandshake.cpp:
            (WebCore::WebSocketHandshake::readServerHandshake):
            (WebCore::WebSocketHandshake::readStatusLine):
            (WebCore::WebSocketHandshake::readHTTPHeaders):
            (WebCore::WebSocketHandshake::checkResponseHeaders):
            * workers/DefaultSharedWorkerRepository.cpp:
            (WebCore::postExceptionTask):
            (WebCore::postConsoleMessageTask):
            * workers/WorkerContext.cpp:
            (WebCore::WorkerContext::WorkerContext):
            (WebCore::WorkerContext::reportException):
            (WebCore::WorkerContext::addMessage):
            * workers/WorkerContext.h:
            * workers/WorkerMessagingProxy.cpp:
            (WebCore::WorkerExceptionTask::performTask):
            (WebCore::postConsoleMessageTask):
            * xml/XMLHttpRequest.cpp:
            (WebCore::reportUnsafeUsage):
    2010-12-13  Yury Semikhatsky  <yurys at chromium.org>
    
            Unreviewed. Rollout 73914, 73915, 73917, 73920 and 73921.
    
            REGRESSION(r73914): "Chromium page_cycler_morejs fails" (Requested by yurys on #webkit).
            https://bugs.webkit.org/show_bug.cgi?id=50950
    
            * src/WebWorkerClientImpl.cpp:
            (WebKit::WebWorkerClientImpl::postExceptionToWorkerObject):
            (WebKit::WebWorkerClientImpl::postConsoleMessageToWorkerObject):
            (WebKit::WebWorkerClientImpl::postExceptionToWorkerObjectTask):
            (WebKit::WebWorkerClientImpl::postConsoleMessageToWorkerObjectTask):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73939 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 84116f9..8c78220 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,58 @@
+2010-12-13  Yury Semikhatsky  <yurys at chromium.org>
+
+        Unreviewed. Rollout 73914, 73915, 73917, 73920 and 73921.
+
+        REGRESSION(r73914): "Chromium page_cycler_morejs fails" (Requested by yurys on #webkit).
+        https://bugs.webkit.org/show_bug.cgi?id=50950
+
+        * fast/events/resources/window-onerror.js: Removed.
+        * fast/events/window-onerror1-expected.txt: Removed.
+        * fast/events/window-onerror1.html: Removed.
+        * fast/events/window-onerror10-expected.txt: Removed.
+        * fast/events/window-onerror10.html: Removed.
+        * fast/events/window-onerror11-expected.txt: Removed.
+        * fast/events/window-onerror11.html: Removed.
+        * fast/events/window-onerror2-expected.txt: Removed.
+        * fast/events/window-onerror2.html: Removed.
+        * fast/events/window-onerror3-expected.txt: Removed.
+        * fast/events/window-onerror3.html: Removed.
+        * fast/events/window-onerror4-expected.txt: Removed.
+        * fast/events/window-onerror4.html: Removed.
+        * fast/events/window-onerror5-expected.txt: Removed.
+        * fast/events/window-onerror5.html: Removed.
+        * fast/events/window-onerror6-expected.txt: Removed.
+        * fast/events/window-onerror6.html: Removed.
+        * fast/events/window-onerror7-expected.txt: Removed.
+        * fast/events/window-onerror7.html: Removed.
+        * fast/events/window-onerror8-expected.txt: Removed.
+        * fast/events/window-onerror8.html: Removed.
+        * fast/events/window-onerror9-expected.txt: Removed.
+        * fast/events/window-onerror9.html: Removed.
+        * fast/workers/worker-script-error-expected.txt:
+        * http/tests/security/resources/onerror-iframe.html: Removed.
+        * http/tests/security/window-onerror-exception-in-iframe-expected.txt: Removed.
+        * http/tests/security/window-onerror-exception-in-iframe.html: Removed.
+        * platform/chromium-win/fast/workers/worker-script-error-expected.txt:
+        * platform/chromium/fast/events/window-onerror1-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror10-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror11-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror2-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror3-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror4-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror5-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror6-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror7-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror8-expected.txt: Removed.
+        * platform/chromium/fast/events/window-onerror9-expected.txt: Removed.
+        * platform/chromium/http/tests/security/window-onerror-exception-in-iframe-expected.txt: Removed.
+        * platform/chromium/userscripts/window-onerror-for-isolated-world-1-expected.txt: Removed.
+        * platform/chromium/userscripts/window-onerror-for-isolated-world-2-expected.txt: Removed.
+        * platform/gtk/Skipped:
+        * userscripts/window-onerror-for-isolated-world-1-expected.txt: Removed.
+        * userscripts/window-onerror-for-isolated-world-1.html: Removed.
+        * userscripts/window-onerror-for-isolated-world-2-expected.txt: Removed.
+        * userscripts/window-onerror-for-isolated-world-2.html: Removed.
+
 2010-12-09  Antti Koivisto  <antti at apple.com>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/LayoutTests/fast/events/resources/window-onerror.js b/LayoutTests/fast/events/resources/window-onerror.js
deleted file mode 100644
index 344574b..0000000
--- a/LayoutTests/fast/events/resources/window-onerror.js
+++ /dev/null
@@ -1,3 +0,0 @@
-function throwException() {
-    throw new Error("An exception");
-}
diff --git a/LayoutTests/fast/events/window-onerror1-expected.txt b/LayoutTests/fast/events/window-onerror1-expected.txt
deleted file mode 100644
index fe51b72..0000000
--- a/LayoutTests/fast/events/window-onerror1-expected.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-This page tests setting onerror handlers through the DOM. If it passes, you will see "PASS" messages below.Bug 8519.
-
-PASS: caught global error: ReferenceError: Can't find variable: hahaha_good_luck_finding_me at window-onerror1.html:25
diff --git a/LayoutTests/fast/events/window-onerror1.html b/LayoutTests/fast/events/window-onerror1.html
deleted file mode 100644
index 59d2495..0000000
--- a/LayoutTests/fast/events/window-onerror1.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<html>
-<head>
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function print(message, color)
-{
-    var paragraph = document.createElement("div");
-    paragraph.appendChild(document.createTextNode(message));
-    paragraph.style.fontFamily = "monospace";
-    if (color)
-        paragraph.style.color = color;
-    document.getElementById("console").appendChild(paragraph);
-}
-
-function test()
-{
-    // must be last because the exception ends JavaScript execution
-    window.onerror = function (error, url, line) {
-        url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-        print("PASS: caught global error: " + error + " at " + url + ":" + line, "green");
-        return false;
-    };
-    hahaha_good_luck_finding_me(); // caught by window.onerror
-}
-</script>
-</head>
-<body onload="test();">
-<p>This page tests setting onerror handlers through the DOM. If it passes, you will
-   see "PASS" messages below.<a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<hr>
-<div id='console'></div>
-</body>
-</html>
diff --git a/LayoutTests/fast/events/window-onerror10-expected.txt b/LayoutTests/fast/events/window-onerror10-expected.txt
deleted file mode 100644
index bff5636..0000000
--- a/LayoutTests/fast/events/window-onerror10-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Test that "error" event listener added with window.addEventListener is invoked for uncaucht exceptions. Bug 8519.
-
-event passed to the listener is the same as window.event: true
-Event details:
-type: error
-phase: 2
-currentTarget is the global object: true
-message: Error: My fault.
-filename: window-onerror10.html
-lineno: 29
-
diff --git a/LayoutTests/fast/events/window-onerror10.html b/LayoutTests/fast/events/window-onerror10.html
deleted file mode 100644
index 26ed018..0000000
--- a/LayoutTests/fast/events/window-onerror10.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<html>
-<body>
-<p>Test that "error" event listener added with window.addEventListener is invoked for uncaucht exceptions. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<div id="console"></div>
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-function lastPathComponent(url) {
-    return url ? url.match( /[^\/]+\/?$/ )[0] : url;
-}
-
-window.addEventListener("error", function(e) {
-    log("event passed to the listener is the same as window.event: " + (window.event === e));
-    log("Event details:");
-    log("type: " + e.type);
-    log("phase: " + e.eventPhase)
-    log("currentTarget is the global object: " + (e.currentTarget === window));
-    log("message: " + e.message);
-    log("filename: " + lastPathComponent(e.filename));
-    log("lineno: " + e.lineno);
-    e.preventDefault();
-}, false);
-
-throw new Error("My fault.");
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/events/window-onerror11-expected.txt b/LayoutTests/fast/events/window-onerror11-expected.txt
deleted file mode 100644
index 96e20cc..0000000
--- a/LayoutTests/fast/events/window-onerror11-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Test that window.onerror is called on window object. Bug 8519.
-
-Main frame window.onerror: Error: An exception at window-onerror.js:2
-
diff --git a/LayoutTests/fast/events/window-onerror11.html b/LayoutTests/fast/events/window-onerror11.html
deleted file mode 100644
index 7655fa7..0000000
--- a/LayoutTests/fast/events/window-onerror11.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<html>
-<head>
-<script src="resources/window-onerror.js">
-</script>
-</head>
-<body>
-<p>Test that window.onerror is called on window object. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<div id="console"></div>
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-window.onerror = function(msg, url, line)
-{
-    url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-    log("Main frame window.onerror: " + msg + " at " + url + ":" + line);
-    return false;
-}
-
-throwException();
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/events/window-onerror2-expected.txt b/LayoutTests/fast/events/window-onerror2-expected.txt
deleted file mode 100644
index 93a2d3f..0000000
--- a/LayoutTests/fast/events/window-onerror2-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Test that uncaught exceptions will be reported to the window.onerror handler. Bug 8519.
-
-Main frame window.onerror: Error: Inline script exception at window-onerror2.html:35
-Main frame window.onerror: Exception in onload at undefined:0
-Main frame window.onerror: Error: Exception in setTimeout at window-onerror2.html:29
-
diff --git a/LayoutTests/fast/events/window-onerror2.html b/LayoutTests/fast/events/window-onerror2.html
deleted file mode 100644
index db9fb75..0000000
--- a/LayoutTests/fast/events/window-onerror2.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<html>
-<body onload="throw 'Exception in onload';">
-<p>Test that uncaught exceptions will be reported to the window.onerror handler. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<div id="result"></div>
-<script>
-if (window.layoutTestController) {
-    layoutTestController.dumpAsText();
-    layoutTestController.waitUntilDone();
-}
-
-function log(msg) {
-    document.getElementById("result").innerHTML += msg + "<br>";
-}
-
-var unhandledErrorCount = 0;
-window.onerror = function(msg, url, line)
-{
-    url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-    log("Main frame window.onerror: " + msg + " at " + url + ":" + line);
-    
-    if (++unhandledErrorCount === 3 && window.layoutTestController)
-        layoutTestController.notifyDone();
-
-    return false;
-}
-
-function delayedThrowException()
-{
-    throw new Error("Exception in setTimeout");
-}
-setTimeout(delayedThrowException, 0);
-
-function throwException()
-{
-    throw new Error("Inline script exception");
-}
-throwException();
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/events/window-onerror3-expected.txt b/LayoutTests/fast/events/window-onerror3-expected.txt
deleted file mode 100644
index 7025dbb..0000000
--- a/LayoutTests/fast/events/window-onerror3-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-You should see a message if window.onerror is working properly for this test.Bug 8519.
-
-Error caught successfully: ReferenceError: Can't find variable: unknownObject File: window-onerror3.html Line: 16
-
diff --git a/LayoutTests/fast/events/window-onerror3.html b/LayoutTests/fast/events/window-onerror3.html
deleted file mode 100644
index ee2893f..0000000
--- a/LayoutTests/fast/events/window-onerror3.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-function test1()
-{
-    window.onerror = function (error, url, line) {
-        url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-        log("Error caught successfully: " + error + "\nFile: " + url + "\nLine: " + line)
-        return false;
-    };
-    unknownObject.unknownProperty++;
-}
-</script>
-<body onload="test1();">
-<p>You should see a message if window.onerror is working properly for this test.<a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<hr>
-<div id='console'></div>
-</body>
diff --git a/LayoutTests/fast/events/window-onerror4-expected.txt b/LayoutTests/fast/events/window-onerror4-expected.txt
deleted file mode 100644
index 26af8a1..0000000
--- a/LayoutTests/fast/events/window-onerror4-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-You should see a log record if window.onerror is working properly for this test.Bug 8519.
-
-Error caught successfully: ReferenceError: Left side of assignment is not a reference. File: undefined Line: 1
-
diff --git a/LayoutTests/fast/events/window-onerror4.html b/LayoutTests/fast/events/window-onerror4.html
deleted file mode 100644
index c51887d..0000000
--- a/LayoutTests/fast/events/window-onerror4.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-function test1()
-{
-    window.onerror = function (error, url, line) {
-        url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-        log("Error caught successfully: " + error + "\nFile: " + url + "\nLine: " + line)
-        return false;
-    };
-    eval("1=2");
-}
-</script>
-<body onload="test1();">
-<p>You should see a log record if window.onerror is working properly for this test.<a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<hr>
-<div id='console'></div>
-</body>
diff --git a/LayoutTests/fast/events/window-onerror5-expected.txt b/LayoutTests/fast/events/window-onerror5-expected.txt
deleted file mode 100644
index 3ec7f5e..0000000
--- a/LayoutTests/fast/events/window-onerror5-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Test that window.onerror is invoked for syntax error in eval. You should see a log record if window.onerror is working properly for this test.Bug 8519.
-
-Error caught successfully: SyntaxError: Parse error File: undefined Line: 1
-
diff --git a/LayoutTests/fast/events/window-onerror5.html b/LayoutTests/fast/events/window-onerror5.html
deleted file mode 100644
index 932d438..0000000
--- a/LayoutTests/fast/events/window-onerror5.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-function test1()
-{
-    window.onerror = function (error, url, line) {
-        url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-        log("Error caught successfully: " + error + "\nFile: " + url + "\nLine: " + line)
-        return false;
-    };
-    eval("a(");
-}
-</script>
-<body onload="test1();">
-<p>Test that window.onerror is invoked for syntax error in eval. You should see a log record if window.onerror is working properly for this test.<a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<hr>
-<div id='console'></div>
-</body>
diff --git a/LayoutTests/fast/events/window-onerror6-expected.txt b/LayoutTests/fast/events/window-onerror6-expected.txt
deleted file mode 100644
index e7c27bb..0000000
--- a/LayoutTests/fast/events/window-onerror6-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Test that syntax error will be reported to the window.onerror handler. Bug 8519.
-
-Main frame window.onerror: SyntaxError: Parse error at window-onerror6.html:22
-
diff --git a/LayoutTests/fast/events/window-onerror6.html b/LayoutTests/fast/events/window-onerror6.html
deleted file mode 100644
index 1978436..0000000
--- a/LayoutTests/fast/events/window-onerror6.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<html>
-<body>
-<p>Test that syntax error will be reported to the window.onerror handler. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<div id="console"></div>
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-window.onerror = function(msg, url, line)
-{
-    url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-    log("Main frame window.onerror: " + msg + " at " + url + ":" + line);
-    return false;
-}
-</script>
-<script>
-
-a) // syntax error
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/events/window-onerror7-expected.txt b/LayoutTests/fast/events/window-onerror7-expected.txt
deleted file mode 100644
index 5d22e7e..0000000
--- a/LayoutTests/fast/events/window-onerror7-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-CONSOLE MESSAGE: line 20: Error: Original error
-CONSOLE MESSAGE: line 17: Error: Nested error
-Test that exception in window.onerror won't lead to recursive window.onerror call. Bug 8519.
-
-Main frame window.onerror: Error: Original error at window-onerror7.html:20
-
diff --git a/LayoutTests/fast/events/window-onerror7.html b/LayoutTests/fast/events/window-onerror7.html
deleted file mode 100644
index f665686..0000000
--- a/LayoutTests/fast/events/window-onerror7.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<html>
-<body>
-<p>Test that exception in window.onerror won't lead to recursive window.onerror call. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<div id="console"></div>
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-window.onerror = function(msg, url, line)
-{
-    url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-    log("Main frame window.onerror: " + msg + " at " + url + ":" + line);
-    throw new Error("Nested error");
-}
-
-throw new Error("Original error");
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/events/window-onerror8-expected.txt b/LayoutTests/fast/events/window-onerror8-expected.txt
deleted file mode 100644
index efc6308..0000000
--- a/LayoutTests/fast/events/window-onerror8-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Test that window.onerror is called on window object. Bug 8519.
-
-Main frame window.onerror: 2010 at undefined:0
-PASSED: this === window
-
diff --git a/LayoutTests/fast/events/window-onerror8.html b/LayoutTests/fast/events/window-onerror8.html
deleted file mode 100644
index bade538..0000000
--- a/LayoutTests/fast/events/window-onerror8.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<html>
-<body>
-<p>Test that window.onerror is called on window object. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<div id="console"></div>
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-window.onerror = function(msg, url, line)
-{
-    url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-    log("Main frame window.onerror: " + msg + " at " + url + ":" + line);
-    if (this === window) 
-        log("PASSED: this === window");
-    else
-        log("FAILED: this === window");
-    return false;
-}
-
-throw 2010;
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/events/window-onerror9-expected.txt b/LayoutTests/fast/events/window-onerror9-expected.txt
deleted file mode 100644
index 94316d3..0000000
--- a/LayoutTests/fast/events/window-onerror9-expected.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Test that when window.onerror handler is called, window.event is the corresponding ErrorEvent object. Bug 8519.
-
-Main frame window.onerror: Error: 2010 at window-onerror9.html:31
-window.event.type = error
-window.event.message = Error: 2010
-window.event.filename = window-onerror9.html
-window.event.lineno = 31
-
diff --git a/LayoutTests/fast/events/window-onerror9.html b/LayoutTests/fast/events/window-onerror9.html
deleted file mode 100644
index 1086ace..0000000
--- a/LayoutTests/fast/events/window-onerror9.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<html>
-<body>
-<p>Test that when window.onerror handler is called, window.event is the corresponding ErrorEvent object. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
-<div id="console"></div>
-<script>
-if (window.layoutTestController) {
-    layoutTestController.dumpAsText();
-    layoutTestController.waitUntilDone();
-}
-
-function log(msg) {
-    document.getElementById("console").innerHTML += msg + "<br>";
-}
-
-function lastPathComponent(url) {
-    return url ? url.match( /[^\/]+\/?$/ )[0] : url;
-}
-
-window.onerror = function(msg, url, line)
-{
-    log("Main frame window.onerror: " + msg + " at " + lastPathComponent(url) + ":" + line);
-    log("window.event.type = " + window.event.type);
-    log("window.event.message = " + window.event.message);
-    log("window.event.filename = " + lastPathComponent(window.event.filename));
-    log("window.event.lineno = " + window.event.lineno);
-    if (window.layoutTestController)
-        layoutTestController.notifyDone();
-    return false;
-}
-
-throw new Error(2010);
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/workers/worker-script-error-expected.txt b/LayoutTests/fast/workers/worker-script-error-expected.txt
index 4041640..10ab049 100644
--- a/LayoutTests/fast/workers/worker-script-error-expected.txt
+++ b/LayoutTests/fast/workers/worker-script-error-expected.txt
@@ -4,10 +4,10 @@ Test Worker script error handling functionality. Should print a series of PASS m
 PASS: onerror invoked for a script that has invalid syntax.
 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1.
 PASS: event listener invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1.
-PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 7.
 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: bar' at line 3.
 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 7.
 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 7.
+PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 7.
 PASS: message received from WorkerGlobalScope.onerror: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 7.
 PASS: onerror invoked for an exception in setTimeout callback.
 DONE
diff --git a/LayoutTests/http/tests/security/resources/onerror-iframe.html b/LayoutTests/http/tests/security/resources/onerror-iframe.html
deleted file mode 100644
index 312fd12..0000000
--- a/LayoutTests/http/tests/security/resources/onerror-iframe.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<script>
-function handleLoad()
-{
-    window.parent.postMessage("IFrameLoaded", "*");
-}
-
-throw "IframeException";
-
-</script>
-<body onload="handleLoad()">
-</body>
diff --git a/LayoutTests/http/tests/security/window-onerror-exception-in-iframe-expected.txt b/LayoutTests/http/tests/security/window-onerror-exception-in-iframe-expected.txt
deleted file mode 100644
index 8b17d92..0000000
--- a/LayoutTests/http/tests/security/window-onerror-exception-in-iframe-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-CONSOLE MESSAGE: line 0: IframeException
-Test that exceptions in iframe are not reported to the main frame window.onerror handler. window.onerror should print exactly one line.
-
-Main frame window.onerror: MainFrameException at undefined:0
-DONE
-
diff --git a/LayoutTests/http/tests/security/window-onerror-exception-in-iframe.html b/LayoutTests/http/tests/security/window-onerror-exception-in-iframe.html
deleted file mode 100644
index 0904e39..0000000
--- a/LayoutTests/http/tests/security/window-onerror-exception-in-iframe.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<html>
-<body>
-<p>Test that exceptions in iframe are not reported to the main frame window.onerror handler.
-window.onerror should print exactly one line.</p>
-<div id="result"></div>
-<script>
-if (window.layoutTestController) {
-    layoutTestController.dumpAsText();
-    layoutTestController.waitUntilDone();
-}
-
-function log(msg) {
-    document.getElementById("result").innerHTML += msg + "<br>";
-}
-
-window.onerror = function(msg, url, line)
-{
-    url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
-    log("Main frame window.onerror: " + msg + " at " + url + ":" + line);
-    return false;
-}
-
-function receiveMessage(event) {
-    if (event.data === "IFrameLoaded") {
-        log("DONE");
-        if (window.layoutTestController)
-            layoutTestController.notifyDone();
-    } else
-        log("FAIL " + event.data);
-}
-
-window.addEventListener("message", receiveMessage, false);
-
-throw "MainFrameException";
-
-</script>
-<iframe src="http://localhost:8000/security/resources/onerror-iframe.html"/>
-</body>
-</html>
diff --git a/LayoutTests/platform/chromium-win/fast/workers/worker-script-error-expected.txt b/LayoutTests/platform/chromium-win/fast/workers/worker-script-error-expected.txt
index ef0a391..fdf660b 100644
--- a/LayoutTests/platform/chromium-win/fast/workers/worker-script-error-expected.txt
+++ b/LayoutTests/platform/chromium-win/fast/workers/worker-script-error-expected.txt
@@ -3,10 +3,10 @@ Test Worker script error handling functionality. Should print a series of PASS m
 PASS: onerror invoked for a script that has invalid syntax.
 PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 1.
 PASS: event listener invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 1.
-PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 7.
 PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: bar is not defined' at line 3.
 PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 7.
 PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 7.
+PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 7.
 PASS: message received from WorkerGlobalScope.onerror: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 7.
 PASS: onerror invoked for an exception in setTimeout callback.
 DONE
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror1-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror1-expected.txt
deleted file mode 100644
index 65b624b..0000000
--- a/LayoutTests/platform/chromium/fast/events/window-onerror1-expected.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-This page tests setting onerror handlers through the DOM. If it passes, you will see "PASS" messages below.Bug 8519.
-
-PASS: caught global error: Uncaught ReferenceError: hahaha_good_luck_finding_me is not defined at window-onerror1.html:25
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror10-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror10-expected.txt
deleted file mode 100644
index b3d2d39..0000000
--- a/LayoutTests/platform/chromium/fast/events/window-onerror10-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Test that "error" event listener added with window.addEventListener is invoked for uncaucht exceptions. Bug 8519.
-
-event passed to the listener is the same as window.event: true
-Event details:
-type: error
-phase: 2
-currentTarget is the global object: true
-message: Uncaught Error: My fault.
-filename: window-onerror10.html
-lineno: 29
-
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror11-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror11-expected.txt
deleted file mode 100644
index 92e3cf5..0000000
--- a/LayoutTests/platform/chromium/fast/events/window-onerror11-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Test that window.onerror is called on window object. Bug 8519.
-
-Main frame window.onerror: Uncaught Error: An exception at window-onerror.js:2
-
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror2-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror2-expected.txt
deleted file mode 100644
index f7b1621..0000000
--- a/LayoutTests/platform/chromium/fast/events/window-onerror2-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Test that uncaught exceptions will be reported to the window.onerror handler. Bug 8519.
-
-Main frame window.onerror: Uncaught Error: Inline script exception at window-onerror2.html:35
-Main frame window.onerror: Uncaught Exception in onload at window-onerror2.html:2
-Main frame window.onerror: Uncaught Error: Exception in setTimeout at window-onerror2.html:29
-
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror3-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror3-expected.txt
deleted file mode 100644
index a1b8bd5..0000000
--- a/LayoutTests/platform/chromium/fast/events/window-onerror3-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-You should see a message if window.onerror is working properly for this test.Bug 8519.
-
-Error caught successfully: Uncaught ReferenceError: unknownObject is not defined File: window-onerror3.html Line: 16
-
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror4-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror4-expected.txt
deleted file mode 100644
index 50f09e0..0000000
--- a/LayoutTests/platform/chromium/fast/events/window-onerror4-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-You should see a log record if window.onerror is working properly for this test.Bug 8519.
-
-Error caught successfully: Uncaught ReferenceError: Invalid left-hand side in assignment File: window-onerror4.html Line: 1
-
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror5-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror5-expected.txt
deleted file mode 100644
index e45369e..0000000
--- a/LayoutTests/platform/chromium/fast/events/window-onerror5-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Test that window.onerror is invoked for syntax error in eval. You should see a log record if window.onerror is working properly for this test.Bug 8519.
-
-Error caught successfully: Uncaught SyntaxError: Unexpected end of input File: window-onerror5.html Line: 1
-
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror6-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror6-expected.txt
deleted file mode 100644
index 18ed81a..0000000
--- a/LayoutTests/platform/chromium/fast/events/window-onerror6-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Test that syntax error will be reported to the window.onerror handler. Bug 8519.
-
-Main frame window.onerror: Uncaught SyntaxError: Unexpected token ) at window-onerror6.html:22
-
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror7-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror7-expected.txt
deleted file mode 100644
index 23d0407..0000000
--- a/LayoutTests/platform/chromium/fast/events/window-onerror7-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-CONSOLE MESSAGE: line 20: Uncaught Error: Original error
-CONSOLE MESSAGE: line 17: Uncaught Error: Nested error
-Test that exception in window.onerror won't lead to recursive window.onerror call. Bug 8519.
-
-Main frame window.onerror: Uncaught Error: Original error at window-onerror7.html:20
-
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror8-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror8-expected.txt
deleted file mode 100644
index 13f2b32..0000000
--- a/LayoutTests/platform/chromium/fast/events/window-onerror8-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Test that window.onerror is called on window object. Bug 8519.
-
-Main frame window.onerror: Uncaught 2010 at window-onerror8.html:24
-PASSED: this === window
-
diff --git a/LayoutTests/platform/chromium/fast/events/window-onerror9-expected.txt b/LayoutTests/platform/chromium/fast/events/window-onerror9-expected.txt
deleted file mode 100644
index 1677e50..0000000
--- a/LayoutTests/platform/chromium/fast/events/window-onerror9-expected.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Test that when window.onerror handler is called, window.event is the corresponding ErrorEvent object. Bug 8519.
-
-Main frame window.onerror: Uncaught Error: 2010 at window-onerror9.html:31
-window.event.type = error
-window.event.message = Uncaught Error: 2010
-window.event.filename = window-onerror9.html
-window.event.lineno = 31
-
diff --git a/LayoutTests/platform/chromium/http/tests/security/window-onerror-exception-in-iframe-expected.txt b/LayoutTests/platform/chromium/http/tests/security/window-onerror-exception-in-iframe-expected.txt
deleted file mode 100644
index 9e9c2ea..0000000
--- a/LayoutTests/platform/chromium/http/tests/security/window-onerror-exception-in-iframe-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-CONSOLE MESSAGE: line 7: Uncaught IframeException
-Test that exceptions in iframe are not reported to the main frame window.onerror handler. window.onerror should print exactly one line.
-
-Main frame window.onerror: Uncaught MainFrameException at window-onerror-exception-in-iframe.html:34
-DONE
-
diff --git a/LayoutTests/platform/chromium/userscripts/window-onerror-for-isolated-world-1-expected.txt b/LayoutTests/platform/chromium/userscripts/window-onerror-for-isolated-world-1-expected.txt
deleted file mode 100644
index 2a3d068..0000000
--- a/LayoutTests/platform/chromium/userscripts/window-onerror-for-isolated-world-1-expected.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-Test that window.onerror and "error" event listeners from main world are invoked for uncaught exceptions in user scripts running in isolate worlds as well as for exceptions in the main world.Bug 8519.
-
-Main world window.onerror: Uncaught Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:54
-Main world error event listener: Uncaught Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:54
-Main world window.onerror: Uncaught Error: Error in user script inline script. at :12
-Main world error event listener: Uncaught Error: Error in user script inline script. at :12
-Main world window.onerror: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:46
-Main world error event listener: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:46
-Main world window.onerror: Uncaught Error: Error in user script load handler. at :4
-Main world error event listener: Uncaught Error: Error in user script load handler. at :4
-Main world window.onerror: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:51
-Main world error event listener: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:51
-Main world window.onerror: Uncaught Error: Error in user script setTimeout callback. at :9
-Main world error event listener: Uncaught Error: Error in user script setTimeout callback. at :9
diff --git a/LayoutTests/platform/chromium/userscripts/window-onerror-for-isolated-world-2-expected.txt b/LayoutTests/platform/chromium/userscripts/window-onerror-for-isolated-world-2-expected.txt
deleted file mode 100644
index 93994db..0000000
--- a/LayoutTests/platform/chromium/userscripts/window-onerror-for-isolated-world-2-expected.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-CONSOLE MESSAGE: line 30: Uncaught Error: Error in main world inline script.
-Test that window.onerror and "error" event listeners from isolated world are invoked for uncaught exceptions in user scripts running in isolate worlds as well as for exceptions in the main world.Bug 8519.
-
-user script window.onerror: Uncaught Error: Error in user script inline script. at :33
-user script error event listener: Uncaught Error: Error in user script inline script. at :33
-user script window.onerror: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:23
-user script error event listener: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:23
-user script window.onerror: Uncaught Error: Error in user script load handler. at :26
-user script error event listener: Uncaught Error: Error in user script load handler. at :26
-user script window.onerror: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:27
-user script error event listener: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:27
-user script window.onerror: Uncaught Error: Error in user script setTimeout callback. at :30
-user script error event listener: Uncaught Error: Error in user script setTimeout callback. at :30
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index 0f9106b..2b45241 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -4709,8 +4709,6 @@ userscripts/user-script-plugin-document.html
 userscripts/user-script-top-frame-only.html
 userscripts/user-script-video-document.html
 userscripts/user-style-top-frame-only.html
-userscripts/window-onerror-for-isolated-world-1.html
-userscripts/window-onerror-for-isolated-world-2.html
 
 # XHR sends sometimes yield null bytes sent instead of 0.
 http/tests/xmlhttprequest/workers/shared-worker-methods.html
diff --git a/LayoutTests/userscripts/window-onerror-for-isolated-world-1-expected.txt b/LayoutTests/userscripts/window-onerror-for-isolated-world-1-expected.txt
deleted file mode 100644
index 6895c41..0000000
--- a/LayoutTests/userscripts/window-onerror-for-isolated-world-1-expected.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-Test that window.onerror and "error" event listeners from main world are invoked for uncaught exceptions in user scripts running in isolate worlds as well as for exceptions in the main world.Bug 8519.
-
-Main world window.onerror: Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:54
-Main world error event listener: Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:54
-Main world window.onerror: Error: Error in user script inline script. at undefined:11
-Main world error event listener: Error: Error in user script inline script. at undefined:11
-Main world window.onerror: Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:46
-Main world error event listener: Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:46
-Main world window.onerror: Error: Error in user script load handler. at undefined:3
-Main world error event listener: Error: Error in user script load handler. at undefined:3
-Main world window.onerror: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:51
-Main world error event listener: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:51
-Main world window.onerror: Error: Error in user script setTimeout callback. at undefined:8
-Main world error event listener: Error: Error in user script setTimeout callback. at undefined:8
diff --git a/LayoutTests/userscripts/window-onerror-for-isolated-world-1.html b/LayoutTests/userscripts/window-onerror-for-isolated-world-1.html
deleted file mode 100644
index 3c6bac2..0000000
--- a/LayoutTests/userscripts/window-onerror-for-isolated-world-1.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-</head>
-<body>
-<p>Test that window.onerror and "error" event listeners from main world are
-invoked for uncaught exceptions in user scripts running in isolate worlds as
-well as for exceptions in the main world.<a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519.</a>
-</p>
-<div id="console"></div>
-<script>
-
-var expectedRecordCount = 12;
-var recordCount = 0;
-document.getElementById("console").addEventListener("DOMNodeInserted", function(e) {
-    recordCount++;
-    if (recordCount === expectedRecordCount && window.layoutTestController)
-        layoutTestController.notifyDone();
-}, false);
-
-function log(msg) {
-    var record = document.createElement("div");
-    record.innerHTML = msg;
-    document.getElementById("console").appendChild(record);
-}
-
-function lastUrlComponent(url) {
-    return url ? url.match( /[^\/]+\/?$/ )[0] : url;
-}
-
-window.onerror = function(msg, url, line)
-{
-    log("Main world window.onerror: " + msg + " at " + lastUrlComponent(url) + ":" + line);
-    return false;
-}
-
-window.addEventListener("error", function(e)
-{
-    var url = lastUrlComponent(e.filename);
-    log("Main world error event listener: " + e.message + " at " + url + ":" + e.lineno);
-}, false);
-
-var exceptions = function(isolatedWorld)
-{
-    window.addEventListener("load", function(e) {
-        throw new Error("Error in " + isolatedWorld + " load handler.");
-    }, false);
-
-
-    setTimeout(function() {
-        throw new Error("Error in " + isolatedWorld + " setTimeout callback.");
-    }, 0);
-
-    throw new Error("Error in "+ isolatedWorld + " inline script.");
-}
-
-if (window.layoutTestController) {
-    layoutTestController.dumpAsText();
-    layoutTestController.waitUntilDone();
-    layoutTestController.addUserScript("(" + exceptions + ")('user script')", false, true);
-}
-
-exceptions("main world");
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/userscripts/window-onerror-for-isolated-world-2-expected.txt b/LayoutTests/userscripts/window-onerror-for-isolated-world-2-expected.txt
deleted file mode 100644
index b909a99..0000000
--- a/LayoutTests/userscripts/window-onerror-for-isolated-world-2-expected.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-CONSOLE MESSAGE: line 30: Error: Error in main world inline script.
-Test that window.onerror and "error" event listeners from isolated world are invoked for uncaught exceptions in user scripts running in isolate worlds as well as for exceptions in the main world.Bug 8519.
-
-user script window.onerror: Error: Error in user script inline script. at undefined:31
-user script error event listener: Error: Error in user script inline script. at undefined:31
-user script window.onerror: Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:23
-user script error event listener: Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:23
-user script window.onerror: Error: Error in user script load handler. at undefined:24
-user script error event listener: Error: Error in user script load handler. at undefined:24
-user script window.onerror: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:27
-user script error event listener: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:27
-user script window.onerror: Error: Error in user script setTimeout callback. at undefined:28
-user script error event listener: Error: Error in user script setTimeout callback. at undefined:28
diff --git a/LayoutTests/userscripts/window-onerror-for-isolated-world-2.html b/LayoutTests/userscripts/window-onerror-for-isolated-world-2.html
deleted file mode 100644
index a6ec699..0000000
--- a/LayoutTests/userscripts/window-onerror-for-isolated-world-2.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-</head>
-<body>
-<p>Test that window.onerror and "error" event listeners from isolated world are
-invoked for uncaught exceptions in user scripts running in isolate worlds as
-well as for exceptions in the main world.<a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519.</a>
-</p>
-<div id="console"></div>
-<script>
-
-var expectedRecordCount = 10;
-var recordCount = 0;
-document.getElementById("console").addEventListener("DOMNodeInserted", function(e) {
-    if (++recordCount === expectedRecordCount && window.layoutTestController)
-        layoutTestController.notifyDone();
-}, false);
-
-var throwExceptions = function(isolatedWorld)
-{
-    window.addEventListener("load", function(e) {
-        throw new Error("Error in " + isolatedWorld + " load handler.");
-    }, false);
-
-    setTimeout(function() {
-        throw new Error("Error in " + isolatedWorld + " setTimeout callback.");
-    }, 0);
-    
-    throw new Error("Error in "+ isolatedWorld + " inline script.");
-};
-
-var errorHandlers = function(isolatedWorld)
-{
-    function lastUrlComponent(url) {
-        return url ? url.match( /[^\/]+\/?$/ )[0] : url;
-    }
-
-    function log(msg) {
-        var record = document.createElement("div");
-        record.innerHTML = msg;
-        document.getElementById("console").appendChild(record);
-    }
-
-    window.onerror = function(msg, url, line) {
-        log(isolatedWorld + " window.onerror: " + msg + " at " + lastUrlComponent(url) + ":" + line, "*");
-        return false;
-    }
-
-    window.addEventListener("error", function(e) {
-        var url = lastUrlComponent(e.filename);
-        log(isolatedWorld + " error event listener: " + e.message + " at " + url + ":" + e.lineno, "*");
-        e.preventDefault();
-    }, false);
-};
-
-if (window.layoutTestController) {
-    layoutTestController.dumpAsText();
-    layoutTestController.waitUntilDone();
-    layoutTestController.addUserScript("(" + errorHandlers + ")('user script'); (" + throwExceptions + ")('user script')", false, true);
-}
-
-throwExceptions("main world");
-
-</script>
-</body>
-</html>
diff --git a/WebCore/Android.jscbindings.mk b/WebCore/Android.jscbindings.mk
index e7fd2fc..653dfec 100644
--- a/WebCore/Android.jscbindings.mk
+++ b/WebCore/Android.jscbindings.mk
@@ -102,7 +102,6 @@ LOCAL_SRC_FILES += \
 	bindings/js/JSDeviceOrientationEventCustom.cpp \
 	bindings/js/JSDocumentCustom.cpp \
 	bindings/js/JSElementCustom.cpp \
-	bindings/js/JSErrorHandler.cpp \
 	bindings/js/JSEventCustom.cpp \
 	bindings/js/JSEventListener.cpp \
 	bindings/js/JSEventTarget.cpp \
@@ -171,6 +170,7 @@ LOCAL_SRC_FILES += \
 	bindings/js/JSWebKitPointCustom.cpp \
 	bindings/js/JSWorkerContextBase.cpp \
 	bindings/js/JSWorkerContextCustom.cpp \
+	bindings/js/JSWorkerContextErrorHandler.cpp \
 	bindings/js/JSWorkerCustom.cpp \
 	bindings/js/JSXMLHttpRequestCustom.cpp \
 	bindings/js/JSXMLHttpRequestUploadCustom.cpp \
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index e3ffc38..2b0ee30 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -634,7 +634,6 @@ SET(WebCore_SOURCES
     bindings/js/JSDeviceOrientationEventCustom.cpp
     bindings/js/JSDocumentCustom.cpp
     bindings/js/JSElementCustom.cpp
-    bindings/js/JSErrorHandler.cpp
     bindings/js/JSEventCustom.cpp
     bindings/js/JSEventListener.cpp
     bindings/js/JSEventSourceCustom.cpp
@@ -704,6 +703,7 @@ SET(WebCore_SOURCES
     bindings/js/JSWebSocketCustom.cpp
     bindings/js/JSWorkerContextBase.cpp
     bindings/js/JSWorkerContextCustom.cpp
+    bindings/js/JSWorkerContextErrorHandler.cpp
     bindings/js/JSWorkerCustom.cpp
     bindings/js/JSXMLHttpRequestCustom.cpp
     bindings/js/JSXMLHttpRequestUploadCustom.cpp
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index bdaa84c..d1ace3c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,75 @@
+2010-12-13  Yury Semikhatsky  <yurys at chromium.org>
+
+        Unreviewed. Rollout 73914, 73915, 73917, 73920 and 73921.
+
+        REGRESSION(r73914): "Chromium page_cycler_morejs fails" (Requested by yurys on #webkit).
+        https://bugs.webkit.org/show_bug.cgi?id=50950
+
+        * Android.jscbindings.mk:
+        * CMakeLists.txt:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.order:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSBindingsAllInOne.cpp:
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::reportException):
+        * bindings/js/JSWorkerContextErrorHandler.cpp: Renamed from WebCore/bindings/js/JSErrorHandler.cpp.
+        (WebCore::JSWorkerContextErrorHandler::JSWorkerContextErrorHandler):
+        (WebCore::JSWorkerContextErrorHandler::~JSWorkerContextErrorHandler):
+        (WebCore::JSWorkerContextErrorHandler::handleEvent):
+        * bindings/js/JSWorkerContextErrorHandler.h: Renamed from WebCore/bindings/js/JSErrorHandler.h.
+        (WebCore::JSWorkerContextErrorHandler::create):
+        (WebCore::createJSWorkerContextErrorHandler):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/V8ConsoleMessage.cpp:
+        (WebCore::V8ConsoleMessage::dispatchNow):
+        (WebCore::V8ConsoleMessage::handler):
+        * bindings/v8/V8ConsoleMessage.h:
+        * bindings/v8/V8WindowErrorHandler.cpp: Removed.
+        * bindings/v8/V8WindowErrorHandler.h: Removed.
+        * bindings/v8/WorkerContextExecutionProxy.cpp:
+        (WebCore::v8MessageHandler):
+        * bindings/v8/WorkerScriptController.cpp:
+        (WebCore::WorkerScriptController::evaluate):
+        * dom/Document.cpp:
+        (WebCore::Document::reportException):
+        (WebCore::Document::addMessage):
+        * dom/Document.h:
+        * dom/ErrorEvent.cpp:
+        * dom/ErrorEvent.h:
+        * dom/Event.cpp:
+        * dom/Event.h:
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::ScriptExecutionContext):
+        * dom/ScriptExecutionContext.h:
+        * websockets/WebSocket.cpp:
+        (WebCore::WebSocket::connect):
+        * websockets/WebSocketChannel.cpp:
+        (WebCore::WebSocketChannel::didOpen):
+        (WebCore::WebSocketChannel::appendToBuffer):
+        * websockets/WebSocketHandshake.cpp:
+        (WebCore::WebSocketHandshake::readServerHandshake):
+        (WebCore::WebSocketHandshake::readStatusLine):
+        (WebCore::WebSocketHandshake::readHTTPHeaders):
+        (WebCore::WebSocketHandshake::checkResponseHeaders):
+        * workers/DefaultSharedWorkerRepository.cpp:
+        (WebCore::postExceptionTask):
+        (WebCore::postConsoleMessageTask):
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::WorkerContext):
+        (WebCore::WorkerContext::reportException):
+        (WebCore::WorkerContext::addMessage):
+        * workers/WorkerContext.h:
+        * workers/WorkerMessagingProxy.cpp:
+        (WebCore::WorkerExceptionTask::performTask):
+        (WebCore::postConsoleMessageTask):
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::reportUnsafeUsage):
+
 2010-12-13  Antti Koivisto  <antti at apple.com>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index dcbe391..4d95df7 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -773,8 +773,6 @@ webcore_sources += \
 	WebCore/bindings/js/JSElementCustom.cpp \
 	WebCore/bindings/js/JSEntryCustom.cpp \
 	WebCore/bindings/js/JSEntrySyncCustom.cpp \
-	WebCore/bindings/js/JSErrorHandler.cpp \
-	WebCore/bindings/js/JSErrorHandler.h \
 	WebCore/bindings/js/JSEventCustom.cpp \
 	WebCore/bindings/js/JSEventListener.cpp \
 	WebCore/bindings/js/JSEventListener.h \
@@ -872,6 +870,8 @@ webcore_sources += \
 	WebCore/bindings/js/JSWorkerContextBase.cpp \
 	WebCore/bindings/js/JSWorkerContextBase.h \
 	WebCore/bindings/js/JSWorkerContextCustom.cpp \
+	WebCore/bindings/js/JSWorkerContextErrorHandler.cpp \
+	WebCore/bindings/js/JSWorkerContextErrorHandler.h \
 	WebCore/bindings/js/JSWorkerCustom.cpp \
 	WebCore/bindings/js/JSXMLHttpRequestCustom.cpp \
 	WebCore/bindings/js/JSXMLHttpRequestUploadCustom.cpp \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 237da0f..00f719b 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -625,8 +625,6 @@
             'bindings/js/JSElementCustom.cpp',
             'bindings/js/JSEntryCustom.cpp',
             'bindings/js/JSEntrySyncCustom.cpp',
-            'bindings/js/JSErrorHandler.cpp',
-            'bindings/js/JSErrorHandler.h',
             'bindings/js/JSEventCustom.cpp',
             'bindings/js/JSEventListener.cpp',
             'bindings/js/JSEventListener.h',
@@ -724,6 +722,8 @@
             'bindings/js/JSWorkerContextBase.cpp',
             'bindings/js/JSWorkerContextBase.h',
             'bindings/js/JSWorkerContextCustom.cpp',
+            'bindings/js/JSWorkerContextErrorHandler.cpp',
+            'bindings/js/JSWorkerContextErrorHandler.h',
             'bindings/js/JSWorkerCustom.cpp',
             'bindings/js/JSXMLHttpRequestCustom.cpp',
             'bindings/js/JSXMLHttpRequestUploadCustom.cpp',
@@ -986,8 +986,6 @@
             'bindings/v8/V8Proxy.h',
             'bindings/v8/V8Utilities.cpp',
             'bindings/v8/V8Utilities.h',
-            'bindings/v8/V8WindowErrorHandler.cpp',
-            'bindings/v8/V8WindowErrorHandler.h',
             'bindings/v8/V8WorkerContextErrorHandler.cpp',
             'bindings/v8/V8WorkerContextErrorHandler.h',
             'bindings/v8/V8WorkerContextEventListener.cpp',
diff --git a/WebCore/WebCore.order b/WebCore/WebCore.order
index 2049fe1..0fdabb1 100644
--- a/WebCore/WebCore.order
+++ b/WebCore/WebCore.order
@@ -25209,9 +25209,13 @@ __ZN7WebCore15JSWorkerContext10setTimeoutEPN3JSC9ExecStateERKNS1_7ArgListE
 __ZN7WebCore13WorkerContext10setTimeoutEPNS_15ScheduledActionEi
 __ZN7WebCore17WorkerSharedTimer11setFireTimeEd
 __ZN7WebCore15ScheduledAction7executeEPNS_13WorkerContextE
+__ZN7WebCore27JSWorkerContextErrorHandlerC1EPN3JSC8JSObjectES3_bPNS_15DOMWrapperWorldE
+__ZN7WebCore27JSWorkerContextErrorHandlerC2EPN3JSC8JSObjectES3_bPNS_15DOMWrapperWorldE
 __ZN7WebCore10ErrorEventC1ERKNS_6StringES3_j
 __ZN7WebCore10ErrorEventC2ERKNS_6StringES3_j
+__ZN7WebCore27JSWorkerContextErrorHandler11handleEventEPNS_22ScriptExecutionContextEPNS_5EventE
 __ZN7WebCore10ErrorEventD0Ev
+__ZN7WebCore27JSWorkerContextErrorHandlerD0Ev
 __ZN7WebCore17jsWorkerOnmessageEPN3JSC9ExecStateENS0_7JSValueERKNS0_10IdentifierE
 __ZN7WebCore34jsWorkerPrototypeFunctionTerminateEPN3JSC9ExecStateEPNS0_8JSObjectENS0_7JSValueERKNS0_7ArgListE
 __ZThn8_N7WebCore20WorkerMessagingProxy19workerContextClosedEv
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 64dd94d..11bf514 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -385,7 +385,6 @@ v8 {
         bindings/v8/V8NodeFilterCondition.cpp \
         bindings/v8/V8Proxy.cpp \
         bindings/v8/V8Utilities.cpp \
-        bindings/v8/V8WindowErrorHandler.cpp \
         bindings/v8/V8WorkerContextEventListener.cpp \
         bindings/v8/WorkerContextExecutionProxy.cpp \
         bindings/v8/WorkerScriptController.cpp \
@@ -530,7 +529,6 @@ v8 {
         bindings/js/JSDeviceOrientationEventCustom.cpp \
         bindings/js/JSDocumentCustom.cpp \
         bindings/js/JSElementCustom.cpp \
-        bindings/js/JSErrorHandler.cpp \
         bindings/js/JSEventCustom.cpp \
         bindings/js/JSEventListener.cpp \
         bindings/js/JSEventSourceCustom.cpp \
@@ -590,6 +588,7 @@ v8 {
         bindings/js/JSWebKitCSSKeyframesRuleCustom.cpp \
         bindings/js/JSWebKitCSSMatrixCustom.cpp \
         bindings/js/JSWebKitPointCustom.cpp \
+        bindings/js/JSWorkerContextErrorHandler.cpp \
         bindings/js/JSXMLHttpRequestCustom.cpp \
         bindings/js/JSXMLHttpRequestUploadCustom.cpp \
         bindings/js/ScheduledAction.cpp \
@@ -1461,7 +1460,6 @@ v8 {
         bindings/v8/V8NPUtils.h \
         bindings/v8/V8Proxy.h \
         bindings/v8/V8Utilities.h \
-        bindings/v8/V8WindowErrorHandler.h \
         bindings/v8/V8WorkerContextEventListener.h \
         bindings/v8/WorkerContextExecutionProxy.h \
         bindings/v8/WorkerScriptController.h \
@@ -1488,7 +1486,6 @@ v8 {
         bindings/js/JSDOMWindowCustom.h \
         bindings/js/JSDOMWindowShell.h \
         bindings/js/JSDOMWrapper.h \
-        bindings/js/JSErrorHandler.h \
         bindings/js/JSEventListener.h \
         bindings/js/JSEventTarget.h \
         bindings/js/JSHistoryCustom.h \
@@ -1506,6 +1503,7 @@ v8 {
         bindings/js/JSPluginElementFunctions.h \
         bindings/js/JSStorageCustom.h \
         bindings/js/JSWorkerContextBase.h \
+        bindings/js/JSWorkerContextErrorHandler.h \
         bindings/js/JavaScriptCallFrame.h \
         bindings/js/ScheduledAction.h \
         bindings/js/ScriptCachedFrameData.h \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 99ee999..c072d5b 100755
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -57944,114 +57944,6 @@
 						/>
 					</FileConfiguration>
 					<FileConfiguration
-						Name="Debug_Internal|Win32"
-						ExcludedFromBuild="true"
-						>
-						<Tool
-							Name="VCCLCompilerTool"
-						/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Debug_Cairo|Win32"
-						ExcludedFromBuild="true"
-						>
-						<Tool
-							Name="VCCLCompilerTool"
-						/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Release_Cairo|Win32"
-						ExcludedFromBuild="true"
-						>
-						<Tool
-							Name="VCCLCompilerTool"
-						/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Debug_All|Win32"
-						ExcludedFromBuild="true"
-						>
-						<Tool
-							Name="VCCLCompilerTool"
-						/>
-					</FileConfiguration>
-				</File>
-				<File
-					RelativePath="..\bindings\js\JSErrorHandler.cpp"
-					>
-					<FileConfiguration
-						Name="Debug|Win32"
-						ExcludedFromBuild="true"
-						>
-						<Tool
-							Name="VCCLCompilerTool"
-						/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Release|Win32"
-						ExcludedFromBuild="true"
-						>
-						<Tool
-							Name="VCCLCompilerTool"
-						/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Debug_Internal|Win32"
-						ExcludedFromBuild="true"
-						>
-						<Tool
-							Name="VCCLCompilerTool"
-						/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Debug_Cairo|Win32"
-						ExcludedFromBuild="true"
-						>
-						<Tool
-							Name="VCCLCompilerTool"
-						/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Release_Cairo|Win32"
-						ExcludedFromBuild="true"
-						>
-						<Tool
-							Name="VCCLCompilerTool"
-						/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Debug_All|Win32"
-						ExcludedFromBuild="true"
-						>
-						<Tool
-							Name="VCCLCompilerTool"
-						/>
-					</FileConfiguration>
-				</File>
-				<File
-					RelativePath="..\bindings\js\JSErrorHandler.h"
-					>
-				</File>
-				<File
-					RelativePath="..\bindings\js\JSEventCustom.cpp"
-					>
-					<FileConfiguration
-						Name="Debug|Win32"
-						ExcludedFromBuild="true"
-						>
-						<Tool
-							Name="VCCLCompilerTool"
-						/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Release|Win32"
-						ExcludedFromBuild="true"
-						>
-						<Tool
-							Name="VCCLCompilerTool"
-						/>
-					</FileConfiguration>
-					<FileConfiguration
 						Name="Debug_Cairo_CFLite|Win32"
 						ExcludedFromBuild="true"
 						>
@@ -61773,6 +61665,62 @@
 					</FileConfiguration>
 				</File>
 				<File
+					RelativePath="..\bindings\js\JSWorkerContextErrorHandler.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						ExcludedFromBuild="true"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						ExcludedFromBuild="true"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug_Cairo_CFLite|Win32"
+						ExcludedFromBuild="true"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release_Cairo_CFLite|Win32"
+						ExcludedFromBuild="true"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug_All|Win32"
+						ExcludedFromBuild="true"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release_LTCG|Win32"
+						ExcludedFromBuild="true"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\bindings\js\JSWorkerContextErrorHandler.h"
+					>
+				</File>
+				<File
 					RelativePath="..\bindings\js\JSWorkerCustom.cpp"
 					>
 					<FileConfiguration
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index b2cda1e..fa02cc9 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -5559,8 +5559,8 @@
 		F392249D126F11AE00A926D9 /* ScriptCallStackFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = F392249B126F11AE00A926D9 /* ScriptCallStackFactory.h */; };
 		F39BE95B12673BF400E0A674 /* ScriptArguments.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F39BE95912673BF400E0A674 /* ScriptArguments.cpp */; };
 		F39BE95C12673BF400E0A674 /* ScriptArguments.h in Headers */ = {isa = PBXBuildFile; fileRef = F39BE95A12673BF400E0A674 /* ScriptArguments.h */; };
-		F3D461481161D53200CA0D09 /* JSErrorHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3D461461161D53200CA0D09 /* JSErrorHandler.cpp */; };
-		F3D461491161D53200CA0D09 /* JSErrorHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D461471161D53200CA0D09 /* JSErrorHandler.h */; };
+		F3D461481161D53200CA0D09 /* JSWorkerContextErrorHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3D461461161D53200CA0D09 /* JSWorkerContextErrorHandler.cpp */; };
+		F3D461491161D53200CA0D09 /* JSWorkerContextErrorHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D461471161D53200CA0D09 /* JSWorkerContextErrorHandler.h */; };
 		F4EAF4AE10C742B1009100D3 /* OpenTypeSanitizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F4EAF4AC10C742B1009100D3 /* OpenTypeSanitizer.cpp */; };
 		F4EAF4AF10C742B1009100D3 /* OpenTypeSanitizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F4EAF4AD10C742B1009100D3 /* OpenTypeSanitizer.h */; };
 		F55B3DAD1251F12D003EF269 /* BaseTextInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D791251F12D003EF269 /* BaseTextInputType.cpp */; };
@@ -11861,8 +11861,8 @@
 		F392249B126F11AE00A926D9 /* ScriptCallStackFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptCallStackFactory.h; sourceTree = "<group>"; };
 		F39BE95912673BF400E0A674 /* ScriptArguments.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptArguments.cpp; sourceTree = "<group>"; };
 		F39BE95A12673BF400E0A674 /* ScriptArguments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptArguments.h; sourceTree = "<group>"; };
-		F3D461461161D53200CA0D09 /* JSErrorHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSErrorHandler.cpp; sourceTree = "<group>"; };
-		F3D461471161D53200CA0D09 /* JSErrorHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorHandler.h; sourceTree = "<group>"; };
+		F3D461461161D53200CA0D09 /* JSWorkerContextErrorHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerContextErrorHandler.cpp; sourceTree = "<group>"; };
+		F3D461471161D53200CA0D09 /* JSWorkerContextErrorHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorkerContextErrorHandler.h; sourceTree = "<group>"; };
 		F4EAF4AC10C742B1009100D3 /* OpenTypeSanitizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OpenTypeSanitizer.cpp; path = opentype/OpenTypeSanitizer.cpp; sourceTree = "<group>"; };
 		F4EAF4AD10C742B1009100D3 /* OpenTypeSanitizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenTypeSanitizer.h; path = opentype/OpenTypeSanitizer.h; sourceTree = "<group>"; };
 		F523D23B02DE4396018635CA /* HTMLDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLDocument.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -17458,8 +17458,6 @@
 				BCBFB53B0DCD29CF0019B3E5 /* JSDOMWindowShell.h */,
 				BC53DAC611433064000D817E /* JSDOMWrapper.cpp */,
 				65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */,
-				F3D461461161D53200CA0D09 /* JSErrorHandler.cpp */,
-				F3D461471161D53200CA0D09 /* JSErrorHandler.h */,
 				BC60901E0E91B8EC000C68B5 /* JSEventTarget.cpp */,
 				BC60901D0E91B8EC000C68B5 /* JSEventTarget.h */,
 				3314ACE910892086000F0E56 /* JSExceptionBase.cpp */,
@@ -17471,6 +17469,8 @@
 				14CD8D81106B529000A46D23 /* JSSharedWorkerCustom.cpp */,
 				E1C36D320EB0A094007410BC /* JSWorkerContextBase.cpp */,
 				E1C36D330EB0A094007410BC /* JSWorkerContextBase.h */,
+				F3D461461161D53200CA0D09 /* JSWorkerContextErrorHandler.cpp */,
+				F3D461471161D53200CA0D09 /* JSWorkerContextErrorHandler.h */,
 				BCA378BA0D15F64200B793D6 /* ScheduledAction.cpp */,
 				BCA378BB0D15F64200B793D6 /* ScheduledAction.h */,
 				41F1D21E0EF35C2A00DA8753 /* ScriptCachedFrameData.cpp */,
@@ -21136,7 +21136,7 @@
 				E1CAA5C60E8BD23600A73ECA /* JSWorker.h in Headers */,
 				E18256900EF2B02D00933242 /* JSWorkerContext.h in Headers */,
 				E1C36D350EB0A094007410BC /* JSWorkerContextBase.h in Headers */,
-				F3D461491161D53200CA0D09 /* JSErrorHandler.h in Headers */,
+				F3D461491161D53200CA0D09 /* JSWorkerContextErrorHandler.h in Headers */,
 				E1C362EF0EAF2AA9007410BC /* JSWorkerLocation.h in Headers */,
 				E1271A580EEECDE400F61213 /* JSWorkerNavigator.h in Headers */,
 				BC348BD40DB7F804004ABAB9 /* JSXMLHttpRequest.h in Headers */,
@@ -23957,7 +23957,7 @@
 				E182568F0EF2B02D00933242 /* JSWorkerContext.cpp in Sources */,
 				E1C36D340EB0A094007410BC /* JSWorkerContextBase.cpp in Sources */,
 				E18258AC0EF3CD7000933242 /* JSWorkerContextCustom.cpp in Sources */,
-				F3D461481161D53200CA0D09 /* JSErrorHandler.cpp in Sources */,
+				F3D461481161D53200CA0D09 /* JSWorkerContextErrorHandler.cpp in Sources */,
 				E1CA5CBC0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp in Sources */,
 				E1C362F00EAF2AA9007410BC /* JSWorkerLocation.cpp in Sources */,
 				E1271A590EEECDE400F61213 /* JSWorkerNavigator.cpp in Sources */,
diff --git a/WebCore/bindings/js/JSBindingsAllInOne.cpp b/WebCore/bindings/js/JSBindingsAllInOne.cpp
index d2c27a9..7fc5740 100644
--- a/WebCore/bindings/js/JSBindingsAllInOne.cpp
+++ b/WebCore/bindings/js/JSBindingsAllInOne.cpp
@@ -72,7 +72,6 @@
 #include "JSDeviceOrientationEventCustom.cpp"
 #include "JSDocumentCustom.cpp"
 #include "JSElementCustom.cpp"
-#include "JSErrorHandler.cpp"
 #include "JSEventCustom.cpp"
 #include "JSEventListener.cpp"
 #include "JSEventSourceCustom.cpp"
@@ -142,6 +141,7 @@
 #include "JSWebSocketCustom.cpp"
 #include "JSWorkerContextBase.cpp"
 #include "JSWorkerContextCustom.cpp"
+#include "JSWorkerContextErrorHandler.cpp"
 #include "JSWorkerCustom.cpp"
 #include "JSXMLHttpRequestCustom.cpp"
 #include "JSXMLHttpRequestUploadCustom.cpp"
diff --git a/WebCore/bindings/js/JSDOMBinding.cpp b/WebCore/bindings/js/JSDOMBinding.cpp
index 6d3e3c5..267d18a 100644
--- a/WebCore/bindings/js/JSDOMBinding.cpp
+++ b/WebCore/bindings/js/JSDOMBinding.cpp
@@ -55,7 +55,6 @@
 #include "ProcessingInstruction.h"
 #include "RangeException.h"
 #include "ScriptCachedFrameData.h"
-#include "ScriptCallStack.h"
 #include "ScriptController.h"
 #include "Settings.h"
 #include "WebCoreJSClientData.h"
@@ -599,7 +598,7 @@ void reportException(ExecState* exec, JSValue exception)
     if (!scriptExecutionContext)
         return;
 
-    scriptExecutionContext->reportException(ustringToString(errorMessage), lineNumber, ustringToString(exceptionSourceURL), 0);
+    scriptExecutionContext->reportException(ustringToString(errorMessage), lineNumber, ustringToString(exceptionSourceURL));
 }
 
 void reportCurrentException(ExecState* exec)
diff --git a/WebCore/bindings/js/JSErrorHandler.cpp b/WebCore/bindings/js/JSErrorHandler.cpp
deleted file mode 100644
index b6f39c1..0000000
--- a/WebCore/bindings/js/JSErrorHandler.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "JSErrorHandler.h"
-
-#include "ErrorEvent.h"
-#include "Event.h"
-#include "JSEvent.h"
-#include <runtime/JSLock.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSErrorHandler::JSErrorHandler(JSObject* function, JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld)
-    : JSEventListener(function, wrapper, isAttribute, isolatedWorld)
-{
-}
-
-JSErrorHandler::~JSErrorHandler()
-{
-}
-
-void JSErrorHandler::handleEvent(ScriptExecutionContext* scriptExecutionContext, Event* event)
-{
-    ASSERT(scriptExecutionContext);
-    if (!scriptExecutionContext)
-        return;
-
-    ASSERT(event->isErrorEvent());
-    ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);
-
-    JSLock lock(SilenceAssertionsOnly);
-
-    JSObject* jsFunction = this->jsFunction(scriptExecutionContext);
-    if (!jsFunction)
-        return;
-
-    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(scriptExecutionContext, isolatedWorld());
-    if (!globalObject)
-        return;
-
-    ExecState* exec = globalObject->globalExec();
-
-    CallData callData;
-    CallType callType = jsFunction->getCallData(callData);
-
-    if (callType != CallTypeNone) {
-        RefPtr<JSErrorHandler> protectedctor(this);
-
-        Event* savedEvent = globalObject->currentEvent();
-        globalObject->setCurrentEvent(event);
-
-        MarkedArgumentBuffer args;
-        args.append(jsString(exec, errorEvent->message()));
-        args.append(jsString(exec, errorEvent->filename()));
-        args.append(jsNumber(errorEvent->lineno()));
-
-        JSGlobalData& globalData = globalObject->globalData();
-        DynamicGlobalObjectScope globalObjectScope(exec, globalData.dynamicGlobalObject ? globalData.dynamicGlobalObject : globalObject);
-
-        JSValue thisValue = globalObject->toThisObject(exec);
-
-        globalData.timeoutChecker.start();
-        JSValue returnValue = JSC::call(exec, jsFunction, callType, callData, thisValue, args);
-        globalData.timeoutChecker.stop();
-
-        globalObject->setCurrentEvent(savedEvent);
-
-        if (exec->hadException())
-            reportCurrentException(exec);
-        else {
-            bool retvalbool;
-            if (returnValue.getBoolean(retvalbool) && !retvalbool)
-                event->preventDefault();
-        }
-    }
-}
-
-} // namespace WebCore
diff --git a/WebCore/bindings/js/JSErrorHandler.h b/WebCore/bindings/js/JSErrorHandler.h
deleted file mode 100644
index 957fd81..0000000
--- a/WebCore/bindings/js/JSErrorHandler.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef JSErrorHandler_h
-#define JSErrorHandler_h
-
-#include "JSEventListener.h"
-
-namespace WebCore {
-
-class JSErrorHandler : public JSEventListener {
-public:
-    static PassRefPtr<JSErrorHandler> create(JSC::JSObject* listener, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld)
-    {
-        return adoptRef(new JSErrorHandler(listener, wrapper, isAttribute, isolatedWorld));
-    }
-
-    virtual ~JSErrorHandler();
-
-private:
-    JSErrorHandler(JSC::JSObject* function, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld);
-    virtual void handleEvent(ScriptExecutionContext*, Event*);
-};
-
-// Creates a JS EventListener for "onerror" event handler in worker context. It has custom implementation because
-// unlike other event listeners it accepts three parameters.
-inline PassRefPtr<JSErrorHandler> createJSErrorHandler(JSC::ExecState* exec, JSC::JSValue listener, JSC::JSObject* wrapper)
-{
-    if (!listener.isObject())
-        return 0;
-
-    return JSErrorHandler::create(asObject(listener), wrapper, true, currentWorld(exec));
-}
-
-} // namespace WebCore
-
-#endif // JSErrorHandler_h
diff --git a/WebCore/bindings/js/JSWorkerContextErrorHandler.cpp b/WebCore/bindings/js/JSWorkerContextErrorHandler.cpp
new file mode 100644
index 0000000..f7d2b02
--- /dev/null
+++ b/WebCore/bindings/js/JSWorkerContextErrorHandler.cpp
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WORKERS)
+
+#include "JSWorkerContextErrorHandler.h"
+
+#include "ErrorEvent.h"
+#include "Event.h"
+#include "JSEvent.h"
+#include <runtime/JSLock.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSWorkerContextErrorHandler::JSWorkerContextErrorHandler(JSObject* function, JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld)
+    : JSEventListener(function, wrapper, isAttribute, isolatedWorld)
+{
+}
+
+JSWorkerContextErrorHandler::~JSWorkerContextErrorHandler()
+{
+}
+
+void JSWorkerContextErrorHandler::handleEvent(ScriptExecutionContext* scriptExecutionContext, Event* event)
+{
+    ASSERT(scriptExecutionContext);
+    if (!scriptExecutionContext)
+        return;
+
+    JSLock lock(SilenceAssertionsOnly);
+
+    JSObject* jsFunction = this->jsFunction(scriptExecutionContext);
+    if (!jsFunction)
+        return;
+
+    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(scriptExecutionContext, isolatedWorld());
+    if (!globalObject)
+        return;
+
+    ExecState* exec = globalObject->globalExec();
+
+    CallData callData;
+    CallType callType = jsFunction->getCallData(callData);
+
+    if (callType != CallTypeNone) {
+
+        ref();
+
+        Event* savedEvent = globalObject->currentEvent();
+        globalObject->setCurrentEvent(event);
+
+        ASSERT(event->isErrorEvent());
+        ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);
+
+        MarkedArgumentBuffer args;
+        args.append(jsString(exec, errorEvent->message()));
+        args.append(jsString(exec, errorEvent->filename()));
+        args.append(jsNumber(errorEvent->lineno()));
+
+        JSGlobalData& globalData = globalObject->globalData();
+        DynamicGlobalObjectScope globalObjectScope(exec, globalData.dynamicGlobalObject ? globalData.dynamicGlobalObject : globalObject);
+
+        JSValue thisValue = globalObject->toThisObject(exec);
+
+        globalData.timeoutChecker.start();
+        JSValue returnValue = JSC::call(exec, jsFunction, callType, callData, thisValue, args);
+        globalData.timeoutChecker.stop();
+
+        globalObject->setCurrentEvent(savedEvent);
+
+        if (exec->hadException())
+            reportCurrentException(exec);
+        else {
+            bool retvalbool;
+            if (returnValue.getBoolean(retvalbool) && !retvalbool)
+                event->preventDefault();
+        }
+
+        deref();
+    }
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WORKERS)
diff --git a/WebCore/bindings/js/JSWorkerContextErrorHandler.h b/WebCore/bindings/js/JSWorkerContextErrorHandler.h
new file mode 100644
index 0000000..a188299
--- /dev/null
+++ b/WebCore/bindings/js/JSWorkerContextErrorHandler.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef JSWorkerContextErrorHandler_h
+#define JSWorkerContextErrorHandler_h
+
+#include "JSEventListener.h"
+
+namespace WebCore {
+
+class JSWorkerContextErrorHandler : public JSEventListener {
+public:
+    static PassRefPtr<JSWorkerContextErrorHandler> create(JSC::JSObject* listener, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld)
+    {
+        return adoptRef(new JSWorkerContextErrorHandler(listener, wrapper, isAttribute, isolatedWorld));
+    }
+
+    virtual ~JSWorkerContextErrorHandler();
+
+private:
+    JSWorkerContextErrorHandler(JSC::JSObject* function, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld);
+    virtual void handleEvent(ScriptExecutionContext*, Event*);
+};
+
+// Creates a JS EventListener for "onerror" event handler in worker context. It has custom implementation because
+// unlike other event listeners it accepts three parameters.
+inline PassRefPtr<JSWorkerContextErrorHandler> createJSWorkerContextErrorHandler(JSC::ExecState* exec, JSC::JSValue listener, JSC::JSObject* wrapper)
+{
+    if (!listener.isObject())
+        return 0;
+
+    return JSWorkerContextErrorHandler::create(asObject(listener), wrapper, true, currentWorld(exec));
+}
+
+} // namespace WebCore
+
+#endif // JSWorkerContextErrorHandler_h
diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm
index 52a6291..132518f 100644
--- a/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -1709,9 +1709,9 @@ sub GenerateImplementation
                                 push(@implContent, "    JSDOMGlobalObject* globalObject = castedThis->globalObject();\n");
                             }
                             push(@implContent, "    $implClassName* imp = static_cast<$implClassName*>(static_cast<$className*>(thisObject)->impl());\n");
-                            if ((($interfaceName eq "DOMWindow") or ($interfaceName eq "WorkerContext")) and $name eq "onerror") {
-                                $implIncludes{"JSErrorHandler.h"} = 1;
-                                push(@implContent, "    imp->set$implSetterFunctionName(createJSErrorHandler(exec, value, thisObject));\n");
+                            if ($interfaceName eq "WorkerContext" and $name eq "onerror") {
+                                $implIncludes{"JSWorkerContextErrorHandler.h"} = 1;
+                                push(@implContent, "    imp->set$implSetterFunctionName(createJSWorkerContextErrorHandler(exec, value, thisObject));\n");
                             } else {
                                 push(@implContent, GenerateAttributeEventListenerCall($className, $implSetterFunctionName, $windowEventListener));
                             }
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 9093757..d339d6a 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -1001,10 +1001,6 @@ END
                 $implIncludes{"V8EventListenerList.h"} = 1;
                 $implIncludes{"V8WorkerContextErrorHandler.h"} = 1;
                 push(@implContentDecls, "    imp->set$implSetterFunctionName(V8EventListenerList::findOrCreateWrapper<V8WorkerContextErrorHandler>(value, true)");
-            } elsif ($interfaceName eq "DOMWindow" and $attribute->signature->name eq "onerror") {
-                $implIncludes{"V8EventListenerList.h"} = 1;
-                $implIncludes{"V8WindowErrorHandler.h"} = 1;
-                push(@implContentDecls, "    imp->set$implSetterFunctionName(V8EventListenerList::findOrCreateWrapper<V8WindowErrorHandler>(value, true)");
             } else {
                 push(@implContentDecls, "    imp->set$implSetterFunctionName(V8DOMWrapper::getEventListener(value, true, ListenerFindOrCreate)");
             }
diff --git a/WebCore/bindings/v8/V8ConsoleMessage.cpp b/WebCore/bindings/v8/V8ConsoleMessage.cpp
index d92822c..e6871fd 100644
--- a/WebCore/bindings/v8/V8ConsoleMessage.cpp
+++ b/WebCore/bindings/v8/V8ConsoleMessage.cpp
@@ -54,14 +54,7 @@ V8ConsoleMessage::V8ConsoleMessage(const String& string, const String& sourceID,
 
 void V8ConsoleMessage::dispatchNow(Page* page)
 {
-    ASSERT(page);
-
-    // Process any delayed messages to make sure that messages
-    // appear in the right order in the console.
-    processDelayed();
-
-    Console* console = page->mainFrame()->domWindow()->console();
-    console->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, m_string, m_lineNumber, m_sourceID);
+    dispatchNow(page, 0);
 }
 
 void V8ConsoleMessage::dispatchLater()
@@ -112,8 +105,8 @@ void V8ConsoleMessage::handler(v8::Handle<v8::Message> message, v8::Handle<v8::V
     Frame* frame = V8Proxy::retrieveFrameForEnteredContext();
     if (!frame)
         return;
-    Document* document = frame->document();
-    if (!document)
+    Page* page = frame->page();
+    if (!page)
         return;
 
     v8::Handle<v8::String> errorMessageString = message->Get();
@@ -129,7 +122,21 @@ void V8ConsoleMessage::handler(v8::Handle<v8::Message> message, v8::Handle<v8::V
     v8::Handle<v8::Value> resourceName = message->GetScriptResourceName();
     bool useURL = resourceName.IsEmpty() || !resourceName->IsString();
     String resourceNameString = useURL ? frame->document()->url() : toWebCoreString(resourceName);
-    document->reportException(errorMessage, message->GetLineNumber(), resourceNameString, callStack);
+    V8ConsoleMessage consoleMessage(errorMessage, resourceNameString, message->GetLineNumber());
+    consoleMessage.dispatchNow(page, callStack);
+}
+
+void V8ConsoleMessage::dispatchNow(Page* page, PassRefPtr<ScriptCallStack> callStack)
+{
+    ASSERT(page);
+
+    // Process any delayed messages to make sure that messages
+    // appear in the right order in the console.
+    processDelayed();
+
+    Console* console = page->mainFrame()->domWindow()->console();
+    MessageType messageType = callStack ? UncaughtExceptionMessageType : LogMessageType;
+    console->addMessage(JSMessageSource, messageType, ErrorMessageLevel, m_string, m_lineNumber, m_sourceID, callStack);
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/V8ConsoleMessage.h b/WebCore/bindings/v8/V8ConsoleMessage.h
index 6183fc6..97de24f 100644
--- a/WebCore/bindings/v8/V8ConsoleMessage.h
+++ b/WebCore/bindings/v8/V8ConsoleMessage.h
@@ -82,6 +82,8 @@ namespace WebCore {
         const String m_sourceID;
         const unsigned m_lineNumber;
 
+        void dispatchNow(Page*, PassRefPtr<ScriptCallStack>);
+
         // All delayed messages are stored in this vector. If the vector
         // is 0, there are no delayed messages.
         static Vector<V8ConsoleMessage>* m_delayedMessages;
diff --git a/WebCore/bindings/v8/V8WindowErrorHandler.cpp b/WebCore/bindings/v8/V8WindowErrorHandler.cpp
deleted file mode 100755
index a74bad4..0000000
--- a/WebCore/bindings/v8/V8WindowErrorHandler.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "V8WindowErrorHandler.h"
-
-#include "ErrorEvent.h"
-#include "V8Binding.h"
-
-namespace WebCore {
-
-V8WindowErrorHandler::V8WindowErrorHandler(v8::Local<v8::Object> listener, bool isInline, const WorldContextHandle& worldContext)
-    : V8EventListener(listener, isInline, worldContext)
-{
-}
-
-v8::Local<v8::Value> V8WindowErrorHandler::callListenerFunction(ScriptExecutionContext* context, v8::Handle<v8::Value> jsEvent, Event* event)
-{
-    ASSERT(event->isErrorEvent());
-    ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);
-    v8::Local<v8::Object> listener = getListenerObject(context);
-    v8::Local<v8::Value> returnValue;
-    if (!listener.IsEmpty() && listener->IsFunction()) {
-        v8::Local<v8::Function> callFunction = v8::Local<v8::Function>::Cast(listener);
-        v8::Local<v8::Object> thisValue = v8::Context::GetCurrent()->Global();
-        v8::Handle<v8::Value> parameters[3] = { v8String(errorEvent->message()), v8String(errorEvent->filename()), v8::Integer::New(errorEvent->lineno()) };
-        returnValue = callFunction->Call(thisValue, 3, parameters);
-        if (!returnValue.IsEmpty() && returnValue->IsBoolean() && !returnValue->BooleanValue())
-            event->preventDefault();
-    }
-    return returnValue;
-}
-
-} // namespace WebCore
diff --git a/WebCore/bindings/v8/V8WindowErrorHandler.h b/WebCore/bindings/v8/V8WindowErrorHandler.h
deleted file mode 100755
index 167ca0d..0000000
--- a/WebCore/bindings/v8/V8WindowErrorHandler.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef V8WindowErrorHandler_h
-#define V8WindowErrorHandler_h
-
-#include "V8CustomEventListener.h"
-#include <v8.h>
-#include <wtf/PassRefPtr.h>
-
-namespace WebCore {
-
-class V8WindowErrorHandler : public V8EventListener {
-public:
-    static PassRefPtr<V8WindowErrorHandler> create(v8::Local<v8::Object> listener, bool isInline, const WorldContextHandle& worldContext)
-    {
-        return adoptRef(new V8WindowErrorHandler(listener, isInline, worldContext));
-    }
-
-private:
-    V8WindowErrorHandler(v8::Local<v8::Object> listener, bool isInline, const WorldContextHandle& worldContext);
-
-    virtual v8::Local<v8::Value> callListenerFunction(ScriptExecutionContext*, v8::Handle<v8::Value> jsEvent, Event*);
-};
-
-} // namespace WebCore
-
-#endif // V8WindowErrorHandler_h
diff --git a/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp b/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
index eb25814..cefb2fa 100644
--- a/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
+++ b/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
@@ -37,7 +37,6 @@
 
 #include "DedicatedWorkerContext.h"
 #include "Event.h"
-#include "ScriptCallStack.h"
 #include "SharedWorker.h"
 #include "SharedWorkerContext.h"
 #include "V8Binding.h"
@@ -73,7 +72,7 @@ static void v8MessageHandler(v8::Handle<v8::Message> message, v8::Handle<v8::Val
         String errorMessage = toWebCoreString(message->Get());
         int lineNumber = message->GetLineNumber();
         String sourceURL = toWebCoreString(message->GetScriptResourceName());
-        context->reportException(errorMessage, lineNumber, sourceURL, 0);
+        context->reportException(errorMessage, lineNumber, sourceURL);
     }
 
     isReportingException = false;
diff --git a/WebCore/bindings/v8/WorkerScriptController.cpp b/WebCore/bindings/v8/WorkerScriptController.cpp
index 42e02e6..b56d383 100644
--- a/WebCore/bindings/v8/WorkerScriptController.cpp
+++ b/WebCore/bindings/v8/WorkerScriptController.cpp
@@ -34,10 +34,11 @@
 
 #include "WorkerScriptController.h"
 
-#include "DOMTimer.h"
-#include "ScriptCallStack.h"
+#include <v8.h>
+
 #include "ScriptSourceCode.h"
 #include "ScriptValue.h"
+#include "DOMTimer.h"
 #include "V8DOMMap.h"
 #include "V8Proxy.h"
 #include "V8WorkerContext.h"
@@ -45,7 +46,6 @@
 #include "WorkerContextExecutionProxy.h"
 #include "WorkerObjectProxy.h"
 #include "WorkerThread.h"
-#include <v8.h>
 
 namespace WebCore {
 
@@ -80,7 +80,7 @@ ScriptValue WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode,
         if (exception)
             *exception = state.exception;
         else
-            m_workerContext->reportException(state.errorMessage, state.lineNumber, state.sourceURL, 0);
+            m_workerContext->reportException(state.errorMessage, state.lineNumber, state.sourceURL);
     }
 
     return result;
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 743e287..775a2ad 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -118,7 +118,6 @@
 #include "RenderTextControl.h"
 #include "RenderView.h"
 #include "RenderWidget.h"
-#include "ScriptCallStack.h"
 #include "ScriptController.h"
 #include "ScriptElement.h"
 #include "ScriptEventListener.h"
@@ -2272,17 +2271,6 @@ KURL Document::virtualCompleteURL(const String& url) const
     return completeURL(url);
 }
 
-EventTarget* Document::errorEventTarget()
-{
-    return domWindow();
-}
-
-void Document::logExceptionToConsole(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack)
-{
-    MessageType messageType = callStack ? UncaughtExceptionMessageType : LogMessageType;
-    addMessage(JSMessageSource, messageType, ErrorMessageLevel, errorMessage, lineNumber, sourceURL, callStack);
-}
-
 void Document::setURL(const KURL& url)
 {
     const KURL& newURL = url.isEmpty() ? blankURL() : url;
@@ -4672,10 +4660,15 @@ void Document::parseDNSPrefetchControlHeader(const String& dnsPrefetchControl)
     m_haveExplicitlyDisabledDNSPrefetch = true;
 }
 
-void Document::addMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack)
+void Document::reportException(const String& errorMessage, int lineNumber, const String& sourceURL)
+{
+    addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, errorMessage, lineNumber, sourceURL);
+}
+
+void Document::addMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
 {
     if (DOMWindow* window = domWindow())
-        window->console()->addMessage(source, type, level, message, lineNumber, sourceURL, callStack);
+        window->console()->addMessage(source, type, level, message, lineNumber, sourceURL);
 }
 
 struct PerformTaskContext : Noncopyable {
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index 3b86b97..f1fe44c 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -930,7 +930,8 @@ public:
     bool isDNSPrefetchEnabled() const { return m_isDNSPrefetchEnabled; }
     void parseDNSPrefetchControlHeader(const String&);
 
-    virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>);
+    virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL);
+    virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
     virtual void postTask(PassOwnPtr<Task>); // Executes the task on context's thread asynchronously.
 
 #if USE(JSC)
@@ -1115,9 +1116,6 @@ private:
     virtual const KURL& virtualURL() const; // Same as url(), but needed for ScriptExecutionContext to implement it without a performance loss for direct calls.
     virtual KURL virtualCompleteURL(const String&) const; // Same as completeURL() for the same reason as above.
 
-    virtual EventTarget* errorEventTarget();
-    virtual void logExceptionToConsole(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>);
-
     void initDNSPrefetch();
 
     String encoding() const;
diff --git a/WebCore/dom/ErrorEvent.cpp b/WebCore/dom/ErrorEvent.cpp
index c598836..2627d01 100644
--- a/WebCore/dom/ErrorEvent.cpp
+++ b/WebCore/dom/ErrorEvent.cpp
@@ -30,6 +30,8 @@
 
 #include "config.h"
 
+#if ENABLE(WORKERS)
+
 #include "ErrorEvent.h"
 
 #include "EventNames.h"
@@ -70,3 +72,5 @@ bool ErrorEvent::isErrorEvent() const
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WORKERS)
diff --git a/WebCore/dom/ErrorEvent.h b/WebCore/dom/ErrorEvent.h
index 719ca2d..f81530a 100644
--- a/WebCore/dom/ErrorEvent.h
+++ b/WebCore/dom/ErrorEvent.h
@@ -31,6 +31,8 @@
 #ifndef ErrorEvent_h
 #define ErrorEvent_h
 
+#if ENABLE(WORKERS)
+
 #include "Event.h"
 #include "PlatformString.h"
 
@@ -67,4 +69,6 @@ namespace WebCore {
 
 } // namespace WebCore
 
+#endif // ENABLE(WORKERS)
+
 #endif // ErrorEvent_h
diff --git a/WebCore/dom/Event.cpp b/WebCore/dom/Event.cpp
index fc6d282..a949fd5 100644
--- a/WebCore/dom/Event.cpp
+++ b/WebCore/dom/Event.cpp
@@ -203,10 +203,12 @@ bool Event::isIDBSuccessEvent() const
 }
 #endif
 
+#if ENABLE(WORKERS)
 bool Event::isErrorEvent() const
 {
     return false;
 }
+#endif
 
 #if ENABLE(TOUCH_EVENTS)
 bool Event::isTouchEvent() const
diff --git a/WebCore/dom/Event.h b/WebCore/dom/Event.h
index 9aef233..f05d36c 100644
--- a/WebCore/dom/Event.h
+++ b/WebCore/dom/Event.h
@@ -132,7 +132,9 @@ namespace WebCore {
 #if ENABLE(WEB_AUDIO)
         virtual bool isAudioProcessingEvent() const;
 #endif
+#if ENABLE(WORKERS)
         virtual bool isErrorEvent() const;
+#endif
 #if ENABLE(TOUCH_EVENTS)
         virtual bool isTouchEvent() const;
 #endif
diff --git a/WebCore/dom/ScriptExecutionContext.cpp b/WebCore/dom/ScriptExecutionContext.cpp
index f498be0..bfda17b 100644
--- a/WebCore/dom/ScriptExecutionContext.cpp
+++ b/WebCore/dom/ScriptExecutionContext.cpp
@@ -33,19 +33,14 @@
 #include "Database.h"
 #include "DatabaseTask.h"
 #include "DatabaseThread.h"
-#include "ErrorEvent.h"
-#include "EventListener.h"
-#include "EventTarget.h"
 #include "FileThread.h"
 #include "MessagePort.h"
-#include "ScriptCallStack.h"
 #include "SecurityOrigin.h"
 #include "ThreadableBlobRegistry.h"
 #include "WorkerContext.h"
 #include "WorkerThread.h"
 #include <wtf/MainThread.h>
 #include <wtf/PassRefPtr.h>
-#include <wtf/Vector.h>
 
 #if USE(JSC)
 #include "JSDOMWindow.h"
@@ -66,25 +61,9 @@ public:
     }
 };
 
-class ScriptExecutionContext::PendingException : public Noncopyable {
-public:
-    PendingException(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack)
-        : m_errorMessage(errorMessage)
-        , m_lineNumber(lineNumber)
-        , m_sourceURL(sourceURL)
-        , m_callStack(callStack)
-    {
-    }
-    String m_errorMessage;
-    int m_lineNumber;
-    String m_sourceURL;
-    RefPtr<ScriptCallStack> m_callStack;
-};
-
 ScriptExecutionContext::ScriptExecutionContext()
-    : m_inDispatchErrorEvent(false)
 #if ENABLE(DATABASE)
-    , m_hasOpenDatabases(false)
+    : m_hasOpenDatabases(false)
 #endif
 {
 }
@@ -264,43 +243,6 @@ void ScriptExecutionContext::setSecurityOrigin(PassRefPtr<SecurityOrigin> securi
     m_securityOrigin = securityOrigin;
 }
 
-void ScriptExecutionContext::reportException(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack)
-{
-    if (m_inDispatchErrorEvent) {
-        if (!m_pendingExceptions)
-            m_pendingExceptions = adoptPtr(new Vector<OwnPtr<PendingException> >());
-        m_pendingExceptions->append(adoptPtr(new PendingException(errorMessage, lineNumber, sourceURL, callStack)));
-        return;
-    }
-
-    // First report the original exception and only then all the nested ones.
-    if (!dispatchErrorEvent(errorMessage, lineNumber, sourceURL))
-        logExceptionToConsole(errorMessage, lineNumber, sourceURL, callStack);
-
-    if (!m_pendingExceptions)
-        return;
-
-    for (size_t i = 0; i < m_pendingExceptions->size(); i++) {
-        PendingException* e = m_pendingExceptions->at(i).get();
-        logExceptionToConsole(e->m_errorMessage, e->m_lineNumber, e->m_sourceURL, e->m_callStack);
-    }
-    m_pendingExceptions.clear();
-}
-
-bool ScriptExecutionContext::dispatchErrorEvent(const String& errorMessage, int lineNumber, const String& sourceURL)
-{
-    EventTarget* target = errorEventTarget();
-    if (!target)
-        return false;
-
-    ASSERT(!m_inDispatchErrorEvent);
-    m_inDispatchErrorEvent = true;
-    RefPtr<ErrorEvent> errorEvent = ErrorEvent::create(errorMessage, sourceURL, lineNumber);
-    target->dispatchEvent(errorEvent);
-    m_inDispatchErrorEvent = false;
-    return errorEvent->defaultPrevented();
-}
-
 void ScriptExecutionContext::addTimeout(int timeoutId, DOMTimer* timer)
 {
     ASSERT(!m_timeouts.contains(timeoutId));
diff --git a/WebCore/dom/ScriptExecutionContext.h b/WebCore/dom/ScriptExecutionContext.h
index 6fb01bb..b46a0f4 100644
--- a/WebCore/dom/ScriptExecutionContext.h
+++ b/WebCore/dom/ScriptExecutionContext.h
@@ -33,7 +33,6 @@
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
-#include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
@@ -53,14 +52,11 @@ namespace WebCore {
     class DatabaseThread;
 #endif
     class DOMTimer;
-    class EventListener;
-    class EventTarget;
 #if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
     class FileThread;
 #endif
     class MessagePort;
     class SecurityOrigin;
-    class ScriptCallStack;
 #if ENABLE(INSPECTOR)
     class InspectorController;
 #endif
@@ -95,8 +91,8 @@ namespace WebCore {
         virtual InspectorController* inspectorController() const { return 0; }
 #endif
 
-        void reportException(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>);
-        virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>) = 0;
+        virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL) = 0;
+        virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL) = 0;
 
         // Active objects are not garbage collected even if inaccessible, e.g. because their activity may result in callbacks being invoked.
         bool canSuspendActiveDOMObjects();
@@ -158,10 +154,6 @@ namespace WebCore {
         virtual const KURL& virtualURL() const = 0;
         virtual KURL virtualCompleteURL(const String&) const = 0;
 
-        virtual EventTarget* errorEventTarget() = 0;
-        virtual void logExceptionToConsole(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>) = 0;
-        bool dispatchErrorEvent(const String& errorMessage, int lineNumber, const String& sourceURL);
-
         void closeMessagePorts();
 
         RefPtr<SecurityOrigin> m_securityOrigin;
@@ -179,10 +171,6 @@ namespace WebCore {
         virtual void refScriptExecutionContext() = 0;
         virtual void derefScriptExecutionContext() = 0;
 
-        bool m_inDispatchErrorEvent;
-        class PendingException;
-        OwnPtr<Vector<OwnPtr<PendingException> > > m_pendingExceptions;
-
 #if ENABLE(DATABASE)
         RefPtr<DatabaseThread> m_databaseThread;
         bool m_hasOpenDatabases; // This never changes back to false, even after the database thread is closed.
diff --git a/WebCore/websockets/WebSocket.cpp b/WebCore/websockets/WebSocket.cpp
index e15d079..358a742 100644
--- a/WebCore/websockets/WebSocket.cpp
+++ b/WebCore/websockets/WebSocket.cpp
@@ -41,7 +41,6 @@
 #include "EventNames.h"
 #include "Logging.h"
 #include "MessageEvent.h"
-#include "ScriptCallStack.h"
 #include "ScriptExecutionContext.h"
 #include "ThreadableWebSocketChannel.h"
 #include "WebSocketChannel.h"
@@ -117,32 +116,32 @@ void WebSocket::connect(const KURL& url, const String& protocol, ExceptionCode&
     m_protocol = protocol;
 
     if (!m_url.isValid()) {
-        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Invalid url for WebSocket " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString(), 0);
+        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Invalid url for WebSocket " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString());
         m_state = CLOSED;
         ec = SYNTAX_ERR;
         return;
     }
 
     if (!m_url.protocolIs("ws") && !m_url.protocolIs("wss")) {
-        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Wrong url scheme for WebSocket " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString(), 0);
+        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Wrong url scheme for WebSocket " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString());
         m_state = CLOSED;
         ec = SYNTAX_ERR;
         return;
     }
     if (m_url.hasFragmentIdentifier()) {
-        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "URL has fragment component " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString(), 0);
+        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "URL has fragment component " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString());
         m_state = CLOSED;
         ec = SYNTAX_ERR;
         return;
     }
     if (!isValidProtocolString(m_protocol)) {
-        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Wrong protocol for WebSocket '" + encodeProtocolString(m_protocol) + "'", 0, scriptExecutionContext()->securityOrigin()->toString(), 0);
+        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Wrong protocol for WebSocket '" + encodeProtocolString(m_protocol) + "'", 0, scriptExecutionContext()->securityOrigin()->toString());
         m_state = CLOSED;
         ec = SYNTAX_ERR;
         return;
     }
     if (!portAllowed(url)) {
-        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, makeString("WebSocket port ", String::number(url.port()), " blocked"), 0, scriptExecutionContext()->securityOrigin()->toString(), 0);
+        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, makeString("WebSocket port ", String::number(url.port()), " blocked"), 0, scriptExecutionContext()->securityOrigin()->toString());
         m_state = CLOSED;
         ec = SECURITY_ERR;
         return;
diff --git a/WebCore/websockets/WebSocketChannel.cpp b/WebCore/websockets/WebSocketChannel.cpp
index 785f124..01c2bef 100644
--- a/WebCore/websockets/WebSocketChannel.cpp
+++ b/WebCore/websockets/WebSocketChannel.cpp
@@ -41,7 +41,6 @@
 #include "Page.h"
 #include "PlatformString.h"
 #include "ProgressTracker.h"
-#include "ScriptCallStack.h"
 #include "ScriptExecutionContext.h"
 #include "SocketStreamError.h"
 #include "SocketStreamHandle.h"
@@ -156,7 +155,7 @@ void WebSocketChannel::didOpen(SocketStreamHandle* handle)
         InspectorInstrumentation::willSendWebSocketHandshakeRequest(m_context, m_identifier, m_handshake.clientHandshakeRequest());
     CString handshakeMessage = m_handshake.clientHandshakeMessage();
     if (!handle->send(handshakeMessage.data(), handshakeMessage.length())) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error sending handshake message.", 0, m_handshake.clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error sending handshake message.", 0, m_handshake.clientOrigin());
         handle->close();
     }
 }
@@ -240,7 +239,7 @@ bool WebSocketChannel::appendToBuffer(const char* data, size_t len)
         m_bufferSize = newBufferSize;
         return true;
     }
-    m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, makeString("WebSocket frame (at ", String::number(static_cast<unsigned long>(newBufferSize)), " bytes) is too long."), 0, m_handshake.clientOrigin(), 0);
+    m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, makeString("WebSocket frame (at ", String::number(static_cast<unsigned long>(newBufferSize)), " bytes) is too long."), 0, m_handshake.clientOrigin());
     return false;
 }
 
diff --git a/WebCore/websockets/WebSocketHandshake.cpp b/WebCore/websockets/WebSocketHandshake.cpp
index ed98834..5049098 100644
--- a/WebCore/websockets/WebSocketHandshake.cpp
+++ b/WebCore/websockets/WebSocketHandshake.cpp
@@ -41,7 +41,6 @@
 #include "HTTPHeaderMap.h"
 #include "KURL.h"
 #include "Logging.h"
-#include "ScriptCallStack.h"
 #include "ScriptExecutionContext.h"
 #include "SecurityOrigin.h"
 
@@ -320,7 +319,7 @@ int WebSocketHandshake::readServerHandshake(const char* header, size_t len)
     m_response.setStatusText(statusText);
     if (statusCode != 101) {
         m_mode = Failed;
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, makeString("Unexpected response code: ", String::number(statusCode)), 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, makeString("Unexpected response code: ", String::number(statusCode)), 0, clientOrigin());
         return len;
     }
     m_mode = Normal;
@@ -450,19 +449,19 @@ int WebSocketHandshake::readStatusLine(const char* header, size_t headerLength,
 
     const char* end = p + 1;
     if (end - header > INT_MAX) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Status line is too long: " + trimConsoleMessage(header, maxConsoleMessageSize + 1), 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Status line is too long: " + trimConsoleMessage(header, maxConsoleMessageSize + 1), 0, clientOrigin());
         return INT_MAX;
     }
     int lineLength = end - header;
 
     if (!space1 || !space2) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "No response code found: " + trimConsoleMessage(header, lineLength - 1), 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "No response code found: " + trimConsoleMessage(header, lineLength - 1), 0, clientOrigin());
         return lineLength;
     }
 
     // The line must end with "\r\n".
     if (*(end - 2) != '\r') {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Status line does not end with CRLF", 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Status line does not end with CRLF", 0, clientOrigin());
         return lineLength;
     }
 
@@ -471,7 +470,7 @@ int WebSocketHandshake::readStatusLine(const char* header, size_t headerLength,
         return lineLength;
     for (int i = 0; i < 3; ++i)
         if (statusCodeString[i] < '0' || statusCodeString[i] > '9') {
-            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Invalid status code: " + statusCodeString, 0, clientOrigin(), 0);
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Invalid status code: " + statusCodeString, 0, clientOrigin());
             return lineLength;
         }
 
@@ -499,13 +498,13 @@ const char* WebSocketHandshake::readHTTPHeaders(const char* start, const char* e
                 if (name.isEmpty()) {
                     if (p + 1 < end && *(p + 1) == '\n')
                         return p + 2;
-                    m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "CR doesn't follow LF at " + trimConsoleMessage(p, end - p), 0, clientOrigin(), 0);
+                    m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "CR doesn't follow LF at " + trimConsoleMessage(p, end - p), 0, clientOrigin());
                     return 0;
                 }
-                m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected CR in name at " + trimConsoleMessage(name.data(), name.size()), 0, clientOrigin(), 0);
+                m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected CR in name at " + trimConsoleMessage(name.data(), name.size()), 0, clientOrigin());
                 return 0;
             case '\n':
-                m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected LF in name at " + trimConsoleMessage(name.data(), name.size()), 0, clientOrigin(), 0);
+                m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected LF in name at " + trimConsoleMessage(name.data(), name.size()), 0, clientOrigin());
                 return 0;
             case ':':
                 break;
@@ -526,7 +525,7 @@ const char* WebSocketHandshake::readHTTPHeaders(const char* start, const char* e
             case '\r':
                 break;
             case '\n':
-                m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected LF in value at " + trimConsoleMessage(value.data(), value.size()), 0, clientOrigin(), 0);
+                m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected LF in value at " + trimConsoleMessage(value.data(), value.size()), 0, clientOrigin());
                 return 0;
             default:
                 value.append(*p);
@@ -537,17 +536,17 @@ const char* WebSocketHandshake::readHTTPHeaders(const char* start, const char* e
             }
         }
         if (p >= end || *p != '\n') {
-            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "CR doesn't follow LF after value at " + trimConsoleMessage(p, end - p), 0, clientOrigin(), 0);
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "CR doesn't follow LF after value at " + trimConsoleMessage(p, end - p), 0, clientOrigin());
             return 0;
         }
         AtomicString nameStr(String::fromUTF8(name.data(), name.size()));
         String valueStr = String::fromUTF8(value.data(), value.size());
         if (nameStr.isNull()) {
-            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "invalid UTF-8 sequence in header name", 0, clientOrigin(), 0);
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "invalid UTF-8 sequence in header name", 0, clientOrigin());
             return 0;
         }
         if (valueStr.isNull()) {
-            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "invalid UTF-8 sequence in header value", 0, clientOrigin(), 0);
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "invalid UTF-8 sequence in header value", 0, clientOrigin());
             return 0;
         }
         LOG(Network, "name=%s value=%s", nameStr.string().utf8().data(), valueStr.utf8().data());
@@ -571,24 +570,24 @@ void WebSocketHandshake::processHeaders()
 bool WebSocketHandshake::checkResponseHeaders()
 {
     if (m_wsOrigin.isNull()) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: 'sec-websocket-origin' header is missing", 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: 'sec-websocket-origin' header is missing", 0, clientOrigin());
         return false;
     }
     if (m_wsLocation.isNull()) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: 'sec-websocket-location' header is missing", 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: 'sec-websocket-location' header is missing", 0, clientOrigin());
         return false;
     }
 
     if (clientOrigin() != m_wsOrigin) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: origin mismatch: " + clientOrigin() + " != " + m_wsOrigin, 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: origin mismatch: " + clientOrigin() + " != " + m_wsOrigin, 0, clientOrigin());
         return false;
     }
     if (clientLocation() != m_wsLocation) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: location mismatch: " + clientLocation() + " != " + m_wsLocation, 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: location mismatch: " + clientLocation() + " != " + m_wsLocation, 0, clientOrigin());
         return false;
     }
     if (!m_clientProtocol.isEmpty() && m_clientProtocol != m_wsProtocol) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: protocol mismatch: " + m_clientProtocol + " != " + m_wsProtocol, 0, clientOrigin(), 0);
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: protocol mismatch: " + m_clientProtocol + " != " + m_wsProtocol, 0, clientOrigin());
         return false;
     }
     return true;
diff --git a/WebCore/workers/DefaultSharedWorkerRepository.cpp b/WebCore/workers/DefaultSharedWorkerRepository.cpp
index 8e1c106..4a8e947 100644
--- a/WebCore/workers/DefaultSharedWorkerRepository.cpp
+++ b/WebCore/workers/DefaultSharedWorkerRepository.cpp
@@ -42,7 +42,6 @@
 #include "MessagePort.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
-#include "ScriptCallStack.h"
 #include "SecurityOrigin.h"
 #include "SecurityOriginHash.h"
 #include "SharedWorker.h"
@@ -156,7 +155,7 @@ void SharedWorkerProxy::postTaskForModeToWorkerContext(PassOwnPtr<ScriptExecutio
 
 static void postExceptionTask(ScriptExecutionContext* context, const String& errorMessage, int lineNumber, const String& sourceURL)
 {
-    context->reportException(errorMessage, lineNumber, sourceURL, 0);
+    context->reportException(errorMessage, lineNumber, sourceURL);
 }
 
 void SharedWorkerProxy::postExceptionToWorkerObject(const String& errorMessage, int lineNumber, const String& sourceURL)
@@ -168,7 +167,7 @@ void SharedWorkerProxy::postExceptionToWorkerObject(const String& errorMessage,
 
 static void postConsoleMessageTask(ScriptExecutionContext* document, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
 {
-    document->addMessage(source, type, level, message, lineNumber, sourceURL, 0);
+    document->addMessage(source, type, level, message, lineNumber, sourceURL);
 }
 
 void SharedWorkerProxy::postConsoleMessageToWorkerObject(MessageSource source, MessageType type, MessageLevel level, const String& message, int lineNumber, const String& sourceURL)
diff --git a/WebCore/workers/WorkerContext.cpp b/WebCore/workers/WorkerContext.cpp
index 03defc7..345e5b7 100644
--- a/WebCore/workers/WorkerContext.cpp
+++ b/WebCore/workers/WorkerContext.cpp
@@ -46,7 +46,6 @@
 #include "KURL.h"
 #include "MessagePort.h"
 #include "NotImplemented.h"
-#include "ScriptCallStack.h"
 #include "ScriptSourceCode.h"
 #include "ScriptValue.h"
 #include "SecurityOrigin.h"
@@ -103,6 +102,7 @@ WorkerContext::WorkerContext(const KURL& url, const String& userAgent, WorkerThr
     , m_script(new WorkerScriptController(this))
     , m_thread(thread)
     , m_closing(false)
+    , m_reportingException(false)
 {
     setSecurityOrigin(SecurityOrigin::create(url));
 }
@@ -259,17 +259,23 @@ void WorkerContext::importScripts(const Vector<String>& urls, ExceptionCode& ec)
     }
 }
 
-EventTarget* WorkerContext::errorEventTarget()
+void WorkerContext::reportException(const String& errorMessage, int lineNumber, const String& sourceURL)
 {
-    return this;
-}
-
-void WorkerContext::logExceptionToConsole(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>)
-{
-    thread()->workerReportingProxy().postExceptionToWorkerObject(errorMessage, lineNumber, sourceURL);
+    bool errorHandled = false;
+    if (!m_reportingException) {
+        if (onerror()) {
+            m_reportingException = true;
+            RefPtr<ErrorEvent> errorEvent(ErrorEvent::create(errorMessage, sourceURL, lineNumber));
+            onerror()->handleEvent(this, errorEvent.get());
+            errorHandled = errorEvent->defaultPrevented();
+            m_reportingException = false;
+        }
+    }
+    if (!errorHandled)
+        thread()->workerReportingProxy().postExceptionToWorkerObject(errorMessage, lineNumber, sourceURL);
 }
 
-void WorkerContext::addMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>)
+void WorkerContext::addMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
 {
     thread()->workerReportingProxy().postConsoleMessageToWorkerObject(source, type, level, message, lineNumber, sourceURL);
 }
diff --git a/WebCore/workers/WorkerContext.h b/WebCore/workers/WorkerContext.h
index e42b82a..5d15d94 100644
--- a/WebCore/workers/WorkerContext.h
+++ b/WebCore/workers/WorkerContext.h
@@ -100,7 +100,8 @@ namespace WebCore {
         void clearInterval(int timeoutId);
 
         // ScriptExecutionContext
-        virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>);
+        virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL);
+        virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
 
 #if ENABLE(NOTIFICATIONS)
         NotificationCenter* webkitNotifications() const;
@@ -173,9 +174,6 @@ namespace WebCore {
         virtual const KURL& virtualURL() const;
         virtual KURL virtualCompleteURL(const String&) const;
 
-        virtual EventTarget* errorEventTarget();
-        virtual void logExceptionToConsole(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>);
-
         KURL m_url;
         String m_userAgent;
 
@@ -189,6 +187,7 @@ namespace WebCore {
         mutable RefPtr<NotificationCenter> m_notifications;
 #endif
         bool m_closing;
+        bool m_reportingException;
         EventTargetData m_eventTargetData;
 
         HashSet<Observer*> m_workerObservers;
diff --git a/WebCore/workers/WorkerMessagingProxy.cpp b/WebCore/workers/WorkerMessagingProxy.cpp
index 735d143..10700c6 100644
--- a/WebCore/workers/WorkerMessagingProxy.cpp
+++ b/WebCore/workers/WorkerMessagingProxy.cpp
@@ -40,7 +40,6 @@
 #include "ExceptionCode.h"
 #include "InspectorController.h"
 #include "MessageEvent.h"
-#include "ScriptCallStack.h"
 #include "ScriptExecutionContext.h"
 #include "Worker.h"
 
@@ -132,7 +131,7 @@ private:
 
         bool errorHandled = !workerObject->dispatchEvent(ErrorEvent::create(m_errorMessage, m_sourceURL, m_lineNumber));
         if (!errorHandled)
-            context->reportException(m_errorMessage, m_lineNumber, m_sourceURL, 0);
+            context->reportException(m_errorMessage, m_lineNumber, m_sourceURL);
     }
 
     String m_errorMessage;
@@ -284,7 +283,7 @@ static void postConsoleMessageTask(ScriptExecutionContext* context, WorkerMessag
 {
     if (messagingProxy->askedToTerminate())
         return;
-    context->addMessage(source, type, level, message, lineNumber, sourceURL, 0);
+    context->addMessage(source, type, level, message, lineNumber, sourceURL);
 }
 
 void WorkerMessagingProxy::postConsoleMessageToWorkerObject(MessageSource source, MessageType type, MessageLevel level, const String& message, int lineNumber, const String& sourceURL)
diff --git a/WebCore/xml/XMLHttpRequest.cpp b/WebCore/xml/XMLHttpRequest.cpp
index f5b2d8d..fc7eb9e 100644
--- a/WebCore/xml/XMLHttpRequest.cpp
+++ b/WebCore/xml/XMLHttpRequest.cpp
@@ -39,7 +39,6 @@
 #include "InspectorInstrumentation.h"
 #include "ResourceError.h"
 #include "ResourceRequest.h"
-#include "ScriptCallStack.h"
 #include "SecurityOrigin.h"
 #include "Settings.h"
 #include "SharedBuffer.h"
@@ -812,7 +811,7 @@ static void reportUnsafeUsage(ScriptExecutionContext* context, const String& mes
         return;
     // FIXME: It's not good to report the bad usage without indicating what source line it came from.
     // We should pass additional parameters so we can tell the console where the mistake occurred.
-    context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, message, 1, String(), 0);
+    context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, message, 1, String());
 }
 
 void XMLHttpRequest::setRequestHeader(const AtomicString& name, const String& value, ExceptionCode& ec)
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 9eec64a..431acb5 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-13  Yury Semikhatsky  <yurys at chromium.org>
+
+        Unreviewed. Rollout 73914, 73915, 73917, 73920 and 73921.
+
+        REGRESSION(r73914): "Chromium page_cycler_morejs fails" (Requested by yurys on #webkit).
+        https://bugs.webkit.org/show_bug.cgi?id=50950
+
+        * src/WebWorkerClientImpl.cpp:
+        (WebKit::WebWorkerClientImpl::postExceptionToWorkerObject):
+        (WebKit::WebWorkerClientImpl::postConsoleMessageToWorkerObject):
+        (WebKit::WebWorkerClientImpl::postExceptionToWorkerObjectTask):
+        (WebKit::WebWorkerClientImpl::postConsoleMessageToWorkerObjectTask):
+
 2010-12-13  Ilya Tikhonovsky  <loislo at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/WebKit/chromium/src/WebWorkerClientImpl.cpp b/WebKit/chromium/src/WebWorkerClientImpl.cpp
index f90e7e8..18282e3 100644
--- a/WebKit/chromium/src/WebWorkerClientImpl.cpp
+++ b/WebKit/chromium/src/WebWorkerClientImpl.cpp
@@ -41,7 +41,6 @@
 #include "MessageEvent.h"
 #include "MessagePort.h"
 #include "MessagePortChannel.h"
-#include "ScriptCallStack.h"
 #include "ScriptExecutionContext.h"
 #include "Worker.h"
 #include "WorkerContext.h"
@@ -248,7 +247,7 @@ void WebWorkerClientImpl::postExceptionToWorkerObject(const WebString& errorMess
                                                                 sourceURL,
                                                                 lineNumber));
     if (unhandled)
-        m_scriptExecutionContext->reportException(errorMessage, lineNumber, sourceURL, 0);
+        m_scriptExecutionContext->reportException(errorMessage, lineNumber, sourceURL);
 }
 
 void WebWorkerClientImpl::postConsoleMessageToWorkerObject(int destination,
@@ -275,7 +274,7 @@ void WebWorkerClientImpl::postConsoleMessageToWorkerObject(int destination,
                                          static_cast<MessageType>(messageType),
                                          static_cast<MessageLevel>(messageLevel),
                                          String(message), lineNumber,
-                                         String(sourceURL), 0);
+                                         String(sourceURL));
 }
 
 void WebWorkerClientImpl::postConsoleMessageToWorkerObject(int sourceId,
@@ -382,7 +381,9 @@ void WebWorkerClientImpl::postExceptionToWorkerObjectTask(
                                                                       sourceURL,
                                                                       lineNumber));
     if (!handled)
-        thisPtr->m_scriptExecutionContext->reportException(errorMessage, lineNumber, sourceURL, 0);
+        thisPtr->m_scriptExecutionContext->reportException(errorMessage,
+                                                           lineNumber,
+                                                           sourceURL);
 }
 
 void WebWorkerClientImpl::postConsoleMessageToWorkerObjectTask(ScriptExecutionContext* context,
@@ -397,7 +398,8 @@ void WebWorkerClientImpl::postConsoleMessageToWorkerObjectTask(ScriptExecutionCo
     thisPtr->m_scriptExecutionContext->addMessage(static_cast<MessageSource>(sourceId),
                                                   static_cast<MessageType>(messageType),
                                                   static_cast<MessageLevel>(messageLevel),
-                                                  message, lineNumber, sourceURL, 0);
+                                                  message, lineNumber,
+                                                  sourceURL);
 }
 
 void WebWorkerClientImpl::confirmMessageFromWorkerObjectTask(ScriptExecutionContext* context,

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list