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/. */
7 #ifndef mozilla_dom_ElementInlines_h
8 #define mozilla_dom_ElementInlines_h
10 #include "mozilla/dom/Element.h"
11 #include "mozilla/ServoBindingTypes.h"
12 #include "nsIContentInlines.h"
13 #include "mozilla/dom/Document.h"
15 namespace mozilla::dom
{
17 inline void Element::RegisterActivityObserver() {
18 OwnerDoc()->RegisterActivityObserver(this);
21 inline void Element::UnregisterActivityObserver() {
22 OwnerDoc()->UnregisterActivityObserver(this);
25 } // namespace mozilla::dom
27 inline mozilla::dom::Element
* nsINode::GetFlattenedTreeParentElement() const {
28 nsINode
* parentNode
= GetFlattenedTreeParentNode();
29 if MOZ_LIKELY (parentNode
&& parentNode
->IsElement()) {
30 return parentNode
->AsElement();
36 inline mozilla::dom::Element
* nsINode::GetFlattenedTreeParentElementForStyle()
38 nsINode
* parentNode
= GetFlattenedTreeParentNodeForStyle();
39 if (MOZ_LIKELY(parentNode
&& parentNode
->IsElement())) {
40 return parentNode
->AsElement();
45 #endif // mozilla_dom_ElementInlines_h