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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js

Issue 2455943003: Backend for css rule tracking (Closed)
Patch Set: Created 4 years, 1 month 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 * @param {!Array<string>=} backgroundColors 573 * @param {!Array<string>=} backgroundColors
574 * @return {?Array<string>} 574 * @return {?Array<string>}
575 */ 575 */
576 function backgroundColorsCallback(error, backgroundColors) { 576 function backgroundColorsCallback(error, backgroundColors) {
577 return !error && backgroundColors ? backgroundColors : null; 577 return !error && backgroundColors ? backgroundColors : null;
578 } 578 }
579 return this._agent.getBackgroundColors(nodeId, backgroundColorsCallback) ; 579 return this._agent.getBackgroundColors(nodeId, backgroundColorsCallback) ;
580 }, 580 },
581 581
582 /** 582 /**
583 * @param {boolean} enable
584 */
585 startSelectorRecording: function(enable)
586 {
587 this._agent.setSelectorRecording(enable);
588 },
589
590 /**
591 * @return {!Promise<?Array<?WebInspector.CSSStyleRule>>}
592 */
593 ruleListPromise: function()
594 {
595 /**
596 * @param {?string} error
597 * @param {!Array<!CSSAgent.CSSRule>=} usedCSSRules
598 * @this {WebInspector.CSSModel}
599 * @return {?Array<?WebInspector.CSSStyleRule>}
600 */
601 function usedRulesCallback(error, usedCSSRules)
602 {
603 if (error || !usedCSSRules)
604 return null;
605
606 // Workaround presubmit errors for not using @this in the function
607 var self = this;
caseq 2016/10/27 20:59:56 You no longer need this one, I fixed the jsdoc val
valih 2016/10/27 21:41:17 Done.
608 return usedCSSRules.map(rule => new WebInspector.CSSStyleRule(self, rule, rule.status));
609 }
610 return this._agent.getRuleList(usedRulesCallback.bind(this));
611 },
612
613 /**
583 * @param {number} nodeId 614 * @param {number} nodeId
584 * @return {!Promise.<?Array.<!CSSAgent.PlatformFontUsage>>} 615 * @return {!Promise.<?Array.<!CSSAgent.PlatformFontUsage>>}
585 */ 616 */
586 platformFontsPromise: function(nodeId) 617 platformFontsPromise: function(nodeId)
587 { 618 {
588 /** 619 /**
589 * @param {?Protocol.Error} error 620 * @param {?Protocol.Error} error
590 * @param {?Array.<!CSSAgent.PlatformFontUsage>} fonts 621 * @param {?Array.<!CSSAgent.PlatformFontUsage>} fonts
591 * @return {?Array.<!CSSAgent.PlatformFontUsage>} 622 * @return {?Array.<!CSSAgent.PlatformFontUsage>}
592 */ 623 */
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 /** 1280 /**
1250 * @constructor 1281 * @constructor
1251 * @param {?WebInspector.CSSStyleDeclaration} inlineStyle 1282 * @param {?WebInspector.CSSStyleDeclaration} inlineStyle
1252 * @param {?WebInspector.CSSStyleDeclaration} attributesStyle 1283 * @param {?WebInspector.CSSStyleDeclaration} attributesStyle
1253 */ 1284 */
1254 WebInspector.CSSModel.InlineStyleResult = function(inlineStyle, attributesStyle) 1285 WebInspector.CSSModel.InlineStyleResult = function(inlineStyle, attributesStyle)
1255 { 1286 {
1256 this.inlineStyle = inlineStyle; 1287 this.inlineStyle = inlineStyle;
1257 this.attributesStyle = attributesStyle; 1288 this.attributesStyle = attributesStyle;
1258 }; 1289 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698