<!DOCTYPE html>
<body>
<style scoped>span { color: red; }</style>
<div><span></span></div>
<script>
var div = document.querySelector("div");
div.remove();
getComputedStyle(div.firstChild, "").color;
</script>