Chromium Code Reviews| Index: ui/webui/resources/js/util.js |
| diff --git a/ui/webui/resources/js/util.js b/ui/webui/resources/js/util.js |
| index 28a60d2ce1378e6c9609170c4aad62c3d547c856..599dc033b1c8532514791f46ef70b6525aa6b9ff 100644 |
| --- a/ui/webui/resources/js/util.js |
| +++ b/ui/webui/resources/js/util.js |
| @@ -10,6 +10,9 @@ |
| * @return {HTMLElement} The found element or null if not found. |
| */ |
| function $(id) { |
| + // Disable getElementById restriction here, since we are instructing other |
| + // places to re-use the $() that is defined here. |
| + // eslint-disable-next-line no-restricted-properties |
| var el = document.getElementById(id); |
| return el ? assertInstanceof(el, HTMLElement) : null; |
| } |
| @@ -22,7 +25,7 @@ function $(id) { |
| * @return {Element} The found element or null if not found. |
| */ |
| function getSVGElement(id) { |
| - var el = document.getElementById(id); |
| + var el = $(id); |
|
dpapad
2017/06/06 19:25:51
Well, that was the culprit for the failing tests.
|
| return el ? assertInstanceof(el, Element) : null; |
| } |