Changeset 202589 in webkit
- Timestamp:
- Jun 28, 2016 2:33:10 PM (8 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r202566 r202589 1 2016-06-28 Nikita Vasilyev <nvasilyev@apple.com> 2 3 REGRESSION (r188730): Web Inspector: Warning icons incorrectly positioned in CSS Rules sidebar 4 https://bugs.webkit.org/show_bug.cgi?id=157869 5 <rdar://problem/26356520> 6 7 Reviewed by Timothy Hatcher. 8 9 Before r188730, CSS text always had a line break as a prefix. r188730 started trimming text. 10 This patch keeps trimming unnecessary whitespace but brings back required line break prefix. 11 12 * UserInterface/Models/CSSStyleDeclaration.js: 13 (WebInspector.CSSStyleDeclaration.prototype.set text): 14 * UserInterface/Views/CSSStyleDeclarationTextEditor.js: 15 Make PrefixWhitespace and SuffixWhitespace public. 16 17 (WebInspector.CSSStyleDeclarationTextEditor.prototype._formattedContent): 18 (WebInspector.CSSStyleDeclarationTextEditor.prototype._updateTextMarkers.update): 19 (WebInspector.CSSStyleDeclarationTextEditor.prototype._updateTextMarkers): 20 Remove an if conditional as it's always true. 21 1 22 2016-06-28 Brian Burg <bburg@apple.com> 2 23 -
trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js
r194717 r202589 187 187 return; 188 188 189 let trimmedText = text.trim();189 let trimmedText = WebInspector.CSSStyleDeclarationTextEditor.PrefixWhitespace + text.trim(); 190 190 if (this._text === trimmedText) 191 191 return; 192 192 193 if ( !trimmedText.length|| this._type === WebInspector.CSSStyleDeclaration.Type.Inline)193 if (trimmedText === WebInspector.CSSStyleDeclarationTextEditor.PrefixWhitespace || this._type === WebInspector.CSSStyleDeclaration.Type.Inline) 194 194 text = trimmedText; 195 195 -
trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js
r201890 r202589 43 43 this._sortProperties = false; 44 44 45 this._prefixWhitespace = "\n";46 this._suffixWhitespace = "\n";47 45 this._linePrefixWhitespace = ""; 48 46 … … 696 694 { 697 695 // Start with the prefix whitespace we stripped. 698 var content = this._prefixWhitespace;696 var content = WebInspector.CSSStyleDeclarationTextEditor.PrefixWhitespace; 699 697 700 698 // Get each line and add the line prefix whitespace and newlines. … … 708 706 709 707 // Add the suffix whitespace we stripped. 710 content += this._suffixWhitespace;708 content += WebInspector.CSSStyleDeclarationTextEditor.SuffixWhitespace; 711 709 712 710 // This regular expression replacement removes extra newlines … … 790 788 791 789 // Adjust the line position for the missing prefix line. 792 if (this._prefixWhitespace) { 793 --from.line; 794 --to.line; 795 } 790 from.line--; 791 to.line--; 796 792 797 793 // Adjust the column for the stripped line prefix whitespace. … … 1667 1663 }; 1668 1664 1665 WebInspector.CSSStyleDeclarationTextEditor.PrefixWhitespace = "\n"; 1666 WebInspector.CSSStyleDeclarationTextEditor.SuffixWhitespace = "\n"; 1669 1667 WebInspector.CSSStyleDeclarationTextEditor.StyleClassName = "css-style-text-editor"; 1670 1668 WebInspector.CSSStyleDeclarationTextEditor.ReadOnlyStyleClassName = "read-only";
Note: See TracChangeset
for help on using the changeset viewer.