Commit c6ba7979 authored by hyatt's avatar hyatt
Browse files

Make <form> inside <table> stay inside the <table> but demote

	itself to a leaf.  Then the children of the <form> are treated
	as though they occurred underneath the <table> itself.  Everything
	KHTML does with this is completely wrong but this band-aid should
	hopefully suffice until 1.0.

	Also allowing <input type="hidden"> to be constructed and attached
	under <table>s.  Since they have no render objects this is safe.
	Again, total hack, since CSS2 anonymous table construction should be
	implemented and that would have fixed all this.

	This collection of hacks makes travelocity render correctly on the
	PLT.

        * khtml/css/html4.css:
        * khtml/html/dtd.cpp:
        (DOM::checkChild):
        * khtml/html/html_tableimpl.cpp:
        (HTMLTableElementImpl::addChild):
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::parseToken):
        (KHTMLParser::insertNode):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2699 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 53f3dec7
2002-11-15 David Hyatt <hyatt@apple.com>
Make <form> inside <table> stay inside the <table> but demote
itself to a leaf. Then the children of the <form> are treated
as though they occurred underneath the <table> itself. Everything
KHTML does with this is completely wrong but this band-aid should
hopefully suffice until 1.0.
Also allowing <input type="hidden"> to be constructed and attached
under <table>s. Since they have no render objects this is safe.
Again, total hack, since CSS2 anonymous table construction should be
implemented and that would have fixed all this.
This collection of hacks makes travelocity render correctly on the
PLT.
* khtml/css/html4.css:
* khtml/html/dtd.cpp:
(DOM::checkChild):
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::addChild):
* khtml/html/htmlparser.cpp:
(KHTMLParser::parseToken):
(KHTMLParser::insertNode):
2002-11-15 David Hyatt <hyatt@apple.com>
 
Fix Hixie's blog. Background images can be transparent, so
......
2002-11-15 David Hyatt <hyatt@apple.com>
Make <form> inside <table> stay inside the <table> but demote
itself to a leaf. Then the children of the <form> are treated
as though they occurred underneath the <table> itself. Everything
KHTML does with this is completely wrong but this band-aid should
hopefully suffice until 1.0.
Also allowing <input type="hidden"> to be constructed and attached
under <table>s. Since they have no render objects this is safe.
Again, total hack, since CSS2 anonymous table construction should be
implemented and that would have fixed all this.
This collection of hacks makes travelocity render correctly on the
PLT.
* khtml/css/html4.css:
* khtml/html/dtd.cpp:
(DOM::checkChild):
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::addChild):
* khtml/html/htmlparser.cpp:
(KHTMLParser::parseToken):
(KHTMLParser::insertNode):
2002-11-15 David Hyatt <hyatt@apple.com>
 
Fix Hixie's blog. Background images can be transparent, so
......
2002-11-15 David Hyatt <hyatt@apple.com>
Make <form> inside <table> stay inside the <table> but demote
itself to a leaf. Then the children of the <form> are treated
as though they occurred underneath the <table> itself. Everything
KHTML does with this is completely wrong but this band-aid should
hopefully suffice until 1.0.
Also allowing <input type="hidden"> to be constructed and attached
under <table>s. Since they have no render objects this is safe.
Again, total hack, since CSS2 anonymous table construction should be
implemented and that would have fixed all this.
This collection of hacks makes travelocity render correctly on the
PLT.
* khtml/css/html4.css:
* khtml/html/dtd.cpp:
(DOM::checkChild):
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::addChild):
* khtml/html/htmlparser.cpp:
(KHTMLParser::parseToken):
(KHTMLParser::insertNode):
2002-11-15 David Hyatt <hyatt@apple.com>
 
Fix Hixie's blog. Background images can be transparent, so
......
......@@ -734,6 +734,7 @@ bool DOM::checkChild(ushort tagID, ushort childID)
case ID_TFOOT:
case ID_TBODY:
case ID_TEXT:
case ID_FORM:
case ID_COMMENT:
return true;
default:
......@@ -743,7 +744,7 @@ bool DOM::checkChild(ushort tagID, ushort childID)
case ID_TFOOT:
case ID_TBODY:
// THEAD: TR +
if(childID == ID_TR || childID == ID_TEXT || childID == ID_COMMENT) return true;
if(childID == ID_FORM || childID == ID_TR || childID == ID_TEXT || childID == ID_COMMENT) return true;
return false;
case ID_COLGROUP:
// COLGROUP: COL *
......
......@@ -304,6 +304,12 @@ NodeImpl *HTMLTableElementImpl::addChild(NodeImpl *child)
//if(incremental && !columnPos[totalCols]);// calcColWidth();
return setTBody(static_cast<HTMLTableSectionElementImpl *>(child));
break;
case ID_FORM:
// First add the child.
HTMLElementImpl::addChild(child);
// Now simply return ourselves as the newnode. This has the effect of
// demoting the form to a leaf and moving it safely out of the way.
return this;
}
return 0;
}
......
......@@ -258,7 +258,8 @@ void KHTMLParser::parseToken(Token *t)
popOneBlock();
}
if ( !insertNode(n, t->flat) ) {
if (!insertNode(n, t->flat))
{
// we couldn't insert the node...
if(n->isElementNode())
......@@ -317,7 +318,10 @@ bool KHTMLParser::insertNode(NodeImpl *n, bool flat)
if(tagPriority[id] != 0 && !flat)
{
pushBlock(id, tagPriority[id]);
current = newNode;
if (newNode == current)
popBlock(id);
else
current = newNode;
#if SPEED_DEBUG < 2
if(!n->attached() && HTMLWidget ) {
// ### get rid of init. it has no reason for existance.
......@@ -467,9 +471,18 @@ bool KHTMLParser::insertNode(NodeImpl *n, bool flat)
ElementImpl *e = static_cast<ElementImpl *>(n);
DOMString type = e->getAttribute(ATTR_TYPE);
if ( strcasecmp( type, "hidden" ) != 0 )
break;
// Fall through!
if ( strcasecmp( type, "hidden" ) == 0 && form) {
form->addChild(n);
#if SPEED_DEBUG < 2
if(!n->attached() && HTMLWidget) {
n->init();
if (!n->attached())
n->attach();
}
#endif
return true;
}
break;
}
case ID_TEXT:
// ignore text inside the following elements.
......
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