Commit ab36c324 authored by hyatt's avatar hyatt

Fix for the weather.com, slate and espn malformations that

	could occur.  Also reverting an earlier change for handling
	font tags like other inlines.  Both FONT and A need to be
	given special treatment until I can implement a strategy that
	will allow them to be handled just like the other inlines.

        * khtml/html/dtd.cpp:
        (DOM::checkChild):
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::isInline):
        * khtml/html/html_elementimpl.h:
        * khtml/xml/dom_nodeimpl.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2823 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f67a9641
2002-11-22 David Hyatt <hyatt@apple.com>
Fix for the weather.com, slate and espn malformations that
could occur. Also reverting an earlier change for handling
font tags like other inlines. Both FONT and A need to be
given special treatment until I can implement a strategy that
will allow them to be handled just like the other inlines.
* khtml/html/dtd.cpp:
(DOM::checkChild):
* khtml/html/html_elementimpl.cpp:
(HTMLElementImpl::isInline):
* khtml/html/html_elementimpl.h:
* khtml/xml/dom_nodeimpl.h:
2002-11-21 Darin Adler <darin@apple.com>
* khtml/ecma/kjs_dom.cpp: (DOMNode::eventHandlerScope): List -> ScopeChain.
......
2002-11-22 David Hyatt <hyatt@apple.com>
Fix for the weather.com, slate and espn malformations that
could occur. Also reverting an earlier change for handling
font tags like other inlines. Both FONT and A need to be
given special treatment until I can implement a strategy that
will allow them to be handled just like the other inlines.
* khtml/html/dtd.cpp:
(DOM::checkChild):
* khtml/html/html_elementimpl.cpp:
(HTMLElementImpl::isInline):
* khtml/html/html_elementimpl.h:
* khtml/xml/dom_nodeimpl.h:
2002-11-21 Darin Adler <darin@apple.com>
* khtml/ecma/kjs_dom.cpp: (DOMNode::eventHandlerScope): List -> ScopeChain.
......
2002-11-22 David Hyatt <hyatt@apple.com>
Fix for the weather.com, slate and espn malformations that
could occur. Also reverting an earlier change for handling
font tags like other inlines. Both FONT and A need to be
given special treatment until I can implement a strategy that
will allow them to be handled just like the other inlines.
* khtml/html/dtd.cpp:
(DOM::checkChild):
* khtml/html/html_elementimpl.cpp:
(HTMLElementImpl::isInline):
* khtml/html/html_elementimpl.h:
* khtml/xml/dom_nodeimpl.h:
2002-11-21 Darin Adler <darin@apple.com>
* khtml/ecma/kjs_dom.cpp: (DOMNode::eventHandlerScope): List -> ScopeChain.
......
......@@ -570,7 +570,6 @@ bool DOM::checkChild(ushort tagID, ushort childID)
switch(tagID)
{
case ID_FONT:
case ID_TT:
case ID_I:
case ID_B:
......@@ -631,6 +630,9 @@ bool DOM::checkChild(ushort tagID, ushort childID)
// ADDRESS: ( _0 | P ) *
if( check_array(childID, tag_list_0) ) return true;
return (childID == ID_P);
case ID_FONT:
// special handling for FONT: (_0 | 3)
return check_array(childID, tag_list_3) || check_array(childID, tag_list_0);
case ID__KONQBLOCK:
if ( childID == ID__KONQBLOCK ) return false;
// Fall through!
......
......@@ -60,6 +60,47 @@ HTMLElementImpl::~HTMLElementImpl()
{
}
bool HTMLElementImpl::isInline() const
{
if (renderer())
return ElementImpl::isInline();
switch(id()) {
case ID_A:
case ID_FONT:
case ID_TT:
case ID_U:
case ID_B:
case ID_I:
case ID_S:
case ID_STRIKE:
case ID_BIG:
case ID_SMALL:
// %phrase
case ID_EM:
case ID_STRONG:
case ID_DFN:
case ID_CODE:
case ID_SAMP:
case ID_KBD:
case ID_VAR:
case ID_CITE:
case ID_ABBR:
case ID_ACRONYM:
// %special
case ID_SUB:
case ID_SUP:
case ID_SPAN:
case ID_NOBR:
case ID_WBR:
return true;
default:
return ElementImpl::isInline();
}
}
void HTMLElementImpl::parseAttribute(AttributeImpl *attr)
{
DOMString indexstring;
......
......@@ -39,6 +39,8 @@ public:
virtual bool isHTMLElement() const { return true; }
virtual bool isInline() const;
virtual Id id() const = 0;
virtual void parseAttribute(AttributeImpl *token);
......
......@@ -202,7 +202,7 @@ public:
*/
virtual bool isSelectable() const { return false; };
bool isInline() const;
virtual bool isInline() const;
virtual QString toHTML() const;
QString recursive_toHTML(bool start = false) const;
......
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