Bug 520581 - HTML5 parser reverses attributes on some elements. r=bzbarsky.

This commit is contained in:
Henri Sivonen
2009-12-23 10:32:39 +02:00
parent 918fdb25b9
commit e808207344
2 changed files with 6 additions and 29 deletions

View File

@@ -308,7 +308,8 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
nsIDocument* document = node->GetCurrentDoc();
PRInt32 len = attributes->getLength();
for (PRInt32 i = 0; i < len; ++i) {
for (PRInt32 i = len; i > 0;) {
--i;
// prefix doesn't need regetting. it is always null or a static atom
// local name is never null
nsCOMPtr<nsIAtom> localName = Reget(attributes->getLocalName(i));
@@ -380,7 +381,8 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
}
PRInt32 len = attributes->getLength();
for (PRInt32 i = 0; i < len; ++i) {
for (PRInt32 i = len; i > 0;) {
--i;
// prefix doesn't need regetting. it is always null or a static atom
// local name is never null
nsCOMPtr<nsIAtom> localName = Reget(attributes->getLocalName(i));