[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:37:38 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 7176baee3e3ac6a08012bd8dc6d831914aa8febb
Author: dglazkov at chromium.org <dglazkov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 29 15:12:39 2010 +0000
2010-11-29 Dimitri Glazkov <dglazkov at chromium.org>
Reviewed by Darin Adler.
Use the right focusable check to avoid multiple focus/blur events being fired from inside of the shadow DOM.
https://bugs.webkit.org/show_bug.cgi?id=49977
* fast/events/shadow-boundary-crossing-2.html: Added a test for multiple focus events.
* fast/events/shadow-boundary-crossing-2-expected.txt: Added new test expectation.
2010-11-29 Dimitri Glazkov <dglazkov at chromium.org>
Reviewed by Darin Adler.
Use the right focusable check to avoid multiple focus/blur events being fired from inside of the shadow DOM.
https://bugs.webkit.org/show_bug.cgi?id=49977
* editing/SelectionController.cpp:
(WebCore::SelectionController::setFocusedNodeIfNeeded): Added a FIXME to remove redundant code.
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent): Changed to use isMouseFocusable, which is what shadow DOM elements
override, and added a FIXME to convert to use shadow DOM-aware traversal instead of render tree traversal.
Test: fast/events/shadow-boundary-crossing-2.html
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72796 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index f850f3c..fcc72c5 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-11-29 Dimitri Glazkov <dglazkov at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Use the right focusable check to avoid multiple focus/blur events being fired from inside of the shadow DOM.
+ https://bugs.webkit.org/show_bug.cgi?id=49977
+
+ * fast/events/shadow-boundary-crossing-2.html: Added a test for multiple focus events.
+ * fast/events/shadow-boundary-crossing-2-expected.txt: Added new test expectation.
+
2010-11-29 Yael Aharon <yael.aharon at nokia.com>
Reviewed by Antonio Gomes.
diff --git a/LayoutTests/fast/events/shadow-boundary-crossing-2-expected.txt b/LayoutTests/fast/events/shadow-boundary-crossing-2-expected.txt
index eb1f33a..3c6936c 100644
--- a/LayoutTests/fast/events/shadow-boundary-crossing-2-expected.txt
+++ b/LayoutTests/fast/events/shadow-boundary-crossing-2-expected.txt
@@ -6,3 +6,4 @@ 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
+Focusing same shadow DOM element repeatedly should not trigger multiple focus/blur events: PASS
diff --git a/LayoutTests/fast/events/shadow-boundary-crossing-2.html b/LayoutTests/fast/events/shadow-boundary-crossing-2.html
index b40d2ed..0754493 100644
--- a/LayoutTests/fast/events/shadow-boundary-crossing-2.html
+++ b/LayoutTests/fast/events/shadow-boundary-crossing-2.html
@@ -21,6 +21,15 @@ function clickOn(element)
eventSender.mouseUp();
}
+
+function leapForward()
+{
+ if (!window.eventSender)
+ return;
+
+ eventSender.leapForward(1000);
+}
+
var tests = {
mutationEventPropagation: function()
{
@@ -73,6 +82,21 @@ var tests = {
clickOn(textInput);
log('After event dispatch, the event object should not reveal shadow DOM', storedEvent && storedEvent.target == textInput);
textInput.parentNode.removeChild(textInput);
+ },
+ focusEventPropagation: function()
+ {
+ var searchInput = document.body.appendChild(document.createElement('input'));
+ searchInput.setAttribute('type', 'search');
+ var count = 0;
+ searchInput.addEventListener('focus', function(evt)
+ {
+ count++;
+ });
+ clickOn(searchInput);
+ leapForward();
+ clickOn(searchInput);
+ log('Focusing same shadow DOM element repeatedly should not trigger multiple focus/blur events', count == 1);
+ searchInput.parentNode.removeChild(searchInput);
}
};
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 16ec292..3a1618b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-11-29 Dimitri Glazkov <dglazkov at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Use the right focusable check to avoid multiple focus/blur events being fired from inside of the shadow DOM.
+ https://bugs.webkit.org/show_bug.cgi?id=49977
+
+ * editing/SelectionController.cpp:
+ (WebCore::SelectionController::setFocusedNodeIfNeeded): Added a FIXME to remove redundant code.
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::dispatchMouseEvent): Changed to use isMouseFocusable, which is what shadow DOM elements
+ override, and added a FIXME to convert to use shadow DOM-aware traversal instead of render tree traversal.
+
+ Test: fast/events/shadow-boundary-crossing-2.html
+
2010-11-29 Adam Roben <aroben at apple.com>
Windows build fix after r72715
diff --git a/WebCore/editing/SelectionController.cpp b/WebCore/editing/SelectionController.cpp
index 1164c45..bc6ef24 100644
--- a/WebCore/editing/SelectionController.cpp
+++ b/WebCore/editing/SelectionController.cpp
@@ -1555,6 +1555,7 @@ void SelectionController::setFocusedNodeIfNeeded()
// Walk up the render tree to search for a node to focus.
// Walking up the DOM tree wouldn't work for shadow trees, like those behind the engine-based text fields.
+ // FIXME: Combine with the same traversal code in EventHandle::dispatchMouseEvent.
while (renderer) {
// We don't want to set focus on a subframe when selecting in a parent frame,
// so add the !isFrameElement check here. There's probably a better way to make this
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index e095136..328be63 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -1859,9 +1859,10 @@ bool EventHandler::dispatchMouseEvent(const AtomicString& eventType, Node* targe
// Walk up the render tree to search for a node to focus.
// Walking up the DOM tree wouldn't work for shadow trees, like those behind the engine-based text fields.
+ // FIXME: Rework to use shadowParent. No need to traverse with the render tree.
while (renderer) {
node = renderer->node();
- if (node && node->isFocusable()) {
+ if (node && node->isMouseFocusable()) {
// To fix <rdar://problem/4895428> Can't drag selected ToDo, we don't focus a
// node on mouse down if it's selected and inside a focused node. It will be
// focused if the user does a mouseup over it, however, because the mouseup
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list