godoc/static: replace innerHTML with textContent

Setting innerHTML is a more heavyweight operation that supports HTML.
What's being done here doesn't use HTML, so it's viable to use the more
lightweight textContent.

Change-Id: I46e9359ffe776001836cc09fea88b04364870db7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/235577
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
Rebecca Stambler 2020-05-28 11:50:37 -04:00
Родитель af9456bb63
Коммит 6be401e3f7
2 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -51,7 +51,7 @@ function initPlayground(transport) {
var sk = e.shiftKey || localStorage.getItem('play-shiftKey') === 'true';
if (running) running.Kill();
output.style.display = 'block';
outpre.innerHTML = '';
outpre.textContent = '';
run1.style.display = 'none';
var options = { Race: sk };
running = transport.Run(text(code), PlaygroundOutput(outpre), options);
@ -72,20 +72,20 @@ function initPlayground(transport) {
}
var run1 = document.createElement('button');
run1.innerHTML = 'Run';
run1.textContent = 'Run';
run1.className = 'run';
run1.addEventListener('click', onRun, false);
var run2 = document.createElement('button');
run2.className = 'run';
run2.innerHTML = 'Run';
run2.textContent = 'Run';
run2.addEventListener('click', onRun, false);
var kill = document.createElement('button');
kill.className = 'kill';
kill.innerHTML = 'Kill';
kill.textContent = 'Kill';
kill.addEventListener('click', onKill, false);
var close = document.createElement('button');
close.className = 'close';
close.innerHTML = 'Close';
close.textContent = 'Close';
close.addEventListener('click', onClose, false);
var button = document.createElement('div');

Различия файлов скрыты, потому что одна или несколько строк слишком длинны