Closed Bug 889091 Opened 8 years ago Closed 5 years ago

getComputedStyle does not provide aggregate styles for border, background etc.

Categories

(Core :: DOM: CSS Object Model, defect)

25 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 137688

People

(Reporter: amitamb, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:25.0) Gecko/20130701 Firefox/25.0 (Nightly/Aurora)
Build ID: 20130701031115

Steps to reproduce:

1. Create an HTML page with with an element(div#d1) having some styles
#d1{
  background:Red;border:1px solid #444;
}
2. Check for computed style properties background and border for the element using getComputedStyle

http://jsbin.com/izocaj/6/edit


Actual results:

getComputedStyle returned with stylesheet object having blank values for background and border
Only constituent values of styles got set i.e. backgroundColor, borderTopWidth, borderTopColor, borderTopStyle and so on...


Expected results:

background should have aggregate values calculated from all assigned background properties which wold be "rgb(255, 0, 0) none repeat scroll 0% 0% / auto padding-box border-box" here
border should have aggregate value of assigned border values wherever possible and here specifically it should have returned "1px solid rgb(68, 68, 68)" or shouldd set border<direction> property with aggregate values
It works as expected in Chrome 27.0.1453.116
Component: Untriaged → DOM: CSS Object Model
Product: Firefox → Core
I thought the spec required that these be empty, but I can't find any such requirement, so I guess my memory was probably wrong.
Your memory is not quite wrong.  getPropertyCSSValue is required to return null for these, and we implement getPropertyValue in terms of getPropertyCSSValue.
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 137688
You need to log in before you can comment on or make changes to this bug.