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

Side by Side Diff: third_party/WebKit/Source/core/dom/DocumentOrShadowRoot.h

Issue 2390543002: Reflow comments in core/dom/. (Closed)
Patch Set: Reformat comments in core/dom/. Created 4 years, 2 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DocumentOrShadowRoot_h 5 #ifndef DocumentOrShadowRoot_h
6 #define DocumentOrShadowRoot_h 6 #define DocumentOrShadowRoot_h
7 7
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/shadow/ShadowRoot.h" 9 #include "core/dom/shadow/ShadowRoot.h"
10 #include "core/frame/UseCounter.h" 10 #include "core/frame/UseCounter.h"
(...skipping 30 matching lines...) Expand all
41 int x, 41 int x,
42 int y) { 42 int y) {
43 return treeScope.elementsFromPoint(x, y); 43 return treeScope.elementsFromPoint(x, y);
44 } 44 }
45 45
46 static Element* pointerLockElement(Document& document) { 46 static Element* pointerLockElement(Document& document) {
47 UseCounter::count(document, UseCounter::DocumentPointerLockElement); 47 UseCounter::count(document, UseCounter::DocumentPointerLockElement);
48 const Element* target = document.pointerLockElement(); 48 const Element* target = document.pointerLockElement();
49 if (!target) 49 if (!target)
50 return nullptr; 50 return nullptr;
51 // For Shadow DOM V0 compatibility: We allow returning an element in V0 shad ow tree, 51 // For Shadow DOM V0 compatibility: We allow returning an element in V0
52 // even though it leaks the Shadow DOM. 52 // shadow tree, even though it leaks the Shadow DOM.
53 // TODO(kochi): Once V0 code is removed, the following V0 check is unnecessa ry. 53 // TODO(kochi): Once V0 code is removed, the following V0 check is
54 // unnecessary.
54 if (target && target->isInV0ShadowTree()) { 55 if (target && target->isInV0ShadowTree()) {
55 UseCounter::count(document, 56 UseCounter::count(document,
56 UseCounter::DocumentPointerLockElementInV0Shadow); 57 UseCounter::DocumentPointerLockElementInV0Shadow);
57 return const_cast<Element*>(target); 58 return const_cast<Element*>(target);
58 } 59 }
59 return document.adjustedElement(*target); 60 return document.adjustedElement(*target);
60 } 61 }
61 62
62 static Element* pointerLockElement(ShadowRoot& shadowRoot) { 63 static Element* pointerLockElement(ShadowRoot& shadowRoot) {
63 // TODO(kochi): Once V0 code is removed, the following non-V1 check is unnec essary. 64 // TODO(kochi): Once V0 code is removed, the following non-V1 check is
64 // After V0 code is removed, we can use the same logic for Document and Shad owRoot. 65 // unnecessary. After V0 code is removed, we can use the same logic for
66 // Document and ShadowRoot.
65 if (!shadowRoot.isV1()) 67 if (!shadowRoot.isV1())
66 return nullptr; 68 return nullptr;
67 UseCounter::count(shadowRoot.document(), 69 UseCounter::count(shadowRoot.document(),
68 UseCounter::ShadowRootPointerLockElement); 70 UseCounter::ShadowRootPointerLockElement);
69 const Element* target = shadowRoot.document().pointerLockElement(); 71 const Element* target = shadowRoot.document().pointerLockElement();
70 if (!target) 72 if (!target)
71 return nullptr; 73 return nullptr;
72 return shadowRoot.adjustedElement(*target); 74 return shadowRoot.adjustedElement(*target);
73 } 75 }
74 }; 76 };
75 77
76 } // namespace blink 78 } // namespace blink
77 79
78 #endif // DocumentOrShadowRoot_h 80 #endif // DocumentOrShadowRoot_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentLifecycle.h ('k') | third_party/WebKit/Source/core/dom/DocumentOrderedList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698