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/shadow/ShadowRoot.h" | 9 #include "core/dom/shadow/ShadowRoot.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class DocumentOrShadowRoot { | 13 class DocumentOrShadowRoot { |
14 public: | 14 public: |
15 static Element* activeElement(Document& document) | 15 static Element* activeElement(Document& document) |
16 { | 16 { |
17 return document.activeElement(); | 17 return document.activeElement(); |
18 } | 18 } |
19 | 19 |
20 static Element* activeElement(ShadowRoot& shadowRoot) | 20 static Element* activeElement(ShadowRoot& shadowRoot) |
21 { | 21 { |
22 return shadowRoot.activeElement(); | 22 return shadowRoot.activeElement(); |
23 } | 23 } |
24 | 24 |
25 static StyleSheetList* styleSheets(Document& document) | 25 static StyleSheetList* styleSheets(Document& document) |
26 { | 26 { |
27 return document.styleSheets(); | 27 return &document.styleSheets(); |
28 } | 28 } |
29 | 29 |
30 static StyleSheetList* styleSheets(ShadowRoot& shadowRoot) | 30 static StyleSheetList* styleSheets(ShadowRoot& shadowRoot) |
31 { | 31 { |
32 return shadowRoot.styleSheets(); | 32 return &shadowRoot.styleSheets(); |
33 } | 33 } |
34 | 34 |
35 static DOMSelection* getSelection(TreeScope& treeScope) | 35 static DOMSelection* getSelection(TreeScope& treeScope) |
36 { | 36 { |
37 return treeScope.getSelection(); | 37 return treeScope.getSelection(); |
38 } | 38 } |
39 | 39 |
40 static Element* elementFromPoint(TreeScope& treeScope, int x, int y) | 40 static Element* elementFromPoint(TreeScope& treeScope, int x, int y) |
41 { | 41 { |
42 return treeScope.elementFromPoint(x, y); | 42 return treeScope.elementFromPoint(x, y); |
43 } | 43 } |
44 | 44 |
45 static HeapVector<Member<Element>> elementsFromPoint(TreeScope& treeScope, i
nt x, int y) | 45 static HeapVector<Member<Element>> elementsFromPoint(TreeScope& treeScope, i
nt x, int y) |
46 { | 46 { |
47 return treeScope.elementsFromPoint(x, y); | 47 return treeScope.elementsFromPoint(x, y); |
48 } | 48 } |
49 }; | 49 }; |
50 | 50 |
51 } // namespace blink | 51 } // namespace blink |
52 | 52 |
53 #endif // DocumentOrShadowRoot_h | 53 #endif // DocumentOrShadowRoot_h |
OLD | NEW |