Closed
Bug 1167669
Opened 9 years ago
Closed 9 years ago
[rule view] Rules and properties that are newly added or modified should be highlighted if it matches the style filter
Categories
(DevTools :: Inspector, defect)
DevTools
Inspector
Tracking
(firefox42 fixed)
RESOLVED
FIXED
Firefox 42
Tracking | Status | |
---|---|---|
firefox42 | --- | fixed |
People
(Reporter: gl, Assigned: gl)
References
Details
Attachments
(4 files, 13 obsolete files)
15.64 KB,
patch
|
bgrins
:
review+
|
Details | Diff | Splinter Review |
9.21 KB,
patch
|
bgrins
:
review+
|
Details | Diff | Splinter Review |
7.13 KB,
patch
|
gl
:
review+
|
Details | Diff | Splinter Review |
12.57 KB,
patch
|
gl
:
review+
|
Details | Diff | Splinter Review |
Currently, the filter styles does not apply a highlight to rules and properties that are newly added or modified and matches the filter style search value.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → gabriel.luong
Status: NEW → ASSIGNED
Assignee | ||
Updated•9 years ago
|
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8632680 -
Flags: review?(bgrinstead)
Assignee | ||
Updated•9 years ago
|
Attachment #8632680 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 2•9 years ago
|
||
Summary of Changes: - Broke apart CssRuleView.highlightRules and moved the logical components for highlighting selectors and stylesheet source into RuleEditor and highlighting properties and computed properties to TextPropertyEditor - Removed isValidSearchTerm trim check since we should allow people to search for " " if they wanted. - Added this.ruleView reference to TextPropertyEditor
Attachment #8632680 -
Attachment is obsolete: true
Attachment #8633044 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 3•9 years ago
|
||
Attachment #8633046 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8633047 -
Flags: review?(bgrinstead)
Assignee | ||
Updated•9 years ago
|
Attachment #8633046 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 5•9 years ago
|
||
Attachment #8633046 -
Attachment is obsolete: true
Attachment #8633051 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 6•9 years ago
|
||
Attachment #8633047 -
Attachment is obsolete: true
Attachment #8633047 -
Flags: review?(bgrinstead)
Attachment #8633053 -
Flags: review?(bgrinstead)
Comment 7•9 years ago
|
||
Looks like this might interact with the work going on in Bug 1164343 - should we mark one as blocking the other? I'm assuming it'd be easier for you to rebase on top of that when it's all said and done than vice versa?
Assignee | ||
Comment 8•9 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #7) > Looks like this might interact with the work going on in Bug 1164343 - > should we mark one as blocking the other? I'm assuming it'd be easier for > you to rebase on top of that when it's all said and done than vice versa? I applied both changes, and the overlaps are very little. The only reject that I saw was for the new getter for the searchValue which is just a 4 line rebase. This would be safe to review.
Assignee | ||
Comment 9•9 years ago
|
||
Attachment #8633346 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 10•9 years ago
|
||
ttps://treeherder.mozilla.org/#/jobs?repo=try&revision=4db2a7c48190
Assignee | ||
Comment 11•9 years ago
|
||
Attachment #8633603 -
Flags: review?(bgrinstead)
Assignee | ||
Updated•9 years ago
|
Attachment #8633346 -
Attachment is obsolete: true
Attachment #8633346 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 12•9 years ago
|
||
Attachment #8633044 -
Attachment is obsolete: true
Attachment #8633044 -
Flags: review?(bgrinstead)
Attachment #8634849 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 13•9 years ago
|
||
Attachment #8633051 -
Attachment is obsolete: true
Attachment #8633051 -
Flags: review?(bgrinstead)
Attachment #8634850 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 14•9 years ago
|
||
Attachment #8633053 -
Attachment is obsolete: true
Attachment #8633053 -
Flags: review?(bgrinstead)
Attachment #8634852 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 15•9 years ago
|
||
Attachment #8633603 -
Attachment is obsolete: true
Attachment #8633603 -
Flags: review?(bgrinstead)
Attachment #8634853 -
Flags: review?(bgrinstead)
Comment 16•9 years ago
|
||
Comment on attachment 8634849 [details] [diff] [review] Part 1: Refactor CssRuleView highlighting of rule selector, property and stylesheet source to RuleEditor and TextPropertyEditor [3.0] Review of attachment 8634849 [details] [diff] [review]: ----------------------------------------------------------------- This is a general comment about parts 1 and 2. Although I agree the search matching behavior for a rule 'belongs' to the editors, I'm not a big fan of splitting the one nasty function into these functions across the file. Mostly because (a) we could at least before point to one place that all search stuff was happening and (b) we end up having to reach up to the rule view from the editors to do things like get the current search value, add highlight classes, clear the 'no-match' class, etc. Of those, (b) is of more concern. I think I'd be most happy if we kept the bulk of the logic of _highlightRuleProperty, _highlightComputedProperty in the editor, but renamed it to _getMatchingRuleProperty and _getMatchingComputedProperty, then those would return arrays of elements that matched and the rule view would be in charge of actually adding the class, maintaining the state of the search box, etc. This would especially help I think when part 2 starts to introduce more ruleview specific functionality into the TPE. So it would look something like this: let matchedRules = textProp.editor._getMatchingRuleProperty(this.searchPropertyName, this.searchPropertyValue, this.searchPropertyMatch); let isPropertyHighlighted = matchedRules.length > 0; for (let rule of matchedRules) { rule.classList.add("ruleview-highlight"); } We could do similar things for all of the _highlight* functions introduced in the refactor and maybe even keep one big list of things that need their classList updated and do all the updates at once to limit the amount of style recalc. Alternatively, I'd be fine with splitting things up as you propose, but keeping _highlightRuleProperty, _highlightComputedProperty, _highlightMatches, and then _updateRulePropertyHighlight, _clearRulePropertyHighlights on the rule view and take a rule in as an argument. Personally I think it makes more sense to have the ruleview manage the TPE than have the TPE manage the rule view. Thanks for taking this on - this is touching some complicated parts of the rule view so I just want to make sure we are on the same page before proceeding. Let's chat if you disagree or want further clarification.
Attachment #8634849 -
Flags: review?(bgrinstead)
Comment 17•9 years ago
|
||
Comment on attachment 8634850 [details] [diff] [review] Part 2: Highlight new filter style matches when rules and properties are added or modified [3.0] Review of attachment 8634850 [details] [diff] [review]: ----------------------------------------------------------------- See comments from part 1 ::: browser/devtools/styleinspector/rule-view.js @@ +2987,5 @@ > + > + // Highlight the new property if it matches the current search value > + // and remove the no search match indicator from the search field if > + // a property or computed property was highlighted > + if (this._updateRulePropertyHighlight() && This is a particular case where it'd be nice to say this.ruleView.highlightRule(this) or similar, and then can get any search box logic out of this object. @@ +3069,5 @@ > /** > + * Clear the rule property highlight for the current TextProperty. > + */ > + _clearRulePropertyHighlights: function() { > + for (let element of this.element.querySelectorAll(".ruleview-highlight")) { This another case where I'd prefer to see the this.ruleView._editorsExpandedForFilter logic handled from within the rule view.
Attachment #8634850 -
Flags: review?(bgrinstead)
Comment 18•9 years ago
|
||
Comment on attachment 8634852 [details] [diff] [review] Part 3: Refactor this.ruleEditor.ruleView to this.ruleView in TextPropertyEditor [3.0] Review of attachment 8634852 [details] [diff] [review]: ----------------------------------------------------------------- LGTM
Attachment #8634852 -
Flags: review?(bgrinstead) → review+
Comment 19•9 years ago
|
||
Comment on attachment 8634853 [details] [diff] [review] Part 4: Add unit tests for highlighting new filter style matches when rule properties are added and modified [3.0] Review of attachment 8634853 [details] [diff] [review]: ----------------------------------------------------------------- Test cases and overall functionality looks good with the patches applied
Attachment #8634853 -
Flags: review?(bgrinstead) → review+
Assignee | ||
Comment 20•9 years ago
|
||
Attachment #8634849 -
Attachment is obsolete: true
Attachment #8636276 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 21•9 years ago
|
||
Attachment #8634850 -
Attachment is obsolete: true
Attachment #8636277 -
Flags: review?(bgrinstead)
Assignee | ||
Comment 22•9 years ago
|
||
Attachment #8634852 -
Attachment is obsolete: true
Attachment #8636278 -
Flags: review+
Assignee | ||
Comment 23•9 years ago
|
||
Attachment #8634853 -
Attachment is obsolete: true
Attachment #8636280 -
Flags: review+
Assignee | ||
Updated•9 years ago
|
Attachment #8636278 -
Attachment description: art 3: Refactor this.ruleEditor.ruleView to this.ruleView in TextPropertyEditor [4.0] → Part 3: Refactor this.ruleEditor.ruleView to this.ruleView in TextPropertyEditor [4.0]
Comment 24•9 years ago
|
||
Comment on attachment 8636276 [details] [diff] [review] Part 1: Refactor the logic for highlighting rule selector, property and stylesheet source [4.0] Review of attachment 8636276 [details] [diff] [review]: ----------------------------------------------------------------- LGTM - r=me with a green try push
Attachment #8636276 -
Flags: review?(bgrinstead) → review+
Updated•9 years ago
|
Attachment #8636277 -
Flags: review?(bgrinstead) → review+
Assignee | ||
Comment 25•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=e9dadc98304b
Assignee | ||
Comment 26•9 years ago
|
||
Attachment #8636280 -
Attachment is obsolete: true
Attachment #8636322 -
Flags: review+
Assignee | ||
Comment 27•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5eacf118b847
Comment 28•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/22db49def94f https://hg.mozilla.org/integration/fx-team/rev/523e9b169dc5 https://hg.mozilla.org/integration/fx-team/rev/efcc530c4364 https://hg.mozilla.org/integration/fx-team/rev/80a6536f6a54
Comment 29•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/22db49def94f https://hg.mozilla.org/mozilla-central/rev/523e9b169dc5 https://hg.mozilla.org/mozilla-central/rev/efcc530c4364 https://hg.mozilla.org/mozilla-central/rev/80a6536f6a54
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox42:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 42
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•