Commit 523f0cbf authored by darin's avatar darin

Reviewed by Don.

	- fixed 3135010 -- nil-dereference in KHTMLPart::xmlDocImpl() at channels.netscape.com

        * khtml/html/html_baseimpl.cpp: (HTMLFrameElementImpl::contentDocument):
        Add missing nil check. Also added lots of FIXME comments about problems I observed here.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 418f83ec
2002-12-24 Darin Adler <darin@apple.com>
Reviewed by Don.
- fixed 3135010 -- nil-dereference in KHTMLPart::xmlDocImpl() at channels.netscape.com
* khtml/html/html_baseimpl.cpp: (HTMLFrameElementImpl::contentDocument):
Add missing nil check. Also added lots of FIXME comments about problems I observed here.
2002-12-24 Darin Adler <darin@apple.com> 2002-12-24 Darin Adler <darin@apple.com>
Reviewed by Richard and Don. Reviewed by Richard and Don.
......
2002-12-24 Darin Adler <darin@apple.com>
Reviewed by Don.
- fixed 3135010 -- nil-dereference in KHTMLPart::xmlDocImpl() at channels.netscape.com
* khtml/html/html_baseimpl.cpp: (HTMLFrameElementImpl::contentDocument):
Add missing nil check. Also added lots of FIXME comments about problems I observed here.
2002-12-24 Darin Adler <darin@apple.com> 2002-12-24 Darin Adler <darin@apple.com>
Reviewed by Richard and Don. Reviewed by Richard and Don.
......
...@@ -226,6 +226,7 @@ NodeImpl::Id HTMLFrameElementImpl::id() const ...@@ -226,6 +226,7 @@ NodeImpl::Id HTMLFrameElementImpl::id() const
return ID_FRAME; return ID_FRAME;
} }
// FIXME: Why is this different from setLocation?
void HTMLFrameElementImpl::updateForNewURL() void HTMLFrameElementImpl::updateForNewURL()
{ {
if (attached()) { if (attached()) {
...@@ -277,21 +278,28 @@ void HTMLFrameElementImpl::parseAttribute(AttributeImpl *attr) ...@@ -277,21 +278,28 @@ void HTMLFrameElementImpl::parseAttribute(AttributeImpl *attr)
case ATTR_ID: case ATTR_ID:
case ATTR_NAME: case ATTR_NAME:
name = attr->value(); name = attr->value();
// FIXME: If we are already attached, this doesn't actually change the frame's name.
// FIXME: If we are already attached, this doesn't check for frame name
// conflicts and generate a unique frame name.
break; break;
case ATTR_FRAMEBORDER: case ATTR_FRAMEBORDER:
{ {
frameBorder = attr->value().toInt(); frameBorder = attr->value().toInt();
frameBorderSet = ( attr->val() != 0 ); frameBorderSet = ( attr->val() != 0 );
// FIXME: If we are already attached, this has no effect.
} }
break; break;
case ATTR_MARGINWIDTH: case ATTR_MARGINWIDTH:
marginWidth = attr->val()->toInt(); marginWidth = attr->val()->toInt();
// FIXME: If we are already attached, this has no effect.
break; break;
case ATTR_MARGINHEIGHT: case ATTR_MARGINHEIGHT:
marginHeight = attr->val()->toInt(); marginHeight = attr->val()->toInt();
// FIXME: If we are already attached, this has no effect.
break; break;
case ATTR_NORESIZE: case ATTR_NORESIZE:
noresize = true; noresize = true;
// FIXME: If we are already attached, this has no effect.
break; break;
case ATTR_SCROLLING: case ATTR_SCROLLING:
kdDebug( 6031 ) << "set scroll mode" << endl; kdDebug( 6031 ) << "set scroll mode" << endl;
...@@ -301,6 +309,8 @@ void HTMLFrameElementImpl::parseAttribute(AttributeImpl *attr) ...@@ -301,6 +309,8 @@ void HTMLFrameElementImpl::parseAttribute(AttributeImpl *attr)
scrolling = QScrollView::AlwaysOn; scrolling = QScrollView::AlwaysOn;
else if( strcasecmp( attr->value(), "no" ) == 0 ) else if( strcasecmp( attr->value(), "no" ) == 0 )
scrolling = QScrollView::AlwaysOff; scrolling = QScrollView::AlwaysOff;
// FIXME: If we are already attached, this has no effect.
// FIXME: Is this falling through on purpose, or do we want a break here?
default: default:
HTMLElementImpl::parseAttribute(attr); HTMLElementImpl::parseAttribute(attr);
...@@ -369,6 +379,7 @@ void HTMLFrameElementImpl::attach() ...@@ -369,6 +379,7 @@ void HTMLFrameElementImpl::attach()
w->part()->requestFrame( static_cast<RenderFrame*>(m_render), url.string(), name.string() ); w->part()->requestFrame( static_cast<RenderFrame*>(m_render), url.string(), name.string() );
} }
// FIXME: Why is this different from updateForNewURL?
void HTMLFrameElementImpl::setLocation( const DOMString& str ) void HTMLFrameElementImpl::setLocation( const DOMString& str )
{ {
url = str; url = str;
...@@ -400,8 +411,10 @@ DocumentImpl* HTMLFrameElementImpl::contentDocument() const ...@@ -400,8 +411,10 @@ DocumentImpl* HTMLFrameElementImpl::contentDocument() const
KHTMLView* w = getDocument()->view(); KHTMLView* w = getDocument()->view();
if (w) { if (w) {
KHTMLPart *part = w->part()->findFrame( name.string() ); KHTMLPart *part = w->part()->findFrame( name.string() );
return part->xmlDocImpl(); if (part) {
return part->xmlDocImpl();
}
} }
return 0; return 0;
...@@ -642,6 +655,9 @@ void HTMLIFrameElementImpl::attach() ...@@ -642,6 +655,9 @@ void HTMLIFrameElementImpl::attach()
assert(!m_render); assert(!m_render);
assert(parentNode()); assert(parentNode());
// FIXME: This self-reference check is the same as the code in the base class attach.
// We should refactor so we can share the code.
KHTMLView* w = getDocument()->view(); KHTMLView* w = getDocument()->view();
// avoid endless recursion // avoid endless recursion
KURL u; KURL u;
......
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