Bug 179585 - Web Inspector: Styles Redesign: clicking on the white space after the property sometimes places a blank property at the wrong index
Summary: Web Inspector: Styles Redesign: clicking on the white space after the propert...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-11-11 18:59 PST by Nikita Vasilyev
Modified: 2018-01-16 12:23 PST (History)
4 users (show)

See Also:


Attachments
[Animated GIF] Bug (77.31 KB, image/gif)
2017-11-11 18:59 PST, Nikita Vasilyev
no flags Details
[Animated GIF] Indices don't get updated (77.91 KB, image/gif)
2018-01-15 16:05 PST, Nikita Vasilyev
no flags Details
Patch (1.58 KB, patch)
2018-01-15 16:23 PST, Nikita Vasilyev
no flags Details | Formatted Diff | Diff
[Animated GIF] With patch applied (63.20 KB, image/gif)
2018-01-15 16:24 PST, Nikita Vasilyev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2017-11-11 18:59:49 PST
Created attachment 326702 [details]
[Animated GIF] Bug

Clicking on a property with index=N should add a blank property at N+1.
Instead, it sometimes adds it at N+2.
Comment 1 Radar WebKit Bug Importer 2017-11-11 19:00:06 PST
<rdar://problem/35490780>
Comment 2 Nikita Vasilyev 2018-01-15 16:05:13 PST
Created attachment 331359 [details]
[Animated GIF] Indices don't get updated

I added this CSS for debugging:

.spreadsheet-style-declaration-editor .property[data-property-index]::before {
    content: attr(data-property-index)': ';
    color: red;
}

On the attached animated GIF you can see that the indices don't get updated after a blank property is discarded.
Comment 3 Nikita Vasilyev 2018-01-15 16:23:14 PST
Created attachment 331362 [details]
Patch
Comment 4 Nikita Vasilyev 2018-01-15 16:24:42 PST
Created attachment 331363 [details]
[Animated GIF] With patch applied

With patch applied and the debug CSS added.
Comment 5 Joseph Pecoraro 2018-01-16 12:19:30 PST
Comment on attachment 331362 [details]
Patch

r=me
Comment 6 WebKit Commit Bot 2018-01-16 12:23:16 PST
Comment on attachment 331362 [details]
Patch

Clearing flags on attachment: 331362

Committed r226994: <https://trac.webkit.org/changeset/226994>
Comment 7 WebKit Commit Bot 2018-01-16 12:23:18 PST
All reviewed patches have been landed.  Closing bug.