1
0
mirror of https://github.com/golang/go synced 2024-09-30 12:28:35 -06:00

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
parent af9456bb63
commit 6be401e3f7
2 changed files with 6 additions and 6 deletions

View File

@ -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');

File diff suppressed because one or more lines are too long