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

Issue 1967913002: Material WebUI: cr-slider element for intelligent range mapping (Closed)

Created:
4 years, 7 months ago by michaelpg
Modified:
4 years, 6 months ago
CC:
chromium-reviews, michaelpg+watch-elements_chromium.org, dbeam+watch-elements_chromium.org, michaelpg+watch-md-settings_chromium.org, michaelpg+watch-md-ui_chromium.org, arv+watch_chromium.org, oshima+watch_chromium.org, vitalyp+closure_chromium.org, dbeam+watch-settings_chromium.org, dbeam+watch-closure_chromium.org, stevenjb+watch-md-settings_chromium.org, jlklein+watch-closure_chromium.org, Dan Beam, stevenjb
Base URL:
https://chromium.googlesource.com/chromium/src.git@KeyboardFinish
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Material WebUI: cr-slider element for intelligent range mapping Most sliders don't correspond 1:1 with a range of values. For instance, we curate a range of valid values for pointer sensitivity, then map these to a linear slider. <cr-slider> takes an array of values corresponding to slider indices, and binds the value of the <paper-slider> it wraps to the host element's property. This simplifies the logic that was duplicated in keyboard.html and appearance_fonts_page.html. It also fixes a rare edge case when a pref value updates while the slider is being dragged. BUG=611949 TEST=CrElementsBrowserTest.CrElements CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714 Cr-Commit-Position: refs/heads/master@{#397517}

Patch Set 1 #

Total comments: 3

Patch Set 2 : cr-slider element #

Patch Set 3 : cleanup #

Patch Set 4 : rebase #

Total comments: 21

Patch Set 5 : comments #

Patch Set 6 : spacing #

Total comments: 2

Patch Set 7 : comments #

Total comments: 1

Patch Set 8 : #

Total comments: 4

Patch Set 9 : dschuyler #

Patch Set 10 : rebase #

Patch Set 11 : rebase #

Patch Set 12 : Merge cr-elements tests #

Total comments: 1

Patch Set 13 : rebase #

Patch Set 14 : rebase fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+559 lines, -481 lines) Patch
M chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html View 1 2 3 4 5 6 7 8 9 10 6 chunks +35 lines, -26 lines 0 comments Download
M chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js View 1 2 3 4 5 6 chunks +4 lines, -104 lines 0 comments Download
M chrome/browser/resources/settings/device_page/compiled_resources2.gyp View 1 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/resources/settings/device_page/keyboard.html View 1 2 3 4 5 6 7 8 9 10 3 chunks +11 lines, -10 lines 0 comments Download
M chrome/browser/resources/settings/device_page/keyboard.js View 1 3 chunks +24 lines, -108 lines 0 comments Download
M chrome/browser/resources/settings/settings_shared_css.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
A chrome/test/data/webui/cr_elements/cr_elements_browsertest.js View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +54 lines, -0 lines 0 comments Download
A chrome/test/data/webui/cr_elements/cr_slider_tests.js View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +125 lines, -0 lines 0 comments Download
A chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +100 lines, -0 lines 0 comments Download
D chrome/test/data/webui/cr_elements_browsertest.js View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -119 lines 0 comments Download
M chrome/test/data/webui/settings/device_page_tests.js View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +75 lines, -108 lines 0 comments Download
M ui/webui/resources/cr_elements/compiled_resources2.gyp View 1 1 chunk +1 line, -0 lines 0 comments Download
A + ui/webui/resources/cr_elements/cr_slider/compiled_resources2.gyp View 1 1 chunk +3 lines, -3 lines 0 comments Download
A ui/webui/resources/cr_elements/cr_slider/cr_slider.html View 1 2 3 4 5 6 1 chunk +14 lines, -0 lines 0 comments Download
A ui/webui/resources/cr_elements/cr_slider/cr_slider.js View 1 2 3 4 5 6 7 1 chunk +105 lines, -0 lines 0 comments Download
M ui/webui/resources/cr_elements_resources.grdp View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 47 (23 generated)
michaelpg
Please take a quick look at slider_host_behavior.js. This is the simplest I could come up ...
4 years, 7 months ago (2016-05-11 00:14:21 UTC) #2
stevenjb
I'm a little concerned that we may be over-optimizing here. This seems like a strong ...
4 years, 7 months ago (2016-05-11 16:37:41 UTC) #4
michaelpg
On 2016/05/11 16:37:41, stevenjb wrote: > I'm a little concerned that we may be over-optimizing ...
4 years, 7 months ago (2016-05-14 04:44:34 UTC) #8
michaelpg
+dschuyler as fyi, input on slider & font stuff is welcome tho
4 years, 7 months ago (2016-05-16 04:50:01 UTC) #11
dschuyler
https://codereview.chromium.org/1967913002/diff/80001/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js File chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js (right): https://codereview.chromium.org/1967913002/diff/80001/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js#newcode154 chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js:154: // TODO(dschuyler): Actually fetch this pref so setting it ...
4 years, 7 months ago (2016-05-16 20:49:50 UTC) #12
stevenjb
Much nicer as a separate custom element I think, thanks. https://codereview.chromium.org/1967913002/diff/80001/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html File chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html (right): https://codereview.chromium.org/1967913002/diff/80001/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html#newcode48 ...
4 years, 7 months ago (2016-05-16 21:57:51 UTC) #13
michaelpg
PTAL. https://codereview.chromium.org/1967913002/diff/80001/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html File chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html (right): https://codereview.chromium.org/1967913002/diff/80001/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html#newcode48 chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html:48: <span>[[prefs.webkit.webprefs.default_font_size.value]]</span>:&nbsp; On 2016/05/16 21:57:51, stevenjb wrote: > wrapping ...
4 years, 7 months ago (2016-05-17 19:18:43 UTC) #14
stevenjb
I think the tangentially related appearance_fonts_page changes would probably be better in a follow-up CL, ...
4 years, 7 months ago (2016-05-17 19:30:36 UTC) #15
Dan Beam
https://codereview.chromium.org/1967913002/diff/80001/chrome/test/data/webui/cr_elements/cr_elements_browsertest.js File chrome/test/data/webui/cr_elements/cr_elements_browsertest.js (right): https://codereview.chromium.org/1967913002/diff/80001/chrome/test/data/webui/cr_elements/cr_elements_browsertest.js#newcode26 chrome/test/data/webui/cr_elements/cr_elements_browsertest.js:26: 'cr_slider_tests.js', indent off https://codereview.chromium.org/1967913002/diff/80001/ui/webui/resources/cr_elements/cr_slider/cr_slider.html File ui/webui/resources/cr_elements/cr_slider/cr_slider.html (right): https://codereview.chromium.org/1967913002/diff/80001/ui/webui/resources/cr_elements/cr_slider/cr_slider.html#newcode8 ui/webui/resources/cr_elements/cr_slider/cr_slider.html:8: ...
4 years, 7 months ago (2016-05-17 19:35:45 UTC) #17
dschuyler
https://codereview.chromium.org/1967913002/diff/120001/ui/webui/resources/cr_elements/cr_slider/cr_slider.js File ui/webui/resources/cr_elements/cr_slider/cr_slider.js (right): https://codereview.chromium.org/1967913002/diff/120001/ui/webui/resources/cr_elements/cr_slider/cr_slider.js#newcode78 ui/webui/resources/cr_elements/cr_slider/cr_slider.js:78: // The pref changed somewhere else (e.g., sync) but ...
4 years, 7 months ago (2016-05-18 00:58:41 UTC) #18
michaelpg
PTAL, thanks. https://codereview.chromium.org/1967913002/diff/80001/chrome/test/data/webui/cr_elements/cr_elements_browsertest.js File chrome/test/data/webui/cr_elements/cr_elements_browsertest.js (right): https://codereview.chromium.org/1967913002/diff/80001/chrome/test/data/webui/cr_elements/cr_elements_browsertest.js#newcode26 chrome/test/data/webui/cr_elements/cr_elements_browsertest.js:26: 'cr_slider_tests.js', On 2016/05/17 19:35:45, Dan Beam wrote: ...
4 years, 7 months ago (2016-05-18 17:05:49 UTC) #19
dschuyler
LGTM with optional nits. https://codereview.chromium.org/1967913002/diff/160001/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html File chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html (right): https://codereview.chromium.org/1967913002/diff/160001/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html#newcode49 chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html:49: no whitespace -->:&nbsp;$i18n{quickBrownFox} nit: will ...
4 years, 7 months ago (2016-05-18 20:51:21 UTC) #20
michaelpg
https://codereview.chromium.org/1967913002/diff/160001/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html File chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html (right): https://codereview.chromium.org/1967913002/diff/160001/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html#newcode49 chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html:49: no whitespace -->:&nbsp;$i18n{quickBrownFox} On 2016/05/18 20:51:21, dschuyler wrote: > ...
4 years, 7 months ago (2016-05-19 17:09:27 UTC) #21
Dan Beam
i didn't really re-review everything but cr_slider.js looks fine and you already got enough reviews ...
4 years, 7 months ago (2016-05-24 01:54:49 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1967913002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1967913002/200001
4 years, 7 months ago (2016-05-26 17:59:59 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/219011)
4 years, 7 months ago (2016-05-26 18:37:42 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1967913002/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1967913002/240001
4 years, 6 months ago (2016-05-27 15:51:52 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/235191)
4 years, 6 months ago (2016-05-27 16:27:34 UTC) #33
michaelpg
+tsergeant for FYI after expanding cr_elements_browsertest.js. https://codereview.chromium.org/1967913002/diff/260001/chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js File chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js (right): https://codereview.chromium.org/1967913002/diff/260001/chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js#newcode8 chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js:8: suite('cr-toolbar-search-field', function() { ...
4 years, 6 months ago (2016-05-27 19:23:08 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1967913002/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1967913002/260001
4 years, 6 months ago (2016-05-27 19:24:13 UTC) #38
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/12754) ios-simulator on tryserver.chromium.mac (JOB_FAILED, ...
4 years, 6 months ago (2016-05-27 19:27:19 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1967913002/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1967913002/300001
4 years, 6 months ago (2016-06-02 18:28:23 UTC) #43
commit-bot: I haz the power
Committed patchset #14 (id:300001)
4 years, 6 months ago (2016-06-02 21:43:43 UTC) #45
commit-bot: I haz the power
4 years, 6 months ago (2016-06-02 21:46:55 UTC) #47
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/d326605487da452867181c1fe0dc7c6580b0d714
Cr-Commit-Position: refs/heads/master@{#397517}

Powered by Google App Engine
This is Rietveld 408576698