|
|
Chromium Code Reviews|
Created:
3 years, 11 months ago by einbinder Modified:
3 years, 10 months ago CC:
apavlov+blink_chromium.org, blink-reviews, blink-reviews-style_chromium.org, caseq+blink_chromium.org, chromium-reviews, devtools-reviews_chromium.org, kozyatinskiy+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, pfeldman Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionDevTools: Autocomplete CSS variables in StylesSidebar
BUG=680693
Review-Url: https://codereview.chromium.org/2637593002
Cr-Commit-Position: refs/heads/master@{#448543}
Committed: https://chromium.googlesource.com/chromium/src/+/1fb1dc19092fca70ebee18705dab8463eed8c6dc
Patch Set 1 #
Total comments: 2
Patch Set 2 : Use cascade #
Total comments: 8
Patch Set 3 : Move cssVariables method into matched styles #Patch Set 4 : More thorough test #Patch Set 5 : merge #
Messages
Total messages: 32 (16 generated)
einbinder@chromium.org changed reviewers: + dgozman@chromium.org
ptal
Description was changed from ========== DevTools: Autocomplete CSS variables in StylesSidebar BUG=none ========== to ========== DevTools: Autocomplete CSS variables in StylesSidebar BUG=680693 ==========
The CQ bit was checked by einbinder@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2637593002/diff/1/third_party/WebKit/Source/d... File third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js (right): https://codereview.chromium.org/2637593002/diff/1/third_party/WebKit/Source/d... third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js:3131: var regexResult = text.match(/[^A-Za-z0-9\-]--[A-Za-z0-9\-]+/g) || []; I see we now show defined variables in SSP unless it's in a rule which does not inherit anything except for variables. Should we instead show those rules as well? And also not dim the variable to indicate it's actually inherited. Then you don't have to parse anything - just show suggestions from the variables currently displayed in SSP, since those are exactly the ones which are available for specific element. WDYT?
On 2017/01/18 at 16:29:38, dgozman wrote: > https://codereview.chromium.org/2637593002/diff/1/third_party/WebKit/Source/d... > File third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js (right): > > https://codereview.chromium.org/2637593002/diff/1/third_party/WebKit/Source/d... > third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js:3131: var regexResult = text.match(/[^A-Za-z0-9\-]--[A-Za-z0-9\-]+/g) || []; > I see we now show defined variables in SSP unless it's in a rule which does not inherit anything except for variables. Should we instead show those rules as well? And also not dim the variable to indicate it's actually inherited. > > Then you don't have to parse anything - just show suggestions from the variables currently displayed in SSP, since those are exactly the ones which are available for specific element. WDYT? We don't show variables in the cascade unless they are defined in that element.
lushnikov@chromium.org changed reviewers: + lushnikov@chromium.org
https://codereview.chromium.org/2637593002/diff/1/third_party/WebKit/Source/d... File third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js (right): https://codereview.chromium.org/2637593002/diff/1/third_party/WebKit/Source/d... third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js:3114: Elements.StylesSidebarPane.findCSSVariables = function() { fetching & parsing everything is a lot of work. can we rather pull the css variables from the backend? It should be available for us almost for free
Now that CSS variables show in the cascade, I use the matched properties as dgozman suggested.
Andrey, do we have tests which exercise completions for full-stack, with getting real data from backend? We could really use that for this patch.
Dmitry: I'm not aware of such a test - completions are defined in CSSMetadata, so no one bothered doing full-stack test. https://codereview.chromium.org/2637593002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js (right): https://codereview.chromium.org/2637593002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js:2356: var cssVariables = []; nit: this makes sense as a method on MatchedStyles https://codereview.chromium.org/2637593002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js:2911: var editingName = this._isEditingName; nit: i understand this is to avoid binding of filterCompletions, but it is a bit confusing. Let's just use this._isEditingName https://codereview.chromium.org/2637593002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js:2912: var editingVariable = expression.trim().endsWith('var('); nit: let's move this down to where it is actually used? Also, should it be var editingVariable = !this._isEditingName && expression.trim().endsWith('var('); https://codereview.chromium.org/2637593002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js:2918: if (!editingVariable) should it be: if (editingVariable) this._cssVariables.forEach(filterCompletions); else this._cssCompletions.forEach(filterCompletions);
https://codereview.chromium.org/2637593002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js (right): https://codereview.chromium.org/2637593002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js:2356: var cssVariables = []; On 2017/01/24 at 01:35:03, lushnikov wrote: > nit: this makes sense as a method on MatchedStyles Done. https://codereview.chromium.org/2637593002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js:2911: var editingName = this._isEditingName; On 2017/01/24 at 01:35:03, lushnikov wrote: > nit: i understand this is to avoid binding of filterCompletions, but it is a bit confusing. Let's just use this._isEditingName Done. https://codereview.chromium.org/2637593002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js:2912: var editingVariable = expression.trim().endsWith('var('); On 2017/01/24 at 01:35:03, lushnikov wrote: > nit: let's move this down to where it is actually used? Also, should it be > > var editingVariable = !this._isEditingName && expression.trim().endsWith('var('); It is used in the next line. https://codereview.chromium.org/2637593002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js:2918: if (!editingVariable) On 2017/01/24 at 01:35:04, lushnikov wrote: > should it be: > > if (editingVariable) > this._cssVariables.forEach(filterCompletions); > else > this._cssCompletions.forEach(filterCompletions); When we are editing the name, we want to show both css completions and css variables.
The test isn't completely full stack, but it gets the variables from a real node now.
pfeldman@chromium.org changed reviewers: + pfeldman@chromium.org
lgtm
The CQ bit was checked by einbinder@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...)
The CQ bit was checked by einbinder@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from pfeldman@chromium.org Link to the patchset: https://codereview.chromium.org/2637593002/#ps80001 (title: "merge")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by einbinder@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 80001, "attempt_start_ts": 1486436122205440,
"parent_rev": "f0de79a0e44c878b66df8012e77ff38896fe8faf", "commit_rev":
"1fb1dc19092fca70ebee18705dab8463eed8c6dc"}
Message was sent while issue was closed.
Description was changed from ========== DevTools: Autocomplete CSS variables in StylesSidebar BUG=680693 ========== to ========== DevTools: Autocomplete CSS variables in StylesSidebar BUG=680693 Review-Url: https://codereview.chromium.org/2637593002 Cr-Commit-Position: refs/heads/master@{#448543} Committed: https://chromium.googlesource.com/chromium/src/+/1fb1dc19092fca70ebee18705dab... ==========
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/chromium/src/+/1fb1dc19092fca70ebee18705dab... |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
