From kde-commits Mon Apr 18 11:54:13 2005 From: David Faure Date: Mon, 18 Apr 2005 11:54:13 +0000 To: kde-commits Subject: kdelibs/khtml Message-Id: <20050418115413.013E1625 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=111382526514736 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: