Fixing bug 394534. Make first attribute win in misplaced content. Patch by bzbarsky@mit.edu, r=mrbkap@gmail.com, sr=peterv@propagandism.org, a=jonas@sicking.cc/dsicore@mozilla.com
git-svn-id: svn://10.0.0.236/trunk@235482 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1062,7 +1062,7 @@ PushMisplacedAttributes(nsIParserNode& aNode, nsDeque& aDeque)
|
||||
nsCParserNode& theAttrNode = static_cast<nsCParserNode &>(aNode);
|
||||
|
||||
for (PRInt32 count = aNode.GetAttributeCount(); count > 0; --count) {
|
||||
CToken* theAttrToken = theAttrNode.PopAttributeToken();
|
||||
CToken* theAttrToken = theAttrNode.PopAttributeTokenFront();
|
||||
if (theAttrToken) {
|
||||
theAttrToken->SetNewlineCount(0);
|
||||
aDeque.Push(theAttrToken);
|
||||
@@ -1742,14 +1742,19 @@ CNavDTD::HandleSavedTokens(PRInt32 anIndex)
|
||||
if (theToken) {
|
||||
theTag = (eHTMLTags)theToken->GetTypeID();
|
||||
attrCount = theToken->GetAttributeCount();
|
||||
// Put back attributes, which once got popped out, into the tokenizer
|
||||
// Put back attributes, which once got popped out, into the
|
||||
// tokenizer. Make sure we preserve their ordering, however!
|
||||
// XXXbz would it be faster to get the tokens out with ObjectAt and
|
||||
// the PopFront them all?
|
||||
nsDeque temp;
|
||||
for (PRInt32 j = 0; j < attrCount; ++j) {
|
||||
CToken* theAttrToken = (CToken*)mMisplacedContent.PopFront();
|
||||
if (theAttrToken) {
|
||||
mTokenizer->PushTokenFront(theAttrToken);
|
||||
temp.Push(theAttrToken);
|
||||
}
|
||||
theBadTokenCount--;
|
||||
}
|
||||
mTokenizer->PrependTokens(temp);
|
||||
|
||||
if (eToken_end == theToken->GetTokenType()) {
|
||||
// Ref: Bug 25202
|
||||
|
||||
Reference in New Issue
Block a user