[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
dglazkov at chromium.org
dglazkov at chromium.org
Wed Dec 22 16:36:33 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 2f2e9ecbc7e81b36d6c78445728c12872e60de95
Author: dglazkov at chromium.org <dglazkov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 29 06:45:38 2010 +0000
2010-11-28 Dimitri Glazkov <dglazkov at chromium.org>
Reviewed by Darin Adler.
Default event handlers should also be using event retargeting.
https://bugs.webkit.org/show_bug.cgi?id=49986
* fast/events/shadow-boundary-crossing-2.html: Added a test.
* fast/events/shadow-boundary-crossing-2-expected.txt: Modified expectations to include new test.
2010-11-28 Dimitri Glazkov <dglazkov at chromium.org>
Reviewed by Darin Adler.
Default event handlers should also be using event retargeting.
https://bugs.webkit.org/show_bug.cgi?id=49986
Test: fast/events/shadow-boundary-crossing-2.html
* dom/EventContext.cpp:
(WebCore::EventContext::defaultEventHandler): Added.
* dom/EventContext.h: Added decl.
* dom/Node.cpp:
(WebCore::Node::dispatchGenericEvent): Changed to use event retargeting for
default event handlers.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index c0ce6fb..4b2e033 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-11-28 Dimitri Glazkov <dglazkov at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Default event handlers should also be using event retargeting.
+ https://bugs.webkit.org/show_bug.cgi?id=49986
+
+ * fast/events/shadow-boundary-crossing-2.html: Added a test.
+ * fast/events/shadow-boundary-crossing-2-expected.txt: Modified expectations to include new test.
+
2010-11-23 MORITA Hajime <morrita at google.com>
Reviewed by Kent Tamura.
diff --git a/LayoutTests/fast/events/shadow-boundary-crossing-2-expected.txt b/LayoutTests/fast/events/shadow-boundary-crossing-2-expected.txt
index 23d620b..eb1f33a 100644
--- a/LayoutTests/fast/events/shadow-boundary-crossing-2-expected.txt
+++ b/LayoutTests/fast/events/shadow-boundary-crossing-2-expected.txt
@@ -3,5 +3,6 @@ Tests to ensure that shadow DOM boundary is not crossed during event propagation
See bug 46015 for details.
Mutation events should not propagate out of the shadow DOM: PASS
+Events for default event handler should also be retargeted: PASS
Other events should be retargeted: PASS
After event dispatch, the event object should not reveal shadow DOM: PASS
diff --git a/LayoutTests/fast/events/shadow-boundary-crossing-2.html b/LayoutTests/fast/events/shadow-boundary-crossing-2.html
index 3cf88b0..b40d2ed 100644
--- a/LayoutTests/fast/events/shadow-boundary-crossing-2.html
+++ b/LayoutTests/fast/events/shadow-boundary-crossing-2.html
@@ -36,6 +36,22 @@ var tests = {
log('Mutation events should not propagate out of the shadow DOM', !mutationEventFired);
textarea.parentNode.removeChild(textarea);
},
+ defaultEventRetargeting: function()
+ {
+ var count = 0;
+ var label = document.body.appendChild(document.createElement('label'));
+ var searchInput = label.appendChild(document.createElement('input'));
+ searchInput.setAttribute('type', 'search');
+ searchInput.setAttribute('id', 'baz');
+ label.setAttribute('for', 'baz');
+ searchInput.addEventListener('click', function(e)
+ {
+ count++;
+ }, false);
+ clickOn(searchInput);
+ log("Events for default event handler should also be retargeted", count == 1);
+ label.parentNode.removeChild(label);
+ },
eventInProgress: function()
{
var textInput = document.body.appendChild(document.createElement('input'));
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index fb55bd0..9db015b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-11-28 Dimitri Glazkov <dglazkov at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Default event handlers should also be using event retargeting.
+ https://bugs.webkit.org/show_bug.cgi?id=49986
+
+ Test: fast/events/shadow-boundary-crossing-2.html
+
+ * dom/EventContext.cpp:
+ (WebCore::EventContext::defaultEventHandler): Added.
+ * dom/EventContext.h: Added decl.
+ * dom/Node.cpp:
+ (WebCore::Node::dispatchGenericEvent): Changed to use event retargeting for
+ default event handlers.
+
2010-11-23 MORITA Hajime <morrita at google.com>
Reviewed by Kent Tamura.
diff --git a/WebCore/dom/EventContext.cpp b/WebCore/dom/EventContext.cpp
index 2a5c521..e5fe0ee 100644
--- a/WebCore/dom/EventContext.cpp
+++ b/WebCore/dom/EventContext.cpp
@@ -41,6 +41,13 @@ EventContext::EventContext(PassRefPtr<Node> node, PassRefPtr<EventTarget> curren
{
}
+void EventContext::defaultEventHandler(Event* event) const
+{
+ event->setTarget(m_target.get());
+ event->setCurrentTarget(m_currentTarget.get());
+ m_node->defaultEventHandler(event);
+}
+
void EventContext::handleLocalEvents(Event* event) const
{
event->setTarget(m_target.get());
diff --git a/WebCore/dom/EventContext.h b/WebCore/dom/EventContext.h
index 9bab9d4..8331b4d 100644
--- a/WebCore/dom/EventContext.h
+++ b/WebCore/dom/EventContext.h
@@ -42,6 +42,7 @@ public:
Node* node() const;
EventTarget* target() const;
+ void defaultEventHandler(Event*) const;
void handleLocalEvents(Event*) const;
private:
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index e71c4bd..15a5ab1 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -2634,7 +2634,7 @@ doneDispatching:
if (event->bubbles()) {
size_t size = ancestors.size();
for (size_t i = 0; i < size; ++i) {
- ancestors[i].node()->defaultEventHandler(event.get());
+ ancestors[i].defaultEventHandler(event.get());
ASSERT(!event->defaultPrevented());
if (event->defaultHandled())
goto doneWithDefault;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list