Changeset 83843 in webkit
- Timestamp:
- Apr 14, 2011 5:46:52 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r83840 r83843 1 2011-04-14 Pavel Feldman <pfeldman@google.com> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: implement incremental CSS free flow editing. 6 https://bugs.webkit.org/show_bug.cgi?id=58529 7 8 * inspector/styles/get-set-stylesheet-text.html: 9 1 10 2011-04-14 Herczeg Zoltan <zherczeg@webkit.org> 2 11 -
trunk/LayoutTests/inspector/styles/get-set-stylesheet-text.html
r83441 r83843 52 52 InspectorTest.addResult("=== Original stylesheet text: ==="); 53 53 InspectorTest.addResult(foundStyleSheet.getText()); 54 foundStyleSheet.setText("h1 { COLOR: Red; }", callback);54 foundStyleSheet.setText("h1 { COLOR: Red; }", true, callback); 55 55 } 56 56 -
trunk/Source/WebCore/ChangeLog
r83841 r83843 1 2011-04-14 Pavel Feldman <pfeldman@google.com> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: implement incremental CSS free flow editing. 6 https://bugs.webkit.org/show_bug.cgi?id=58529 7 8 * inspector/front-end/CSSStyleModel.js: 9 (WebInspector.CSSStyleSheet.prototype.setText): 10 * inspector/front-end/Resource.js: 11 (WebInspector.Resource.prototype.isResourceRevision): 12 (WebInspector.Resource.prototype.setContent): 13 * inspector/front-end/ResourceView.js: 14 (WebInspector.CSSSourceFrame.prototype.isContentEditable): 15 (WebInspector.CSSSourceFrame.prototype.editContent): 16 (WebInspector.CSSSourceFrame.prototype.endEditing.commitIncrementalEdit): 17 (WebInspector.CSSSourceFrame.prototype.endEditing): 18 * inspector/front-end/SourceFrame.js: 19 (WebInspector.SourceFrame.prototype.commitEditing): 20 (WebInspector.SourceFrame.prototype.editContent): 21 1 22 2011-04-14 Ilya Tikhonovsky <loislo@chromium.org> 2 23 -
trunk/Source/WebCore/inspector/front-end/CSSStyleModel.js
r82663 r83843 582 582 }, 583 583 584 setText: function(newText, userCallback)584 setText: function(newText, majorChange, userCallback) 585 585 { 586 586 function callback(error, isChangeSuccessful) … … 589 589 userCallback(isChangeSuccessful); 590 590 if (isChangeSuccessful) 591 WebInspector.cssModel._styleSheetChanged(this.id, true);591 WebInspector.cssModel._styleSheetChanged(this.id, majorChange); 592 592 } 593 593 -
trunk/Source/WebCore/inspector/front-end/Resource.js
r83564 r83843 641 641 }, 642 642 643 is LocallyModified: function()644 { 645 return !!this._ baseRevision;643 isResourceRevision: function() 644 { 645 return !!this._actualResource; 646 646 }, 647 647 … … 675 675 this._content = newContent; 676 676 this.timestamp = new Date(); 677 677 678 this.dispatchEventToListeners("content-changed", data); 678 679 }, -
trunk/Source/WebCore/inspector/front-end/ResourceView.js
r83719 r83843 167 167 isContentEditable: function() 168 168 { 169 return !!this._styleSheet ;169 return !!this._styleSheet && !this._resource.isResourceRevision(); 170 170 }, 171 171 … … 197 197 }, 198 198 199 _editContent: function(newText, callback)199 editContent: function(newText, callback) 200 200 { 201 201 if (!this._styleSheet) { … … 203 203 return; 204 204 } 205 206 this._resetIncrementalUpdateTimer(); 205 207 206 208 function didSetText(success) … … 211 213 callback(error); 212 214 } 213 214 this._styleSheet.setText(newText, didSetText.bind(this)); 215 this._styleSheet.setText(newText, true, didSetText.bind(this)); 216 }, 217 218 endEditing: function(oldRange, newRange) 219 { 220 function commitIncrementalEdit() 221 { 222 var majorChange = false; 223 this._styleSheet.setText(this._textModel.text, majorChange); 224 } 225 const updateTimeout = 200; 226 this._incrementalUpdateTimer = setTimeout(commitIncrementalEdit.bind(this), updateTimeout); 227 }, 228 229 _resetIncrementalUpdateTimer: function() 230 { 231 if (this._incrementalUpdateTimer) 232 clearTimeout(this._incrementalUpdateTimer); 233 delete this._incrementalUpdateTimer; 215 234 } 216 235 } -
trunk/Source/WebCore/inspector/front-end/SourceFrame.js
r83748 r83843 924 924 callback(); 925 925 } 926 this. _editContent(this._textModel.text, didEditContent.bind(this));927 }, 928 929 _editContent: function(newContent, callback)926 this.editContent(this._textModel.text, didEditContent.bind(this)); 927 }, 928 929 editContent: function(newContent, callback) 930 930 { 931 931 this._delegate.editScriptSource(newContent, callback);
Note: See TracChangeset
for help on using the changeset viewer.