mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
Bug 690120 - Make nsEditor::GetAttributeValue not use attribute nodes; r=ehsan
This commit is contained in:
parent
7852c8dc13
commit
ea43ea6030
@ -84,6 +84,7 @@
|
|||||||
#include "nsCSSStyleSheet.h"
|
#include "nsCSSStyleSheet.h"
|
||||||
|
|
||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
|
#include "nsDOMString.h"
|
||||||
#include "nsServiceManagerUtils.h"
|
#include "nsServiceManagerUtils.h"
|
||||||
|
|
||||||
// transactions the editor knows how to build
|
// transactions the editor knows how to build
|
||||||
@ -1252,19 +1253,18 @@ nsEditor::GetAttributeValue(nsIDOMElement *aElement,
|
|||||||
bool *aResultIsSet)
|
bool *aResultIsSet)
|
||||||
{
|
{
|
||||||
NS_ENSURE_TRUE(aResultIsSet, NS_ERROR_NULL_POINTER);
|
NS_ENSURE_TRUE(aResultIsSet, NS_ERROR_NULL_POINTER);
|
||||||
*aResultIsSet=false;
|
*aResultIsSet = false;
|
||||||
nsresult result=NS_OK;
|
if (!aElement) {
|
||||||
if (aElement)
|
return NS_OK;
|
||||||
{
|
|
||||||
nsCOMPtr<nsIDOMAttr> attNode;
|
|
||||||
result = aElement->GetAttributeNode(aAttribute, getter_AddRefs(attNode));
|
|
||||||
if ((NS_SUCCEEDED(result)) && attNode)
|
|
||||||
{
|
|
||||||
attNode->GetSpecified(aResultIsSet);
|
|
||||||
attNode->GetValue(aResultValue);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result;
|
nsAutoString value;
|
||||||
|
nsresult rv = aElement->GetAttribute(aAttribute, value);
|
||||||
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
if (!DOMStringIsNull(value)) {
|
||||||
|
*aResultIsSet = true;
|
||||||
|
aResultValue = value;
|
||||||
|
}
|
||||||
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
Loading…
Reference in New Issue
Block a user