Truly independent web browser
<!DOCTYPE html>
<script src="../../include.js"></script>
<style>
#reaction.before { background-color: red; }
#reaction.after { background-color: green; }
#hidden { display: none; }
#hidden-reaction.before { color: red; }
#hidden-reaction.after { color: green; }
</style>
<span id="reaction" class="before"></span>
<div id="bystander"></div>
<div id="hidden"><span id="hidden-reaction" class="before"></span></div>
<script>
test(() => {
const reaction = document.getElementById("reaction");
const bystander = document.getElementById("bystander");
const hiddenReaction = document.getElementById("hidden-reaction");
internals.updateStyle();
reaction.className = "after";
hiddenReaction.className = "after";
bystander.appendChild(document.createElement("span"));
internals.updateStyle();
const reactionColor = getComputedStyle(reaction).backgroundColor;
const hiddenReactionColor = getComputedStyle(hiddenReaction).color;
println("reaction color: " + reactionColor);
println("hidden reaction color: " + hiddenReactionColor);
});
</script>