RESOLVED FIXED 178328
Web Inspector: [PARITY] Styles Redesign: Ability to modify style attributes
https://bugs.webkit.org/show_bug.cgi?id=178328
Summary Web Inspector: [PARITY] Styles Redesign: Ability to modify style attributes
Nikita Vasilyev
Reported 2017-10-15 20:51:07 PDT
Style attributes, as in <div style="color: red">, can't be edited yet.
Attachments
Patch (2.10 KB, patch)
2017-10-27 13:29 PDT, Nikita Vasilyev
no flags
[Animated GIF] Before the patch (130.08 KB, image/gif)
2017-10-27 13:37 PDT, Nikita Vasilyev
no flags
[Animated GIF] With patch applied (175.41 KB, image/gif)
2017-10-27 13:39 PDT, Nikita Vasilyev
no flags
Patch (5.52 KB, patch)
2017-10-27 16:40 PDT, Nikita Vasilyev
joepeck: review+
joepeck: commit-queue-
Patch (18.19 KB, patch)
2017-10-27 18:44 PDT, Nikita Vasilyev
no flags
Patch (6.28 KB, patch)
2017-10-30 15:39 PDT, Nikita Vasilyev
no flags
Radar WebKit Bug Importer
Comment 1 2017-10-15 20:51:28 PDT
Nikita Vasilyev
Comment 2 2017-10-27 13:29:56 PDT
Nikita Vasilyev
Comment 3 2017-10-27 13:37:37 PDT
Nikita Vasilyev
Comment 4 2017-10-27 13:39:23 PDT
Created attachment 325194 [details] [Animated GIF] With patch applied
Nikita Vasilyev
Comment 5 2017-10-27 16:40:02 PDT
Created attachment 325217 [details] Patch Added tests for WI.TextRange.prototype.resolveOffsets.
Nikita Vasilyev
Comment 6 2017-10-27 18:44:43 PDT
Created attachment 325229 [details] Patch Rebaselined.
Nikita Vasilyev
Comment 7 2017-10-27 18:45:55 PDT
Comment on attachment 325229 [details] Patch Whoops, wrong patch.
Matt Baker
Comment 8 2017-10-29 06:27:35 PDT
Comment on attachment 325217 [details] Patch r-, for the following issue: Editing the style attribute via the sidebar causes a space to be prepended to the style attribute text in the DOM tree: 1. Open the test page (http://nv.github.io/webkit-inspector-bugs/styles-redesign/tests/style-attributes.html) 2. In the sidebar, change "darkslateblue" to "red" => Style attribute changes to " color: red"
Nikita Vasilyev
Comment 9 2017-10-29 13:47:22 PDT
Comment on attachment 325217 [details] Patch (In reply to Matt Baker from comment #8) > Comment on attachment 325217 [details] > Patch > > r-, for the following issue: > > Editing the style attribute via the sidebar causes a space to be prepended > to the style attribute text in the DOM tree: > > 1. Open the test page > (http://nv.github.io/webkit-inspector-bugs/styles-redesign/tests/style- > attributes.html) > 2. In the sidebar, change "darkslateblue" to "red" > => Style attribute changes to " color: red" This works the same in the old styles sidebar. I filed Bug 178990 - Web Inspector: Styles: Editing style attribute prepends line-break. I'm setting my patch back to "r?".
Joseph Pecoraro
Comment 10 2017-10-30 11:49:54 PDT
Comment on attachment 325217 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=325217&action=review > LayoutTests/inspector/unit-tests/text-range.html:7 > + let suite = InspectorTest.createAsyncSuite("WI.TextRange"); This should be a createSyncSuite. No need for async in this test. > LayoutTests/inspector/unit-tests/text-range.html:12 > + test(resolve, reject) { This would just be `test() {` in a Sync suite. > LayoutTests/inspector/unit-tests/text-range.html:25 > + resolve(); This would turn into `return true` in a Sync suite. > LayoutTests/inspector/unit-tests/text-range.html:47 > + }); What are the expected values when the text ends in multiple line breaks? let text = "\ncolor: blue;\n\n" We may want to add a test for that, since the CSSProperty.js change looks like it could make that happen. > LayoutTests/inspector/unit-tests/text-range.html:54 > + <p>Testing that WI.TextRange.prototype.resolveOffsets works.</p> Nit: The test description should be for all of TextRange. We only happen to be testing resolveOffsets but we could test anything in TestRange in this generically named test. > Source/WebInspectorUI/UserInterface/Models/CSSProperty.js:352 > + range.resolveOffsets(styleText + "\n"); Should we only append a newline if it didn't end in a newline, otherwise we could have multiple newlines. Maybe it doesn't matter.
Nikita Vasilyev
Comment 11 2017-10-30 15:39:52 PDT
Created attachment 325383 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=325217&action=review >> Source/WebInspectorUI/UserInterface/Models/CSSProperty.js:352 >> + range.resolveOffsets(styleText + "\n"); > > Should we only append a newline if it didn't end in a newline, otherwise we could have multiple newlines. Maybe it doesn't matter. It doesn't matter here, but I added a test with two trailing line breaks anyway.
WebKit Commit Bot
Comment 12 2017-10-30 16:11:10 PDT
Comment on attachment 325383 [details] Patch Clearing flags on attachment: 325383 Committed r224210: <https://trac.webkit.org/changeset/224210>
WebKit Commit Bot
Comment 13 2017-10-30 16:11:11 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.