WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
67119
Return value of window.onerror has inverted semantics
https://bugs.webkit.org/show_bug.cgi?id=67119
Summary
Return value of window.onerror has inverted semantics
Yury Semikhatsky
Reported
2011-08-29 04:51:19 PDT
In Chrome, returning 'true' from window.onerror allows the error to propagate, and returning 'false' suppresses it. This is the inverse of the behavior in Firefox and IE, where returning 'true' suppresses the error, but returning 'false' propagates it. (See also
https://developer.mozilla.org/en/DOM/window.onerror
which states: "When the function returns true, this prevents the firing of the default event handler.") The attached html page can be used to reproduce the issue. Original Chromium bug report:
http://code.google.com/p/chromium/issues/detail?id=92062
Attachments
Patch
(14.17 KB, patch)
2011-08-29 07:54 PDT
,
Yury Semikhatsky
darin
: review+
webkit.review.bot
: commit-queue-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Yury Semikhatsky
Comment 1
2011-08-29 04:52:52 PDT
Ian is going to make the spec match behavior of IE and FF, WebKit implementation should also be changed.
Yury Semikhatsky
Comment 2
2011-08-29 07:54:57 PDT
Created
attachment 105490
[details]
Patch
WebKit Review Bot
Comment 3
2011-08-29 08:20:20 PDT
Comment on
attachment 105490
[details]
Patch
Attachment 105490
[details]
did not pass chromium-ews (chromium-xvfb): Output:
http://queues.webkit.org/results/9563186
New failing tests: fast/events/window-onerror13.html
Darin Adler
Comment 4
2011-08-29 10:21:57 PDT
I think the test coverage here is not sufficient. I’d like to see tests covering the case where the function does not have a return statement. And cases where event.preventDefault() is called.
Yury Semikhatsky
Comment 5
2011-08-30 02:28:56 PDT
Committed
r94061
: <
http://trac.webkit.org/changeset/94061
>
Yury Semikhatsky
Comment 6
2011-08-30 02:29:42 PDT
(In reply to
comment #4
)
> I think the test coverage here is not sufficient. I’d like to see tests covering the case where the function does not have a return statement. And cases where event.preventDefault() is called.
I'll add new tests in a separate patch shortly.
Csaba Osztrogonác
Comment 7
2011-08-30 03:17:22 PDT
It made 3 tests fail on the SL bot and on the Qt bot. (maybe on other bots too) Reopen to fix the bug and/or update tests. (I don't know if the new results are correct or not.) --- /Volumes/Data/WebKit-BuildSlave/snowleopard-intel-release-tests/build/layout-test-results/fast/workers/shared-worker-script-error-expected.txt +++ /Volumes/Data/WebKit-BuildSlave/snowleopard-intel-release-tests/build/layout-test-results/fast/workers/shared-worker-script-error-actual.txt @@ -1,4 +1,5 @@ CONSOLE MESSAGE: line 12: ReferenceError: Can't find variable: generateError +CONSOLE MESSAGE: line 18: ReferenceError: Can't find variable: generateError Test SharedWorker script error handling functionality. Should print a series of PASS messages, followed with DONE. SUCCESS: unhandled error generated --- /Volumes/Data/WebKit-BuildSlave/snowleopard-intel-release-tests/build/layout-test-results/http/tests/security/cross-origin-script-window-onerror-redirected-expected.txt +++ /Volumes/Data/WebKit-BuildSlave/snowleopard-intel-release-tests/build/layout-test-results/http/tests/security/cross-origin-script-window-onerror-redirected-actual.txt @@ -1,3 +1,4 @@ +CONSOLE MESSAGE: line 1: SyntaxError: Expected an identifier but found 'sensitive' instead Test that window.onerror won't reveal any potentially sensitive script content if the latter is loaded from a different domain after a redirect. The test passes if you don't see any data from the linked resource.
Bug 52903
. window.onerror message: Script error. at : 0 --- /Volumes/Data/WebKit-BuildSlave/snowleopard-intel-release-tests/build/layout-test-results/http/tests/security/cross-origin-script-window-onerror-expected.txt +++ /Volumes/Data/WebKit-BuildSlave/snowleopard-intel-release-tests/build/layout-test-results/http/tests/security/cross-origin-script-window-onerror-actual.txt @@ -1,3 +1,4 @@ +CONSOLE MESSAGE: line 1: SyntaxError: Expected an identifier but found 'sensitive' instead Test that window.onerror won't reveal any potentially sensitive script content if the latter is loaded from a different domain. The test passes if you don't see any data from the linked resource.
Bug 52903
. window.onerror message: Script error. at : 0
Csaba Osztrogonác
Comment 8
2011-08-30 06:00:10 PDT
Fixed in
http://trac.webkit.org/changeset/94066
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug