I often find that I want to duplicate a rule to be able to tweak the selector from that rule without messing up the applied properties. I think that the best place to put this would be as a context menu item that inserts the duplicated (same selector but no properties) rule immediately after the copied rule.
<rdar://problem/22031990>
Created attachment 257655 [details] Patch
Comment on attachment 257655 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=257655&action=review > Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js:408 > + if (!(this._style.ownerRule && this._style.ownerRule.type === WebInspector.CSSRule.Type.UserAgent)) { Why exclude UserAgent? (Or am I failing at boolean logic.) I think it would be useful to duplicate a rule that you can't edit directly.
Comment on attachment 257655 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=257655&action=review >> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js:408 >> + if (!(this._style.ownerRule && this._style.ownerRule.type === WebInspector.CSSRule.Type.UserAgent)) { > > Why exclude UserAgent? (Or am I failing at boolean logic.) I think it would be useful to duplicate a rule that you can't edit directly. That was supposed to be Inherited, not UserAgent. Duplicated Inherited rules won't show up in the sidebar unless the node which the inherited rule comes from is selected, so its pointless to allow users to duplicate rules that are marked as inherited.
Created attachment 257720 [details] Patch
Created attachment 258029 [details] Patch
Comment on attachment 258029 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=258029&action=review > Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js:459 > + if (this._delegate && typeof this._delegate.focusNextNewInspectorRule === "function") > + this._delegate.focusNextNewInspectorRule(); Delegate methods should be prefixed with the class name. So cssStyleDeclarationSectionFocusNextNewInspectorRule. This is really just calling a public method as a delegate method currently.
Created attachment 258264 [details] Patch
Comment on attachment 258264 [details] Patch Clearing flags on attachment: 258264 Committed r187960: <http://trac.webkit.org/changeset/187960>
All reviewed patches have been landed. Closing bug.