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

Side by Side Diff: Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 1210893002: DevTools: [CSS] introduce strong types (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 var payload = new WebInspector.StylesSidebarPane.MatchedRulesPayload(); 374 var payload = new WebInspector.StylesSidebarPane.MatchedRulesPayload();
375 var cssModel = this.cssModel(); 375 var cssModel = this.cssModel();
376 if (!cssModel) { 376 if (!cssModel) {
377 callback(payload); 377 callback(payload);
378 return; 378 return;
379 } 379 }
380 cssModel.getInlineStylesAsync(node.id, inlineCallback); 380 cssModel.getInlineStylesAsync(node.id, inlineCallback);
381 cssModel.getMatchedStylesAsync(node.id, false, false, matchedCallback); 381 cssModel.getMatchedStylesAsync(node.id, false, false, matchedCallback);
382 382
383 /** 383 /**
384 * @param {?WebInspector.CSSStyleDeclaration} inlineStyle 384 * @param {?WebInspector.CSSStyleModel.InlineStyleResult} inlineStyleRes ult
385 * @param {?WebInspector.CSSStyleDeclaration} attributesStyle
386 */ 385 */
387 function inlineCallback(inlineStyle, attributesStyle) 386 function inlineCallback(inlineStyleResult)
388 { 387 {
389 payload.inlineStyle = /** @type {?WebInspector.CSSStyleDeclaration} */(inlineStyle); 388 if (!inlineStyleResult)
390 payload.attributesStyle = /** @type {?WebInspector.CSSStyleDeclarati on} */(attributesStyle); 389 return;
390 payload.inlineStyle = inlineStyleResult.inlineStyle;
391 payload.attributesStyle = inlineStyleResult.attributesStyle;
391 } 392 }
392 393
393 /** 394 /**
394 * @param {?*} matchedResult 395 * @param {?WebInspector.CSSStyleModel.MatchedStyleResult} matchedResult
395 */ 396 */
396 function matchedCallback(matchedResult) 397 function matchedCallback(matchedResult)
397 { 398 {
398 if (matchedResult) { 399 if (matchedResult) {
399 payload.matchedCSSRules = /** @type {?Array.<!WebInspector.CSSRu le>} */(matchedResult.matchedCSSRules); 400 payload.matchedCSSRules = matchedResult.matchedCSSRules;
400 payload.pseudoElements = /** @type {?Array.<{pseudoId: number, r ules: !Array.<!WebInspector.CSSRule>}>} */(matchedResult.pseudoElements); 401 payload.pseudoElements = matchedResult.pseudoElements;
401 payload.inherited = /** @type {?Array.<{matchedCSSRules: !Array. <!WebInspector.CSSRule>}>} */(matchedResult.inherited); 402 payload.inherited = matchedResult.inherited;
402 } 403 }
403 callback(payload); 404 callback(payload);
404 } 405 }
405 }, 406 },
406 407
407 /** 408 /**
408 * @param {boolean} editing 409 * @param {boolean} editing
409 */ 410 */
410 setEditingStyle: function(editing) 411 setEditingStyle: function(editing)
411 { 412 {
(...skipping 2730 matching lines...) Expand 10 before | Expand all | Expand 10 after
3142 * @constructor 3143 * @constructor
3143 */ 3144 */
3144 WebInspector.StylesSidebarPane.MatchedRulesPayload = function() 3145 WebInspector.StylesSidebarPane.MatchedRulesPayload = function()
3145 { 3146 {
3146 /** @type {?WebInspector.CSSStyleDeclaration} */ 3147 /** @type {?WebInspector.CSSStyleDeclaration} */
3147 this.inlineStyle = null; 3148 this.inlineStyle = null;
3148 /** @type {?WebInspector.CSSStyleDeclaration} */ 3149 /** @type {?WebInspector.CSSStyleDeclaration} */
3149 this.attributesStyle = null; 3150 this.attributesStyle = null;
3150 /** @type {?Array.<!WebInspector.CSSRule>} */ 3151 /** @type {?Array.<!WebInspector.CSSRule>} */
3151 this.matchedCSSRules = null; 3152 this.matchedCSSRules = null;
3152 /** @type {?Array.<{pseudoId: number, rules: !Array.<!WebInspector.CSSRule>} >} */ 3153 /** @type {?Array.<!WebInspector.CSSStyleModel.PseudoElementMatches>} */
3153 this.pseudoElements = null; 3154 this.pseudoElements = null;
3154 /** @type {?Array.<{matchedCSSRules: !Array.<!WebInspector.CSSRule>}>} */ 3155 /** @type {?Array.<!WebInspector.CSSStyleModel.InheritedMatches>} */
3155 this.inherited = null; 3156 this.inherited = null;
3156 } 3157 }
3157 3158
3158 WebInspector.StylesSidebarPane.MatchedRulesPayload.prototype = { 3159 WebInspector.StylesSidebarPane.MatchedRulesPayload.prototype = {
3159 /** 3160 /**
3160 * @return {boolean} 3161 * @return {boolean}
3161 */ 3162 */
3162 fulfilled: function() 3163 fulfilled: function()
3163 { 3164 {
3164 return !!(this.matchedCSSRules && this.pseudoElements && this.inherited) ; 3165 return !!(this.matchedCSSRules && this.pseudoElements && this.inherited) ;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
3239 3240
3240 /** 3241 /**
3241 * @override 3242 * @override
3242 * @return {?WebInspector.ToolbarItem} 3243 * @return {?WebInspector.ToolbarItem}
3243 */ 3244 */
3244 item: function() 3245 item: function()
3245 { 3246 {
3246 return this._button; 3247 return this._button;
3247 } 3248 }
3248 } 3249 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/elements/PlatformFontsWidget.js ('k') | Source/devtools/front_end/sdk/CSSStyleModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698