[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:33:15 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit a8af496bc069a3f9110ee73c3f53b7c7e0878d97
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Apr 2 00:46:02 2003 +0000
Reviewed by Maciej.
- fixed 3123709 -- redirect isn't followed at Apple's Dental Benefits provider
* khtml/dom/dom2_events.h: Added boolean "isWindowEvent" parameter.
* khtml/dom/dom2_events.cpp: (EventListener::handleEvent): Ignore boolean "isWindowEvent" parameter.
* khtml/ecma/kjs_events.h: Added boolean "isWindowEvent" parameter.
* khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): Look at new "isWindowEvent" parameter,
and send the event to the window if it's true, rather than the current node, document, and form.
* khtml/xml/dom_docimpl.cpp: (DocumentImpl::defaultEventHandler): Pass true for "isWindowEvent".
* khtml/xml/dom_nodeimpl.cpp: (NodeImpl::handleLocalEvents): Pass false for "isWindowEvent".
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3993 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index fd5b599..e099e8a 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,21 @@
2003-04-01 Darin Adler <darin at apple.com>
+ Reviewed by Maciej.
+
+ - fixed 3123709 -- redirect isn't followed at Apple's Dental Benefits provider
+
+ * khtml/dom/dom2_events.h: Added boolean "isWindowEvent" parameter.
+ * khtml/dom/dom2_events.cpp: (EventListener::handleEvent): Ignore boolean "isWindowEvent" parameter.
+
+ * khtml/ecma/kjs_events.h: Added boolean "isWindowEvent" parameter.
+ * khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): Look at new "isWindowEvent" parameter,
+ and send the event to the window if it's true, rather than the current node, document, and form.
+
+ * khtml/xml/dom_docimpl.cpp: (DocumentImpl::defaultEventHandler): Pass true for "isWindowEvent".
+ * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::handleLocalEvents): Pass false for "isWindowEvent".
+
+2003-04-01 Darin Adler <darin at apple.com>
+
Reviewed by John.
- fixed 3144287 -- CSS with media=print not used when printing
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index fd5b599..e099e8a 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,21 @@
2003-04-01 Darin Adler <darin at apple.com>
+ Reviewed by Maciej.
+
+ - fixed 3123709 -- redirect isn't followed at Apple's Dental Benefits provider
+
+ * khtml/dom/dom2_events.h: Added boolean "isWindowEvent" parameter.
+ * khtml/dom/dom2_events.cpp: (EventListener::handleEvent): Ignore boolean "isWindowEvent" parameter.
+
+ * khtml/ecma/kjs_events.h: Added boolean "isWindowEvent" parameter.
+ * khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): Look at new "isWindowEvent" parameter,
+ and send the event to the window if it's true, rather than the current node, document, and form.
+
+ * khtml/xml/dom_docimpl.cpp: (DocumentImpl::defaultEventHandler): Pass true for "isWindowEvent".
+ * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::handleLocalEvents): Pass false for "isWindowEvent".
+
+2003-04-01 Darin Adler <darin at apple.com>
+
Reviewed by John.
- fixed 3144287 -- CSS with media=print not used when printing
diff --git a/WebCore/khtml/dom/dom2_events.cpp b/WebCore/khtml/dom/dom2_events.cpp
index bb26f9a..9469846 100644
--- a/WebCore/khtml/dom/dom2_events.cpp
+++ b/WebCore/khtml/dom/dom2_events.cpp
@@ -35,7 +35,7 @@ EventListener::~EventListener()
{
}
-void EventListener::handleEvent(Event &/*evt*/)
+void EventListener::handleEvent(Event &/*evt*/, bool)
{
}
diff --git a/WebCore/khtml/dom/dom2_events.h b/WebCore/khtml/dom/dom2_events.h
index 449f641..aa8a60b 100644
--- a/WebCore/khtml/dom/dom2_events.h
+++ b/WebCore/khtml/dom/dom2_events.h
@@ -72,8 +72,11 @@ public:
* also contains the stopPropagation and preventDefault methods which are
* used in determining the event's flow and default action.
*
+ * @param isWindowEvent If true, the "this" should be the window, not the current
+ * target (there is no DOM node for the window, so it can't be the target).
+ *
*/
- virtual void handleEvent(Event &evt);
+ virtual void handleEvent(Event &evt, bool isWindowEvent);
/**
* @internal
diff --git a/WebCore/khtml/ecma/kjs_events.cpp b/WebCore/khtml/ecma/kjs_events.cpp
index accd9e2..52fe4c0 100644
--- a/WebCore/khtml/ecma/kjs_events.cpp
+++ b/WebCore/khtml/ecma/kjs_events.cpp
@@ -50,7 +50,7 @@ JSEventListener::~JSEventListener()
//fprintf(stderr,"JSEventListener::~JSEventListener this=%p listener=%p\n",this,listener.imp());
}
-void JSEventListener::handleEvent(DOM::Event &evt)
+void JSEventListener::handleEvent(DOM::Event &evt, bool isWindowEvent)
{
#ifdef KJS_DEBUGGER
if (KJSDebugWin::instance() && KJSDebugWin::instance()->inSession())
@@ -72,13 +72,17 @@ void JSEventListener::handleEvent(DOM::Event &evt)
// Add the event's target element to the scope
// (and the document, and the form - see KJS::HTMLElement::eventHandlerScope)
- Object thisObj = Object::dynamicCast(getDOMNode(exec,evt.currentTarget()));
ScopeChain oldScope = listener.scope();
- //if (thisVal.type() != NullType)
- if ( !thisObj.isNull() ) {
- ScopeChain scope = oldScope;
- static_cast<DOMNode*>(thisObj.imp())->pushEventHandlerScope(exec, scope);
- listener.setScope( scope );
+ Object thisObj;
+ if (isWindowEvent) {
+ thisObj = win;
+ } else {
+ thisObj = Object::dynamicCast(getDOMNode(exec,evt.currentTarget()));
+ if ( !thisObj.isNull() ) {
+ ScopeChain scope = oldScope;
+ static_cast<DOMNode*>(thisObj.imp())->pushEventHandlerScope(exec, scope);
+ listener.setScope( scope );
+ }
}
Window *window = static_cast<Window*>(win.imp());
diff --git a/WebCore/khtml/ecma/kjs_events.h b/WebCore/khtml/ecma/kjs_events.h
index 4ecf838..3ce499e 100644
--- a/WebCore/khtml/ecma/kjs_events.h
+++ b/WebCore/khtml/ecma/kjs_events.h
@@ -34,7 +34,7 @@ namespace KJS {
public:
JSEventListener(Object _listener, const Object &_win, bool _html = false);
virtual ~JSEventListener();
- virtual void handleEvent(DOM::Event &evt);
+ virtual void handleEvent(DOM::Event &evt, bool isWindowEvent);
virtual DOM::DOMString eventListenerType();
Object listenerObj() const { return listener; }
ObjectImp *listenerObjImp() const { return listener.imp(); }
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index 7a8a879..f1dc941 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -2117,8 +2117,7 @@ void DocumentImpl::defaultEventHandler(EventImpl *evt)
Event ev(evt);
for (; it.current(); ++it) {
if (it.current()->id == evt->id()) {
- evt->setCurrentTarget(this);
- it.current()->listener->handleEvent(ev);
+ it.current()->listener->handleEvent(ev, true);
return;
}
}
diff --git a/WebCore/khtml/xml/dom_nodeimpl.cpp b/WebCore/khtml/xml/dom_nodeimpl.cpp
index fb4435b..a39d277 100644
--- a/WebCore/khtml/xml/dom_nodeimpl.cpp
+++ b/WebCore/khtml/xml/dom_nodeimpl.cpp
@@ -726,7 +726,7 @@ void NodeImpl::handleLocalEvents(EventImpl *evt, bool useCapture)
Event ev = evt;
for (; it.current(); ++it) {
if (it.current()->id == evt->id() && it.current()->useCapture == useCapture)
- it.current()->listener->handleEvent(ev);
+ it.current()->listener->handleEvent(ev, false);
}
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list