Commit 6d17fb2b authored by hyatt's avatar hyatt

Finish the KONQBLOCK removal and make sure that table rows and

	cells encountered inside stray content cause the stray content to
	close so that the rows and cells can be part of the table.

	This fixes the versiontracker bug.  #3142319.

        Reviewed by darin.

        * khtml/html/htmlparser.cpp:
        (KHTMLParser::reset):
        (isTableRelatedTag):
        (KHTMLParser::insertNode):
        (KHTMLParser::popOneBlock):
        * khtml/html/htmlparser.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3282 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 66177e0b
2003-01-08 David Hyatt <hyatt@apple.com>
Finish the KONQBLOCK removal and make sure that table rows and
cells encountered inside stray content cause the stray content to
close so that the rows and cells can be part of the table.
This fixes the versiontracker bug. #3142319.
Reviewed by darin.
* khtml/html/htmlparser.cpp:
(KHTMLParser::reset):
(isTableRelatedTag):
(KHTMLParser::insertNode):
(KHTMLParser::popOneBlock):
* khtml/html/htmlparser.h:
2003-01-08 David Hyatt <hyatt@apple.com>
Revert the redundancy that dirk noticed.
......
2003-01-08 David Hyatt <hyatt@apple.com>
Finish the KONQBLOCK removal and make sure that table rows and
cells encountered inside stray content cause the stray content to
close so that the rows and cells can be part of the table.
This fixes the versiontracker bug. #3142319.
Reviewed by darin.
* khtml/html/htmlparser.cpp:
(KHTMLParser::reset):
(isTableRelatedTag):
(KHTMLParser::insertNode):
(KHTMLParser::popOneBlock):
* khtml/html/htmlparser.h:
2003-01-08 David Hyatt <hyatt@apple.com>
Revert the redundancy that dirk noticed.
......
......@@ -76,12 +76,14 @@ public:
:
id(_id),
level(_level),
strayTableContent(false),
node(_node),
next(_next)
{ }
int id;
int level;
bool strayTableContent;
NodeImpl *node;
HTMLStackElem *next;
};
......@@ -175,6 +177,7 @@ void KHTMLParser::reset()
haveFrameSet = false;
haveContent = false;
inSelect = false;
inStrayTableContent = false;
form = 0;
map = 0;
......@@ -300,6 +303,12 @@ void KHTMLParser::parseToken(Token *t)
}
}
static bool isTableRelatedTag(int id)
{
return (id == ID_TR || id == ID_TD || id == ID_TABLE || id == ID_TBODY || id == ID_TFOOT || id == ID_THEAD ||
id == ID_TH);
}
bool KHTMLParser::insertNode(NodeImpl *n, bool flat)
{
int id = n->id();
......@@ -365,6 +374,17 @@ bool KHTMLParser::insertNode(NodeImpl *n, bool flat)
// switch according to the element to insert
switch(id)
{
case ID_TR:
case ID_TH:
case ID_TD:
if (inStrayTableContent) {
// pop out to the nearest enclosing table-related tag.
while (!isTableRelatedTag(current->id()))
popOneBlock();
inStrayTableContent = false;
return insertNode(n);
}
break;
case ID_COMMENT:
break;
case ID_HEAD:
......@@ -638,6 +658,8 @@ bool KHTMLParser::insertNode(NodeImpl *n, bool flat)
{
pushBlock(id, tagPriority[id]);
current = n;
inStrayTableContent = true;
blockStack->strayTableContent = true;
}
return true;
}
......@@ -1235,6 +1257,9 @@ void KHTMLParser::popOneBlock()
blockStack = Elem->next;
current = Elem->node;
if (Elem->strayTableContent)
inStrayTableContent = false;
delete Elem;
}
......
......@@ -175,7 +175,8 @@ protected:
int discard_until;
bool headLoaded;
bool inStrayTableContent;
#if SPEED_DEBUG > 0
QTime qt;
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment