This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 217366 - Screen resize buttons in browser toolbar should honor the device width
Summary: Screen resize buttons in browser toolbar should honor the device width
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Embedded Browser (show other bugs)
Version: 7.3
Hardware: All All
: P2 normal (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-24 11:10 UTC by Petr Jiricka
Modified: 2012-09-12 02:08 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2012-08-24 11:10:02 UTC
1. Create a HTML5 application
2. Run it in embedded browser
3. Resize using the toolbar icons (Desktop, Tablet landscape, ...)

You notice that if the declared width of the device is bigger than the width of the browser window, the viewport will only be as wide as the window, making it narrower than the declared device width. 

The correct behavior is that the viewport width should honor the declared width of the device, and the horizontal scrollbar should be shown in the browser window if needed.
Comment 1 Stanislav Aubrecht 2012-08-24 11:15:30 UTC
That means there will be two sets of scrollbars then - one set of scrollbars to scroll the content in the WebView component, then second set to scroll WebView viewport. Are you sure it's what we want?
Comment 2 lxlyons 2012-08-27 14:05:21 UTC
I'm not following the issue here, and why we would end up with double scrollbars.  Can I see a screenshot?
Comment 3 Petr Jiricka 2012-08-27 16:23:17 UTC
I don't have a screenshot, but I think Standa is right. There are three different widths to consider:
- width of the NetBeans browser window (w1)
- declared width of the device (w2)
- width of the page content (w3)

The width of the page content may be wider than the width of the device, in case the page is not responsive enough and "refuses" to shrink below a certain width threshold. So there may be 4 cases:
a/ w1 >= w2 and w3 <= w2 : then the device fits in the NetBeans window and the page fits into the device: no issue, no scrollbar needed
b/ w1 >= w2 and w3 > w2 : then we don't need a scrollbar for the device within the browser window, but we do need a scrollbar for the page within the device
c/ w1 < w2 and w3 <= w2 : then we do need a scrollbar for the device within the browser window, but we don't need a scrollbar for the page within the device
d/ w1 < w2 and w3 > w2: then we need two scrollbars, one for the device within the browser window and one for the page within the device

So case d/ is problematic - it requires two scrollbars. Also, I am thinking that since the main reason to do this kind of testing is to make sure that the page is responsive and that is correctly shrinks when the device width gets small, I think both b/ and d/ could be considered an error in the user application, and we could signal this fact to the user somehow.

So I am thinking about the following solution: always display at most one scrollbar, in case that w3 > w1. Additionally, in case that w3 > w2, display a vertical line corresponding to the device width, so the user clearly sees that everything that is to the right of this line does not fit on the device screen. This could be accompanied by a warning icon somewhere. What do you think?
Comment 4 Petr Jiricka 2012-09-10 11:14:11 UTC
Solution agreed to in the UI meeting: if necessary (case d), display two scrollbars.
Comment 5 Stanislav Aubrecht 2012-09-10 15:37:24 UTC
core-main 8582b347a965
Comment 6 Quality Engineering 2012-09-12 02:08:08 UTC
Integrated into 'main-golden', will be available in build *201209120001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/8582b347a965
User: S. Aubrecht <saubrecht@netbeans.org>
Log: #217366 - show double scrollbars when browser's min size is too big to fit into window