2013-02-07 00:08:57 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#include "mozilla/dom/HTMLMapElement.h"
|
2013-02-07 00:08:57 -08:00
|
|
|
#include "mozilla/dom/HTMLMapElementBinding.h"
|
2013-02-07 00:08:57 -08:00
|
|
|
#include "nsGkAtoms.h"
|
|
|
|
#include "nsStyleConsts.h"
|
|
|
|
#include "nsContentList.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
|
|
|
NS_IMPL_NS_NEW_HTML_ELEMENT(Map)
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2014-06-19 19:01:40 -07:00
|
|
|
HTMLMapElement::HTMLMapElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-07 00:08:57 -08:00
|
|
|
: nsGenericHTMLElement(aNodeInfo)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-08-01 18:29:05 -07:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLMapElement)
|
|
|
|
|
2013-02-07 00:08:57 -08:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLMapElement,
|
|
|
|
nsGenericHTMLElement)
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAreas)
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
|
|
|
|
|
|
|
NS_IMPL_ADDREF_INHERITED(HTMLMapElement, Element)
|
|
|
|
NS_IMPL_RELEASE_INHERITED(HTMLMapElement, Element)
|
|
|
|
|
|
|
|
|
|
|
|
// QueryInterface implementation for HTMLMapElement
|
|
|
|
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLMapElement)
|
2014-04-27 00:06:00 -07:00
|
|
|
NS_INTERFACE_TABLE_INHERITED(HTMLMapElement, nsIDOMHTMLMapElement)
|
2013-08-07 13:23:08 -07:00
|
|
|
NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLElement)
|
2013-02-07 00:08:57 -08:00
|
|
|
|
|
|
|
NS_IMPL_ELEMENT_CLONE(HTMLMapElement)
|
|
|
|
|
|
|
|
|
2013-02-07 00:08:57 -08:00
|
|
|
nsIHTMLCollection*
|
|
|
|
HTMLMapElement::Areas()
|
2013-02-07 00:08:57 -08:00
|
|
|
{
|
|
|
|
if (!mAreas) {
|
|
|
|
// Not using NS_GetContentList because this should not be cached
|
|
|
|
mAreas = new nsContentList(this,
|
|
|
|
kNameSpaceID_XHTML,
|
|
|
|
nsGkAtoms::area,
|
|
|
|
nsGkAtoms::area,
|
|
|
|
false);
|
|
|
|
}
|
|
|
|
|
2013-02-07 00:08:57 -08:00
|
|
|
return mAreas;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HTMLMapElement::GetAreas(nsIDOMHTMLCollection** aAreas)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aAreas);
|
|
|
|
NS_ADDREF(*aAreas = Areas());
|
2013-02-07 00:08:57 -08:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NS_IMPL_STRING_ATTR(HTMLMapElement, Name, name)
|
|
|
|
|
2013-02-07 00:08:57 -08:00
|
|
|
|
|
|
|
JSObject*
|
2014-04-08 15:27:17 -07:00
|
|
|
HTMLMapElement::WrapNode(JSContext* aCx)
|
2013-02-07 00:08:57 -08:00
|
|
|
{
|
Bug 991742 part 6. Remove the "aScope" argument of binding Wrap() methods. r=bholley
This patch was mostly generated with this command:
find . -name "*.h" -o -name "*.cpp" | xargs sed -e 's/Binding::Wrap(aCx, aScope, this/Binding::Wrap(aCx, this/' -e 's/Binding_workers::Wrap(aCx, aScope, this/Binding_workers::Wrap(aCx, this/' -e 's/Binding::Wrap(cx, scope, this/Binding::Wrap(cx, this/' -i ""
plus a few manual fixes to dom/bindings/Codegen.py, js/xpconnect/src/event_impl_gen.py, and a few C++ files that were not caught in the search-and-replace above.
2014-04-08 15:27:17 -07:00
|
|
|
return HTMLMapElementBinding::Wrap(aCx, this);
|
2013-02-07 00:08:57 -08:00
|
|
|
}
|
|
|
|
|
2013-02-07 00:08:57 -08:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|