Bug 149197 - REGRESSION(r188427): Web Inspector: Extra whitespace left behind in styles sidebar after clicking in and out
Summary: REGRESSION(r188427): Web Inspector: Extra whitespace left behind in styles si...
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: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-09-15 16:59 PDT by Joseph Pecoraro
Modified: 2015-09-17 00:29 PDT (History)
9 users (show)

See Also:


Attachments
Patch (2.01 KB, patch)
2015-09-16 21:42 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-09-15 16:59:13 PDT
* SUMMARY
Extra whitespace left behind in styles sidebar after clicking in and out.

* STEPS TO REPRODUCE
1. Inspect <body> on <http://daringfireball.net>
2. Show Styles > Rules sidebar
3. Click in the first CSSStyleDeclarationTextEditor at the end of the line-height line
  => newline added to add a new property
4. Click out of the editor
  => expected newline to be removed, it remains

* NOTES
- Regressed with r188427 - bug 145679
Comment 1 Radar WebKit Bug Importer 2015-09-15 16:59:30 PDT
<rdar://problem/22711632>
Comment 2 Devin Rousso 2015-09-15 19:58:03 PDT
Just so I understand, we want to have it such that new CSS styles that are added follow the same indentation of existing CSS, but remove any leading/trailing whitespace and extra newlines in the middle.  So it would format

body {
    color: red;

    background-color: black;

}

into the style declaration with the following formatting:

body {
    color: red;
    background-color: black;
}
Comment 3 Joseph Pecoraro 2015-09-16 11:27:15 PDT
(In reply to comment #2)
> Just so I understand, we want to have it such that new CSS styles that are
> added follow the same indentation of existing CSS, but remove any
> leading/trailing whitespace and extra newlines in the middle.  So it would
> format
> 
> body {
>     color: red;
> 
>     background-color: black;
> 
> }
> 
> into the style declaration with the following formatting:
> 
> body {
>     color: red;
>     background-color: black;
> }

Yep! In the sidebar I don't expect extra newlines in the middle if the editor is not focused. Preserving newlines in the actual StyleSheet's text would be nice, but I don't think we do that now so its fine if we reformat that a little.
Comment 4 Devin Rousso 2015-09-16 21:42:26 PDT
Created attachment 261365 [details]
Patch
Comment 5 WebKit Commit Bot 2015-09-17 00:29:08 PDT
Comment on attachment 261365 [details]
Patch

Clearing flags on attachment: 261365

Committed r189909: <http://trac.webkit.org/changeset/189909>
Comment 6 WebKit Commit Bot 2015-09-17 00:29:12 PDT
All reviewed patches have been landed.  Closing bug.