| 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(TreeScope& scope) { |
| 79 return Fullscreen::fullscreenElementForBindingFrom(scope); |
| 80 } |
| 76 }; | 81 }; |
| 77 | 82 |
| 78 } // namespace blink | 83 } // namespace blink |
| 79 | 84 |
| 80 #endif // DocumentOrShadowRoot_h | 85 #endif // DocumentOrShadowRoot_h |
| OLD | NEW |