Commit a176a20d authored by hyatt's avatar hyatt

Fix tables so that malformations inside them are properly pulled

	out of the table without being flattened.

	Fixes 3131480.

        Reviewed by gramps

        * khtml/html/dtd.cpp:
        (DOM::checkChild):
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::insertNode):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3226 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f146ac5e
2003-01-01 David Hyatt <hyatt@apple.com>
Fix tables so that malformations inside them are properly pulled
out of the table without being flattened.
Fixes 3131480.
Reviewed by gramps
* khtml/html/dtd.cpp:
(DOM::checkChild):
* khtml/html/htmlparser.cpp:
(KHTMLParser::insertNode):
=== Alexander-47 ===
2002-12-30 Darin Adler <darin@apple.com>
......
2003-01-01 David Hyatt <hyatt@apple.com>
Fix tables so that malformations inside them are properly pulled
out of the table without being flattened.
Fixes 3131480.
Reviewed by gramps
* khtml/html/dtd.cpp:
(DOM::checkChild):
* khtml/html/htmlparser.cpp:
(KHTMLParser::insertNode):
=== Alexander-47 ===
2002-12-30 Darin Adler <darin@apple.com>
......
......@@ -727,7 +727,7 @@ bool DOM::checkChild(ushort tagID, ushort childID)
case ID_TFOOT:
case ID_TBODY:
// THEAD: TR +
if(childID == ID_FORM || childID == ID_TR || childID == ID_TEXT || childID == ID_COMMENT ||
if(childID == ID_FORM || childID == ID_TR || childID == ID_COMMENT ||
childID == ID_SCRIPT)
return true;
return false;
......
......@@ -614,14 +614,16 @@ bool KHTMLParser::insertNode(NodeImpl *n, bool flat)
NodeImpl *parentparent = parent->parentNode();
if(( node->id() == ID_TR &&
( parent->id() == ID_THEAD ||
parent->id() == ID_TBODY ||
parent->id() == ID_TFOOT ) && parentparent->id() == ID_TABLE ) ||
( !checkChild( ID_TR, id ) && ( node->id() == ID_THEAD || node->id() == ID_TBODY || node->id() == ID_TFOOT ) &&
parent->id() == ID_TABLE ) )
if (n->isTextNode() ||
( node->id() == ID_TR &&
( parent->id() == ID_THEAD ||
parent->id() == ID_TBODY ||
parent->id() == ID_TFOOT ) && parentparent->id() == ID_TABLE ) ||
( !checkChild( ID_TR, id ) && ( node->id() == ID_THEAD || node->id() == ID_TBODY || node->id() == ID_TFOOT ) &&
parent->id() == ID_TABLE ))
{
node = ( node->id() == ID_TR ) ? parentparent : parent;
node = (node->id() == ID_TABLE) ? node :
((node->id() == ID_TR) ? parentparent : parent);
NodeImpl *parent = node->parentNode();
int exceptioncode = 0;
parent->insertBefore( n, node, exceptioncode );
......@@ -631,6 +633,12 @@ bool KHTMLParser::insertNode(NodeImpl *n, bool flat)
#endif
break;
}
if (n->isElementNode() && tagPriority[id] != 0 &&
!flat && endTag[id] != DOM::FORBIDDEN)
{
pushBlock(id, tagPriority[id]);
current = n;
}
return true;
}
......@@ -640,7 +648,7 @@ bool KHTMLParser::insertNode(NodeImpl *n, bool flat)
e = new HTMLTableSectionElementImpl( document, ID_TBODY );
else
e = new HTMLTableRowElementImpl( document );
// Now reattach any discarded attributes if they exist. -dwh
if (discardedStackPos > 0 && current->id() != ID_TABLE) {
discardedStackPos--;
......
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