зеркало из https://github.com/mozilla/pjs.git
bug 90664: Make sure we perform RS handling when we can, in cases where tags that cannot nest and normally would be closed out cannot, due to block tags between them. r=jst sr=brendan
This commit is contained in:
Родитель
9f398856f9
Коммит
b4a99b4032
|
@ -394,8 +394,26 @@ nsresult nsHTMLTokenizer::ScanDocStructure(PRBool aFinalChunk) {
|
|||
if(theTagIsBlock || theTagIsInline || eHTMLTag_table == theTag) {
|
||||
switch(theType) {
|
||||
case eToken_start:
|
||||
theStack.Push(theToken);
|
||||
++theStackDepth;
|
||||
{
|
||||
if (gHTMLElements[theTag].ShouldVerifyHierarchy()) {
|
||||
PRInt32 earlyPos = FindLastIndexOfTag(theTag, theStack);
|
||||
if (earlyPos != kNotFound) {
|
||||
// Uh-oh, we've found a tag that is not allowed to nest at
|
||||
// all. Mark the previous one as malformed to increase our
|
||||
// chances of doing RS handling on it. We want to do this
|
||||
// for cases such as: <a><div><a></a></div></a>.
|
||||
// XXX What about <a><span><a>, where the second <a> closes
|
||||
// the <span>?
|
||||
CHTMLToken *theMalformedToken =
|
||||
NS_STATIC_CAST(CHTMLToken*, theStack.ObjectAt(earlyPos));
|
||||
|
||||
theMalformedToken->SetContainerInfo(eMalformed);
|
||||
}
|
||||
}
|
||||
|
||||
theStack.Push(theToken);
|
||||
++theStackDepth;
|
||||
}
|
||||
break;
|
||||
case eToken_end:
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче