getComputedStyle text-decoration inherit
- by Guilherme Nascimento
getComputedStyle fails to get text-decoration property inherited, but can get font-size.
Failed in Firefox 25 and GoogleChrome 30.
Note: In Internet Explorer 10 work!
<!DOCTYPE html>
<html>
<style>
#parent
{
font-size: 38px;
text-decoration: underline;
}
</style>
<body>
<div id="parent">
<p id="child">Test</p>
</div>
<script>
var elem = document.getElementById("child");
document.write("text-decoration:"+window.getComputedStyle(elem).getPropertyValue("text-decoration"));
document.write("<br>");
document.write("text-decoration:"+document.defaultView.getComputedStyle(elem).getPropertyValue("text-decoration"));
document.write("<hr>");
document.write("font-size:"+window.getComputedStyle(elem).getPropertyValue("font-size"));
document.write("<br>");
document.write("font-size:"+document.defaultView.getComputedStyle(elem).getPropertyValue("font-size"));
</script>
</body>
</html>
It is a fault of mine, or browsers that failed?