Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/DocumentOrShadowRoot.h |
| diff --git a/third_party/WebKit/Source/core/dom/DocumentOrShadowRoot.h b/third_party/WebKit/Source/core/dom/DocumentOrShadowRoot.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f9ff81940ac95ae6dbcc7f896785fd77e90bc4b6 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/dom/DocumentOrShadowRoot.h |
| @@ -0,0 +1,53 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef DocumentOrShadowRoot_h |
| +#define DocumentOrShadowRoot_h |
| + |
| +#include "core/dom/Document.h" |
| +#include "core/dom/shadow/ShadowRoot.h" |
| + |
| +namespace blink { |
| + |
| +class DocumentOrShadowRoot { |
| +public: |
| + static Element* activeElement(Document& document) |
| + { |
| + return document.activeElement(); |
|
kochi
2016/03/22 03:43:56
Can activeElement() and styleSheets() be a pure vi
hayato
2016/03/22 03:50:08
I did not do it intentionally in this CL. That sho
|
| + } |
| + |
| + static Element* activeElement(ShadowRoot& shadowRoot) |
| + { |
| + return shadowRoot.activeElement(); |
| + } |
| + |
| + static StyleSheetList* styleSheets(Document& document) |
| + { |
| + return document.styleSheets(); |
| + } |
| + |
| + static StyleSheetList* styleSheets(ShadowRoot& shadowRoot) |
| + { |
| + return shadowRoot.styleSheets(); |
| + } |
| + |
| + static DOMSelection* getSelection(TreeScope& treeScope) |
| + { |
| + return treeScope.getSelection(); |
| + } |
| + |
| + static Element* elementFromPoint(TreeScope& treeScope, int x, int y) |
| + { |
| + return treeScope.elementFromPoint(x, y); |
| + } |
| + |
| + static WillBeHeapVector<RawPtrWillBeMember<Element>> elementsFromPoint(TreeScope& treeScope, int x, int y) |
| + { |
| + return treeScope.elementsFromPoint(x, y); |
| + } |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // DocumentOrShadowRoot_h |