OLD | NEW |
---|---|
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/Fullscreen.h" | |
9 #include "core/dom/shadow/ShadowRoot.h" | 10 #include "core/dom/shadow/ShadowRoot.h" |
10 #include "core/frame/UseCounter.h" | 11 #include "core/frame/UseCounter.h" |
11 | 12 |
12 namespace blink { | 13 namespace blink { |
13 | 14 |
14 class DocumentOrShadowRoot { | 15 class DocumentOrShadowRoot { |
15 public: | 16 public: |
16 static Element* activeElement(Document& document) { | 17 static Element* activeElement(Document& document) { |
17 return document.activeElement(); | 18 return document.activeElement(); |
18 } | 19 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 // Document and ShadowRoot. | 67 // Document and ShadowRoot. |
67 if (!shadowRoot.isV1()) | 68 if (!shadowRoot.isV1()) |
68 return nullptr; | 69 return nullptr; |
69 UseCounter::count(shadowRoot.document(), | 70 UseCounter::count(shadowRoot.document(), |
70 UseCounter::ShadowRootPointerLockElement); | 71 UseCounter::ShadowRootPointerLockElement); |
71 const Element* target = shadowRoot.document().pointerLockElement(); | 72 const Element* target = shadowRoot.document().pointerLockElement(); |
72 if (!target) | 73 if (!target) |
73 return nullptr; | 74 return nullptr; |
74 return shadowRoot.adjustedElement(*target); | 75 return shadowRoot.adjustedElement(*target); |
75 } | 76 } |
77 | |
78 static Element* fullscreenElement(Document& document) { | |
79 return Fullscreen::fullscreenElementForBindingFrom(document); | |
foolip
2016/10/10 12:13:40
I think it's probably fine to not have a special c
kochi
2016/10/17 11:14:27
The motivation I introduced *ForBinding* was that
| |
80 } | |
81 | |
82 static Element* fullscreenElement(ShadowRoot& shadowRoot) { | |
83 return Fullscreen::fullscreenElementForBindingFrom(shadowRoot); | |
84 } | |
76 }; | 85 }; |
77 | 86 |
78 } // namespace blink | 87 } // namespace blink |
79 | 88 |
80 #endif // DocumentOrShadowRoot_h | 89 #endif // DocumentOrShadowRoot_h |
OLD | NEW |