OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
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 20 matching lines...) Expand all Loading... |
31 * @extends {WebInspector.SidebarPane} | 31 * @extends {WebInspector.SidebarPane} |
32 */ | 32 */ |
33 WebInspector.MetricsSidebarPane = function() | 33 WebInspector.MetricsSidebarPane = function() |
34 { | 34 { |
35 WebInspector.SidebarPane.call(this, WebInspector.UIString("Metrics")); | 35 WebInspector.SidebarPane.call(this, WebInspector.UIString("Metrics")); |
36 | 36 |
37 WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Sty
leSheetChanged, this._styleSheetOrMediaQueryResultChanged, this); | 37 WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Sty
leSheetChanged, this._styleSheetOrMediaQueryResultChanged, this); |
38 WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Med
iaQueryResultChanged, this._styleSheetOrMediaQueryResultChanged, this); | 38 WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Med
iaQueryResultChanged, this._styleSheetOrMediaQueryResultChanged, this); |
39 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModi
fied, this._attributesUpdated, this); | 39 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModi
fied, this._attributesUpdated, this); |
40 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemo
ved, this._attributesUpdated, this); | 40 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemo
ved, this._attributesUpdated, this); |
| 41 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.FrameResized, this._frameResized, this); |
41 } | 42 } |
42 | 43 |
43 WebInspector.MetricsSidebarPane.prototype = { | 44 WebInspector.MetricsSidebarPane.prototype = { |
44 /** | 45 /** |
45 * @param {WebInspector.DOMNode=} node | 46 * @param {WebInspector.DOMNode=} node |
46 */ | 47 */ |
47 update: function(node) | 48 update: function(node) |
48 { | 49 { |
49 if (node) | 50 if (node) |
50 this.node = node; | 51 this.node = node; |
(...skipping 30 matching lines...) Expand all Loading... |
81 this.inlineStyle = style; | 82 this.inlineStyle = style; |
82 } | 83 } |
83 WebInspector.cssModel.getInlineStylesAsync(node.id, inlineStyleCallback.
bind(this)); | 84 WebInspector.cssModel.getInlineStylesAsync(node.id, inlineStyleCallback.
bind(this)); |
84 }, | 85 }, |
85 | 86 |
86 _styleSheetOrMediaQueryResultChanged: function() | 87 _styleSheetOrMediaQueryResultChanged: function() |
87 { | 88 { |
88 this._innerUpdate(); | 89 this._innerUpdate(); |
89 }, | 90 }, |
90 | 91 |
| 92 _frameResized: function() |
| 93 { |
| 94 function refreshContents() |
| 95 { |
| 96 this._innerUpdate(); |
| 97 delete this._activeTimer; |
| 98 } |
| 99 |
| 100 if (this._activeTimer) |
| 101 clearTimeout(this._activeTimer); |
| 102 |
| 103 this._activeTimer = setTimeout(refreshContents.bind(this), 100); |
| 104 }, |
| 105 |
91 _attributesUpdated: function(event) | 106 _attributesUpdated: function(event) |
92 { | 107 { |
93 if (this.node !== event.data.node) | 108 if (this.node !== event.data.node) |
94 return; | 109 return; |
95 | 110 |
96 this._innerUpdate(); | 111 this._innerUpdate(); |
97 }, | 112 }, |
98 | 113 |
99 _getPropertyValueAsPx: function(style, propertyName) | 114 _getPropertyValueAsPx: function(style, propertyName) |
100 { | 115 { |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 }, | 432 }, |
418 | 433 |
419 editingCommitted: function(element, userInput, previousContent, context) | 434 editingCommitted: function(element, userInput, previousContent, context) |
420 { | 435 { |
421 this.editingEnded(element, context); | 436 this.editingEnded(element, context); |
422 this._applyUserInput(element, userInput, previousContent, context, true)
; | 437 this._applyUserInput(element, userInput, previousContent, context, true)
; |
423 }, | 438 }, |
424 | 439 |
425 __proto__: WebInspector.SidebarPane.prototype | 440 __proto__: WebInspector.SidebarPane.prototype |
426 } | 441 } |
OLD | NEW |