Bug 105794 - Sandbox-blocked pointer lock should log to the console.
Summary: Sandbox-blocked pointer lock should log to the console.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Vincent Scheib
URL:
Keywords:
Depends on:
Blocks: 101964
  Show dependency treegraph
 
Reported: 2012-12-27 04:20 PST by Mike West
Modified: 2013-01-03 11:08 PST (History)
4 users (show)

See Also:


Attachments
Patch (4.42 KB, patch)
2013-01-02 16:19 PST, Vincent Scheib
no flags Details | Formatted Diff | Diff
Patch (4.43 KB, patch)
2013-01-03 10:01 PST, Vincent Scheib
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike West 2012-12-27 04:20:17 PST
The following frame should log something reasonable to the console when clicked (or throw a SecurityError exception?):

    <iframe sandbox="allow-scripts" srcdoc="<div></div><script>document.onclick = function () { document.querySelector('div').webkitRequestPointerLock(); }</script>"></iframe>
Comment 1 Vincent Scheib 2013-01-02 16:19:03 PST
Created attachment 181104 [details]
Patch
Comment 2 Mike West 2013-01-03 00:27:05 PST
Comment on attachment 181104 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=181104&action=review

LGTM, with one nit. Thanks Vincent! Now you just need an actual reviewer's approval... :)

> Source/WebCore/page/PointerLockController.cpp:58
> +        target->document()->addConsoleMessage(HTMLMessageSource, ErrorMessageLevel, "Blocked pointer lock on an element because the element's frame is sandboxed and the 'allow-pointer-lock' permission is not set.");

Please change this to JSMessageSource (unless there's some way of triggering pointer lock declaratively from markup?).
Comment 3 Vincent Scheib 2013-01-03 10:01:11 PST
Created attachment 181182 [details]
Patch
Comment 4 Vincent Scheib 2013-01-03 10:01:51 PST
Thanks Mike, fixed.
Comment 5 Adrienne Walker 2013-01-03 10:56:16 PST
Comment on attachment 181182 [details]
Patch

R=me.
Comment 6 WebKit Review Bot 2013-01-03 11:08:34 PST
Comment on attachment 181182 [details]
Patch

Clearing flags on attachment: 181182

Committed r138722: <http://trac.webkit.org/changeset/138722>
Comment 7 WebKit Review Bot 2013-01-03 11:08:38 PST
All reviewed patches have been landed.  Closing bug.