Changeset 204510 in webkit
- Timestamp:
- Aug 16, 2016 9:57:27 AM (8 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r204507 r204510 1 2016-08-16 Devin Rousso <dcrousso+webkit@gmail.com> 2 3 Web Inspector: Visual Styles: "Text -> Content" isn't escaped 4 https://bugs.webkit.org/show_bug.cgi?id=158271 5 6 Reviewed by Timothy Hatcher. 7 8 * UserInterface/Base/Utilities.js: 9 (String.prototype.hasMatchingEscapedQuotes): 10 Checks that the given string has property escaped quotes (single or double). 11 12 * UserInterface/Views/VisualStyleBasicInput.js: 13 (WebInspector.VisualStyleBasicInput): 14 (WebInspector.VisualStyleBasicInput.prototype._handleInputElementInput): 15 1 16 2016-08-16 Joseph Pecoraro <pecoraro@apple.com> 2 17 -
trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js
r201778 r204510 918 918 }); 919 919 920 Object.defineProperty(String.prototype, "hasMatchingEscapedQuotes", 921 { 922 value: function() 923 { 924 return /^\"(?:[^\"\\]|\\.)*\"$/.test(this) || /^\'(?:[^\'\\]|\\.)*\'$/.test(this); 925 } 926 }); 927 920 928 Object.defineProperty(Math, "roundTo", 921 929 { -
trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleBasicInput.js
r194673 r204510 33 33 this._inputElement.spellcheck = false; 34 34 this._inputElement.setAttribute("placeholder", placeholder || ""); 35 this._inputElement.addEventListener("input", this. _handleInputElementInput.bind(this));35 this._inputElement.addEventListener("input", this.debounce(500)._handleInputElementInput); 36 36 } 37 37 … … 60 60 _handleInputElementInput(event) 61 61 { 62 let value = this.value; 63 if (value && value.trim().length) { 64 let validItems = []; 65 for (let item of value.split(/([^\"\'\s]+|\"[^\"]*\"|\'[^\']*\')/)) { 66 if (!item.length || (!item.hasMatchingEscapedQuotes() && !/^[\w\s\-\.\(\)]+$/.test(item))) 67 continue; 68 69 validItems.push(item); 70 } 71 72 this.value = validItems.filter(item => item.trim().length).join(" "); 73 } 74 62 75 this._valueDidChange(); 63 76 }
Note: See TracChangeset
for help on using the changeset viewer.