diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index aad9692fd57a4040f7ea648aeb13ee50e54244ba..a949bb3ce172d5b0efd573292b21c37578200faa 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2012-07-09 Vincent Scheib + + Pointer Lock requestPointerLock rejects locking an element not in a document. + https://bugs.webkit.org/show_bug.cgi?id=90821 + + Reviewed by Adrienne Walker. + + * pointer-lock/lock-element-not-in-dom-expected.txt: Added. + * pointer-lock/lock-element-not-in-dom.html: Added. + 2012-07-09 Eric Seidel document.write of scripts that also document.write sometimes writes async diff --git a/LayoutTests/pointer-lock/lock-element-not-in-dom-expected.txt b/LayoutTests/pointer-lock/lock-element-not-in-dom-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..adc04389bb89f0d85f219432728ff347757bd3ef --- /dev/null +++ b/LayoutTests/pointer-lock/lock-element-not-in-dom-expected.txt @@ -0,0 +1,13 @@ +Test locking an element not in a document is rejected and pointerlockerror event dispatched. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS targetDiv1.parentElement is not null + Remove targetDiv1 from document, and try to lock it. +PASS targetDiv1.parentElement is null +PASS onwebkitpointerlockerror received after: Remove targetDiv1 from document, and try to lock it. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/pointer-lock/lock-element-not-in-dom.html b/LayoutTests/pointer-lock/lock-element-not-in-dom.html new file mode 100644 index 0000000000000000000000000000000000000000..97a99a8e5b0e9fcaed083de45a87093213cc491f --- /dev/null +++ b/LayoutTests/pointer-lock/lock-element-not-in-dom.html @@ -0,0 +1,31 @@ + + + + + + + +
+
+
+ + + + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index c37ecc17893736d6fb5db41cb3b80e47332918b9..afac97b65b071c05a087ff19c0fac09028bfb1f4 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,15 @@ +2012-07-09 Vincent Scheib + + Pointer Lock requestPointerLock rejects locking an element not in a document. + https://bugs.webkit.org/show_bug.cgi?id=90821 + + Reviewed by Adrienne Walker. + + Test: pointer-lock/lock-element-not-in-dom.html + + * page/PointerLockController.cpp: + (WebCore::PointerLockController::requestPointerLock): + 2012-07-09 Eric Seidel document.write of scripts that also document.write sometimes writes async diff --git a/Source/WebCore/page/PointerLockController.cpp b/Source/WebCore/page/PointerLockController.cpp index 5c70dcf78e5ea59fe4659eb994ad57b30a30d2bb..c250cb7befc2305efa75917d3dd1e2b060f3e826 100644 --- a/Source/WebCore/page/PointerLockController.cpp +++ b/Source/WebCore/page/PointerLockController.cpp @@ -51,6 +51,11 @@ void PointerLockController::requestPointerLock(Element* target, PassRefPtrinDocument()) { + enqueueEvent(eventNames().webkitpointerlockerrorEvent, target); + return; + } + if (isLocked()) { // FIXME: Keep enqueueEvent usage. (https://bugs.webkit.org/show_bug.cgi?id=84402) enqueueEvent(eventNames().webkitpointerlockchangeEvent, target);