mirror of
https://github.com/classilla/tenfourfox.git
synced 2025-01-16 01:31:37 +00:00
#399: fix 'null' Blobs, add isSameNode(), fix select element non-match bug
This commit is contained in:
parent
e9cc6b1d37
commit
e085a5b30e
@ -5973,6 +5973,26 @@ nsContentUtils::GetUTFOrigin(nsIURI* aURI, nsAString& aOrigin)
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (uri && uri != aURI) {
|
||||
return GetUTFOrigin(uri, aOrigin);
|
||||
}
|
||||
} else {
|
||||
// We are probably dealing with an unknown blob.
|
||||
bool isBlob = false;
|
||||
nsresult rv = aURI->SchemeIs(BLOBURI_SCHEME, &isBlob);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (isBlob) {
|
||||
nsAutoCString path;
|
||||
rv = aURI->GetPath(path);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult rv = NS_NewURI(getter_AddRefs(uri), path);
|
||||
if (NS_FAILED(rv)) {
|
||||
aOrigin.AssignLiteral("null");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return GetUTFOrigin(uri, aOrigin);
|
||||
}
|
||||
}
|
||||
|
@ -968,6 +968,12 @@ nsINode::CompareDocumentPosition(nsINode& aOtherNode) const
|
||||
nsIDOMNode::DOCUMENT_POSITION_CONTAINED_BY);
|
||||
}
|
||||
|
||||
bool
|
||||
nsINode::IsSameNode(nsINode *other)
|
||||
{
|
||||
return other == this;
|
||||
}
|
||||
|
||||
bool
|
||||
nsINode::IsEqualNode(nsINode* aOther)
|
||||
{
|
||||
|
@ -1761,6 +1761,7 @@ public:
|
||||
}
|
||||
nsINode* RemoveChild(nsINode& aChild, mozilla::ErrorResult& aError);
|
||||
already_AddRefed<nsINode> CloneNode(bool aDeep, mozilla::ErrorResult& aError);
|
||||
bool IsSameNode(nsINode* aNode);
|
||||
bool IsEqualNode(nsINode* aNode);
|
||||
void GetNamespaceURI(nsAString& aNamespaceURI) const
|
||||
{
|
||||
|
@ -1149,9 +1149,11 @@ HTMLSelectElement::SetValue(const nsAString& aValue)
|
||||
option->GetValue(optionVal);
|
||||
if (optionVal.Equals(aValue)) {
|
||||
SetSelectedIndexInternal(int32_t(i), true);
|
||||
break;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
// No matching option was found.
|
||||
SetSelectedIndexInternal(-1, true);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -70,6 +70,8 @@ interface Node : EventTarget {
|
||||
[Throws]
|
||||
Node cloneNode(optional boolean deep = false);
|
||||
[Pure]
|
||||
boolean isSameNode(Node? node);
|
||||
[Pure]
|
||||
boolean isEqualNode(Node? node);
|
||||
|
||||
const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
|
||||
|
Loading…
x
Reference in New Issue
Block a user