Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Issue 2745593003: Use actual client width of list excluding scroll bar for adjusting column widths.

Created:
3 years, 9 months ago by yamaguchi
Modified:
3 years, 8 months ago
Reviewers:
fukino
CC:
chromium-reviews, oka+watch_chromium.org, rginda+watch_chromium.org, mtomasz+watch_chromium.org, yamaguchi+watch_chromium.org, fukino+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Use actual client width of list excluding scroll bar for adjusting column widths. The clientWidth of the list can be narrowed by the thickness of the vertical scrollbar. Existing logic in cr.ui.Table doesn't take this into account, but assumes that it's always same to the table width. This change will fix it by always referring the clientWidth of the list, instead of that of the table. It also handles ON/OFF of the vertical scrollbar which happens when: - changing the content of list using batch update, or - resizing the window cr.ui.Table is currently only used by the Files app. This change should not give any visible change in it by itself because it currently uses overlay scroll bars instead of the normal ones. This is a preparation before removing the individual implementation of an overlay scroll bar in file_manager by this change: https://codereview.chromium.org/2724303003 After that point, we will display normal solid scroll bar after that, iff. the native overlay scroll bar is disabled by about:flags. TEST=tested manually by also patching crrev.com/2724303003 BUG=697057 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Patch Set 1 #

Patch Set 2 : Remove debug code. Remove link to crbug as it's already described in the comment. #

Patch Set 3 : Revert unnecessary change. #

Patch Set 4 : Make change to the base class instead of overriding #

Patch Set 5 : Add comment to describe existing issue. #

Total comments: 1

Patch Set 6 : Register callback function for handling clientWidth change in list. #

Patch Set 7 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -1 line) Patch
M ui/webui/resources/js/cr/ui/list.js View 1 2 3 4 5 4 chunks +18 lines, -0 lines 0 comments Download
M ui/webui/resources/js/cr/ui/table.js View 1 2 3 4 5 6 2 chunks +10 lines, -1 line 0 comments Download

Messages

Total messages: 29 (21 generated)
yamaguchi
PTAL. Do you think we should add unit test in browser_test FileTableTest? I am afraid ...
3 years, 9 months ago (2017-03-10 03:16:06 UTC) #8
yamaguchi
PTAL Revised to put the change to the base class, reflecting the offline discussion.
3 years, 9 months ago (2017-03-13 10:00:32 UTC) #12
fukino
Hi yamaguchi@, could you clarify what is wrong with cr.ui.Table? (Maybe passing clientWidth to normalizeWidths() ...
3 years, 9 months ago (2017-03-14 03:12:11 UTC) #15
yamaguchi
On 2017/03/14 03:12:11, fukino wrote: > Hi yamaguchi@, could you clarify what is wrong with ...
3 years, 9 months ago (2017-03-14 03:45:12 UTC) #18
fukino
On 2017/03/14 03:45:12, yamaguchi wrote: > On 2017/03/14 03:12:11, fukino wrote: > > Hi yamaguchi@, ...
3 years, 9 months ago (2017-03-14 04:02:46 UTC) #19
yamaguchi
On 2017/03/14 04:02:46, fukino wrote: > On 2017/03/14 03:45:12, yamaguchi wrote: > > On 2017/03/14 ...
3 years, 9 months ago (2017-03-14 04:22:26 UTC) #21
yamaguchi
https://codereview.chromium.org/2745593003/diff/80001/ui/webui/resources/js/cr/ui/table.js File ui/webui/resources/js/cr/ui/table.js (right): https://codereview.chromium.org/2745593003/diff/80001/ui/webui/resources/js/cr/ui/table.js#newcode383 ui/webui/resources/js/cr/ui/table.js:383: this.columnModel.normalizeWidths(this.list_.clientWidth); cr.ui.table.TableColumnModel.normalizeWidths only changes the first column. A good ...
3 years, 9 months ago (2017-03-14 09:07:30 UTC) #24
yamaguchi
3 years, 9 months ago (2017-03-24 12:47:14 UTC) #25
PTAL

As we discussed offline, we worried whether this change causes "drift" of the
column sizes when the scrollbar appear and disappear multiple times.
I confirmed it actually causes drift. The first column continues to shrink
little by little whereas some other columns becomes wider, if I resize the
window vertically to show/hide the vertical scrollbar repeatedly.
However, its root causes resides in the re-calculation of the column sizes
keeping the relative size. The same thing happens even with the existing logic
when resizing the window horizontally (which is more problematic as it happens
even when using overlay scrollbar).

Therefore I think we can go with the current logic.

Powered by Google App Engine
This is Rietveld 408576698