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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // (if a CSS property is added, a StyleSheetChanged event is dispatched)
. | 47 // (if a CSS property is added, a StyleSheetChanged event is dispatched)
. |
48 if (this._isEditingMetrics) { | 48 if (this._isEditingMetrics) { |
49 finishedCallback(); | 49 finishedCallback(); |
50 return; | 50 return; |
51 } | 51 } |
52 | 52 |
53 // FIXME: avoid updates of a collapsed pane. | 53 // FIXME: avoid updates of a collapsed pane. |
54 var node = this.node(); | 54 var node = this.node(); |
55 var cssModel = this.cssModel(); | 55 var cssModel = this.cssModel(); |
56 if (!node || node.nodeType() !== Node.ELEMENT_NODE || !cssModel) { | 56 if (!node || node.nodeType() !== Node.ELEMENT_NODE || !cssModel) { |
57 this.bodyElement.removeChildren(); | 57 this.element.removeChildren(); |
58 finishedCallback(); | 58 finishedCallback(); |
59 return; | 59 return; |
60 } | 60 } |
61 | 61 |
62 /** | 62 /** |
63 * @param {?WebInspector.CSSStyleDeclaration} style | 63 * @param {?WebInspector.CSSStyleDeclaration} style |
64 * @this {WebInspector.MetricsSidebarPane} | 64 * @this {WebInspector.MetricsSidebarPane} |
65 */ | 65 */ |
66 function callback(style) | 66 function callback(style) |
67 { | 67 { |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 boxElement.appendChild(createBoxPartElement.call(this, style, na
me, "right", suffix)); | 296 boxElement.appendChild(createBoxPartElement.call(this, style, na
me, "right", suffix)); |
297 boxElement.appendChild(createElement("br")); | 297 boxElement.appendChild(createElement("br")); |
298 boxElement.appendChild(createBoxPartElement.call(this, style, na
me, "bottom", suffix)); | 298 boxElement.appendChild(createBoxPartElement.call(this, style, na
me, "bottom", suffix)); |
299 } | 299 } |
300 | 300 |
301 previousBox = boxElement; | 301 previousBox = boxElement; |
302 } | 302 } |
303 | 303 |
304 metricsElement.appendChild(previousBox); | 304 metricsElement.appendChild(previousBox); |
305 metricsElement.addEventListener("mouseover", this._highlightDOMNode.bind
(this, false, "all"), false); | 305 metricsElement.addEventListener("mouseover", this._highlightDOMNode.bind
(this, false, "all"), false); |
306 this.bodyElement.removeChildren(); | 306 this.element.removeChildren(); |
307 this.bodyElement.appendChild(metricsElement); | 307 this.element.appendChild(metricsElement); |
308 }, | 308 }, |
309 | 309 |
310 startEditing: function(targetElement, box, styleProperty, computedStyle) | 310 startEditing: function(targetElement, box, styleProperty, computedStyle) |
311 { | 311 { |
312 if (WebInspector.isBeingEdited(targetElement)) | 312 if (WebInspector.isBeingEdited(targetElement)) |
313 return; | 313 return; |
314 | 314 |
315 var context = { box: box, styleProperty: styleProperty, computedStyle: c
omputedStyle }; | 315 var context = { box: box, styleProperty: styleProperty, computedStyle: c
omputedStyle }; |
316 var boundKeyDown = this._handleKeyDown.bind(this, context, styleProperty
); | 316 var boundKeyDown = this._handleKeyDown.bind(this, context, styleProperty
); |
317 context.keyDownHandler = boundKeyDown; | 317 context.keyDownHandler = boundKeyDown; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 }, | 456 }, |
457 | 457 |
458 editingCommitted: function(element, userInput, previousContent, context) | 458 editingCommitted: function(element, userInput, previousContent, context) |
459 { | 459 { |
460 this.editingEnded(element, context); | 460 this.editingEnded(element, context); |
461 this._applyUserInput(element, userInput, previousContent, context, true)
; | 461 this._applyUserInput(element, userInput, previousContent, context, true)
; |
462 }, | 462 }, |
463 | 463 |
464 __proto__: WebInspector.ElementsSidebarPane.prototype | 464 __proto__: WebInspector.ElementsSidebarPane.prototype |
465 } | 465 } |
OLD | NEW |