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

Unified Diff: Source/devtools/front_end/ui/UIUtils.js

Issue 1076453004: Show reasons why nodes are ignored in accessibility sidebar (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add a catch-all return to ignoredReasonName Created 5 years, 8 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
« no previous file with comments | « Source/devtools/front_end/elements/ElementsSidebarPane.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/UIUtils.js
diff --git a/Source/devtools/front_end/ui/UIUtils.js b/Source/devtools/front_end/ui/UIUtils.js
index 1ca572b7b1038fc2998e3a6c22d8746826cfcc81..8046fbec2972e40cb1ab51841e69c7df835c80ec 100644
--- a/Source/devtools/front_end/ui/UIUtils.js
+++ b/Source/devtools/front_end/ui/UIUtils.js
@@ -563,14 +563,28 @@ Number.withThousandsSeparator = function(num)
/**
* @param {string} format
* @param {?ArrayLike} substitutions
- * @param {!Object.<string, function(string, ...):*>} formatters
- * @param {string} initialValue
- * @param {function(string, string): ?} append
- * @return {!{formattedResult: string, unusedSubstitutions: ?ArrayLike}};
+ * @param {?string} initialValue
+ * @return {!Element}
*/
-WebInspector.formatLocalized = function(format, substitutions, formatters, initialValue, append)
+WebInspector.formatLocalized = function(format, substitutions, initialValue)
{
- return String.format(WebInspector.UIString(format), substitutions, formatters, initialValue, append);
+ var element = createElement("span");
+ var formatters = {
+ s: function(substitution)
+ {
+ return substitution;
+ }
+ };
+ function append(a, b)
+ {
+ if (typeof b === "string")
+ b = createTextNode(b);
+ else if (b.shadowRoot)
+ b = createTextNode(b.shadowRoot.lastChild.textContent);
+ element.appendChild(b);
+ }
+ String.format(WebInspector.UIString(format), substitutions, formatters, initialValue, append);
+ return element;
}
/**
« no previous file with comments | « Source/devtools/front_end/elements/ElementsSidebarPane.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698