Closed Bug 395823 Opened 17 years ago Closed 17 years ago

Javascript-css: getComputedStyle can't get the property border-color of an element

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 137688

People

(Reporter: sitomega, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6

GetComputedStyle doesn't work with border-color and returns null.
This is an example:
<html>
<head>
  <style type="text/css">
     #c { border-style:solid; border-width:2px; border-color:#ff0000; }
  </style>
  <script type="text/javascript">
    window.onload = function() {
      alert( document.defaultView.getComputedStyle(document.getElementById("c"), null).getPropertyValue("border-color") );
    }
  </script>
</head>
<body>
 <div id="c">Content</div>
</body>
</html>

Reproducible: Always

Steps to Reproduce:
1.Give a border color to an element
2.Try to get it by using getPropertyValue
3.Check the returned value; it should be null
Actual Results:  
The value is null.

Expected Results:  
The method should return the color.
border-color is a shorthand for the four properties border-[top|right|bottom|left]-color.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.