mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
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
This commit is contained in:
parent
22f6392e92
commit
766c82a844
@ -377,3 +377,4 @@ random-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 379316-2.html 379316-2-ref.html # bug
|
||||
== 393671-2.html 393671-2-ref.html
|
||||
== 393671-3.html 393671-3-ref.html
|
||||
== 394111-1.html about:blank # Really an assertion test rather than a rendering test
|
||||
== 394534-1.html 394534-1-ref.html
|
||||
|
@ -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
|
||||
|
@ -264,6 +264,11 @@ nsCParserNode::PopAttributeToken() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
CToken*
|
||||
nsCParserNode::PopAttributeTokenFront() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Retrieve a string containing the tag and its attributes in "source" form
|
||||
* @update rickg 06June2000
|
||||
* @return void
|
||||
@ -353,6 +358,12 @@ nsCParserStartNode::PopAttributeToken()
|
||||
return static_cast<CToken*>(mAttributes.Pop());
|
||||
}
|
||||
|
||||
CToken*
|
||||
nsCParserStartNode::PopAttributeTokenFront()
|
||||
{
|
||||
return static_cast<CToken*>(mAttributes.PopFront());
|
||||
}
|
||||
|
||||
void nsCParserStartNode::GetSource(nsString& aString) const
|
||||
{
|
||||
aString.Assign(PRUnichar('<'));
|
||||
|
@ -239,6 +239,9 @@ class nsCParserNode : public nsIParserNode {
|
||||
*/
|
||||
virtual CToken* PopAttributeToken();
|
||||
|
||||
/** Like PopAttributeToken, but pops off the front of the attribute list */
|
||||
virtual CToken* PopAttributeTokenFront();
|
||||
|
||||
/** Retrieve a string containing the tag and its attributes in "source" form
|
||||
* @update rickg 06June2000
|
||||
* @return void
|
||||
@ -314,6 +317,7 @@ public:
|
||||
virtual const nsAString& GetKeyAt(PRUint32 anIndex) const;
|
||||
virtual const nsAString& GetValueAt(PRUint32 anIndex) const;
|
||||
virtual CToken* PopAttributeToken();
|
||||
virtual CToken* PopAttributeTokenFront();
|
||||
virtual void GetSource(nsString& aString) const;
|
||||
virtual nsresult ReleaseAll();
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user