Bug 147578 - Web Inspector: Add Visual editors for CSS properties with comma separated values
Summary: Web Inspector: Add Visual editors for CSS properties with comma separated values
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on: 147576 147579
Blocks: 147563 147570 147623
  Show dependency treegraph
 
Reported: 2015-08-03 11:43 PDT by Devin Rousso
Modified: 2015-08-14 13:05 PDT (History)
9 users (show)

See Also:


Attachments
Patch (34.72 KB, patch)
2015-08-03 11:48 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (34.73 KB, patch)
2015-08-05 18:27 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (35.22 KB, patch)
2015-08-06 23:22 PDT, Devin Rousso
timothy: review+
Details | Formatted Diff | Diff
Patch (34.65 KB, patch)
2015-08-14 00:19 PDT, Devin Rousso
timothy: review+
Details | Formatted Diff | Diff
Patch (34.64 KB, patch)
2015-08-14 12:13 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2015-08-03 11:43:30 PDT
Add tree outline style list editors for CSS properties with comma separated values.  Will be use in the new Visual style details panel in the CSS sidebar.
Comment 1 Devin Rousso 2015-08-03 11:48:07 PDT
Created attachment 258094 [details]
Patch
Comment 2 Devin Rousso 2015-08-05 18:27:35 PDT
Created attachment 258332 [details]
Patch
Comment 3 Devin Rousso 2015-08-06 23:22:36 PDT
Created attachment 258462 [details]
Patch
Comment 4 Timothy Hatcher 2015-08-11 23:16:32 PDT
Comment on attachment 258462 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=258462&action=review

> Source/WebInspectorUI/UserInterface/Images/Minus.svg:2
> +<!-- Copyright © 2014 Apple Inc. All rights reserved. -->

2015

> Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js:124
> +    _onTreeItemSelect(item, selectedByUser)

No on prefix. Just _treeElementSelected. Also why item and not treeElement? It would tell you more what it is.

> Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js:137
> +        let newItem = this._addCommaSeparatedKeyword(null, this._commaSeparatedKeywords.selectedTreeElementIndex);

newTreeElement?

> Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js:152
> +        for (let treeItem of this._commaSeparatedKeywords.children) {

treeElement

> Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js:167
> +        if (indexIsSet) {
> +            this._commaSeparatedKeywords.insertChild(valueElement, indexIsSet ? index + !this._insertNewItemsBeforeSelected : 0);
> +        } else

Nit: No need for the braces.

> Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js:175
> +        if (!treeElement)

See!

> Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js:185
> +    _createNewListItem(value)

_createNewTreeElement

> Source/WebInspectorUI/UserInterface/Views/VisualStyleFontFamilyListEditor.js:92
> +    _itemEditorKeyDown(event)

_treeElementKeyDown

> Source/WebInspectorUI/UserInterface/Views/VisualStyleFontFamilyListEditor.js:136
> +        let treeItem = this._commaSeparatedKeywords.selectedTreeElement;

treeElement

> Source/WebInspectorUI/UserInterface/Views/VisualStyleFontFamilyTreeItem.js:26
> +WebInspector.VisualStyleFontFamilyTreeItem = class VisualStyleFontFamilyTreeItem extends WebInspector.GeneralTreeElement

VisualStyleFontFamilyTreeElement. Classes should always end in a common suffix as what they subclass.

> Source/WebInspectorUI/UserInterface/Views/VisualStyleFontFamilyTreeItem.js:34
> +        this._keywordEditor.placeholder = "(" + WebInspector.UIString("modify the boxes below to add a value") + ")";

The () should be part of the UIString. I am also not sure the () are needed. Sentence case with a period might be best. Is a placeholder even needed?
Comment 5 Devin Rousso 2015-08-11 23:45:50 PDT
(In reply to comment #4)
> > Source/WebInspectorUI/UserInterface/Views/VisualStyleFontFamilyTreeItem.js:34
> > +        this._keywordEditor.placeholder = "(" + WebInspector.UIString("modify the boxes below to add a value") + ")";
> 
> The () should be part of the UIString. I am also not sure the () are needed.
> Sentence case with a period might be best. Is a placeholder even needed?

Not having a placeholder made the empty rows appear very odd when the list is empty, as it would appear as a blue row with nothing in it.  I added the parenthesis to make it clear that the text was not meant to be the actual value and more like a hint, but I can remove it.
Comment 6 Timothy Hatcher 2015-08-12 00:00:42 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > > Source/WebInspectorUI/UserInterface/Views/VisualStyleFontFamilyTreeItem.js:34
> > > +        this._keywordEditor.placeholder = "(" + WebInspector.UIString("modify the boxes below to add a value") + ")";
> > 
> > The () should be part of the UIString. I am also not sure the () are needed.
> > Sentence case with a period might be best. Is a placeholder even needed?
> 
> Not having a placeholder made the empty rows appear very odd when the list
> is empty, as it would appear as a blue row with nothing in it.  I added the
> parenthesis to make it clear that the text was not meant to be the actual
> value and more like a hint, but I can remove it.

Okay, I think the parenthesis is fine. It should just be localized. Not all locales use the same parenthesis.
Comment 7 Devin Rousso 2015-08-14 00:19:30 PDT
Created attachment 258991 [details]
Patch
Comment 8 Radar WebKit Bug Importer 2015-08-14 00:20:04 PDT
<rdar://problem/22283812>
Comment 9 Timothy Hatcher 2015-08-14 11:00:50 PDT
Comment on attachment 258991 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=258991&action=review

> Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.css:115
> +    filter: opacity(0.7);

opacity: 0.7;
Comment 10 Devin Rousso 2015-08-14 12:13:33 PDT
Created attachment 259019 [details]
Patch
Comment 11 WebKit Commit Bot 2015-08-14 13:05:30 PDT
Comment on attachment 259019 [details]
Patch

Clearing flags on attachment: 259019

Committed r188483: <http://trac.webkit.org/changeset/188483>
Comment 12 WebKit Commit Bot 2015-08-14 13:05:35 PDT
All reviewed patches have been landed.  Closing bug.