Changeset 213187 in webkit
- Timestamp:
- Feb 28, 2017 3:33:55 PM (7 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r213004 r213187 1 2017-02-28 Devin Rousso <dcrousso+webkit@gmail.com> 2 3 Web Inspector: CSS variable uses that are unresolved should have an error or warning icon 4 https://bugs.webkit.org/show_bug.cgi?id=168352 5 6 Reviewed by Brian Burg. 7 8 * Localizations/en.lproj/localizedStrings.js: 9 10 * UserInterface/Views/CSSStyleDeclarationTextEditor.js: 11 (WebInspector.CSSStyleDeclarationTextEditor.prototype._createInlineSwatches.update): 12 Insert a warning icon if the variable is not found in the computed style. 13 1 14 2017-02-25 Devin Rousso <dcrousso+webkit@gmail.com> 2 15 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r212702 r213187 774 774 localizedStrings["The value “%s” is not supported for this property.\nClick to delete and open autocomplete."] = "The value “%s” is not supported for this property.\nClick to delete and open autocomplete."; 775 775 localizedStrings["The value “%s” needs units.\nClick to add “px” to the value."] = "The value “%s” needs units.\nClick to add “px” to the value."; 776 localizedStrings["The variable “%s” does not exist.\nClick to delete and open autocomplete."] = "The variable “%s” does not exist.\nClick to delete and open autocomplete."; 776 777 localizedStrings["The “%s”\ntable is empty."] = "The “%s”\ntable is empty."; 777 778 localizedStrings["The “webkit” prefix is needed for this property.\nClick to insert a duplicate with the prefix."] = "The “webkit” prefix is needed for this property.\nClick to insert a duplicate with the prefix."; -
trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js
r212761 r213187 901 901 const dontCreateIfMissing = true; 902 902 let variableProperty = this._style.nodeStyles.computedStyle.propertyForName(variableString, dontCreateIfMissing); 903 if (!variableProperty) 903 if (!variableProperty) { 904 let from = {line: marker.range.startLine, ch: marker.range.startColumn}; 905 let to = {line: marker.range.endLine, ch: marker.range.endColumn}; 906 this._codeMirror.markText(from, to, {className: "invalid"}); 907 908 let invalidMarker = document.createElement("button"); 909 invalidMarker.classList.add("invalid-warning-marker", "clickable"); 910 invalidMarker.title = WebInspector.UIString("The variable “%s” does not exist.\nClick to delete and open autocomplete.").format(variableString); 911 invalidMarker.addEventListener("click", (event) => { 912 this._codeMirror.replaceRange("", from, to); 913 this._codeMirror.setCursor(from); 914 this._completionController.completeAtCurrentPositionIfNeeded(true); 915 }); 916 this._codeMirror.setBookmark(from, invalidMarker); 904 917 return; 918 } 905 919 906 920 let trimmedValue = variableProperty.value.trim();
Note: See TracChangeset
for help on using the changeset viewer.