Ensure that CanPropagate and CreateContextStackFor are consistent. bug 423373, r+sr=sicking a=beltzner

This commit is contained in:
mrbkap@gmail.com 2008-03-17 13:24:00 -07:00
parent aa87a0a004
commit 0e57506436
5 changed files with 12 additions and 8 deletions

View File

@ -1061,7 +1061,7 @@ CNavDTD::HandleDefaultStartToken(CToken* aToken, eHTMLTags aChildTag,
break;
}
} else {
CreateContextStackFor(aChildTag);
CreateContextStackFor(theParentTag, aChildTag);
theIndex = mBodyContext->GetCount();
}
}
@ -3100,19 +3100,18 @@ CNavDTD::AddHeadContent(nsIParserNode *aNode)
}
void
CNavDTD::CreateContextStackFor(eHTMLTags aChild)
CNavDTD::CreateContextStackFor(eHTMLTags aParent, eHTMLTags aChild)
{
mScratch.Truncate();
eHTMLTags theTop = mBodyContext->Last();
PRBool result = ForwardPropagate(mScratch, theTop, aChild);
PRBool result = ForwardPropagate(mScratch, aParent, aChild);
if (!result) {
if (eHTMLTag_unknown == theTop) {
if (eHTMLTag_unknown == aParent) {
result = BackwardPropagate(mScratch, eHTMLTag_html, aChild);
} else if (theTop != aChild) {
} else if (aParent != aChild) {
// Don't even bother if we're already inside a similar element...
result = BackwardPropagate(mScratch, theTop, aChild);
result = BackwardPropagate(mScratch, aParent, aChild);
}
}

View File

@ -221,9 +221,10 @@ private:
* Attempt forward and/or backward propagation for the given child within
* the current context vector stack. And actually open the required tags.
*
* @param aParent The tag we're trying to open this element inside of.
* @param aChild Type of child to be propagated.
*/
void CreateContextStackFor(eHTMLTags aChild);
void CreateContextStackFor(eHTMLTags aParent, eHTMLTags aChild);
/**
* Ask if a given container is open anywhere on its stack

View File

@ -0,0 +1 @@
<body><asdf><legend>

View File

@ -0,0 +1 @@
load 423373-1.html

View File

@ -43,6 +43,8 @@ include ../../layout/xul/base/src/tree/src/crashtests/crashtests.list
include ../../gfx/src/thebes/crashtests/crashtests.list
include ../../gfx/thebes/crashtests/crashtests.list
include ../../parser/htmlparser/tests/crashtests/crashtests.list
include ../../security/manager/ssl/crashtests/crashtests.list
include ../../view/crashtests/crashtests.list