diff options
Diffstat (limited to 'dom/base/ElementInlines.h')
-rw-r--r-- | dom/base/ElementInlines.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/dom/base/ElementInlines.h b/dom/base/ElementInlines.h index 540512d89..16e8c2fc6 100644 --- a/dom/base/ElementInlines.h +++ b/dom/base/ElementInlines.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -26,6 +25,17 @@ Element::UnregisterActivityObserver() OwnerDoc()->UnregisterActivityObserver(this); } +inline Element* +Element::GetFlattenedTreeParentElementForStyle() const +{ + nsINode* parentNode = GetFlattenedTreeParentNodeForStyle(); + if MOZ_LIKELY(parentNode && parentNode->IsElement()) { + return parentNode->AsElement(); + } + + return nullptr; +} + } // namespace dom } // namespace mozilla |