Backed out changeset c724fbd9c326 (bug 1332812) for build bustage. r=backout on a CLOSED TREE
This commit is contained in:
@@ -601,6 +601,12 @@ Element::ClassList()
|
|||||||
return slots->mClassList;
|
return slots->mClassList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Element::GetClassList(nsISupports** aClassList)
|
||||||
|
{
|
||||||
|
NS_ADDREF(*aClassList = ClassList());
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Element::GetAttributeNames(nsTArray<nsString>& aResult)
|
Element::GetAttributeNames(nsTArray<nsString>& aResult)
|
||||||
{
|
{
|
||||||
@@ -617,6 +623,13 @@ Element::GetElementsByTagName(const nsAString& aLocalName)
|
|||||||
return NS_GetContentList(this, kNameSpaceID_Unknown, aLocalName);
|
return NS_GetContentList(this, kNameSpaceID_Unknown, aLocalName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Element::GetElementsByTagName(const nsAString& aLocalName,
|
||||||
|
nsIDOMHTMLCollection** aResult)
|
||||||
|
{
|
||||||
|
*aResult = GetElementsByTagName(aLocalName).take();
|
||||||
|
}
|
||||||
|
|
||||||
nsIFrame*
|
nsIFrame*
|
||||||
Element::GetStyledFrame()
|
Element::GetStyledFrame()
|
||||||
{
|
{
|
||||||
@@ -1403,6 +1416,21 @@ Element::GetElementsByTagNameNS(const nsAString& aNamespaceURI,
|
|||||||
return NS_GetContentList(this, nameSpaceId, aLocalName);
|
return NS_GetContentList(this, nameSpaceId, aLocalName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
Element::GetElementsByTagNameNS(const nsAString& namespaceURI,
|
||||||
|
const nsAString& localName,
|
||||||
|
nsIDOMHTMLCollection** aResult)
|
||||||
|
{
|
||||||
|
mozilla::ErrorResult rv;
|
||||||
|
nsCOMPtr<nsIHTMLCollection> list =
|
||||||
|
GetElementsByTagNameNS(namespaceURI, localName, rv);
|
||||||
|
if (rv.Failed()) {
|
||||||
|
return rv.StealNSResult();
|
||||||
|
}
|
||||||
|
list.forget(aResult);
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Element::HasAttributeNS(const nsAString& aNamespaceURI,
|
Element::HasAttributeNS(const nsAString& aNamespaceURI,
|
||||||
const nsAString& aLocalName) const
|
const nsAString& aLocalName) const
|
||||||
@@ -1426,6 +1454,15 @@ Element::GetElementsByClassName(const nsAString& aClassNames)
|
|||||||
return nsContentUtils::GetElementsByClassName(this, aClassNames);
|
return nsContentUtils::GetElementsByClassName(this, aClassNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
Element::GetElementsByClassName(const nsAString& aClassNames,
|
||||||
|
nsIDOMHTMLCollection** aResult)
|
||||||
|
{
|
||||||
|
*aResult =
|
||||||
|
nsContentUtils::GetElementsByClassName(this, aClassNames).take();
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the count of descendants (inclusive of aContent) in
|
* Returns the count of descendants (inclusive of aContent) in
|
||||||
* the uncomposed document that are explicitly set as editable.
|
* the uncomposed document that are explicitly set as editable.
|
||||||
|
|||||||
@@ -1093,6 +1093,20 @@ public:
|
|||||||
*/
|
*/
|
||||||
static CORSMode AttrValueToCORSMode(const nsAttrValue* aValue);
|
static CORSMode AttrValueToCORSMode(const nsAttrValue* aValue);
|
||||||
|
|
||||||
|
// These are just used to implement nsIDOMElement using
|
||||||
|
// NS_FORWARD_NSIDOMELEMENT_TO_GENERIC and for quickstubs.
|
||||||
|
void
|
||||||
|
GetElementsByTagName(const nsAString& aQualifiedName,
|
||||||
|
nsIDOMHTMLCollection** aResult);
|
||||||
|
nsresult
|
||||||
|
GetElementsByTagNameNS(const nsAString& aNamespaceURI,
|
||||||
|
const nsAString& aLocalName,
|
||||||
|
nsIDOMHTMLCollection** aResult);
|
||||||
|
nsresult
|
||||||
|
GetElementsByClassName(const nsAString& aClassNames,
|
||||||
|
nsIDOMHTMLCollection** aResult);
|
||||||
|
void GetClassList(nsISupports** aClassList);
|
||||||
|
|
||||||
virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) final override;
|
virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) final override;
|
||||||
|
|
||||||
nsINode* GetScopeChainParent() const override;
|
nsINode* GetScopeChainParent() const override;
|
||||||
@@ -1641,6 +1655,31 @@ NS_IMETHOD GetTagName(nsAString& aTagName) final override \
|
|||||||
Element::GetTagName(aTagName); \
|
Element::GetTagName(aTagName); \
|
||||||
return NS_OK; \
|
return NS_OK; \
|
||||||
} \
|
} \
|
||||||
|
NS_IMETHOD GetId(nsAString& aId) final override \
|
||||||
|
{ \
|
||||||
|
Element::GetId(aId); \
|
||||||
|
return NS_OK; \
|
||||||
|
} \
|
||||||
|
NS_IMETHOD SetId(const nsAString& aId) final override \
|
||||||
|
{ \
|
||||||
|
Element::SetId(aId); \
|
||||||
|
return NS_OK; \
|
||||||
|
} \
|
||||||
|
NS_IMETHOD GetClassName(nsAString& aClassName) final override \
|
||||||
|
{ \
|
||||||
|
Element::GetClassName(aClassName); \
|
||||||
|
return NS_OK; \
|
||||||
|
} \
|
||||||
|
NS_IMETHOD SetClassName(const nsAString& aClassName) final override \
|
||||||
|
{ \
|
||||||
|
Element::SetClassName(aClassName); \
|
||||||
|
return NS_OK; \
|
||||||
|
} \
|
||||||
|
NS_IMETHOD GetClassList(nsISupports** aClassList) final override \
|
||||||
|
{ \
|
||||||
|
Element::GetClassList(aClassList); \
|
||||||
|
return NS_OK; \
|
||||||
|
} \
|
||||||
NS_IMETHOD GetAttributes(nsIDOMMozNamedAttrMap** aAttributes) final override \
|
NS_IMETHOD GetAttributes(nsIDOMMozNamedAttrMap** aAttributes) final override \
|
||||||
{ \
|
{ \
|
||||||
NS_ADDREF(*aAttributes = Attributes()); \
|
NS_ADDREF(*aAttributes = Attributes()); \
|
||||||
@@ -1655,6 +1694,13 @@ NS_IMETHOD GetAttribute(const nsAString& name, nsAString& _retval) final \
|
|||||||
_retval = attr; \
|
_retval = attr; \
|
||||||
return NS_OK; \
|
return NS_OK; \
|
||||||
} \
|
} \
|
||||||
|
NS_IMETHOD GetAttributeNS(const nsAString& namespaceURI, \
|
||||||
|
const nsAString& localName, \
|
||||||
|
nsAString& _retval) final override \
|
||||||
|
{ \
|
||||||
|
Element::GetAttributeNS(namespaceURI, localName, _retval); \
|
||||||
|
return NS_OK; \
|
||||||
|
} \
|
||||||
NS_IMETHOD SetAttribute(const nsAString& name, \
|
NS_IMETHOD SetAttribute(const nsAString& name, \
|
||||||
const nsAString& value) override \
|
const nsAString& value) override \
|
||||||
{ \
|
{ \
|
||||||
@@ -1662,6 +1708,28 @@ NS_IMETHOD SetAttribute(const nsAString& name, \
|
|||||||
Element::SetAttribute(name, value, rv); \
|
Element::SetAttribute(name, value, rv); \
|
||||||
return rv.StealNSResult(); \
|
return rv.StealNSResult(); \
|
||||||
} \
|
} \
|
||||||
|
NS_IMETHOD SetAttributeNS(const nsAString& namespaceURI, \
|
||||||
|
const nsAString& qualifiedName, \
|
||||||
|
const nsAString& value) final override \
|
||||||
|
{ \
|
||||||
|
mozilla::ErrorResult rv; \
|
||||||
|
Element::SetAttributeNS(namespaceURI, qualifiedName, value, rv); \
|
||||||
|
return rv.StealNSResult(); \
|
||||||
|
} \
|
||||||
|
using Element::RemoveAttribute; \
|
||||||
|
NS_IMETHOD RemoveAttribute(const nsAString& name) final override \
|
||||||
|
{ \
|
||||||
|
mozilla::ErrorResult rv; \
|
||||||
|
RemoveAttribute(name, rv); \
|
||||||
|
return rv.StealNSResult(); \
|
||||||
|
} \
|
||||||
|
NS_IMETHOD RemoveAttributeNS(const nsAString& namespaceURI, \
|
||||||
|
const nsAString& localName) final override \
|
||||||
|
{ \
|
||||||
|
mozilla::ErrorResult rv; \
|
||||||
|
Element::RemoveAttributeNS(namespaceURI, localName, rv); \
|
||||||
|
return rv.StealNSResult(); \
|
||||||
|
} \
|
||||||
using Element::HasAttribute; \
|
using Element::HasAttribute; \
|
||||||
NS_IMETHOD HasAttribute(const nsAString& name, \
|
NS_IMETHOD HasAttribute(const nsAString& name, \
|
||||||
bool* _retval) final override \
|
bool* _retval) final override \
|
||||||
@@ -1669,12 +1737,46 @@ NS_IMETHOD HasAttribute(const nsAString& name, \
|
|||||||
*_retval = HasAttribute(name); \
|
*_retval = HasAttribute(name); \
|
||||||
return NS_OK; \
|
return NS_OK; \
|
||||||
} \
|
} \
|
||||||
|
NS_IMETHOD HasAttributeNS(const nsAString& namespaceURI, \
|
||||||
|
const nsAString& localName, \
|
||||||
|
bool* _retval) final override \
|
||||||
|
{ \
|
||||||
|
*_retval = Element::HasAttributeNS(namespaceURI, localName); \
|
||||||
|
return NS_OK; \
|
||||||
|
} \
|
||||||
|
NS_IMETHOD HasAttributes(bool* _retval) final override \
|
||||||
|
{ \
|
||||||
|
*_retval = Element::HasAttributes(); \
|
||||||
|
return NS_OK; \
|
||||||
|
} \
|
||||||
NS_IMETHOD GetAttributeNode(const nsAString& name, \
|
NS_IMETHOD GetAttributeNode(const nsAString& name, \
|
||||||
nsIDOMAttr** _retval) final override \
|
nsIDOMAttr** _retval) final override \
|
||||||
{ \
|
{ \
|
||||||
NS_IF_ADDREF(*_retval = Element::GetAttributeNode(name)); \
|
NS_IF_ADDREF(*_retval = Element::GetAttributeNode(name)); \
|
||||||
return NS_OK; \
|
return NS_OK; \
|
||||||
} \
|
} \
|
||||||
|
NS_IMETHOD SetAttributeNode(nsIDOMAttr* newAttr, \
|
||||||
|
nsIDOMAttr** _retval) final override \
|
||||||
|
{ \
|
||||||
|
if (!newAttr) { \
|
||||||
|
return NS_ERROR_INVALID_POINTER; \
|
||||||
|
} \
|
||||||
|
mozilla::ErrorResult rv; \
|
||||||
|
mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(newAttr); \
|
||||||
|
*_retval = Element::SetAttributeNode(*attr, rv).take(); \
|
||||||
|
return rv.StealNSResult(); \
|
||||||
|
} \
|
||||||
|
NS_IMETHOD RemoveAttributeNode(nsIDOMAttr* oldAttr, \
|
||||||
|
nsIDOMAttr** _retval) final override \
|
||||||
|
{ \
|
||||||
|
if (!oldAttr) { \
|
||||||
|
return NS_ERROR_INVALID_POINTER; \
|
||||||
|
} \
|
||||||
|
mozilla::ErrorResult rv; \
|
||||||
|
mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(oldAttr); \
|
||||||
|
*_retval = Element::RemoveAttributeNode(*attr, rv).take(); \
|
||||||
|
return rv.StealNSResult(); \
|
||||||
|
} \
|
||||||
NS_IMETHOD GetAttributeNodeNS(const nsAString& namespaceURI, \
|
NS_IMETHOD GetAttributeNodeNS(const nsAString& namespaceURI, \
|
||||||
const nsAString& localName, \
|
const nsAString& localName, \
|
||||||
nsIDOMAttr** _retval) final override \
|
nsIDOMAttr** _retval) final override \
|
||||||
@@ -1682,5 +1784,34 @@ NS_IMETHOD GetAttributeNodeNS(const nsAString& namespaceURI, \
|
|||||||
NS_IF_ADDREF(*_retval = Element::GetAttributeNodeNS(namespaceURI, \
|
NS_IF_ADDREF(*_retval = Element::GetAttributeNodeNS(namespaceURI, \
|
||||||
localName)); \
|
localName)); \
|
||||||
return NS_OK; \
|
return NS_OK; \
|
||||||
|
} \
|
||||||
|
NS_IMETHOD SetAttributeNodeNS(nsIDOMAttr* newAttr, \
|
||||||
|
nsIDOMAttr** _retval) final override \
|
||||||
|
{ \
|
||||||
|
mozilla::ErrorResult rv; \
|
||||||
|
mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(newAttr); \
|
||||||
|
*_retval = Element::SetAttributeNodeNS(*attr, rv).take(); \
|
||||||
|
return rv.StealNSResult(); \
|
||||||
|
} \
|
||||||
|
NS_IMETHOD GetElementsByTagName(const nsAString& name, \
|
||||||
|
nsIDOMHTMLCollection** _retval) final \
|
||||||
|
override \
|
||||||
|
{ \
|
||||||
|
Element::GetElementsByTagName(name, _retval); \
|
||||||
|
return NS_OK; \
|
||||||
|
} \
|
||||||
|
NS_IMETHOD GetElementsByTagNameNS(const nsAString& namespaceURI, \
|
||||||
|
const nsAString& localName, \
|
||||||
|
nsIDOMHTMLCollection** _retval) final \
|
||||||
|
override \
|
||||||
|
{ \
|
||||||
|
return Element::GetElementsByTagNameNS(namespaceURI, localName, \
|
||||||
|
_retval); \
|
||||||
|
} \
|
||||||
|
NS_IMETHOD GetElementsByClassName(const nsAString& classes, \
|
||||||
|
nsIDOMHTMLCollection** _retval) final \
|
||||||
|
override \
|
||||||
|
{ \
|
||||||
|
return Element::GetElementsByClassName(classes, _retval); \
|
||||||
}
|
}
|
||||||
#endif // mozilla_dom_Element_h__
|
#endif // mozilla_dom_Element_h__
|
||||||
|
|||||||
@@ -869,23 +869,26 @@ void
|
|||||||
nsObjectLoadingContent::GetNestedParams(nsTArray<MozPluginParameter>& aParams,
|
nsObjectLoadingContent::GetNestedParams(nsTArray<MozPluginParameter>& aParams,
|
||||||
bool aIgnoreCodebase)
|
bool aIgnoreCodebase)
|
||||||
{
|
{
|
||||||
nsCOMPtr<Element> ourElement =
|
nsCOMPtr<nsIDOMElement> domElement =
|
||||||
do_QueryInterface(static_cast<nsIObjectLoadingContent*>(this));
|
do_QueryInterface(static_cast<nsIObjectLoadingContent*>(this));
|
||||||
|
|
||||||
nsCOMPtr<nsIHTMLCollection> allParams;
|
nsCOMPtr<nsIDOMHTMLCollection> allParams;
|
||||||
NS_NAMED_LITERAL_STRING(xhtml_ns, "http://www.w3.org/1999/xhtml");
|
NS_NAMED_LITERAL_STRING(xhtml_ns, "http://www.w3.org/1999/xhtml");
|
||||||
ErrorResult rv;
|
domElement->GetElementsByTagNameNS(xhtml_ns,
|
||||||
allParams = ourElement->GetElementsByTagNameNS(xhtml_ns,
|
NS_LITERAL_STRING("param"), getter_AddRefs(allParams));
|
||||||
NS_LITERAL_STRING("param"),
|
|
||||||
rv);
|
|
||||||
if (rv.Failed()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MOZ_ASSERT(allParams);
|
|
||||||
|
|
||||||
uint32_t numAllParams = allParams->Length();
|
if (!allParams)
|
||||||
|
return;
|
||||||
|
|
||||||
|
uint32_t numAllParams;
|
||||||
|
allParams->GetLength(&numAllParams);
|
||||||
for (uint32_t i = 0; i < numAllParams; i++) {
|
for (uint32_t i = 0; i < numAllParams; i++) {
|
||||||
RefPtr<Element> element = allParams->Item(i);
|
nsCOMPtr<nsIDOMNode> pNode;
|
||||||
|
allParams->Item(i, getter_AddRefs(pNode));
|
||||||
|
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(pNode);
|
||||||
|
|
||||||
|
if (!element)
|
||||||
|
continue;
|
||||||
|
|
||||||
nsAutoString name;
|
nsAutoString name;
|
||||||
element->GetAttribute(NS_LITERAL_STRING("name"), name);
|
element->GetAttribute(NS_LITERAL_STRING("name"), name);
|
||||||
@@ -893,13 +896,16 @@ nsObjectLoadingContent::GetNestedParams(nsTArray<MozPluginParameter>& aParams,
|
|||||||
if (name.IsEmpty())
|
if (name.IsEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
nsCOMPtr<nsIContent> parent = element->GetParent();
|
nsCOMPtr<nsIDOMNode> parent;
|
||||||
nsCOMPtr<nsIDOMHTMLObjectElement> domObject;
|
nsCOMPtr<nsIDOMHTMLObjectElement> domObject;
|
||||||
nsCOMPtr<nsIDOMHTMLAppletElement> domApplet;
|
nsCOMPtr<nsIDOMHTMLAppletElement> domApplet;
|
||||||
|
pNode->GetParentNode(getter_AddRefs(parent));
|
||||||
while (!(domObject || domApplet) && parent) {
|
while (!(domObject || domApplet) && parent) {
|
||||||
domObject = do_QueryInterface(parent);
|
domObject = do_QueryInterface(parent);
|
||||||
domApplet = do_QueryInterface(parent);
|
domApplet = do_QueryInterface(parent);
|
||||||
parent = parent->GetParent();
|
nsCOMPtr<nsIDOMNode> temp;
|
||||||
|
parent->GetParentNode(getter_AddRefs(temp));
|
||||||
|
parent = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (domApplet) {
|
if (domApplet) {
|
||||||
@@ -910,7 +916,8 @@ nsObjectLoadingContent::GetNestedParams(nsTArray<MozPluginParameter>& aParams,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parent == ourElement) {
|
nsCOMPtr<nsIDOMNode> domNode = do_QueryInterface(domElement);
|
||||||
|
if (parent == domNode) {
|
||||||
MozPluginParameter param;
|
MozPluginParameter param;
|
||||||
element->GetAttribute(NS_LITERAL_STRING("name"), param.mName);
|
element->GetAttribute(NS_LITERAL_STRING("name"), param.mName);
|
||||||
element->GetAttribute(NS_LITERAL_STRING("value"), param.mValue);
|
element->GetAttribute(NS_LITERAL_STRING("value"), param.mValue);
|
||||||
|
|||||||
@@ -29,14 +29,45 @@ interface nsIDOMElement : nsIDOMNode
|
|||||||
{
|
{
|
||||||
readonly attribute DOMString tagName;
|
readonly attribute DOMString tagName;
|
||||||
|
|
||||||
|
attribute DOMString id;
|
||||||
|
attribute DOMString className;
|
||||||
|
/**
|
||||||
|
* Returns a DOMTokenList object reflecting the class attribute.
|
||||||
|
*/
|
||||||
|
readonly attribute nsISupports classList;
|
||||||
|
|
||||||
readonly attribute nsIDOMMozNamedAttrMap attributes;
|
readonly attribute nsIDOMMozNamedAttrMap attributes;
|
||||||
DOMString getAttribute(in DOMString name);
|
DOMString getAttribute(in DOMString name);
|
||||||
|
DOMString getAttributeNS(in DOMString namespaceURI,
|
||||||
|
in DOMString localName);
|
||||||
void setAttribute(in DOMString name,
|
void setAttribute(in DOMString name,
|
||||||
in DOMString value);
|
in DOMString value);
|
||||||
|
void setAttributeNS(in DOMString namespaceURI,
|
||||||
|
in DOMString qualifiedName,
|
||||||
|
in DOMString value);
|
||||||
|
void removeAttribute(in DOMString name);
|
||||||
|
void removeAttributeNS(in DOMString namespaceURI,
|
||||||
|
in DOMString localName);
|
||||||
boolean hasAttribute(in DOMString name);
|
boolean hasAttribute(in DOMString name);
|
||||||
|
boolean hasAttributeNS(in DOMString namespaceURI,
|
||||||
|
in DOMString localName);
|
||||||
|
boolean hasAttributes();
|
||||||
|
|
||||||
// Obsolete methods.
|
// Obsolete methods.
|
||||||
nsIDOMAttr getAttributeNode(in DOMString name);
|
nsIDOMAttr getAttributeNode(in DOMString name);
|
||||||
|
nsIDOMAttr setAttributeNode(in nsIDOMAttr newAttr);
|
||||||
|
nsIDOMAttr removeAttributeNode(in nsIDOMAttr oldAttr);
|
||||||
nsIDOMAttr getAttributeNodeNS(in DOMString namespaceURI,
|
nsIDOMAttr getAttributeNodeNS(in DOMString namespaceURI,
|
||||||
in DOMString localName);
|
in DOMString localName);
|
||||||
|
nsIDOMAttr setAttributeNodeNS(in nsIDOMAttr newAttr)
|
||||||
|
raises(DOMException);
|
||||||
|
|
||||||
|
nsIDOMHTMLCollection getElementsByTagName(in DOMString name);
|
||||||
|
nsIDOMHTMLCollection getElementsByTagNameNS(in DOMString namespaceURI,
|
||||||
|
in DOMString localName);
|
||||||
|
/**
|
||||||
|
* Retrieve elements matching all classes listed in a
|
||||||
|
* space-separated string.
|
||||||
|
*/
|
||||||
|
nsIDOMHTMLCollection getElementsByClassName(in DOMString classes);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -713,6 +713,19 @@ PersistNodeFixup::GetNodeToFixup(nsIDOMNode *aNodeIn, nsIDOMNode **aNodeOut)
|
|||||||
} else {
|
} else {
|
||||||
NS_ADDREF(*aNodeOut = aNodeIn);
|
NS_ADDREF(*aNodeOut = aNodeIn);
|
||||||
}
|
}
|
||||||
|
nsCOMPtr<nsIDOMHTMLElement> element(do_QueryInterface(*aNodeOut));
|
||||||
|
if (element) {
|
||||||
|
// Make sure this is not XHTML
|
||||||
|
nsAutoString namespaceURI;
|
||||||
|
element->GetNamespaceURI(namespaceURI);
|
||||||
|
if (namespaceURI.IsEmpty()) {
|
||||||
|
// This is a tag-soup node. It may have a _base_href attribute
|
||||||
|
// stuck on it by the parser, but since we're fixing up all URIs
|
||||||
|
// relative to the overall document base that will screw us up.
|
||||||
|
// Just remove the _base_href.
|
||||||
|
element->RemoveAttribute(NS_LITERAL_STRING("_base_href"));
|
||||||
|
}
|
||||||
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1142,9 +1155,8 @@ PersistNodeFixup::FixupNode(nsIDOMNode *aNodeIn,
|
|||||||
}
|
}
|
||||||
// Unset the codebase too, since we'll correctly relativize the
|
// Unset the codebase too, since we'll correctly relativize the
|
||||||
// code and archive paths.
|
// code and archive paths.
|
||||||
IgnoredErrorResult ignored;
|
|
||||||
static_cast<dom::HTMLSharedObjectElement*>(newApplet.get())->
|
static_cast<dom::HTMLSharedObjectElement*>(newApplet.get())->
|
||||||
RemoveAttribute(NS_LITERAL_STRING("codebase"), ignored);
|
RemoveAttribute(NS_LITERAL_STRING("codebase"));
|
||||||
FixupAttribute(*aNodeOut, "code");
|
FixupAttribute(*aNodeOut, "code");
|
||||||
FixupAttribute(*aNodeOut, "archive");
|
FixupAttribute(*aNodeOut, "archive");
|
||||||
// restore the base URI we really want to have
|
// restore the base URI we really want to have
|
||||||
@@ -1221,12 +1233,10 @@ PersistNodeFixup::FixupNode(nsIDOMNode *aNodeIn,
|
|||||||
case NS_FORM_INPUT_COLOR:
|
case NS_FORM_INPUT_COLOR:
|
||||||
nodeAsInput->GetValue(valueStr, dom::CallerType::System);
|
nodeAsInput->GetValue(valueStr, dom::CallerType::System);
|
||||||
// Avoid superfluous value="" serialization
|
// Avoid superfluous value="" serialization
|
||||||
if (valueStr.IsEmpty()) {
|
if (valueStr.IsEmpty())
|
||||||
IgnoredErrorResult ignored;
|
outElt->RemoveAttribute(valueAttr);
|
||||||
outElt->RemoveAttribute(valueAttr, ignored);
|
else
|
||||||
} else {
|
|
||||||
outElt->SetAttribute(valueAttr, valueStr);
|
outElt->SetAttribute(valueAttr, valueStr);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case NS_FORM_INPUT_CHECKBOX:
|
case NS_FORM_INPUT_CHECKBOX:
|
||||||
case NS_FORM_INPUT_RADIO:
|
case NS_FORM_INPUT_RADIO:
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ interface MozXULTemplateBuilder;
|
|||||||
|
|
||||||
[Func="IsChromeOrXBL"]
|
[Func="IsChromeOrXBL"]
|
||||||
interface XULElement : Element {
|
interface XULElement : Element {
|
||||||
|
[SetterThrows]
|
||||||
|
attribute DOMString className;
|
||||||
|
|
||||||
// Layout properties
|
// Layout properties
|
||||||
[SetterThrows]
|
[SetterThrows]
|
||||||
attribute DOMString align;
|
attribute DOMString align;
|
||||||
|
|||||||
@@ -455,6 +455,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// WebIDL API
|
// WebIDL API
|
||||||
|
void SetClassName(const nsAString& aValue, mozilla::ErrorResult& rv)
|
||||||
|
{
|
||||||
|
SetXULAttr(nsGkAtoms::_class, aValue, rv);
|
||||||
|
}
|
||||||
void GetAlign(DOMString& aValue) const
|
void GetAlign(DOMString& aValue) const
|
||||||
{
|
{
|
||||||
GetXULAttr(nsGkAtoms::align, aValue);
|
GetXULAttr(nsGkAtoms::align, aValue);
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
#include "nsISupportsBase.h"
|
#include "nsISupportsBase.h"
|
||||||
#include "nsLiteralString.h"
|
#include "nsLiteralString.h"
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
#include "nsIHTMLCollection.h"
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
@@ -1029,13 +1028,16 @@ TextEditRules::DidRedo(Selection* aSelection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
NS_ENSURE_STATE(mTextEditor);
|
NS_ENSURE_STATE(mTextEditor);
|
||||||
RefPtr<Element> theRoot = mTextEditor->GetRoot();
|
nsCOMPtr<nsIDOMElement> theRoot = do_QueryInterface(mTextEditor->GetRoot());
|
||||||
NS_ENSURE_TRUE(theRoot, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(theRoot, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsCOMPtr<nsIHTMLCollection> nodeList =
|
nsCOMPtr<nsIDOMHTMLCollection> nodeList;
|
||||||
theRoot->GetElementsByTagName(NS_LITERAL_STRING("br"));
|
nsresult rv = theRoot->GetElementsByTagName(NS_LITERAL_STRING("br"),
|
||||||
MOZ_ASSERT(nodeList);
|
getter_AddRefs(nodeList));
|
||||||
uint32_t len = nodeList->Length();
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
if (nodeList) {
|
||||||
|
uint32_t len;
|
||||||
|
nodeList->GetLength(&len);
|
||||||
|
|
||||||
if (len != 1) {
|
if (len != 1) {
|
||||||
// only in the case of one br could there be the bogus node
|
// only in the case of one br could there be the bogus node
|
||||||
@@ -1043,12 +1045,16 @@ TextEditRules::DidRedo(Selection* aSelection,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Element> node = nodeList->Item(0);
|
nsCOMPtr<nsIDOMNode> node;
|
||||||
if (mTextEditor->IsMozEditorBogusNode(node)) {
|
nodeList->Item(0, getter_AddRefs(node));
|
||||||
mBogusNode = do_QueryInterface(node);
|
nsCOMPtr<nsIContent> content = do_QueryInterface(node);
|
||||||
|
MOZ_ASSERT(content);
|
||||||
|
if (mTextEditor->IsMozEditorBogusNode(content)) {
|
||||||
|
mBogusNode = node;
|
||||||
} else {
|
} else {
|
||||||
mBogusNode = nullptr;
|
mBogusNode = nullptr;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -522,7 +522,7 @@ nsFormFillController::GetSearchParam(nsAString &aSearchParam)
|
|||||||
|
|
||||||
mFocusedInput->GetName(aSearchParam);
|
mFocusedInput->GetName(aSearchParam);
|
||||||
if (aSearchParam.IsEmpty()) {
|
if (aSearchParam.IsEmpty()) {
|
||||||
nsCOMPtr<Element> element = do_QueryInterface(mFocusedInput);
|
nsCOMPtr<nsIDOMHTMLElement> element = do_QueryInterface(mFocusedInput);
|
||||||
element->GetId(aSearchParam);
|
element->GetId(aSearchParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user