| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 { | 54 { |
| 55 return "\n/*# sourceURL=" + WebInspector.ParsedURL.completeURL(window.locati
on.href, cssFile) + " */"; | 55 return "\n/*# sourceURL=" + WebInspector.ParsedURL.completeURL(window.locati
on.href, cssFile) + " */"; |
| 56 } | 56 } |
| 57 | 57 |
| 58 /** | 58 /** |
| 59 * @param {string} cssFile | 59 * @param {string} cssFile |
| 60 * @return {!Element} | 60 * @return {!Element} |
| 61 */ | 61 */ |
| 62 WebInspector.View.createStyleElement = function(cssFile) | 62 WebInspector.View.createStyleElement = function(cssFile) |
| 63 { | 63 { |
| 64 var content = Runtime.cachedResources[cssFile]; | 64 var content = Runtime.cachedResources[cssFile] || ""; |
| 65 if (!content) { | 65 if (!content) |
| 66 if (Runtime.isReleaseMode()) | 66 console.error(cssFile + " not preloaded. Check module.json"); |
| 67 console.error(cssFile + " not preloaded, loading from the remote. Ch
eck module.json"); | |
| 68 content = loadResource(cssFile) + WebInspector.View._buildSourceURL(cssF
ile); | |
| 69 Runtime.cachedResources[cssFile] = content; | |
| 70 } | |
| 71 var styleElement = createElement("style"); | 67 var styleElement = createElement("style"); |
| 72 styleElement.type = "text/css"; | 68 styleElement.type = "text/css"; |
| 73 styleElement.textContent = content; | 69 styleElement.textContent = content; |
| 74 return styleElement; | 70 return styleElement; |
| 75 } | 71 } |
| 76 | 72 |
| 77 WebInspector.View.prototype = { | 73 WebInspector.View.prototype = { |
| 78 markAsRoot: function() | 74 markAsRoot: function() |
| 79 { | 75 { |
| 80 WebInspector.installComponentRootStyles(this.element); | 76 WebInspector.installComponentRootStyles(this.element); |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 { | 652 { |
| 657 WebInspector.View.__assert(!child.__viewCounter && !child.__view, "Attempt t
o remove element containing view via regular DOM operation"); | 653 WebInspector.View.__assert(!child.__viewCounter && !child.__view, "Attempt t
o remove element containing view via regular DOM operation"); |
| 658 return WebInspector.View._originalRemoveChild.call(this, child); | 654 return WebInspector.View._originalRemoveChild.call(this, child); |
| 659 } | 655 } |
| 660 | 656 |
| 661 Element.prototype.removeChildren = function() | 657 Element.prototype.removeChildren = function() |
| 662 { | 658 { |
| 663 WebInspector.View.__assert(!this.__viewCounter, "Attempt to remove element c
ontaining view via regular DOM operation"); | 659 WebInspector.View.__assert(!this.__viewCounter, "Attempt to remove element c
ontaining view via regular DOM operation"); |
| 664 WebInspector.View._originalRemoveChildren.call(this); | 660 WebInspector.View._originalRemoveChildren.call(this); |
| 665 } | 661 } |
| OLD | NEW |