Changeset 126171 in webkit
- Timestamp:
- Aug 21, 2012 10:42:50 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r126168 r126171 1 2012-08-21 Vincent Scheib <scheib@chromium.org> 2 3 Add parsing logic for allow-pointer-lock to iframe sandbox attribute. 4 https://bugs.webkit.org/show_bug.cgi?id=94513 5 6 Reviewed by Adam Barth. 7 8 Pointer lock was previously blocked from all sandboxed iframes. 9 Parsing the sandbox="allow-pointer-lock" attribute allows pages 10 to control the feature and enable it in sandboxed iframes. 11 12 * http/tests/pointer-lock/iframe-sandboxed-allow-pointer-lock-expected.txt: Added. 13 * http/tests/pointer-lock/iframe-sandboxed-allow-pointer-lock.html: Copied from LayoutTests/http/tests/pointer-lock/iframe-sandboxed.html. 14 * http/tests/pointer-lock/iframe-sandboxed-nested-allow-pointer-lock-expected.txt: Added. 15 * http/tests/pointer-lock/iframe-sandboxed-nested-allow-pointer-lock.html: Copied from LayoutTests/http/tests/pointer-lock/iframe-sandboxed.html. 16 * http/tests/pointer-lock/iframe-sandboxed-nested-disallow-then-allow-pointer-lock-expected.txt: Added. 17 * http/tests/pointer-lock/iframe-sandboxed-nested-disallow-then-allow-pointer-lock.html: Copied from LayoutTests/http/tests/pointer-lock/iframe-sandboxed.html. 18 * http/tests/pointer-lock/iframe-sandboxed.html: 19 * http/tests/resources/pointer-lock/iframe-allows-inner-iframe.html: Added. 20 * http/tests/resources/pointer-lock/iframe-common.js: 21 (window.onmessage): 22 1 23 2012-08-21 Pavel Feldman <pfeldman@chromium.org> 2 24 -
trunk/LayoutTests/http/tests/pointer-lock/iframe-sandboxed-allow-pointer-lock.html
r126170 r126171 8 8 <div> 9 9 <div id="target1"></div> 10 <iframe src="../resources/pointer-lock/inner-iframe.html" sandbox="allow- same-originallow-scripts" onload="doNextStepWithUserGesture()"></iframe>10 <iframe src="../resources/pointer-lock/inner-iframe.html" sandbox="allow-pointer-lock allow-scripts" onload="doNextStepWithUserGesture()"></iframe> 11 11 </div> 12 12 <script> 13 description("Test sandboxed iframe blocks pointer lock.")13 description("Test sandboxed iframe with allow-pointer-lock allows pointer lock."); 14 14 window.jsTestIsAsync = true; 15 15 … … 22 22 window.onmessage = function (messageEvent) { 23 23 message = messageEvent.data; 24 shouldBeEqualToString("message", "inner-iframe.html onwebkitpointerlock error");24 shouldBeEqualToString("message", "inner-iframe.html onwebkitpointerlockchange, document.webkitPointerLockElement = [object HTMLBodyElement]"); 25 25 window.onmessage = null; 26 26 doNextStep(); -
trunk/LayoutTests/http/tests/pointer-lock/iframe-sandboxed-nested-allow-pointer-lock.html
r126170 r126171 8 8 <div> 9 9 <div id="target1"></div> 10 <iframe src="../resources/pointer-lock/i nner-iframe.html" sandbox="allow-same-originallow-scripts" onload="doNextStepWithUserGesture()"></iframe>10 <iframe src="../resources/pointer-lock/iframe-allows-inner-iframe.html" sandbox="allow-pointer-lock allow-scripts" onload="doNextStepWithUserGesture()"></iframe> 11 11 </div> 12 12 <script> 13 description("Test sandboxed iframe blocks pointer lock.")13 description("Test nested sandboxed iframes with allow-pointer-lock allow pointer lock."); 14 14 window.jsTestIsAsync = true; 15 15 … … 19 19 todo = [ 20 20 function () { 21 iframe.contentWindow.postMessage([" eval", 'document.body.webkitRequestPointerLock()'], "*");21 iframe.contentWindow.postMessage(["pass message down", "eval", 'document.body.webkitRequestPointerLock()'], "*"); 22 22 window.onmessage = function (messageEvent) { 23 23 message = messageEvent.data; 24 shouldBeEqualToString("message", "inner-iframe.html onwebkitpointerlock error");24 shouldBeEqualToString("message", "inner-iframe.html onwebkitpointerlockchange, document.webkitPointerLockElement = [object HTMLBodyElement]"); 25 25 window.onmessage = null; 26 26 doNextStep(); -
trunk/LayoutTests/http/tests/pointer-lock/iframe-sandboxed-nested-disallow-then-allow-pointer-lock.html
r126170 r126171 8 8 <div> 9 9 <div id="target1"></div> 10 <iframe src="../resources/pointer-lock/i nner-iframe.html" sandbox="allow-same-originallow-scripts" onload="doNextStepWithUserGesture()"></iframe>10 <iframe src="../resources/pointer-lock/iframe-allows-inner-iframe.html" sandbox="allow-scripts" onload="doNextStepWithUserGesture()"></iframe> 11 11 </div> 12 12 <script> 13 description("Test sandboxed iframe blocks pointer lock.")13 description("Test nested sandboxed iframes without and then with allow-pointer-lock disallow pointer lock."); 14 14 window.jsTestIsAsync = true; 15 15 … … 19 19 todo = [ 20 20 function () { 21 iframe.contentWindow.postMessage([" eval", 'document.body.webkitRequestPointerLock()'], "*");21 iframe.contentWindow.postMessage(["pass message down", "eval", 'document.body.webkitRequestPointerLock()'], "*"); 22 22 window.onmessage = function (messageEvent) { 23 23 message = messageEvent.data; -
trunk/LayoutTests/http/tests/pointer-lock/iframe-sandboxed.html
r124368 r126171 8 8 <div> 9 9 <div id="target1"></div> 10 <iframe src="../resources/pointer-lock/inner-iframe.html" sandbox="allow-s ame-origin allow-scripts" onload="doNextStepWithUserGesture()"></iframe>10 <iframe src="../resources/pointer-lock/inner-iframe.html" sandbox="allow-scripts" onload="doNextStepWithUserGesture()"></iframe> 11 11 </div> 12 12 <script> -
trunk/LayoutTests/http/tests/resources/pointer-lock/iframe-common.js
r124301 r126171 9 9 eval(messageEvent.data[1]); 10 10 break; 11 case "pass message down": 12 iframe = document.getElementsByTagName("iframe")[0]; 13 iframe.contentWindow.postMessage(messageEvent.data.slice(1), "*"); 14 break; 15 default: 16 // Pass all other messages up to parent. 17 parent.postMessage(messageEvent.data, "*"); 11 18 } 12 19 } -
trunk/Source/WebCore/ChangeLog
r126170 r126171 1 2012-08-21 Vincent Scheib <scheib@chromium.org> 2 3 Add parsing logic for allow-pointer-lock to iframe sandbox attribute. 4 https://bugs.webkit.org/show_bug.cgi?id=94513 5 6 Reviewed by Adam Barth. 7 8 Pointer lock was previously blocked from all sandboxed iframes. 9 Parsing the sandbox="allow-pointer-lock" attribute allows pages 10 to control the feature and enable it in sandboxed iframes. 11 12 Tests: http/tests/pointer-lock/iframe-sandboxed-allow-pointer-lock.html 13 http/tests/pointer-lock/iframe-sandboxed-nested-allow-pointer-lock.html 14 http/tests/pointer-lock/iframe-sandboxed-nested-disallow-then-allow-pointer-lock.html 15 16 * dom/SecurityContext.cpp: 17 (WebCore::SecurityContext::parseSandboxPolicy): 18 1 19 2012-08-21 James Robinson <jamesr@chromium.org> 2 20 -
trunk/Source/WebCore/dom/SecurityContext.cpp
r119204 r126171 113 113 else if (equalIgnoringCase(sandboxToken, "allow-popups")) 114 114 flags &= ~SandboxPopups; 115 else if (equalIgnoringCase(sandboxToken, "allow-pointer-lock")) 116 flags &= ~SandboxPointerLock; 115 117 116 118 start = end + 1;
Note: See TracChangeset
for help on using the changeset viewer.