| OLD | NEW |
| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.StyleShe
etAdded, styleSheetHeader); | 452 this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.StyleShe
etAdded, styleSheetHeader); |
| 453 }, | 453 }, |
| 454 | 454 |
| 455 /** | 455 /** |
| 456 * @param {!CSSAgent.StyleSheetId} id | 456 * @param {!CSSAgent.StyleSheetId} id |
| 457 */ | 457 */ |
| 458 _styleSheetRemoved: function(id) | 458 _styleSheetRemoved: function(id) |
| 459 { | 459 { |
| 460 var header = this._styleSheetIdToHeader[id]; | 460 var header = this._styleSheetIdToHeader[id]; |
| 461 console.assert(header); | 461 console.assert(header); |
| 462 if (!header) |
| 463 return; |
| 462 delete this._styleSheetIdToHeader[id]; | 464 delete this._styleSheetIdToHeader[id]; |
| 463 var url = header.resourceURL(); | 465 var url = header.resourceURL(); |
| 464 var frameIdToStyleSheetIds = this._styleSheetIdsForURL[url]; | 466 var frameIdToStyleSheetIds = this._styleSheetIdsForURL[url]; |
| 465 frameIdToStyleSheetIds[header.frameId].remove(id); | 467 frameIdToStyleSheetIds[header.frameId].remove(id); |
| 466 if (!frameIdToStyleSheetIds[header.frameId].length) { | 468 if (!frameIdToStyleSheetIds[header.frameId].length) { |
| 467 delete frameIdToStyleSheetIds[header.frameId]; | 469 delete frameIdToStyleSheetIds[header.frameId]; |
| 468 if (!Object.keys(this._styleSheetIdsForURL[url]).length) | 470 if (!Object.keys(this._styleSheetIdsForURL[url]).length) |
| 469 delete this._styleSheetIdsForURL[url]; | 471 delete this._styleSheetIdsForURL[url]; |
| 470 } | 472 } |
| 471 this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.StyleShe
etRemoved, header); | 473 this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.StyleShe
etRemoved, header); |
| (...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1606 for (var i = 0; i < callbacks.length; ++i) | 1608 for (var i = 0; i < callbacks.length; ++i) |
| 1607 callbacks[i](computedStyle); | 1609 callbacks[i](computedStyle); |
| 1608 } | 1610 } |
| 1609 } | 1611 } |
| 1610 } | 1612 } |
| 1611 | 1613 |
| 1612 /** | 1614 /** |
| 1613 * @type {!WebInspector.CSSStyleModel} | 1615 * @type {!WebInspector.CSSStyleModel} |
| 1614 */ | 1616 */ |
| 1615 WebInspector.cssModel; | 1617 WebInspector.cssModel; |
| OLD | NEW |