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

Unified Diff: third_party/WebKit/Source/core/dom/DocumentOrShadowRoot.h

Issue 1815643002: Introduce DocumentOrShadowRoot Mixin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@debug
Patch Set: fix typo Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.idl ('k') | third_party/WebKit/Source/core/dom/DocumentOrShadowRoot.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698