http://gwt-code-reviews.appspot.com/1819803/diff/1/user/src/com/google/gwt/user/client/ui/Tree.java
File user/src/com/google/gwt/user/client/ui/Tree.java (right):

http://gwt-code-reviews.appspot.com/1819803/diff/1/user/src/com/google/gwt/user/client/ui/Tree.java#newcode641
user/src/com/google/gwt/user/client/ui/Tree.java:641: * Determines
whether scrolling a tree item into view is currently enabled.
"whether selecting a tree item will scroll it into view" (or something
similar)

http://gwt-code-reviews.appspot.com/1819803/diff/1/user/src/com/google/gwt/user/client/ui/Tree.java#newcode643
user/src/com/google/gwt/user/client/ui/Tree.java:643: * @return true if
scrolling a tree item into view is enabled, false if not
We generally avoid stating the obvious in JavaDoc.

http://gwt-code-reviews.appspot.com/1819803/diff/1/user/src/com/google/gwt/user/client/ui/Tree.java#newcode872
user/src/com/google/gwt/user/client/ui/Tree.java:872: public void
setScrollIntoViewEnabled(boolean enable) {
setScrollTreeItemIntoViewOnSelect would be a better name, or maybe
setTreeItemScrolledIntoViewOnSelect for the getter to look better:
isTreeItemScrolledIntoViewOnSelect

http://gwt-code-reviews.appspot.com/1819803/diff/1/user/src/com/google/gwt/user/client/ui/Tree.java#newcode1275
user/src/com/google/gwt/user/client/ui/Tree.java:1275: if
(scrollIntoViewEnabled) {
All of the above is about moving the 'focusable' element so that
scrollIntoView "works". If we don't scrollIntoView(focusable), then we
don't need to compute the location of the selected item and move the
focusable element around. Or is there a "risk" that setFocus (which sets
the focus on the 'focusable' element) would scroll it into view too, in
some browsers and this computation is needed anyway?

(as a side note, I wonder whether it's an oversight or on-purpose that
updateAriaAttributes isn't called in the 'focusableWidget != null' case;
similarly, the 'tree' role should probably be set on getElement() rather
than 'focusable'; but A11Y is another issue)

http://gwt-code-reviews.appspot.com/1819803/diff/1/user/test/com/google/gwt/user/client/ui/TreeTest.java
File user/test/com/google/gwt/user/client/ui/TreeTest.java (right):

http://gwt-code-reviews.appspot.com/1819803/diff/1/user/test/com/google/gwt/user/client/ui/TreeTest.java#newcode348
user/test/com/google/gwt/user/client/ui/TreeTest.java:348: public void
testScrollIntoViewEnabled() {
This test is totally useless.

Testing whether the flag has a side-effect would be useful:
 1. create a ScrollPanel with a very small width and height,
 2. put the Tree inside and populate it with a bunch of TreeItems,
 3. make sure the ScrollPanel is at 0,0
 4. select the innermost TreeItem
 5. verify that the ScrollPanel has scrolled
 6. setScrollTreeItemIntoViewOnSelect(false) and repeat steps 3-5, but
check that the ScrollPanel has *not* scrolled in this case.

http://gwt-code-reviews.appspot.com/1819803/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to