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

Unified Diff: Source/devtools/front_end/elements/SharedSidebarModel.js

Issue 1204393002: DevTools: [CSS] promisify CSSStyleModel fetching methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/elements/SharedSidebarModel.js
diff --git a/Source/devtools/front_end/elements/SharedSidebarModel.js b/Source/devtools/front_end/elements/SharedSidebarModel.js
index 43e1591ab07fef854f58eb8803f9babb2a3d431d..e322a41e32c9e1f941124b48ea789bfcd1906440 100644
--- a/Source/devtools/front_end/elements/SharedSidebarModel.js
+++ b/Source/devtools/front_end/elements/SharedSidebarModel.js
@@ -107,21 +107,12 @@ WebInspector.SharedSidebarModel.prototype = {
return Promise.resolve(/** @type {?WebInspector.SharedSidebarModel.ComputedStyle} */(null));
if (!this._computedStylePromise)
- this._computedStylePromise = new Promise(getComputedStyle.bind(null, elementNode)).then(verifyOutdated.bind(this, elementNode));
+ this._computedStylePromise = cssModel.computedStylePromise(elementNode.id).then(verifyOutdated.bind(this, elementNode));
return this._computedStylePromise;
/**
* @param {!WebInspector.DOMNode} elementNode
- * @param {function(?WebInspector.CSSStyleDeclaration)} resolve
- */
- function getComputedStyle(elementNode, resolve)
- {
- cssModel.getComputedStyleAsync(elementNode.id, resolve);
- }
-
- /**
- * @param {!WebInspector.DOMNode} elementNode
* @param {?WebInspector.CSSStyleDeclaration} style
* @return {?WebInspector.SharedSidebarModel.ComputedStyle}
* @this {WebInspector.SharedSidebarModel}

Powered by Google App Engine
This is Rietveld 408576698