WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
105162
Web Inspector: MediaQueryList listener silently catches errors
https://bugs.webkit.org/show_bug.cgi?id=105162
Summary
Web Inspector: MediaQueryList listener silently catches errors
Yury Semikhatsky
Reported
2012-12-17 04:26:44 PST
Upstreaming Chromium issue:
http://code.google.com/p/chromium/issues/detail?id=162651
Steps to reproduce the problem: 1. Get a media query list 2. Add a listener with an error inside 3. Trigger the listener var theMediaQueryList = window.matchMedia("screen and (max-width: 600px)"); theMediaQueryList.addListener(function(aMediaQueryList) { console.log("Function started"); objectThatDoesNotExist.produceError(); console.log("Function ended"); });
http://www.developedbyme.com/dbm-repository/bugs/mediaQueryListCatchError.html
What is the expected behavior? The error to be displayed in the console. What went wrong? Nothing is printed code in the functions is stopped.
Attachments
Patch
(4.51 KB, patch)
2012-12-17 04:29 PST
,
Yury Semikhatsky
no flags
Details
Formatted Diff
Diff
Patch
(4.51 KB, patch)
2012-12-17 04:39 PST
,
Yury Semikhatsky
no flags
Details
Formatted Diff
Diff
Patch
(4.51 KB, patch)
2012-12-17 04:46 PST
,
Yury Semikhatsky
no flags
Details
Formatted Diff
Diff
Patch
(4.51 KB, patch)
2012-12-17 04:47 PST
,
Yury Semikhatsky
no flags
Details
Formatted Diff
Diff
Patch
(8.50 KB, patch)
2012-12-18 02:14 PST
,
Yury Semikhatsky
apavlov
: review+
apavlov
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Yury Semikhatsky
Comment 1
2012-12-17 04:29:58 PST
Created
attachment 179715
[details]
Patch
Yury Semikhatsky
Comment 2
2012-12-17 04:39:25 PST
Created
attachment 179716
[details]
Patch
Yury Semikhatsky
Comment 3
2012-12-17 04:41:04 PST
(In reply to
comment #2
)
> Created an attachment (id=179716) [details] > Patch
I'd like to test this but because of crbug.com/40680 LayoutTestController.setViewModeMediaFeature is not implemented for Chromium yet which makes it hard to emulate media query changes.
Yury Semikhatsky
Comment 4
2012-12-17 04:46:54 PST
Created
attachment 179717
[details]
Patch
Yury Semikhatsky
Comment 5
2012-12-17 04:47:43 PST
Created
attachment 179718
[details]
Patch
Pavel Feldman
Comment 6
2012-12-17 22:19:37 PST
Comment on
attachment 179718
[details]
Patch A test?
Yury Semikhatsky
Comment 7
2012-12-17 22:39:45 PST
(In reply to
comment #6
)
> (From update of
attachment 179718
[details]
) > A test?
Any suggestions on how to write it without LayoutTestController.setViewModeMediaFeature ?
Yury Semikhatsky
Comment 8
2012-12-18 02:14:35 PST
Created
attachment 179908
[details]
Patch
Yury Semikhatsky
Comment 9
2012-12-18 02:15:29 PST
(In reply to
comment #7
)
> (In reply to
comment #6
) > > (From update of
attachment 179718
[details]
[details]) > > A test? > > Any suggestions on how to write it without LayoutTestController.setViewModeMediaFeature ?
Added a layout test for this. Kudos to apavlov for his suggestions on this!
Alexander Pavlov (apavlov)
Comment 10
2012-12-18 02:39:54 PST
Comment on
attachment 179908
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=179908&action=review
Please address the comments prior to landing.
> LayoutTests/http/tests/inspector-protocol/resources/protocol-test.js:67 > + return;
The common behavior in this situation is to output something like "This test requires DumpRenderTree", since oftentimes tests can be run manually in the browser.
> LayoutTests/inspector-protocol/media-query-listener-exception-expected.txt:3 > +Test that uncaught exception in MediaQueryListListener will be reported to the console. On success you should see to exceptions in the listener logged to the console(first time when the device metrics are overriden and second - when they are restored).
Bug 105162
.
"to exceptions" -> "two exceptions" space before '(' "device metrics are" -> "media type is" "overriden" -> "overridden"
Yury Semikhatsky
Comment 11
2012-12-18 02:47:26 PST
(In reply to
comment #10
)
> (From update of
attachment 179908
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=179908&action=review
> > Please address the comments prior to landing. > > > LayoutTests/http/tests/inspector-protocol/resources/protocol-test.js:67 > > + return; > > The common behavior in this situation is to output something like "This test requires DumpRenderTree", since oftentimes tests can be run manually in the browser. >
Done.
> > LayoutTests/inspector-protocol/media-query-listener-exception-expected.txt:3 > > +Test that uncaught exception in MediaQueryListListener will be reported to the console. On success you should see to exceptions in the listener logged to the console(first time when the device metrics are overriden and second - when they are restored).
Bug 105162
. > > "to exceptions" -> "two exceptions" > space before '(' > "device metrics are" -> "media type is" > "overriden" -> "overridden"
Done.
Yury Semikhatsky
Comment 12
2012-12-18 02:48:52 PST
Committed
r138003
: <
http://trac.webkit.org/changeset/138003
>
János Badics
Comment 13
2012-12-18 04:21:31 PST
The test (inspector-protocol/media-query-listener-exception.html) you have added in 138003 fails on Qt, Apple Lion, GTK and EFL with the same diff: --- /ramdisk/qt-linux-64-release/build/layout-test-results/inspector-protocol/media-query-listener-exception-expected.txt +++ /ramdisk/qt-linux-64-release/build/layout-test-results/inspector-protocol/media-query-listener-exception-actual.txt @@ -1,5 +1,5 @@ -CONSOLE MESSAGE: line 13: Uncaught ReferenceError: objectThatDoesNotExist is not defined -CONSOLE MESSAGE: line 13: Uncaught ReferenceError: objectThatDoesNotExist is not defined +CONSOLE MESSAGE: line 13: +CONSOLE MESSAGE: line 13: Test that uncaught exception in MediaQueryListListener will be reported to the console. On success you should see two exceptions in the listener logged to the console (first time when the media type is overridden and second - when they are restored).
Bug 105162
. Could you have a look at it please?
János Badics
Comment 14
2012-12-18 04:24:06 PST
Is it maybe because the differences in working of JSC and V8?
Yury Semikhatsky
Comment 15
2012-12-18 05:22:55 PST
(In reply to
comment #14
)
> Is it maybe because the differences in working of JSC and V8?
Yes, it is. Ilya landed updated expectations:
http://trac.webkit.org/changeset/138010
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