CVS commit by faure: Apply followup patch by Maciej - body onload is not tied to the body particularly, it's a Window event, so don't add the body as special scope there. M +10 -7 ecma/kjs_events.cpp 1.95 M +5 -5 html/html_baseimpl.cpp 1.206 --- kdelibs/khtml/ecma/kjs_events.cpp #1.94:1.95 @@ -199,4 +199,6 @@ void JSLazyEventListener::parseCode() co declFunc->setName(Identifier(name)); + if (originalNode) + { // Add the event's home element to the scope // (and the document, and the form - see KJS::HTMLElement::eventHandlerScope) @@ -212,4 +214,5 @@ void JSLazyEventListener::parseCode() co } } + } // no more need to keep the unparsed code around --- kdelibs/khtml/html/html_baseimpl.cpp #1.205:1.206 @@ -141,21 +141,21 @@ void HTMLBodyElementImpl::parseAttribute case ATTR_ONLOAD: getDocument()->setHTMLWindowEventListener(EventImpl::LOAD_EVENT, - getDocument()->createHTMLEventListener(attr->value().string(), "onload", this)); + getDocument()->createHTMLEventListener(attr->value().string(), "onload", NULL)); break; case ATTR_ONUNLOAD: getDocument()->setHTMLWindowEventListener(EventImpl::UNLOAD_EVENT, - getDocument()->createHTMLEventListener(attr->value().string(), "onunload", this)); + getDocument()->createHTMLEventListener(attr->value().string(), "onunload", NULL)); break; case ATTR_ONBLUR: getDocument()->setHTMLWindowEventListener(EventImpl::BLUR_EVENT, - getDocument()->createHTMLEventListener(attr->value().string(), "onblur", this)); + getDocument()->createHTMLEventListener(attr->value().string(), "onblur", NULL)); break; case ATTR_ONFOCUS: getDocument()->setHTMLWindowEventListener(EventImpl::FOCUS_EVENT, - getDocument()->createHTMLEventListener(attr->value().string(), "onfocus", this)); + getDocument()->createHTMLEventListener(attr->value().string(), "onfocus", NULL)); break; case ATTR_ONRESIZE: getDocument()->setHTMLWindowEventListener(EventImpl::RESIZE_EVENT, - getDocument()->createHTMLEventListener(attr->value().string(), "onresize", this)); + getDocument()->createHTMLEventListener(attr->value().string(), "onresize", NULL)); break; case ATTR_NOSAVE: