[devtools] Clean up utilities
This patch simplifies some utility methods by applying the following
changes:
1) `type=text/css` is the implicit default for <style> elements and for
<link rel=stylesheet>. Thus, we should omit it in those cases.
This additionally reduces visual clutter in various places,
including the elements pane when inspecting DevTools using DevTools.
2) Prefer `const` over `let` even in dynamically generated scripts,
matching Google's JS style guide.
3) Simplify `leadZero` by leveraging `String.prototype.padStart`, which
shipped in Chrome 51.
BUG=v8:9396
Change-Id: I50d0b88ff9c9c2791a194d2f50445e4a561e3a23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1803929Reviewed-by:
Yang Guo <yangguo@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697104}
Showing
Please register or sign in to comment