RESOLVED FIXED 147361
Web Inspector: Allow users to duplicate rules in the Rules sidebar panel
https://bugs.webkit.org/show_bug.cgi?id=147361
Summary Web Inspector: Allow users to duplicate rules in the Rules sidebar panel
Devin Rousso
Reported 2015-07-28 09:57:01 PDT
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.
Attachments
Patch (4.22 KB, patch)
2015-07-28 10:24 PDT, Devin Rousso
no flags
Patch (5.17 KB, patch)
2015-07-28 18:52 PDT, Devin Rousso
no flags
Patch (5.13 KB, patch)
2015-08-02 00:54 PDT, Devin Rousso
no flags
Patch (5.27 KB, patch)
2015-08-04 21:26 PDT, Devin Rousso
no flags
Radar WebKit Bug Importer
Comment 1 2015-07-28 09:57:11 PDT
Devin Rousso
Comment 2 2015-07-28 10:24:04 PDT
Timothy Hatcher
Comment 3 2015-07-28 12:13:50 PDT
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.
Devin Rousso
Comment 4 2015-07-28 12:56:51 PDT
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.
Devin Rousso
Comment 5 2015-07-28 18:52:29 PDT
Devin Rousso
Comment 6 2015-08-02 00:54:19 PDT
Timothy Hatcher
Comment 7 2015-08-04 14:49:23 PDT
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.
Devin Rousso
Comment 8 2015-08-04 21:26:56 PDT
WebKit Commit Bot
Comment 9 2015-08-05 07:08:05 PDT
Comment on attachment 258264 [details] Patch Clearing flags on attachment: 258264 Committed r187960: <http://trac.webkit.org/changeset/187960>
WebKit Commit Bot
Comment 10 2015-08-05 07:08:09 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.