Bug 199760

Summary: Web Inspector: Changes: dismissing a blank property makes style rule to show in Changes panel
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hi, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[Animated GIF] Bug
none
Patch none

Description Nikita Vasilyev 2019-07-12 14:42:40 PDT
Created attachment 374036 [details]
[Animated GIF] Bug

Steps:
1. Inspect <body> (or any element)
2. In the Styles panel, click to add a new CSS property
3. Click elsewhere to dismiss it
4. Select Changes panel

Expected:
Changes panel is empty

Actual:
Changes panel shows one CSS rule. All text is gray; no additions or deletions.
Comment 1 Nikita Vasilyev 2019-07-12 14:46:23 PDT
Created attachment 374038 [details]
Patch
Comment 2 Devin Rousso 2019-07-12 14:47:59 PDT
Comment on attachment 374038 [details]
Patch

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

rs=me

> Source/WebInspectorUI/UserInterface/Models/CSSProperty.js:443
> +                this._ownerStyle.updatePropertiesModifiedState();

Why not move this call inside `shiftPropertiesAfter`?  That way, you could remove the `updatePropertiesModifiedState` on <480 as well.
Comment 3 Nikita Vasilyev 2019-07-12 14:55:42 PDT
Comment on attachment 374038 [details]
Patch

(In reply to Devin Rousso from comment #2)
> Comment on attachment 374038 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=374038&action=review
> 
> rs=me
> 
> > Source/WebInspectorUI/UserInterface/Models/CSSProperty.js:443
> > +                this._ownerStyle.updatePropertiesModifiedState();
> 
> Why not move this call inside `shiftPropertiesAfter`?  That way, you could
> remove the `updatePropertiesModifiedState` on <480 as well.

While it would save one line of code, I think it's more clear when shiftPropertiesAfter only shifts properties.
Comment 4 WebKit Commit Bot 2019-07-12 16:21:38 PDT
Comment on attachment 374038 [details]
Patch

Clearing flags on attachment: 374038

Committed r247406: <https://trac.webkit.org/changeset/247406>
Comment 5 WebKit Commit Bot 2019-07-12 16:21:39 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2019-07-12 16:24:06 PDT
<rdar://problem/53032783>