Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Side by Side Diff: third_party/WebKit/Source/core/page/PointerLockController.cpp

Issue 2086293004: Document/ShadowRoot split of pointerLockElement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update UseCounters Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 void PointerLockController::requestPointerLock(Element* target) 48 void PointerLockController::requestPointerLock(Element* target)
49 { 49 {
50 if (!target || !target->inShadowIncludingDocument() || m_documentOfRemovedEl ementWhileWaitingForUnlock) { 50 if (!target || !target->inShadowIncludingDocument() || m_documentOfRemovedEl ementWhileWaitingForUnlock) {
51 enqueueEvent(EventTypeNames::pointerlockerror, target); 51 enqueueEvent(EventTypeNames::pointerlockerror, target);
52 return; 52 return;
53 } 53 }
54 54
55 UseCounter::countCrossOriginIframe(target->document(), UseCounter::ElementRe questPointerLockIframe); 55 UseCounter::countCrossOriginIframe(target->document(), UseCounter::ElementRe questPointerLockIframe);
56 if (target->isInShadowTree())
57 UseCounter::count(target->document(), UseCounter::ElementRequestPointerL ockInShadow);
56 58
57 if (target->document().isSandboxed(SandboxPointerLock)) { 59 if (target->document().isSandboxed(SandboxPointerLock)) {
58 // FIXME: This message should be moved off the console once a solution t o https://bugs.webkit.org/show_bug.cgi?id=103274 exists. 60 // FIXME: This message should be moved off the console once a solution t o https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
59 target->document().addConsoleMessage(ConsoleMessage::create(SecurityMess ageSource, ErrorMessageLevel, "Blocked pointer lock on an element because the el ement's frame is sandboxed and the 'allow-pointer-lock' permission is not set.") ); 61 target->document().addConsoleMessage(ConsoleMessage::create(SecurityMess ageSource, ErrorMessageLevel, "Blocked pointer lock on an element because the el ement's frame is sandboxed and the 'allow-pointer-lock' permission is not set.") );
60 enqueueEvent(EventTypeNames::pointerlockerror, target); 62 enqueueEvent(EventTypeNames::pointerlockerror, target);
61 return; 63 return;
62 } 64 }
63 65
64 if (m_element) { 66 if (m_element) {
65 if (m_element->document() != target->document()) { 67 if (m_element->document() != target->document()) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 162 }
161 163
162 DEFINE_TRACE(PointerLockController) 164 DEFINE_TRACE(PointerLockController)
163 { 165 {
164 visitor->trace(m_page); 166 visitor->trace(m_page);
165 visitor->trace(m_element); 167 visitor->trace(m_element);
166 visitor->trace(m_documentOfRemovedElementWhileWaitingForUnlock); 168 visitor->trace(m_documentOfRemovedElementWhileWaitingForUnlock);
167 } 169 }
168 170
169 } // namespace blink 171 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698