• yurys@chromium.org's avatar
    2010-12-27 yury semikhatsky <yurys@chromium.org> · c8a06eb9
    yurys@chromium.org authored
            reviewed by pavel feldman.
    
            webcore doesn't fire window.onerror event when uncaught javascript exceptions are thrown
            https://bugs.webkit.org/show_bug.cgi?id=8519
    
            uncaught exceptions are propagated to window.onerror hander if one is present.
            the handler is expected to be a function accepting three arguments: error message,
            resource url and line number where the exception occured.
    
            it was decided to dispatch errorevent to all listeners/handlers no matter if they
            were created in the same isolated world where the exception occured or not.
    
            tests: fast/events/window-onerror1.html
                   fast/events/window-onerror10.html
                   fast/events/window-onerror11.html
                   fast/events/window-onerror12.html
                   fast/events/window-onerror2.html
                   fast/events/window-onerror3.html
                   fast/events/window-onerror4.html
                   fast/events/window-onerror5.html
                   fast/events/window-onerror6.html
                   fast/events/window-onerror7.html
                   fast/events/window-onerror8.html
                   fast/events/window-onerror9.html
                   http/tests/security/window-onerror-exception-in-iframe.html
                   userscripts/window-onerror-for-isolated-world-1.html
                   userscripts/window-onerror-for-isolated-world-2.html
    
            * 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/jserrorhandler.cpp: renamed from webcore/bindings/js/jsworkercontexterrorhandler.cpp.
            (webcore::jserrorhandler::jserrorhandler):
            (webcore::jserrorhandler::~jserrorhandler):
            (webcore::jserrorhandler::handleevent):
            * bindings/js/jserrorhandler.h: copied from webcore/bindings/js/jsworkercontexterrorhandler.h.
            (webcore::jserrorhandler::create):
            (webcore::createjserrorhandler):
            * bindings/js/jseventlistener.h:
            * bindings/scripts/codegeneratorjs.pm:
            * bindings/scripts/codegeneratorv8.pm:
            * bindings/v8/v8consolemessage.cpp:
            (webcore::v8consolemessage::dispatchnow):
            (webcore::v8consolemessage::handler): the method was changed to use generic webcore exception
            reporting mechanism which is also used by jsc bindings.
            * bindings/v8/v8consolemessage.h:
            * bindings/v8/v8eventlistener.h:
            * bindings/v8/v8windowerrorhandler.cpp: renamed from webcore/bindings/js/jsworkercontexterrorhandler.h.
            (webcore::v8windowerrorhandler::v8windowerrorhandler):
            (webcore::v8windowerrorhandler::calllistenerfunction):
            * bindings/v8/v8windowerrorhandler.h: copied from webcore/dom/errorevent.cpp.
            (webcore::v8windowerrorhandler::create):
            * bindings/v8/workercontextexecutionproxy.cpp:
            (webcore::v8messagehandler):
            * bindings/v8/workerscriptcontroller.cpp:
            (webcore::workerscriptcontroller::evaluate):
            * dom/document.cpp:
            (webcore::document::erroreventtarget):
            (webcore::document::logexceptiontoconsole):
            (webcore::document::addmessage):
            * dom/document.h:
            * dom/errorevent.cpp:
            * dom/errorevent.h:
            * dom/event.cpp:
            (webcore::event::iserrorevent):
            * dom/event.h:
            * dom/scriptexecutioncontext.cpp:
            (webcore::scriptexecutioncontext::pendingexception::pendingexception):
            (webcore::scriptexecutioncontext::scriptexecutioncontext):
            (webcore::scriptexecutioncontext::reportexception): this method is not virtual anymore to
            ensure that error event dispatching algorithm is the same in workercontext and in document.
            (webcore::scriptexecutioncontext::dispatcherrorevent):
            * dom/scriptexecutioncontext.h:
            * websockets/websocket.cpp:
            (webcore::websocket::connect):
            * websockets/websocketchannel.cpp:
            (webcore::websocketchannel::didopen):
            (webcore::websocketchannel::didfail):
            (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::erroreventtarget):
            (webcore::workercontext::logexceptiontoconsole):
            (webcore::workercontext::addmessage):
            * workers/workercontext.h:
            * workers/workermessagingproxy.cpp:
            (webcore::workerexceptiontask::performtask):
            (webcore::postconsolemessagetask):
            * xml/xmlhttprequest.cpp:
            (webcore::reportunsafeusage):
    
    2010-12-27  Yury Semikhatsky  <yurys@chromium.org>
    
            Reviewed by Pavel Feldman.
    
            WebCore doesn't fire window.onerror event when uncaught JavaScript exceptions are thrown
            https://bugs.webkit.org/show_bug.cgi?id=8519
    
            Uncaught exceptions are propagated to window.onerror hander if one is present.
            The handler is expected to be a function accepting three arguments: error message,
            resource url and line number where the exception occured.
    
            * fast/events/resources/window-onerror.js: Added.
            (throwException):
            * fast/events/window-onerror1-expected.txt: Added.
            * fast/events/window-onerror1.html: Added.
            * fast/events/window-onerror10-expected.txt: Added.
            * fast/events/window-onerror10.html: Added.
            * fast/events/window-onerror11-expected.txt: Added.
            * fast/events/window-onerror11.html: Added.
            * fast/events/window-onerror12-expected.txt: Added.
            * fast/events/window-onerror12.html: Added.
            * fast/events/window-onerror2-expected.txt: Added.
            * fast/events/window-onerror2.html: Added.
            * fast/events/window-onerror3-expected.txt: Added.
            * fast/events/window-onerror3.html: Added.
            * fast/events/window-onerror4-expected.txt: Added.
            * fast/events/window-onerror4.html: Added.
            * fast/events/window-onerror5-expected.txt: Added.
            * fast/events/window-onerror5.html: Added.
            * fast/events/window-onerror6-expected.txt: Added.
            * fast/events/window-onerror6.html: Added.
            * fast/events/window-onerror7-expected.txt: Added.
            * fast/events/window-onerror7.html: Added.
            * fast/events/window-onerror8-expected.txt: Added.
            * fast/events/window-onerror8.html: Added.
            * fast/events/window-onerror9-expected.txt: Added.
            * fast/events/window-onerror9.html: Added.
            * fast/workers/worker-script-error-expected.txt:
            * http/tests/security/resources/onerror-iframe.html: Added.
            * http/tests/security/window-onerror-exception-in-iframe-expected.txt: Added.
            * http/tests/security/window-onerror-exception-in-iframe.html: Added.
            * platform/chromium-win/fast/workers/worker-script-error-expected.txt:
            * platform/chromium/fast/events/window-onerror1-expected.txt: Added.
            * platform/chromium/fast/events/window-onerror10-expected.txt: Added.
            * platform/chromium/fast/events/window-onerror11-expected.txt: Added.
            * platform/chromium/fast/events/window-onerror2-expected.txt: Added.
            * platform/chromium/fast/events/window-onerror3-expected.txt: Added.
            * platform/chromium/fast/events/window-onerror4-expected.txt: Added.
            * platform/chromium/fast/events/window-onerror5-expected.txt: Added.
            * platform/chromium/fast/events/window-onerror6-expected.txt: Added.
            * platform/chromium/fast/events/window-onerror7-expected.txt: Added.
            * platform/chromium/fast/events/window-onerror8-expected.txt: Added.
            * platform/chromium/fast/events/window-onerror9-expected.txt: Added.
            * platform/chromium/http/tests/security/window-onerror-exception-in-iframe-expected.txt: Added.
            * platform/chromium/userscripts/window-onerror-for-isolated-world-1-expected.txt: Added.
            * platform/chromium/userscripts/window-onerror-for-isolated-world-2-expected.txt: Added.
            * platform/gtk/Skipped:
            * userscripts/window-onerror-for-isolated-world-1-expected.txt: Added.
            * userscripts/window-onerror-for-isolated-world-1.html: Added.
            * userscripts/window-onerror-for-isolated-world-2-expected.txt: Added.
            * userscripts/window-onerror-for-isolated-world-2.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    c8a06eb9
ChangeLog 1.11 MB
The source could not be displayed because it is larger than 1 MB. You can load it anyway or download it instead.