/src/mozilla-central/dom/html/HTMLMapElement.cpp
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 | | #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" |
13 | | |
14 | | NS_IMPL_NS_NEW_HTML_ELEMENT(Map) |
15 | | |
16 | | namespace mozilla { |
17 | | namespace dom { |
18 | | |
19 | | HTMLMapElement::HTMLMapElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo) |
20 | | : nsGenericHTMLElement(std::move(aNodeInfo)) |
21 | 0 | { |
22 | 0 | } |
23 | | |
24 | | NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLMapElement) |
25 | | |
26 | 0 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLMapElement, |
27 | 0 | nsGenericHTMLElement) |
28 | 0 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAreas) |
29 | 0 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END |
30 | | |
31 | | NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(HTMLMapElement, |
32 | | nsGenericHTMLElement) |
33 | | |
34 | | NS_IMPL_ELEMENT_CLONE(HTMLMapElement) |
35 | | |
36 | | |
37 | | nsIHTMLCollection* |
38 | | HTMLMapElement::Areas() |
39 | 0 | { |
40 | 0 | if (!mAreas) { |
41 | 0 | // Not using NS_GetContentList because this should not be cached |
42 | 0 | mAreas = new nsContentList(this, |
43 | 0 | kNameSpaceID_XHTML, |
44 | 0 | nsGkAtoms::area, |
45 | 0 | nsGkAtoms::area, |
46 | 0 | false); |
47 | 0 | } |
48 | 0 |
|
49 | 0 | return mAreas; |
50 | 0 | } |
51 | | |
52 | | |
53 | | JSObject* |
54 | | HTMLMapElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) |
55 | 0 | { |
56 | 0 | return HTMLMapElement_Binding::Wrap(aCx, this, aGivenProto); |
57 | 0 | } |
58 | | |
59 | | } // namespace dom |
60 | | } // namespace mozilla |