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

Side by Side Diff: Source/devtools/front_end/audits/AuditRules.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) 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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 * @param {!Array.<!DOMAgent.NodeId>=} nodeIds 979 * @param {!Array.<!DOMAgent.NodeId>=} nodeIds
980 */ 980 */
981 function getStyles(nodeIds) 981 function getStyles(nodeIds)
982 { 982 {
983 if (progress.isCanceled()) { 983 if (progress.isCanceled()) {
984 callback(null); 984 callback(null);
985 return; 985 return;
986 } 986 }
987 var targetResult = {}; 987 var targetResult = {};
988 988
989 function inlineCallback(inlineStyle, attributesStyle) 989 /**
990 * @param {?WebInspector.CSSStyleModel.InlineStyleResult} inlineStyl eResult
991 */
992 function inlineCallback(inlineStyleResult)
990 { 993 {
991 targetResult.inlineStyle = inlineStyle; 994 if (!inlineStyleResult)
992 targetResult.attributesStyle = attributesStyle; 995 return;
996 targetResult.inlineStyle = inlineStyleResult.inlineStyle;
997 targetResult.attributesStyle = inlineStyleResult.attributesStyle ;
993 } 998 }
994 999
995 function matchedCallback(result) 1000 /**
1001 * @param {?WebInspector.CSSStyleModel.MatchedStyleResult} matchedSt yleResult
1002 */
1003 function matchedCallback(matchedStyleResult)
996 { 1004 {
997 if (result) 1005 if (matchedStyleResult)
998 targetResult.matchedCSSRules = result.matchedCSSRules; 1006 targetResult.matchedCSSRules = matchedStyleResult.matchedCSS Rules;
999 } 1007 }
1000 1008
1001 if (!nodeIds || !nodeIds.length) 1009 if (!nodeIds || !nodeIds.length)
1002 doneCallback(); 1010 doneCallback();
1003 1011
1004 for (var i = 0; nodeIds && i < nodeIds.length; ++i) { 1012 for (var i = 0; nodeIds && i < nodeIds.length; ++i) {
1005 cssModel.getMatchedStylesAsync(nodeIds[i], false, false, matched Callback); 1013 cssModel.getMatchedStylesAsync(nodeIds[i], false, false, matched Callback);
1006 cssModel.getInlineStylesAsync(nodeIds[i], inlineCallback); 1014 cssModel.getInlineStylesAsync(nodeIds[i], inlineCallback);
1007 cssModel.getComputedStyleAsync(nodeIds[i], imageStylesReady.bind (null, nodeIds[i], targetResult, i === nodeIds.length - 1)); 1015 cssModel.getComputedStyleAsync(nodeIds[i], imageStylesReady.bind (null, nodeIds[i], targetResult, i === nodeIds.length - 1));
1008 } 1016 }
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 result.violationCount = badUrls.length; 1677 result.violationCount = badUrls.length;
1670 }, 1678 },
1671 1679
1672 _collectorCallback: function(matchingResourceData, request, cookie) 1680 _collectorCallback: function(matchingResourceData, request, cookie)
1673 { 1681 {
1674 matchingResourceData[request.url] = (matchingResourceData[request.url] | | 0) + cookie.size(); 1682 matchingResourceData[request.url] = (matchingResourceData[request.url] | | 0) + cookie.size();
1675 }, 1683 },
1676 1684
1677 __proto__: WebInspector.AuditRules.CookieRuleBase.prototype 1685 __proto__: WebInspector.AuditRules.CookieRuleBase.prototype
1678 } 1686 }
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorCSSAgent.cpp ('k') | Source/devtools/front_end/elements/MetricsSidebarPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698