mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Ensure that CanPropagate and CreateContextStackFor are consistent. bug 423373, r+sr=sicking a=beltzner
This commit is contained in:
parent
aa87a0a004
commit
0e57506436
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
1
parser/htmlparser/tests/crashtests/423373-1.html
Normal file
1
parser/htmlparser/tests/crashtests/423373-1.html
Normal file
@ -0,0 +1 @@
|
||||
<body><asdf><legend>
|
1
parser/htmlparser/tests/crashtests/crashtests.list
Normal file
1
parser/htmlparser/tests/crashtests/crashtests.list
Normal file
@ -0,0 +1 @@
|
||||
load 423373-1.html
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user