зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1258205 - Make setAttribute throw InvalidCharacterError if the attribute already exists. r=baku
This commit is contained in:
Родитель
dfb2effe59
Коммит
2d08290117
|
@ -1177,14 +1177,12 @@ Element::SetAttribute(const nsAString& aName,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
ErrorResult& aError)
|
ErrorResult& aError)
|
||||||
{
|
{
|
||||||
|
aError = nsContentUtils::CheckQName(aName, false);
|
||||||
|
if (aError.Failed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const nsAttrName* name = InternalGetExistingAttrNameFromQName(aName);
|
const nsAttrName* name = InternalGetExistingAttrNameFromQName(aName);
|
||||||
|
|
||||||
if (!name) {
|
if (!name) {
|
||||||
aError = nsContentUtils::CheckQName(aName, false);
|
|
||||||
if (aError.Failed()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsCOMPtr<nsIAtom> nameAtom;
|
nsCOMPtr<nsIAtom> nameAtom;
|
||||||
if (IsHTMLElement() && IsInHTMLDocument()) {
|
if (IsHTMLElement() && IsInHTMLDocument()) {
|
||||||
nsAutoString lower;
|
nsAutoString lower;
|
||||||
|
|
|
@ -6,6 +6,3 @@
|
||||||
[First set attribute is returned with mapped attribute set first]
|
[First set attribute is returned with mapped attribute set first]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[When qualifiedName does not match the Name production, an INVALID_CHARACTER_ERR exception is to be thrown, even if the attribute is already present. (setAttribute)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче