Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(590)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/MetricsSidebarPane.js

Issue 2146233002: DevTools: reuse computedstylesmodel in the elements sidebar base class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (2) Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 var promises = [ 79 var promises = [
80 cssModel.computedStylePromise(node.id).then(callback.bind(this)), 80 cssModel.computedStylePromise(node.id).then(callback.bind(this)),
81 cssModel.inlineStylesPromise(node.id).then(inlineStyleCallback.bind( this)) 81 cssModel.inlineStylesPromise(node.id).then(inlineStyleCallback.bind( this))
82 ]; 82 ];
83 return Promise.all(promises); 83 return Promise.all(promises);
84 }, 84 },
85 85
86 /** 86 /**
87 * @override 87 * @override
88 */ 88 */
89 onDOMModelChanged: function()
90 {
91 this.update();
92 },
93
94 /**
95 * @override
96 */
97 onCSSModelChanged: function() 89 onCSSModelChanged: function()
98 { 90 {
99 this.update(); 91 this.update();
100 }, 92 },
101 93
102 /** 94 /**
103 * @override
104 */
105 onFrameResizedThrottled: function()
106 {
107 this.update();
108 },
109
110 /**
111 * @param {!Map.<string, string>} style 95 * @param {!Map.<string, string>} style
112 * @param {string} propertyName 96 * @param {string} propertyName
113 * @return {number} 97 * @return {number}
114 */ 98 */
115 _getPropertyValueAsPx: function(style, propertyName) 99 _getPropertyValueAsPx: function(style, propertyName)
116 { 100 {
117 return Number(style.get(propertyName).replace(/px$/, "") || 0); 101 return Number(style.get(propertyName).replace(/px$/, "") || 0);
118 }, 102 },
119 103
120 /** 104 /**
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 * @this {WebInspector.MetricsSidebarPane} 446 * @this {WebInspector.MetricsSidebarPane}
463 */ 447 */
464 function callback(success) 448 function callback(success)
465 { 449 {
466 if (!success) 450 if (!success)
467 return; 451 return;
468 if (!("originalPropertyData" in this)) 452 if (!("originalPropertyData" in this))
469 this.originalPropertyData = this.previousPropertyDataCandidate; 453 this.originalPropertyData = this.previousPropertyDataCandidate;
470 454
471 if (typeof this._highlightMode !== "undefined") 455 if (typeof this._highlightMode !== "undefined")
472 this._node.highlight(this._highlightMode); 456 this.node().highlight(this._highlightMode);
473 457
474 if (commitEditor) 458 if (commitEditor)
475 this.update(); 459 this.update();
476 } 460 }
477 }, 461 },
478 462
479 editingCommitted: function(element, userInput, previousContent, context) 463 editingCommitted: function(element, userInput, previousContent, context)
480 { 464 {
481 this.editingEnded(element, context); 465 this.editingEnded(element, context);
482 this._applyUserInput(element, userInput, previousContent, context, true) ; 466 this._applyUserInput(element, userInput, previousContent, context, true) ;
483 }, 467 },
484 468
485 __proto__: WebInspector.ElementsSidebarPane.prototype 469 __proto__: WebInspector.ElementsSidebarPane.prototype
486 } 470 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698