| 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 { | 610 { |
| 611 if (WebInspector.targetManager.allTargetsSuspended()) { | 611 if (WebInspector.targetManager.allTargetsSuspended()) { |
| 612 this._agent.disable(); | 612 this._agent.disable(); |
| 613 this._isEnabled = false; | 613 this._isEnabled = false; |
| 614 } else { | 614 } else { |
| 615 this._resetStyleSheets(); | 615 this._resetStyleSheets(); |
| 616 this._agent.enable(this._wasEnabled.bind(this)); | 616 this._agent.enable(this._wasEnabled.bind(this)); |
| 617 } | 617 } |
| 618 }, | 618 }, |
| 619 | 619 |
| 620 _cssPropertyEdited: function(nodeId, newValue) |
| 621 { |
| 622 console.log("cssProp " + newValue + " " + nodeId); |
| 623 var node = this._domModel.nodeForId(nodeId); |
| 624 if (node) |
| 625 node.setAttributeValue("style", "margin-left: " + newValue + "px"); |
| 626 }, |
| 627 |
| 620 __proto__: WebInspector.SDKModel.prototype | 628 __proto__: WebInspector.SDKModel.prototype |
| 621 } | 629 } |
| 622 | 630 |
| 623 /** | 631 /** |
| 624 * @constructor | 632 * @constructor |
| 625 * @extends {WebInspector.SDKObject} | 633 * @extends {WebInspector.SDKObject} |
| 626 * @param {!WebInspector.CSSStyleModel} cssModel | 634 * @param {!WebInspector.CSSStyleModel} cssModel |
| 627 * @param {!CSSAgent.StyleSheetId} styleSheetId | 635 * @param {!CSSAgent.StyleSheetId} styleSheetId |
| 628 * @param {string} url | 636 * @param {string} url |
| 629 * @param {number} lineNumber | 637 * @param {number} lineNumber |
| (...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1779 }, | 1787 }, |
| 1780 | 1788 |
| 1781 /** | 1789 /** |
| 1782 * @override | 1790 * @override |
| 1783 * @param {!CSSAgent.StyleSheetId} id | 1791 * @param {!CSSAgent.StyleSheetId} id |
| 1784 */ | 1792 */ |
| 1785 styleSheetRemoved: function(id) | 1793 styleSheetRemoved: function(id) |
| 1786 { | 1794 { |
| 1787 this._cssModel._styleSheetRemoved(id); | 1795 this._cssModel._styleSheetRemoved(id); |
| 1788 }, | 1796 }, |
| 1797 |
| 1798 cssPropertyEdited: function(nodeId, newValue) |
| 1799 { |
| 1800 this._cssModel._cssPropertyEdited(nodeId, newValue); |
| 1801 }, |
| 1789 } | 1802 } |
| 1790 | 1803 |
| 1791 /** | 1804 /** |
| 1792 * @constructor | 1805 * @constructor |
| 1793 * @param {!WebInspector.CSSStyleModel} cssModel | 1806 * @param {!WebInspector.CSSStyleModel} cssModel |
| 1794 */ | 1807 */ |
| 1795 WebInspector.CSSStyleModel.ComputedStyleLoader = function(cssModel) | 1808 WebInspector.CSSStyleModel.ComputedStyleLoader = function(cssModel) |
| 1796 { | 1809 { |
| 1797 this._cssModel = cssModel; | 1810 this._cssModel = cssModel; |
| 1798 /** @type {!Object.<*, !Array.<function(?WebInspector.CSSStyleDeclaration)>>
} */ | 1811 /** @type {!Object.<*, !Array.<function(?WebInspector.CSSStyleDeclaration)>>
} */ |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1849 } | 1862 } |
| 1850 | 1863 |
| 1851 /** | 1864 /** |
| 1852 * @param {!WebInspector.DOMNode} node | 1865 * @param {!WebInspector.DOMNode} node |
| 1853 * @return {!WebInspector.CSSStyleModel} | 1866 * @return {!WebInspector.CSSStyleModel} |
| 1854 */ | 1867 */ |
| 1855 WebInspector.CSSStyleModel.fromNode = function(node) | 1868 WebInspector.CSSStyleModel.fromNode = function(node) |
| 1856 { | 1869 { |
| 1857 return /** @type {!WebInspector.CSSStyleModel} */ (WebInspector.CSSStyleMode
l.fromTarget(node.target())); | 1870 return /** @type {!WebInspector.CSSStyleModel} */ (WebInspector.CSSStyleMode
l.fromTarget(node.target())); |
| 1858 } | 1871 } |
| OLD | NEW |