HTMLMapElement.cpp (1476B)
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 #include "mozilla/dom/HTMLMapElement.h" 8 9 #include "mozilla/dom/HTMLMapElementBinding.h" 10 #include "nsCOMPtr.h" 11 #include "nsContentList.h" 12 #include "nsGkAtoms.h" 13 #include "nsStyleConsts.h" 14 15 NS_IMPL_NS_NEW_HTML_ELEMENT(Map) 16 17 namespace mozilla::dom { 18 19 HTMLMapElement::HTMLMapElement( 20 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo) 21 : nsGenericHTMLElement(std::move(aNodeInfo)) {} 22 23 NS_IMPL_CYCLE_COLLECTION_INHERITED(HTMLMapElement, nsGenericHTMLElement, mAreas) 24 25 NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(HTMLMapElement, 26 nsGenericHTMLElement) 27 28 NS_IMPL_ELEMENT_CLONE(HTMLMapElement) 29 30 nsIHTMLCollection* HTMLMapElement::Areas() { 31 if (!mAreas) { 32 // Not using NS_GetContentList because this should not be cached 33 mAreas = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::area, 34 nsGkAtoms::area, false); 35 } 36 37 return mAreas; 38 } 39 40 JSObject* HTMLMapElement::WrapNode(JSContext* aCx, 41 JS::Handle<JSObject*> aGivenProto) { 42 return HTMLMapElement_Binding::Wrap(aCx, this, aGivenProto); 43 } 44 45 } // namespace mozilla::dom