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 24 matching lines...) Expand all Loading... |
35 */ | 35 */ |
36 WebInspector.CSSStyleModel = function(target) | 36 WebInspector.CSSStyleModel = function(target) |
37 { | 37 { |
38 WebInspector.TargetAwareObject.call(this, target); | 38 WebInspector.TargetAwareObject.call(this, target); |
39 this._domModel = target.domModel; | 39 this._domModel = target.domModel; |
40 this._agent = target.cssAgent(); | 40 this._agent = target.cssAgent(); |
41 this._pendingCommandsMajorState = []; | 41 this._pendingCommandsMajorState = []; |
42 this._styleLoader = new WebInspector.CSSStyleModel.ComputedStyleLoader(this)
; | 42 this._styleLoader = new WebInspector.CSSStyleModel.ComputedStyleLoader(this)
; |
43 this._domModel.addEventListener(WebInspector.DOMModel.Events.UndoRedoRequest
ed, this._undoRedoRequested, this); | 43 this._domModel.addEventListener(WebInspector.DOMModel.Events.UndoRedoRequest
ed, this._undoRedoRequested, this); |
44 this._domModel.addEventListener(WebInspector.DOMModel.Events.UndoRedoComplet
ed, this._undoRedoCompleted, this); | 44 this._domModel.addEventListener(WebInspector.DOMModel.Events.UndoRedoComplet
ed, this._undoRedoCompleted, this); |
45 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve
ntTypes.MainFrameCreatedOrNavigated, this._mainFrameCreatedOrNavigated, this); | 45 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve
ntTypes.MainFrameNavigated, this._mainFrameNavigated, this); |
46 target.registerCSSDispatcher(new WebInspector.CSSDispatcher(this)); | 46 target.registerCSSDispatcher(new WebInspector.CSSDispatcher(this)); |
47 this._agent.enable(this._wasEnabled.bind(this)); | 47 this._agent.enable(this._wasEnabled.bind(this)); |
48 this._resetStyleSheets(); | 48 this._resetStyleSheets(); |
49 } | 49 } |
50 | 50 |
51 WebInspector.CSSStyleModel.PseudoStatePropertyName = "pseudoState"; | 51 WebInspector.CSSStyleModel.PseudoStatePropertyName = "pseudoState"; |
52 | 52 |
53 /** | 53 /** |
54 * @param {!WebInspector.CSSStyleModel} cssModel | 54 * @param {!WebInspector.CSSStyleModel} cssModel |
55 * @param {!Array.<!CSSAgent.RuleMatch>|undefined} matchArray | 55 * @param {!Array.<!CSSAgent.RuleMatch>|undefined} matchArray |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 _undoRedoRequested: function() | 534 _undoRedoRequested: function() |
535 { | 535 { |
536 this._pendingCommandsMajorState.push(true); | 536 this._pendingCommandsMajorState.push(true); |
537 }, | 537 }, |
538 | 538 |
539 _undoRedoCompleted: function() | 539 _undoRedoCompleted: function() |
540 { | 540 { |
541 this._pendingCommandsMajorState.pop(); | 541 this._pendingCommandsMajorState.pop(); |
542 }, | 542 }, |
543 | 543 |
544 _mainFrameCreatedOrNavigated: function() | 544 _mainFrameNavigated: function() |
545 { | 545 { |
546 this._resetStyleSheets(); | 546 this._resetStyleSheets(); |
547 }, | 547 }, |
548 | 548 |
549 _resetStyleSheets: function() | 549 _resetStyleSheets: function() |
550 { | 550 { |
551 /** @type {!Object.<string, !Object.<!PageAgent.FrameId, !Array.<!CSSAge
nt.StyleSheetId>>>} */ | 551 /** @type {!Object.<string, !Object.<!PageAgent.FrameId, !Array.<!CSSAge
nt.StyleSheetId>>>} */ |
552 this._styleSheetIdsForURL = {}; | 552 this._styleSheetIdsForURL = {}; |
553 /** @type {!Object.<!CSSAgent.StyleSheetId, !WebInspector.CSSStyleSheetH
eader>} */ | 553 /** @type {!Object.<!CSSAgent.StyleSheetId, !WebInspector.CSSStyleSheetH
eader>} */ |
554 this._styleSheetIdToHeader = {}; | 554 this._styleSheetIdToHeader = {}; |
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1715 for (var i = 0; i < callbacks.length; ++i) | 1715 for (var i = 0; i < callbacks.length; ++i) |
1716 callbacks[i](computedStyle); | 1716 callbacks[i](computedStyle); |
1717 } | 1717 } |
1718 } | 1718 } |
1719 } | 1719 } |
1720 | 1720 |
1721 /** | 1721 /** |
1722 * @type {!WebInspector.CSSStyleModel} | 1722 * @type {!WebInspector.CSSStyleModel} |
1723 */ | 1723 */ |
1724 WebInspector.cssModel; | 1724 WebInspector.cssModel; |
OLD | NEW |