Bug 1880216 - Migrate Fenix docs into Sphinx. r=owlish,geckoview-reviewers,android...
[gecko.git] / dom / html / HTMLMapElement.cpp
blobe4d3ca4f413b70cd7283784528aaa5fc3aa8c25c
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 #include "mozilla/dom/HTMLMapElement.h"
8 #include "mozilla/dom/HTMLMapElementBinding.h"
9 #include "nsGkAtoms.h"
10 #include "nsStyleConsts.h"
11 #include "nsContentList.h"
12 #include "nsCOMPtr.h"
14 NS_IMPL_NS_NEW_HTML_ELEMENT(Map)
16 namespace mozilla::dom {
18 HTMLMapElement::HTMLMapElement(
19 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
20 : nsGenericHTMLElement(std::move(aNodeInfo)) {}
22 NS_IMPL_CYCLE_COLLECTION_INHERITED(HTMLMapElement, nsGenericHTMLElement, mAreas)
24 NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(HTMLMapElement,
25 nsGenericHTMLElement)
27 NS_IMPL_ELEMENT_CLONE(HTMLMapElement)
29 nsIHTMLCollection* HTMLMapElement::Areas() {
30 if (!mAreas) {
31 // Not using NS_GetContentList because this should not be cached
32 mAreas = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::area,
33 nsGkAtoms::area, false);
36 return mAreas;
39 JSObject* HTMLMapElement::WrapNode(JSContext* aCx,
40 JS::Handle<JSObject*> aGivenProto) {
41 return HTMLMapElement_Binding::Wrap(aCx, this, aGivenProto);
44 } // namespace mozilla::dom