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

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

Issue 2149893003: Rename Node::inShadowIncludingDocument() to Node::isConnected() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed 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 29 matching lines...) Expand all
40 { 40 {
41 } 41 }
42 42
43 PointerLockController* PointerLockController::create(Page* page) 43 PointerLockController* PointerLockController::create(Page* page)
44 { 44 {
45 return new PointerLockController(page); 45 return new PointerLockController(page);
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->isConnected() || m_documentOfRemovedElementWhileWait ingForUnlock) {
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()) 56 if (target->isInShadowTree())
57 UseCounter::count(target->document(), UseCounter::ElementRequestPointerL ockInShadow); 57 UseCounter::count(target->document(), UseCounter::ElementRequestPointerL ockInShadow);
58 58
59 if (target->document().isSandboxed(SandboxPointerLock)) { 59 if (target->document().isSandboxed(SandboxPointerLock)) {
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. 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.
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 163
164 DEFINE_TRACE(PointerLockController) 164 DEFINE_TRACE(PointerLockController)
165 { 165 {
166 visitor->trace(m_page); 166 visitor->trace(m_page);
167 visitor->trace(m_element); 167 visitor->trace(m_element);
168 visitor->trace(m_documentOfRemovedElementWhileWaitingForUnlock); 168 visitor->trace(m_documentOfRemovedElementWhileWaitingForUnlock);
169 } 169 }
170 170
171 } // namespace blink 171 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698