From a694b492fde73472f2b2437ba971de25467c6132 Mon Sep 17 00:00:00 2001 From: Jonatan Kronqvist Date: Tue, 11 Oct 2011 11:25:43 +0000 Subject: Fixed #7548 - testbench tests with keyboard navigation now work in ie6 svn changeset:21678/svn branch:6.7 --- .../terminal/gwt/client/ui/FocusElementPanel.java | 7 ++ src/com/vaadin/terminal/gwt/client/ui/VTree.java | 10 +++ .../components/tree/TreeKeyboardNavigationScroll | 87 ------------------- .../tree/TreeKeyboardNavigationScroll.html | 87 +++++++++++++++++++ .../tree/TreeKeyboardNavigationScrolls.java | 9 +- .../tree/TreeKeyboardNavigationValidators | 97 ---------------------- .../tree/TreeKeyboardNavigationValidators.html | 97 ++++++++++++++++++++++ 7 files changed, 208 insertions(+), 186 deletions(-) delete mode 100644 tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll create mode 100644 tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll.html delete mode 100644 tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators create mode 100644 tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.html diff --git a/src/com/vaadin/terminal/gwt/client/ui/FocusElementPanel.java b/src/com/vaadin/terminal/gwt/client/ui/FocusElementPanel.java index 04fc34b769..5f3e5b18fd 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/FocusElementPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/FocusElementPanel.java @@ -82,4 +82,11 @@ public class FocusElementPanel extends SimpleFocusablePanel { } } } + + /** + * @return the focus element + */ + public Element getFocusElement() { + return focusElement.cast(); + } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java index fa25279328..f50b722d0c 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java @@ -2173,6 +2173,12 @@ public class VTree extends FocusElementPanel implements Paintable, * .lang.String) */ public Element getSubPartElement(String subPart) { + if ("fe".equals(subPart)) { + if (isIE6OrOpera() && focusedNode != null) { + return focusedNode.getElement(); + } + return getFocusElement(); + } if (subPart.startsWith(SUBPART_NODE_PREFIX + "[")) { boolean expandCollapse = false; @@ -2237,6 +2243,10 @@ public class VTree extends FocusElementPanel implements Paintable, return null; } + if (subElement == getFocusElement()) { + return "fe"; + } + TreeNode treeNode = Util.findWidget(subElement, TreeNode.class); if (treeNode == null) { // Did not click on a node, let somebody else take care of the diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll deleted file mode 100644 index 8d03e3aaf3..0000000000 --- a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - -TreeKeyboardNavigationScroll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
New Test
open/run/com.vaadin.tests.components.tree.TreeKeyboardNavigationScrolls?restartApplication
mouseClickvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#n[0]4,3
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]right
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]right
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]right
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
screenCapturenoscroll
- - diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll.html b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll.html new file mode 100644 index 0000000000..0f0db2b71e --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll.html @@ -0,0 +1,87 @@ + + + + + + +TreeKeyboardNavigationScroll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.components.tree.TreeKeyboardNavigationScrolls?restartApplication
mouseClickvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#n[0]6,7
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#feright
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#feright
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#feright
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
screenCapturenoscroll
+ + diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java index 5bbc5423ab..a3ac2ee277 100644 --- a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java +++ b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java @@ -31,8 +31,13 @@ public class TreeKeyboardNavigationScrolls extends TestBase { cont.addItem(i); for (int j = 1; j < 3; j++) { String id = i - + " foo bar baz make this node really wide so that we don't have to fiddle with resizing the browser window -> what would you do if you had one of your legs on backwards? it's legs time! everybody get your legs! " - + j; + + " foo bar baz make this node really wide so that we don't have to fiddle with resizing the browser window -> " + + "what would you do if you had one of your legs on backwards? it's legs time! everybody get your legs! " + + "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore " + + "et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut " + + "aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum " + + "dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui " + + "officia deserunt mollit anim id est laborum." + j; cont.addItem(id); cont.setChildrenAllowed(id, false); cont.setParent(id, i); diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators deleted file mode 100644 index 8b9722df94..0000000000 --- a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - -TreeKeyboardNavigationValidators - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
New Test
open/run/com.vaadin.tests.components.tree.TreeKeyboardNavigationValidators?restartApplication
mouseClickvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#n[0]7,10
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]right
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]right
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]right
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
screenCapture5-2-sel
- - diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.html b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.html new file mode 100644 index 0000000000..2439079d09 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.html @@ -0,0 +1,97 @@ + + + + + + +TreeKeyboardNavigationValidators + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.components.tree.TreeKeyboardNavigationValidators?restartApplication
mouseClickvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#n[0]7,10
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#feright
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#feright
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#feright
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fedown
screenCapture5-2-sel
+ + -- cgit v1.2.3