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

Issue 2597013002: Run clang-format on ui/webui/resources (Closed)

Created:
4 years ago by Dan Beam
Modified:
4 years ago
Reviewers:
dschuyler, stevenjb, dpapad
CC:
chromium-reviews, dbeam+watch-elements_chromium.org, dcheng, dschuyler, michaelpg+watch-elements_chromium.org, oshima+watch_chromium.org, stevenjb+watch-md-settings_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Run clang-format on ui/webui/resources This is in preparation of: - turning down closure_linter - turning on CheckPatchFormatted in the PRESUBMIT This was done with: $ find ui/webui/resources -type f -name '*.js' | xargs clang-format -i R=dpapad@chromium.org, stevenjb@chromium.org BUG=567770 NOPRESUBMIT=true # existing deprecated JS CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Committed: https://chromium.googlesource.com/chromium/src/+/5f6807f5ad3db2215f1d25837118e112e1437665

Patch Set 1 #

Patch Set 2 : merge #

Total comments: 3

Patch Set 3 : fixes #

Patch Set 4 : . #

Patch Set 5 : fix includes #

Patch Set 6 : . #

Patch Set 7 : preserve quotes for now #

Patch Set 8 : remove cr_shared_menu.js #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+1290 lines, -1710 lines) Patch
M chrome/browser/resources/md_downloads/vulcanized.html View 1 2 3 4 5 26 chunks +111 lines, -91 lines 0 comments Download
M chrome/browser/resources/md_history/app.vulcanized.html View 1 2 3 4 5 17 chunks +126 lines, -108 lines 0 comments Download
M chrome/browser/resources/md_history/lazy_load.vulcanized.html View 1 2 3 4 5 7 chunks +10 lines, -4 lines 0 comments Download
A ui/webui/resources/.clang-format View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js View 4 chunks +7 lines, -10 lines 0 comments Download
M ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js View 1 chunk +1 line, -3 lines 0 comments Download
M ui/webui/resources/cr_elements/cr_expand_button/cr_expand_button.js View 2 chunks +3 lines, -13 lines 0 comments Download
M ui/webui/resources/cr_elements/cr_lazy_render/cr_lazy_render.js View 2 chunks +2 lines, -6 lines 0 comments Download
M ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.js View 1 2 chunks +3 lines, -11 lines 0 comments Download
M ui/webui/resources/cr_elements/cr_scrollable_behavior.js View 1 chunk +1 line, -4 lines 0 comments Download
M ui/webui/resources/cr_elements/cr_search_field/cr_search_field_behavior.js View 1 chunk +1 line, -3 lines 0 comments Download
M ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.js View 3 chunks +12 lines, -23 lines 0 comments Download
M ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.js View 6 chunks +8 lines, -27 lines 0 comments Download
M ui/webui/resources/cr_elements/network/cr_network_icon.js View 1 chunk +233 lines, -232 lines 0 comments Download
M ui/webui/resources/cr_elements/network/cr_network_list.js View 2 chunks +3 lines, -15 lines 0 comments Download
M ui/webui/resources/cr_elements/network/cr_network_list_item.js View 1 chunk +1 line, -3 lines 3 comments Download
M ui/webui/resources/cr_elements/network/cr_network_select.js View 2 chunks +2 lines, -9 lines 0 comments Download
M ui/webui/resources/cr_elements/policy/cr_policy_indicator_behavior.js View 2 chunks +2 lines, -2 lines 0 comments Download
M ui/webui/resources/cr_elements/policy/cr_policy_network_indicator.js View 1 chunk +5 lines, -4 lines 0 comments Download
M ui/webui/resources/cr_elements/policy/cr_policy_pref_behavior.js View 1 chunk +1 line, -1 line 0 comments Download
M ui/webui/resources/js/action_link.js View 3 chunks +4 lines, -9 lines 0 comments Download
M ui/webui/resources/js/assert.js View 1 chunk +3 lines, -2 lines 0 comments Download
M ui/webui/resources/js/chromeos/ui_account_tweaks.js View 1 2 8 chunks +19 lines, -26 lines 0 comments Download
M ui/webui/resources/js/cr.js View 5 chunks +14 lines, -36 lines 2 comments Download
M ui/webui/resources/js/cr/event_target.js View 3 chunks +3 lines, -8 lines 0 comments Download
M ui/webui/resources/js/cr/link_controller.js View 4 chunks +13 lines, -22 lines 0 comments Download
M ui/webui/resources/js/cr/ui.js View 2 chunks +2 lines, -2 lines 0 comments Download
M ui/webui/resources/js/cr/ui/alert_overlay.js View 2 chunks +4 lines, -6 lines 0 comments Download
M ui/webui/resources/js/cr/ui/array_data_model.js View 10 chunks +15 lines, -27 lines 0 comments Download
M ui/webui/resources/js/cr/ui/autocomplete_list.js View 3 chunks +4 lines, -11 lines 0 comments Download
M ui/webui/resources/js/cr/ui/bubble.js View 8 chunks +27 lines, -26 lines 2 comments Download
M ui/webui/resources/js/cr/ui/bubble_button.js View 1 chunk +1 line, -3 lines 0 comments Download
M ui/webui/resources/js/cr/ui/card_slider.js View 16 chunks +46 lines, -58 lines 0 comments Download
M ui/webui/resources/js/cr/ui/command.js View 5 chunks +7 lines, -14 lines 0 comments Download
M ui/webui/resources/js/cr/ui/context_menu_button.js View 1 chunk +1 line, -3 lines 0 comments Download
M ui/webui/resources/js/cr/ui/context_menu_handler.js View 7 chunks +15 lines, -21 lines 0 comments Download
M ui/webui/resources/js/cr/ui/controlled_indicator.js View 1 chunk +2 lines, -5 lines 0 comments Download
M ui/webui/resources/js/cr/ui/dialogs.js View 10 chunks +20 lines, -25 lines 0 comments Download
M ui/webui/resources/js/cr/ui/drag_wrapper.js View 1 chunk +2 lines, -5 lines 0 comments Download
M ui/webui/resources/js/cr/ui/expandable_bubble.js View 6 chunks +11 lines, -16 lines 0 comments Download
M ui/webui/resources/js/cr/ui/focus_grid.js View 1 chunk +1 line, -3 lines 0 comments Download
M ui/webui/resources/js/cr/ui/focus_manager.js View 5 chunks +8 lines, -12 lines 0 comments Download
M ui/webui/resources/js/cr/ui/focus_outline_manager.js View 3 chunks +8 lines, -18 lines 0 comments Download
M ui/webui/resources/js/cr/ui/focus_row.js View 1 3 chunks +5 lines, -8 lines 0 comments Download
M ui/webui/resources/js/cr/ui/grid.js View 7 chunks +14 lines, -24 lines 0 comments Download
M ui/webui/resources/js/cr/ui/list.js View 28 chunks +59 lines, -76 lines 0 comments Download
M ui/webui/resources/js/cr/ui/list_item.js View 3 chunks +7 lines, -15 lines 0 comments Download
M ui/webui/resources/js/cr/ui/list_selection_controller.js View 9 chunks +20 lines, -35 lines 0 comments Download
M ui/webui/resources/js/cr/ui/list_selection_model.js View 7 chunks +14 lines, -27 lines 0 comments Download
M ui/webui/resources/js/cr/ui/list_single_selection_model.js View 8 chunks +15 lines, -38 lines 0 comments Download
M ui/webui/resources/js/cr/ui/menu.js View 9 chunks +10 lines, -22 lines 0 comments Download
M ui/webui/resources/js/cr/ui/menu_button.js View 6 chunks +10 lines, -20 lines 0 comments Download
M ui/webui/resources/js/cr/ui/menu_item.js View 6 chunks +12 lines, -26 lines 0 comments Download
M ui/webui/resources/js/cr/ui/overlay.js View 4 chunks +5 lines, -7 lines 0 comments Download
M ui/webui/resources/js/cr/ui/page_manager/page.js View 1 2 8 chunks +16 lines, -27 lines 0 comments Download
M ui/webui/resources/js/cr/ui/page_manager/page_manager.js View 1 2 15 chunks +23 lines, -37 lines 0 comments Download
M ui/webui/resources/js/cr/ui/position_util.js View 6 chunks +12 lines, -19 lines 0 comments Download
M ui/webui/resources/js/cr/ui/repeating_button.js View 4 chunks +11 lines, -26 lines 0 comments Download
M ui/webui/resources/js/cr/ui/splitter.js View 10 chunks +19 lines, -26 lines 0 comments Download
M ui/webui/resources/js/cr/ui/table.js View 9 chunks +29 lines, -55 lines 0 comments Download
M ui/webui/resources/js/cr/ui/table/table_column.js View 3 chunks +6 lines, -12 lines 0 comments Download
M ui/webui/resources/js/cr/ui/table/table_column_model.js View 4 chunks +7 lines, -21 lines 0 comments Download
M ui/webui/resources/js/cr/ui/table/table_header.js View 8 chunks +11 lines, -19 lines 0 comments Download
M ui/webui/resources/js/cr/ui/table/table_list.js View 1 2 3 4 5 6 3 chunks +4 lines, -5 lines 0 comments Download
M ui/webui/resources/js/cr/ui/table/table_splitter.js View 2 chunks +3 lines, -5 lines 0 comments Download
M ui/webui/resources/js/cr/ui/tabs.js View 3 chunks +6 lines, -7 lines 0 comments Download
M ui/webui/resources/js/cr/ui/touch_handler.js View 17 chunks +51 lines, -54 lines 0 comments Download
M ui/webui/resources/js/cr/ui/tree.js View 21 chunks +34 lines, -74 lines 0 comments Download
M ui/webui/resources/js/i18n_behavior.js View 1 2 chunks +3 lines, -4 lines 0 comments Download
M ui/webui/resources/js/i18n_template_no_process.js View 6 chunks +11 lines, -10 lines 0 comments Download
M ui/webui/resources/js/load_time_data.js View 6 chunks +12 lines, -16 lines 0 comments Download
M ui/webui/resources/js/parse_html_subset.js View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/webui/resources/js/util.js View 1 11 chunks +88 lines, -62 lines 0 comments Download
M ui/webui/resources/js/webui_resource_test.js View 4 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 50 (35 generated)
Dan Beam
see also: https://codereview.chromium.org/2592293002/
4 years ago (2016-12-22 00:13:06 UTC) #2
dpapad
Overall pretty cool. Caveats, git blame will point to you way more after this. Also ...
4 years ago (2016-12-22 00:56:29 UTC) #9
Dan Beam
On 2016/12/22 00:56:29, dpapad wrote: > Overall pretty cool. Caveats, git blame will point to ...
4 years ago (2016-12-22 01:05:14 UTC) #12
dpapad
Touching files that haven't been touched before revealed some presubmit errors/warnings, about __defineGetter__. Should those ...
4 years ago (2016-12-22 01:10:49 UTC) #14
Dan Beam
On 2016/12/22 01:10:49, dpapad wrote: > Touching files that haven't been touched before revealed some ...
4 years ago (2016-12-22 01:18:10 UTC) #15
dschuyler
https://codereview.chromium.org/2597013002/diff/20001/ui/webui/resources/js/cr/ui/bubble.js File ui/webui/resources/js/cr/ui/bubble.js (right): https://codereview.chromium.org/2597013002/diff/20001/ui/webui/resources/js/cr/ui/bubble.js#newcode144 ui/webui/resources/js/cr/ui/bubble.js:144: location == cr.ui.ArrowLocation.BOTTOM_END; On 2016/12/22 01:05:13, Dan Beam wrote: ...
4 years ago (2016-12-22 01:24:25 UTC) #18
stevenjb
kool. RS lgtm.
4 years ago (2016-12-22 01:31:37 UTC) #23
dpapad
LGTM
4 years ago (2016-12-22 01:42:56 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2597013002/140001
4 years ago (2016-12-22 03:36:08 UTC) #39
commit-bot: I haz the power
Failed to apply patch for ui/webui/resources/cr_elements/cr_shared_menu/cr_shared_menu.js: While running git apply --index -p1; Created missing directory ...
4 years ago (2016-12-22 04:39:25 UTC) #43
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/5f6807f5ad3db2215f1d25837118e112e1437665 Cr-Commit-Position: refs/heads/master@{#440342}
4 years ago (2016-12-22 05:02:54 UTC) #45
Dan Beam
Committed patchset #8 (id:160001) manually as 5f6807f5ad3db2215f1d25837118e112e1437665.
4 years ago (2016-12-22 05:03:58 UTC) #47
dschuyler
https://codereview.chromium.org/2597013002/diff/160001/ui/webui/resources/cr_elements/network/cr_network_list_item.js File ui/webui/resources/cr_elements/network/cr_network_list_item.js (right): https://codereview.chromium.org/2597013002/diff/160001/ui/webui/resources/cr_elements/network/cr_network_list_item.js#newcode104 ui/webui/resources/cr_elements/network/cr_network_list_item.js:104: isStateTextConnected_() { return this.isListItem && this.isConnected_(); }, I think ...
4 years ago (2016-12-22 19:41:40 UTC) #48
Dan Beam
https://codereview.chromium.org/2597013002/diff/160001/ui/webui/resources/cr_elements/network/cr_network_list_item.js File ui/webui/resources/cr_elements/network/cr_network_list_item.js (right): https://codereview.chromium.org/2597013002/diff/160001/ui/webui/resources/cr_elements/network/cr_network_list_item.js#newcode104 ui/webui/resources/cr_elements/network/cr_network_list_item.js:104: isStateTextConnected_() { return this.isListItem && this.isConnected_(); }, On 2016/12/22 ...
4 years ago (2016-12-22 19:42:30 UTC) #49
Dan Beam
4 years ago (2016-12-22 19:48:11 UTC) #50
Message was sent while issue was closed.
https://codereview.chromium.org/2597013002/diff/160001/ui/webui/resources/cr_...
File ui/webui/resources/cr_elements/network/cr_network_list_item.js (right):

https://codereview.chromium.org/2597013002/diff/160001/ui/webui/resources/cr_...
ui/webui/resources/cr_elements/network/cr_network_list_item.js:104:
isStateTextConnected_() { return this.isListItem && this.isConnected_(); },
On 2016/12/22 19:42:30, Dan Beam wrote:
> On 2016/12/22 19:41:40, dschuyler wrote:
> > I think these unwrapped lines can make it hard to set breakpoints in the
> > debugger. e.g. in the old version a breakpoint could be set on line 105. In
> the
> > new version a breakpoint on line 104 will become an initialization
breakpoint
> > iirc. 
> > 
> > Is there a way (and would it be desirable) to unwrap object inits like "foo
=
> > {a:5, b:234};" and leave functions wrapped?
> 
> change ui/webui/resources/.clang-format

https://codereview.chromium.org/2603443002

https://codereview.chromium.org/2597013002/diff/160001/ui/webui/resources/js/...
File ui/webui/resources/js/cr.js (right):

https://codereview.chromium.org/2597013002/diff/160001/ui/webui/resources/js/...
ui/webui/resources/js/cr.js:306: ctor.getInstance();
On 2016/12/22 19:41:40, dschuyler wrote:
> In some cases the format seems to favor doing a simple 4 space indent, without
> doing this 'align to something in the line above' thing. In the ternary
operator
> case it seems to have gone with the 'align to something in the line above', is
> that intended/desired?

this is configurable to some extent

https://codereview.chromium.org/2597013002/diff/160001/ui/webui/resources/js/...
File ui/webui/resources/js/cr/ui/bubble.js (right):

https://codereview.chromium.org/2597013002/diff/160001/ui/webui/resources/js/...
ui/webui/resources/js/cr/ui/bubble.js:101: this.innerHTML = '<div
class="bubble-content"></div>' +
On 2016/12/22 19:41:40, dschuyler wrote:
> Could the rectangle rule apply here? It seems more readable as it was
(following
> a rectangle rule).

if this was made a multi-line string literal (i.e. `template`) it might be more
rectangular.  not sure exactly if configurable otherwise

Powered by Google App Engine
This is Rietveld 408576698