/work/obj-fuzz/dist/include/mozilla/dom/ElementInlines.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef mozilla_dom_ElementInlines_h |
8 | | #define mozilla_dom_ElementInlines_h |
9 | | |
10 | | #include "mozilla/dom/Element.h" |
11 | | #include "mozilla/ServoBindingTypes.h" |
12 | | #include "nsIContentInlines.h" |
13 | | #include "nsIDocument.h" |
14 | | #include "nsIPresShell.h" |
15 | | #include "nsIPresShellInlines.h" |
16 | | |
17 | | namespace mozilla { |
18 | | namespace dom { |
19 | | |
20 | | inline void |
21 | | Element::RegisterActivityObserver() |
22 | 0 | { |
23 | 0 | OwnerDoc()->RegisterActivityObserver(this); |
24 | 0 | } |
25 | | |
26 | | inline void |
27 | | Element::UnregisterActivityObserver() |
28 | 0 | { |
29 | 0 | OwnerDoc()->UnregisterActivityObserver(this); |
30 | 0 | } |
31 | | |
32 | | } // namespace dom |
33 | | } // namespace mozilla |
34 | | |
35 | | inline Element* |
36 | | nsINode::GetFlattenedTreeParentElement() const |
37 | 0 | { |
38 | 0 | nsINode* parentNode = GetFlattenedTreeParentNode(); |
39 | 0 | if MOZ_LIKELY(parentNode && parentNode->IsElement()) { |
40 | 0 | return parentNode->AsElement(); |
41 | 0 | } |
42 | 0 | |
43 | 0 | return nullptr; |
44 | 0 | } |
45 | | |
46 | | inline Element* |
47 | | nsINode::GetFlattenedTreeParentElementForStyle() const |
48 | 0 | { |
49 | 0 | nsINode* parentNode = GetFlattenedTreeParentNodeForStyle(); |
50 | 0 | if MOZ_LIKELY(parentNode && parentNode->IsElement()) { |
51 | 0 | return parentNode->AsElement(); |
52 | 0 | } |
53 | 0 | |
54 | 0 | return nullptr; |
55 | 0 | } |
56 | | |
57 | | #endif // mozilla_dom_ElementInlines_h |