Bug 502103 - Crash [@ NS_NewEditorKeyListener] with <isindex action="">. r+sr=mrbkap

This commit is contained in:
Henri Sivonen 2009-07-06 15:11:14 +03:00
Родитель 1bf48eb5e9
Коммит e370dc7062
2 изменённых файлов: 6 добавлений и 7 удалений

Просмотреть файл

@ -2008,8 +2008,9 @@ public abstract class TreeBuilder<T> implements TokenHandler {
);
for (int i = 0; i < attributes.getLength(); i++) {
AttributeName attributeQName = attributes.getAttributeName(i);
if (!(AttributeName.NAME == attributeQName
|| AttributeName.ACTION == attributeQName || AttributeName.PROMPT == attributeQName)) {
if (AttributeName.NAME == attributeQName || AttributeName.PROMPT == attributeQName) {
attributes.releaseValue(i);
} else if (AttributeName.ACTION != attributeQName) {
inputAttributes.addAttribute(
attributeQName,
attributes.getValue(i)
@ -2019,8 +2020,6 @@ public abstract class TreeBuilder<T> implements TokenHandler {
// ]NOCPP]
);
} else {
attributes.releaseValue(i);
}
}
attributes.clearWithoutReleasingContents();

Просмотреть файл

@ -1094,10 +1094,10 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
inputAttributes->addAttribute(nsHtml5AttributeName::ATTR_NAME, nsHtml5Portability::newStringFromLiteral("isindex"));
for (PRInt32 i = 0; i < attributes->getLength(); i++) {
nsHtml5AttributeName* attributeQName = attributes->getAttributeName(i);
if (!(nsHtml5AttributeName::ATTR_NAME == attributeQName || nsHtml5AttributeName::ATTR_ACTION == attributeQName || nsHtml5AttributeName::ATTR_PROMPT == attributeQName)) {
inputAttributes->addAttribute(attributeQName, attributes->getValue(i));
} else {
if (nsHtml5AttributeName::ATTR_NAME == attributeQName || nsHtml5AttributeName::ATTR_PROMPT == attributeQName) {
attributes->releaseValue(i);
} else if (nsHtml5AttributeName::ATTR_ACTION != attributeQName) {
inputAttributes->addAttribute(attributeQName, attributes->getValue(i));
}
}
attributes->clearWithoutReleasingContents();