Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: WebCore/inspector/front-end/CSSStyleModel.js

Issue 5446003: Merge 72938 - 2010-11-30 Pavel Feldman <pfeldman@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « WebCore/inspector/InspectorStyleSheet.cpp ('k') | WebCore/inspector/front-end/Resource.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 _styleSheetChanged: function(styleSheetId, majorChange) 158 _styleSheetChanged: function(styleSheetId, majorChange)
159 { 159 {
160 if (!majorChange || !styleSheetId) 160 if (!majorChange || !styleSheetId)
161 return; 161 return;
162 162
163 function callback(href, content) 163 function callback(href, content)
164 { 164 {
165 var resource = WebInspector.resourceManager.resourceForURL(href); 165 var resource = WebInspector.resourceManager.resourceForURL(href);
166 if (resource && resource.type === WebInspector.Resource.Type.Stylesh eet) 166 if (resource && resource.type === WebInspector.Resource.Type.Stylesh eet)
167 resource.content = content; 167 resource.setContent(content, this._onRevert.bind(this, styleShee tId));
168 } 168 }
169 InspectorBackend.getStyleSheetText2(styleSheetId, callback); 169 InspectorBackend.getStyleSheetText2(styleSheetId, callback.bind(this));
170 },
171
172 _onRevert: function(styleSheetId, contentToRevertTo)
173 {
174 function callback(success)
175 {
176 this._styleSheetChanged(styleSheetId, true);
177 }
178 InspectorBackend.setStyleSheetText2(styleSheetId, contentToRevertTo, cal lback.bind(this));
170 } 179 }
171 } 180 }
172 181
173 WebInspector.CSSStyleDeclaration = function(payload) 182 WebInspector.CSSStyleDeclaration = function(payload)
174 { 183 {
175 this.id = payload.styleId; 184 this.id = payload.styleId;
176 this.properties = payload.properties; 185 this.properties = payload.properties;
177 this._shorthandValues = payload.shorthandValues; 186 this._shorthandValues = payload.shorthandValues;
178 this._livePropertyMap = {}; // LIVE properties (source-based or style-based) : { name -> CSSProperty } 187 this._livePropertyMap = {}; // LIVE properties (source-based or style-based) : { name -> CSSProperty }
179 this._allProperties = []; // ALL properties: [ CSSProperty ] 188 this._allProperties = []; // ALL properties: [ CSSProperty ]
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 userCallback(null); 550 userCallback(null);
542 else { 551 else {
543 userCallback(new WebInspector.CSSStyleSheet(styleSheetPayload)); 552 userCallback(new WebInspector.CSSStyleSheet(styleSheetPayload));
544 WebInspector.cssModel._styleSheetChanged(this.id, true); 553 WebInspector.cssModel._styleSheetChanged(this.id, true);
545 } 554 }
546 } 555 }
547 556
548 InspectorBackend.setStyleSheetText2(this.id, newText, callback.bind(this )); 557 InspectorBackend.setStyleSheetText2(this.id, newText, callback.bind(this ));
549 } 558 }
550 } 559 }
OLDNEW
« no previous file with comments | « WebCore/inspector/InspectorStyleSheet.cpp ('k') | WebCore/inspector/front-end/Resource.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698