2001-10-26 09:31:32 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2011-07-23 09:45:38 +00:00
|
|
|
|
2013-02-08 12:20:11 +00:00
|
|
|
#include "mozilla/dom/HTMLSharedElement.h"
|
2013-02-08 12:20:11 +00:00
|
|
|
#include "mozilla/dom/HTMLBaseElementBinding.h"
|
|
|
|
#include "mozilla/dom/HTMLDirectoryElementBinding.h"
|
|
|
|
#include "mozilla/dom/HTMLHeadElementBinding.h"
|
|
|
|
#include "mozilla/dom/HTMLHtmlElementBinding.h"
|
|
|
|
#include "mozilla/dom/HTMLParamElementBinding.h"
|
|
|
|
#include "mozilla/dom/HTMLQuoteElementBinding.h"
|
2011-08-11 13:29:50 +00:00
|
|
|
|
2013-02-08 12:20:11 +00:00
|
|
|
#include "nsAttrValueInlines.h"
|
2001-10-26 09:31:32 +00:00
|
|
|
#include "nsStyleConsts.h"
|
2004-07-20 06:11:27 +00:00
|
|
|
#include "nsRuleData.h"
|
2004-01-26 19:22:05 +00:00
|
|
|
#include "nsMappedAttributes.h"
|
2011-08-11 13:29:50 +00:00
|
|
|
#include "nsContentUtils.h"
|
2013-09-07 13:01:08 +00:00
|
|
|
#include "nsIURI.h"
|
2010-11-12 23:29:25 +00:00
|
|
|
|
2013-02-08 12:20:11 +00:00
|
|
|
NS_IMPL_NS_NEW_HTML_ELEMENT(Shared)
|
2001-10-26 09:31:32 +00:00
|
|
|
|
2013-01-04 17:02:14 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
2009-09-25 16:50:26 +00:00
|
|
|
|
2013-02-08 12:20:11 +00:00
|
|
|
extern nsAttrValue::EnumTable kListTypeTable[];
|
2001-10-26 09:31:32 +00:00
|
|
|
|
2013-02-08 12:20:11 +00:00
|
|
|
HTMLSharedElement::~HTMLSharedElement()
|
2001-10-26 09:31:32 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-02-08 12:20:11 +00:00
|
|
|
NS_IMPL_ADDREF_INHERITED(HTMLSharedElement, Element)
|
|
|
|
NS_IMPL_RELEASE_INHERITED(HTMLSharedElement, Element)
|
2010-01-12 13:08:43 +00:00
|
|
|
|
2013-02-08 12:20:11 +00:00
|
|
|
// QueryInterface implementation for HTMLSharedElement
|
2013-05-21 13:38:15 +00:00
|
|
|
NS_INTERFACE_MAP_BEGIN(HTMLSharedElement)
|
2001-10-26 09:31:32 +00:00
|
|
|
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLBaseElement, base)
|
2004-04-12 22:25:17 +00:00
|
|
|
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLDirectoryElement, dir)
|
|
|
|
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLQuoteElement, q)
|
|
|
|
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLQuoteElement, blockquote)
|
2010-04-19 19:06:00 +00:00
|
|
|
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLHeadElement, head)
|
|
|
|
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLHtmlElement, html)
|
2013-08-07 20:23:08 +00:00
|
|
|
NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement)
|
2001-10-26 09:31:32 +00:00
|
|
|
|
2004-05-18 20:58:12 +00:00
|
|
|
|
2013-02-08 12:20:11 +00:00
|
|
|
NS_IMPL_ELEMENT_CLONE(HTMLSharedElement)
|
2001-10-26 09:31:32 +00:00
|
|
|
|
2004-04-12 22:25:17 +00:00
|
|
|
// nsIDOMHTMLQuoteElement
|
2013-02-08 12:20:11 +00:00
|
|
|
NS_IMPL_URI_ATTR(HTMLSharedElement, Cite, cite)
|
2004-04-12 22:25:17 +00:00
|
|
|
|
2010-04-19 19:06:00 +00:00
|
|
|
// nsIDOMHTMLHeadElement
|
2011-06-18 09:01:57 +00:00
|
|
|
// Empty
|
2001-10-26 09:31:32 +00:00
|
|
|
|
2010-04-19 19:06:00 +00:00
|
|
|
// nsIDOMHTMLHtmlElement
|
2013-02-08 12:20:11 +00:00
|
|
|
NS_IMPL_STRING_ATTR(HTMLSharedElement, Version, version)
|
2010-04-19 19:06:00 +00:00
|
|
|
|
2001-10-26 09:31:32 +00:00
|
|
|
// nsIDOMHTMLBaseElement
|
2013-02-08 12:20:11 +00:00
|
|
|
NS_IMPL_STRING_ATTR(HTMLSharedElement, Target, target)
|
|
|
|
|
2010-10-07 16:39:01 +00:00
|
|
|
NS_IMETHODIMP
|
2013-02-08 12:20:11 +00:00
|
|
|
HTMLSharedElement::GetHref(nsAString& aValue)
|
2010-10-07 16:39:01 +00:00
|
|
|
{
|
|
|
|
nsAutoString href;
|
|
|
|
GetAttr(kNameSpaceID_None, nsGkAtoms::href, href);
|
|
|
|
|
|
|
|
nsCOMPtr<nsIURI> uri;
|
2011-10-18 10:53:36 +00:00
|
|
|
nsIDocument* doc = OwnerDoc();
|
2011-10-18 11:19:44 +00:00
|
|
|
nsContentUtils::NewURIWithDocumentCharset(
|
|
|
|
getter_AddRefs(uri), href, doc, doc->GetDocumentURI());
|
|
|
|
|
2010-10-07 16:39:01 +00:00
|
|
|
if (!uri) {
|
|
|
|
aValue = href;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2012-09-02 02:35:17 +00:00
|
|
|
nsAutoCString spec;
|
2010-10-07 16:39:01 +00:00
|
|
|
uri->GetSpec(spec);
|
|
|
|
CopyUTF8toUTF16(spec, aValue);
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2013-02-08 12:20:11 +00:00
|
|
|
|
2010-10-07 16:39:01 +00:00
|
|
|
NS_IMETHODIMP
|
2013-02-08 12:20:11 +00:00
|
|
|
HTMLSharedElement::SetHref(const nsAString& aValue)
|
2010-10-07 16:39:01 +00:00
|
|
|
{
|
|
|
|
return SetAttrHelper(nsGkAtoms::href, aValue);
|
|
|
|
}
|
|
|
|
|
2001-10-26 09:31:32 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool
|
2013-02-08 12:20:11 +00:00
|
|
|
HTMLSharedElement::ParseAttribute(int32_t aNamespaceID,
|
|
|
|
nsIAtom* aAttribute,
|
|
|
|
const nsAString& aValue,
|
|
|
|
nsAttrValue& aResult)
|
2001-10-26 09:31:32 +00:00
|
|
|
{
|
2010-08-20 06:05:05 +00:00
|
|
|
if (aNamespaceID == kNameSpaceID_None &&
|
2011-08-08 17:31:32 +00:00
|
|
|
mNodeInfo->Equals(nsGkAtoms::dir)) {
|
2010-08-20 06:05:05 +00:00
|
|
|
if (aAttribute == nsGkAtoms::type) {
|
2013-01-04 17:02:14 +00:00
|
|
|
return aResult.ParseEnumValue(aValue, mozilla::dom::kListTypeTable, false);
|
2004-03-04 02:06:28 +00:00
|
|
|
}
|
2010-08-20 06:05:05 +00:00
|
|
|
if (aAttribute == nsGkAtoms::start) {
|
|
|
|
return aResult.ParseIntWithBounds(aValue, 1);
|
2001-10-26 09:31:32 +00:00
|
|
|
}
|
2004-04-12 22:25:17 +00:00
|
|
|
}
|
2001-10-26 09:31:32 +00:00
|
|
|
|
2005-11-29 16:37:15 +00:00
|
|
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
|
|
|
aResult);
|
2001-10-26 09:31:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-08-08 17:31:32 +00:00
|
|
|
DirectoryMapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
2004-04-12 22:25:17 +00:00
|
|
|
nsRuleData* aData)
|
2001-10-26 09:31:32 +00:00
|
|
|
{
|
2007-10-08 21:58:22 +00:00
|
|
|
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(List)) {
|
2011-03-18 03:14:31 +00:00
|
|
|
nsCSSValue* listStyleType = aData->ValueForListStyleType();
|
|
|
|
if (listStyleType->GetUnit() == eCSSUnit_Null) {
|
2004-04-12 22:25:17 +00:00
|
|
|
// type: enum
|
2006-12-26 17:47:52 +00:00
|
|
|
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::type);
|
2004-04-13 16:45:59 +00:00
|
|
|
if (value) {
|
2005-09-21 19:14:30 +00:00
|
|
|
if (value->Type() == nsAttrValue::eEnum) {
|
2011-03-18 03:14:31 +00:00
|
|
|
listStyleType->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
|
2005-09-21 19:14:30 +00:00
|
|
|
} else {
|
2011-03-18 03:14:31 +00:00
|
|
|
listStyleType->SetIntValue(NS_STYLE_LIST_STYLE_DISC, eCSSUnit_Enumerated);
|
2005-09-21 19:14:30 +00:00
|
|
|
}
|
2004-04-12 22:25:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-10-26 09:31:32 +00:00
|
|
|
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
|
|
|
|
}
|
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
NS_IMETHODIMP_(bool)
|
2013-02-08 12:20:11 +00:00
|
|
|
HTMLSharedElement::IsAttributeMapped(const nsIAtom* aAttribute) const
|
2001-10-26 09:31:32 +00:00
|
|
|
{
|
2006-12-26 17:47:52 +00:00
|
|
|
if (mNodeInfo->Equals(nsGkAtoms::dir)) {
|
2004-04-12 22:25:17 +00:00
|
|
|
static const MappedAttributeEntry attributes[] = {
|
2006-12-26 17:47:52 +00:00
|
|
|
{ &nsGkAtoms::type },
|
|
|
|
// { &nsGkAtoms::compact }, // XXX
|
2012-07-30 14:20:58 +00:00
|
|
|
{ nullptr}
|
2004-04-12 22:25:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const MappedAttributeEntry* const map[] = {
|
|
|
|
attributes,
|
|
|
|
sCommonAttributeMap,
|
|
|
|
};
|
|
|
|
|
2011-12-18 10:09:27 +00:00
|
|
|
return FindAttributeDependence(aAttribute, map);
|
2001-10-26 09:31:32 +00:00
|
|
|
}
|
|
|
|
|
2004-02-25 21:04:50 +00:00
|
|
|
return nsGenericHTMLElement::IsAttributeMapped(aAttribute);
|
2001-10-26 09:31:32 +00:00
|
|
|
}
|
|
|
|
|
2011-01-14 15:34:39 +00:00
|
|
|
static void
|
|
|
|
SetBaseURIUsingFirstBaseWithHref(nsIDocument* aDocument, nsIContent* aMustMatch)
|
2010-04-23 16:10:07 +00:00
|
|
|
{
|
2011-01-14 15:34:39 +00:00
|
|
|
NS_PRECONDITION(aDocument, "Need a document!");
|
2010-04-23 16:10:07 +00:00
|
|
|
|
2011-01-14 15:34:39 +00:00
|
|
|
for (nsIContent* child = aDocument->GetFirstChild(); child;
|
|
|
|
child = child->GetNextNode()) {
|
2015-03-03 11:08:59 +00:00
|
|
|
if (child->IsHTMLElement(nsGkAtoms::base) &&
|
2010-04-23 16:10:07 +00:00
|
|
|
child->HasAttr(kNameSpaceID_None, nsGkAtoms::href)) {
|
|
|
|
if (aMustMatch && child != aMustMatch) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Resolve the <base> element's href relative to our document URI
|
|
|
|
nsAutoString href;
|
|
|
|
child->GetAttr(kNameSpaceID_None, nsGkAtoms::href, href);
|
|
|
|
|
|
|
|
nsCOMPtr<nsIURI> newBaseURI;
|
|
|
|
nsContentUtils::NewURIWithDocumentCharset(
|
2011-01-14 15:34:39 +00:00
|
|
|
getter_AddRefs(newBaseURI), href, aDocument,
|
|
|
|
aDocument->GetDocumentURI());
|
2010-04-23 16:10:07 +00:00
|
|
|
|
|
|
|
// Try to set our base URI. If that fails, try to set base URI to null
|
2011-01-14 15:34:39 +00:00
|
|
|
nsresult rv = aDocument->SetBaseURI(newBaseURI);
|
2013-09-24 21:56:52 +00:00
|
|
|
aDocument->SetChromeXHRDocBaseURI(newBaseURI);
|
2010-04-23 16:10:07 +00:00
|
|
|
if (NS_FAILED(rv)) {
|
2012-07-30 14:20:58 +00:00
|
|
|
aDocument->SetBaseURI(nullptr);
|
2013-09-24 21:56:52 +00:00
|
|
|
aDocument->SetChromeXHRDocBaseURI(nullptr);
|
2010-04-23 16:10:07 +00:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-30 14:20:58 +00:00
|
|
|
aDocument->SetBaseURI(nullptr);
|
2011-01-14 15:34:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
SetBaseTargetUsingFirstBaseWithTarget(nsIDocument* aDocument,
|
|
|
|
nsIContent* aMustMatch)
|
|
|
|
{
|
|
|
|
NS_PRECONDITION(aDocument, "Need a document!");
|
|
|
|
|
|
|
|
for (nsIContent* child = aDocument->GetFirstChild(); child;
|
|
|
|
child = child->GetNextNode()) {
|
2015-03-03 11:08:59 +00:00
|
|
|
if (child->IsHTMLElement(nsGkAtoms::base) &&
|
2011-01-14 15:34:39 +00:00
|
|
|
child->HasAttr(kNameSpaceID_None, nsGkAtoms::target)) {
|
|
|
|
if (aMustMatch && child != aMustMatch) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsString target;
|
|
|
|
child->GetAttr(kNameSpaceID_None, nsGkAtoms::target, target);
|
|
|
|
aDocument->SetBaseTarget(target);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
aDocument->SetBaseTarget(EmptyString());
|
2010-04-23 16:10:07 +00:00
|
|
|
}
|
|
|
|
|
2009-09-25 16:50:26 +00:00
|
|
|
nsresult
|
2013-02-08 12:20:11 +00:00
|
|
|
HTMLSharedElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
|
|
|
nsIAtom* aPrefix, const nsAString& aValue,
|
|
|
|
bool aNotify)
|
2009-09-25 16:50:26 +00:00
|
|
|
{
|
2011-11-16 07:50:19 +00:00
|
|
|
nsresult rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix,
|
|
|
|
aValue, aNotify);
|
2010-04-23 16:10:07 +00:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2009-09-25 16:50:26 +00:00
|
|
|
|
|
|
|
// If the href attribute of a <base> tag is changing, we may need to update
|
|
|
|
// the document's base URI, which will cause all the links on the page to be
|
2011-01-14 15:34:39 +00:00
|
|
|
// re-resolved given the new base. If the target attribute is changing, we
|
|
|
|
// similarly need to change the base target.
|
|
|
|
if (mNodeInfo->Equals(nsGkAtoms::base) &&
|
2009-09-25 16:50:26 +00:00
|
|
|
aNameSpaceID == kNameSpaceID_None &&
|
2011-01-14 15:34:39 +00:00
|
|
|
IsInDoc()) {
|
|
|
|
if (aName == nsGkAtoms::href) {
|
2014-10-02 19:07:24 +00:00
|
|
|
SetBaseURIUsingFirstBaseWithHref(GetUncomposedDoc(), this);
|
2011-01-14 15:34:39 +00:00
|
|
|
} else if (aName == nsGkAtoms::target) {
|
2014-10-02 19:07:24 +00:00
|
|
|
SetBaseTargetUsingFirstBaseWithTarget(GetUncomposedDoc(), this);
|
2011-01-14 15:34:39 +00:00
|
|
|
}
|
2009-09-25 16:50:26 +00:00
|
|
|
}
|
|
|
|
|
2010-04-23 16:10:07 +00:00
|
|
|
return NS_OK;
|
2009-09-25 16:50:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
2013-02-08 12:20:11 +00:00
|
|
|
HTMLSharedElement::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
|
|
|
bool aNotify)
|
2009-09-25 16:50:26 +00:00
|
|
|
{
|
|
|
|
nsresult rv = nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aName, aNotify);
|
2010-04-23 16:10:07 +00:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2009-09-25 16:50:26 +00:00
|
|
|
|
|
|
|
// If we're the first <base> with an href and our href attribute is being
|
|
|
|
// unset, then we're no longer the first <base> with an href, and we need to
|
2011-01-14 15:34:39 +00:00
|
|
|
// find the new one. Similar for target.
|
|
|
|
if (mNodeInfo->Equals(nsGkAtoms::base) &&
|
2009-09-25 16:50:26 +00:00
|
|
|
aNameSpaceID == kNameSpaceID_None &&
|
2011-01-14 15:34:39 +00:00
|
|
|
IsInDoc()) {
|
|
|
|
if (aName == nsGkAtoms::href) {
|
2014-10-02 19:07:24 +00:00
|
|
|
SetBaseURIUsingFirstBaseWithHref(GetUncomposedDoc(), nullptr);
|
2011-01-14 15:34:39 +00:00
|
|
|
} else if (aName == nsGkAtoms::target) {
|
2014-10-02 19:07:24 +00:00
|
|
|
SetBaseTargetUsingFirstBaseWithTarget(GetUncomposedDoc(), nullptr);
|
2011-01-14 15:34:39 +00:00
|
|
|
}
|
2009-09-25 16:50:26 +00:00
|
|
|
}
|
|
|
|
|
2010-04-23 16:10:07 +00:00
|
|
|
return NS_OK;
|
2009-09-25 16:50:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
2013-02-08 12:20:11 +00:00
|
|
|
HTMLSharedElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|
|
|
nsIContent* aBindingParent,
|
|
|
|
bool aCompileEventHandlers)
|
2009-09-25 16:50:26 +00:00
|
|
|
{
|
|
|
|
nsresult rv = nsGenericHTMLElement::BindToTree(aDocument, aParent,
|
|
|
|
aBindingParent,
|
|
|
|
aCompileEventHandlers);
|
2010-04-23 16:10:07 +00:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2009-09-25 16:50:26 +00:00
|
|
|
|
2011-01-14 15:34:39 +00:00
|
|
|
// The document stores a pointer to its base URI and base target, which we may
|
2009-09-25 16:50:26 +00:00
|
|
|
// need to update here.
|
2011-01-14 15:34:39 +00:00
|
|
|
if (mNodeInfo->Equals(nsGkAtoms::base) &&
|
|
|
|
aDocument) {
|
|
|
|
if (HasAttr(kNameSpaceID_None, nsGkAtoms::href)) {
|
|
|
|
SetBaseURIUsingFirstBaseWithHref(aDocument, this);
|
|
|
|
}
|
|
|
|
if (HasAttr(kNameSpaceID_None, nsGkAtoms::target)) {
|
|
|
|
SetBaseTargetUsingFirstBaseWithTarget(aDocument, this);
|
|
|
|
}
|
2009-09-25 16:50:26 +00:00
|
|
|
}
|
|
|
|
|
2010-04-23 16:10:07 +00:00
|
|
|
return NS_OK;
|
2009-09-25 16:50:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2013-02-08 12:20:11 +00:00
|
|
|
HTMLSharedElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
2009-09-25 16:50:26 +00:00
|
|
|
{
|
2014-10-02 19:07:24 +00:00
|
|
|
nsIDocument* doc = GetUncomposedDoc();
|
2009-09-25 16:50:26 +00:00
|
|
|
|
|
|
|
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
|
|
|
|
|
|
|
|
// If we're removing a <base> from a document, we may need to update the
|
2011-01-14 15:34:39 +00:00
|
|
|
// document's base URI and base target
|
|
|
|
if (doc && mNodeInfo->Equals(nsGkAtoms::base)) {
|
|
|
|
if (HasAttr(kNameSpaceID_None, nsGkAtoms::href)) {
|
2012-07-30 14:20:58 +00:00
|
|
|
SetBaseURIUsingFirstBaseWithHref(doc, nullptr);
|
2010-04-23 16:10:07 +00:00
|
|
|
}
|
2011-01-14 15:34:39 +00:00
|
|
|
if (HasAttr(kNameSpaceID_None, nsGkAtoms::target)) {
|
2012-07-30 14:20:58 +00:00
|
|
|
SetBaseTargetUsingFirstBaseWithTarget(doc, nullptr);
|
2010-04-23 16:10:07 +00:00
|
|
|
}
|
2009-09-25 16:50:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-01-12 19:45:38 +00:00
|
|
|
nsMapRuleToAttributesFunc
|
2013-02-08 12:20:11 +00:00
|
|
|
HTMLSharedElement::GetAttributeMappingFunction() const
|
2001-10-26 09:31:32 +00:00
|
|
|
{
|
2011-08-08 17:31:32 +00:00
|
|
|
if (mNodeInfo->Equals(nsGkAtoms::dir)) {
|
|
|
|
return &DirectoryMapAttributesIntoRule;
|
2004-04-12 22:25:17 +00:00
|
|
|
}
|
2005-01-12 19:45:38 +00:00
|
|
|
|
|
|
|
return nsGenericHTMLElement::GetAttributeMappingFunction();
|
2001-10-26 09:31:32 +00:00
|
|
|
}
|
2013-02-08 12:20:11 +00:00
|
|
|
|
2013-02-08 12:20:11 +00:00
|
|
|
JSObject*
|
2014-04-08 22:27:17 +00:00
|
|
|
HTMLSharedElement::WrapNode(JSContext *aCx)
|
2013-02-08 12:20:11 +00:00
|
|
|
{
|
|
|
|
if (mNodeInfo->Equals(nsGkAtoms::param)) {
|
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 22:27:17 +00:00
|
|
|
return HTMLParamElementBinding::Wrap(aCx, this);
|
2013-02-08 12:20:11 +00:00
|
|
|
}
|
|
|
|
if (mNodeInfo->Equals(nsGkAtoms::base)) {
|
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 22:27:17 +00:00
|
|
|
return HTMLBaseElementBinding::Wrap(aCx, this);
|
2013-02-08 12:20:11 +00:00
|
|
|
}
|
|
|
|
if (mNodeInfo->Equals(nsGkAtoms::dir)) {
|
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 22:27:17 +00:00
|
|
|
return HTMLDirectoryElementBinding::Wrap(aCx, this);
|
2013-02-08 12:20:11 +00:00
|
|
|
}
|
|
|
|
if (mNodeInfo->Equals(nsGkAtoms::q) ||
|
|
|
|
mNodeInfo->Equals(nsGkAtoms::blockquote)) {
|
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 22:27:17 +00:00
|
|
|
return HTMLQuoteElementBinding::Wrap(aCx, this);
|
2013-02-08 12:20:11 +00:00
|
|
|
}
|
|
|
|
if (mNodeInfo->Equals(nsGkAtoms::head)) {
|
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 22:27:17 +00:00
|
|
|
return HTMLHeadElementBinding::Wrap(aCx, this);
|
2013-02-08 12:20:11 +00:00
|
|
|
}
|
|
|
|
MOZ_ASSERT(mNodeInfo->Equals(nsGkAtoms::html));
|
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 22:27:17 +00:00
|
|
|
return HTMLHtmlElementBinding::Wrap(aCx, this);
|
2013-02-08 12:20:11 +00:00
|
|
|
}
|
|
|
|
|
2013-02-08 12:20:11 +00:00
|
|
|
} // namespace mozilla
|
|
|
|
} // namespace dom
|