diff options
author | Jonatan Kronqvist <jonatan.kronqvist@itmill.com> | 2011-10-11 11:25:43 +0000 |
---|---|---|
committer | Jonatan Kronqvist <jonatan.kronqvist@itmill.com> | 2011-10-11 11:25:43 +0000 |
commit | a694b492fde73472f2b2437ba971de25467c6132 (patch) | |
tree | 403b32cb134868614f99f0e306c5ab68ebd97131 | |
parent | 4d32522972cde371f6ae8786b45df9dde68eef95 (diff) | |
download | vaadin-framework-a694b492fde73472f2b2437ba971de25467c6132.tar.gz vaadin-framework-a694b492fde73472f2b2437ba971de25467c6132.zip |
Fixed #7548 - testbench tests with keyboard navigation now work in ie6
svn changeset:21678/svn branch:6.7
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/FocusElementPanel.java | 7 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VTree.java | 10 | ||||
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll.html (renamed from tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll) | 24 | ||||
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java | 9 | ||||
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.html (renamed from tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators) | 26 |
5 files changed, 49 insertions, 27 deletions
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.html index 8d03e3aaf3..0f0db2b71e 100644 --- a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll +++ b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll.html @@ -19,61 +19,61 @@ <tr> <td>mouseClick</td> <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#n[0]</td> - <td>4,3</td> + <td>6,7</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>right</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>right</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>right</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> 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.html index 8b9722df94..2439079d09 100644 --- a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators +++ b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.html @@ -23,67 +23,67 @@ </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>right</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>right</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>right</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationValidators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#fe</td> <td>down</td> </tr> <tr> |