Changeset 83719 in webkit
- Timestamp:
- Apr 13, 2011 4:37:10 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83718 r83719 1 2011-04-13 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: inactive style sheets should be read only. 6 https://bugs.webkit.org/show_bug.cgi?id=58423 7 8 * inspector/front-end/ResourceView.js: 9 (WebInspector.CSSSourceFrame): 10 (WebInspector.CSSSourceFrame.prototype.isContentEditable): 11 (WebInspector.CSSSourceFrame.prototype._loadStyleSheet.didGetAllStyleSheets.didCreateForId): 12 (WebInspector.CSSSourceFrame.prototype._loadStyleSheet): 13 1 14 2011-04-13 Mikhail Naganov <mnaganov@chromium.org> 2 15 -
trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js
r83713 r83719 131 131 canEditScriptSource: function(sourceFileId) 132 132 { 133 if (!Preferences.canEditScriptSource )133 if (!Preferences.canEditScriptSource || this._formatSourceFiles) 134 134 return false; 135 135 var script = this._scriptForSourceFileId(sourceFileId); -
trunk/Source/WebCore/inspector/front-end/ResourceView.js
r83438 r83719 161 161 { 162 162 WebInspector.ResourceSourceFrame.call(this, resource); 163 this._loadStyleSheet(); 163 164 } 164 165 … … 166 167 isContentEditable: function() 167 168 { 168 return true;169 }, 170 171 _ editContent: function(newText, callback)172 { 173 function handleStyleSheet(newText, styleSheet)169 return !!this._styleSheet; 170 }, 171 172 _loadStyleSheet: function() 173 { 174 function didGetAllStyleSheets(error, infos) 174 175 { 175 this._styleSheet = styleSheet; 176 this._saveStyleSheet(newText, callback); 177 } 178 179 function handleInfos(newText, error, infos) 180 { 181 if (error) { 182 callback(error); 176 if (error) 183 177 return; 184 } 185 178 179 var stylesheetId; 186 180 for (var i = 0; i < infos.length; ++i) { 187 181 var info = infos[i]; 188 182 if (info.sourceURL === this._resource.url) { 189 WebInspector.CSSStyleSheet.createForId(info.styleSheetId, handleStyleSheet.bind(this, newText));183 stylesheetId = info.styleSheetId; 190 184 break; 191 185 } 192 186 } 193 } 194 195 if (this._styleSheet) 196 this._saveStyleSheet(newText, callback); 197 else 198 CSSAgent.getAllStyleSheets(handleInfos.bind(this, newText)); 199 }, 200 201 _saveStyleSheet: function(newText, callback) 202 { 187 if (!stylesheetId) 188 return; 189 190 function didCreateForId(styleSheet) 191 { 192 this._styleSheet = styleSheet; 193 } 194 WebInspector.CSSStyleSheet.createForId(stylesheetId, didCreateForId.bind(this)); 195 } 196 CSSAgent.getAllStyleSheets(didGetAllStyleSheets.bind(this)); 197 }, 198 199 _editContent: function(newText, callback) 200 { 201 if (!this._styleSheet) { 202 callback("Stylesheet not found."); 203 return; 204 } 205 203 206 function didSetText(success) 204 207 {
Note: See TracChangeset
for help on using the changeset viewer.