Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 325091

Summary: [Tree] Broken horizontal scrolling in FF
Product: [RT] RAP Reporter: Ivan Furnadjiev <ivan>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: tbuschto
Version: 1.4   
Target Milestone: 1.4 M3   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 320597    
Attachments:
Description Flags
Screenshot
none
Snippet to reproduce it
none
"improved" snipped none

Description Ivan Furnadjiev CLA 2010-09-13 05:30:12 EDT
If you have a tree with columns and the content has been scrolled by the horizontal scrollbar, the tree layout get broken after page reload.
Comment 1 Ivan Furnadjiev CLA 2010-09-13 05:31:09 EDT
Created attachment 178724 [details]
Screenshot

Reproducible with FF 3.6.9 on Windows and MAC.
Comment 2 Ivan Furnadjiev CLA 2010-09-13 05:31:54 EDT
Created attachment 178725 [details]
Snippet to reproduce it
Comment 3 Tim Buschtoens CLA 2010-10-13 05:33:42 EDT
Note that i was unable to reproduce this on my windows machine, but under Mac OS X (same FF version).
Comment 4 Tim Buschtoens CLA 2010-10-13 06:53:41 EDT
There are more issues with the horizontal scrolling: Setting scrollLeft (via showColumn) with the first request or while the tree is not visible will have no effect or produce a JS error. Also, the columnHeader will not be scrolled correctly if it is made visible via setHeaderVisible after the Tree has been created and scrolled. 

I won't open new bugs for these, as this can all be fixed with one additional "onAppear" listener in Tree.js.

Note that these additional issues are bugs in the Tree.js, while the original issue with the wrong offset after reload is veryl likely a Firefox bug.
Comment 5 Tim Buschtoens CLA 2010-10-13 10:07:10 EDT
Created attachment 180768 [details]
"improved" snipped

This is a "more risky" version of the snippet: It scrolls an invisible Table with an invisible header on the first request. (Doubleclick the shell to make the table visible and click the tree to make the header visible.) Only if both the clientArea and the header are scrolled to column 12 on appear does the tree work correctly.
Comment 6 Tim Buschtoens CLA 2010-10-13 10:16:23 EDT
Note: I found a similar bug in IE that lets this test fail:
      var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
      var tree = this._createDefaultTree();
      tree.setItemMetrics( 0, 0, 1000, 0, 0, 0, 500 );
      testUtil.flush();
      tree.hide();
      testUtil.flush();
      tree.setScrollLeft( 160 );
      tree.show();
      assertEquals( 160, tree._horzScrollBar.getValue() );
      assertEquals( 160, tree._clientArea.getScrollLeft() );      
      tree.destroy();

The second assertEquals gets a "0" not "160". However, the slightest changes (like making the header visible) to the test and it is green again. I was also unable to reproduce this problem in an actual RAP application so i will comment the test in TreeTest.js for now.
Comment 7 Tim Buschtoens CLA 2010-10-13 10:25:41 EDT
Fixed in CVS HEAD.

Fixed in Tree.js and added tests to TreeTest.js.
Comment 8 Ivan Furnadjiev CLA 2010-10-13 13:28:15 EDT
Did a testing under FF 3.6.10 and IE8 (Windows 7)... works fine.