Closed Bug 911906 Opened 12 years ago Closed 12 years ago

Add an API for getting the authored value of a CSS property

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 731271

People

(Reporter: sebo, Unassigned)

Details

The Firebug Working Group wants to allow users to see the original values of their CSS properties.[1] We're currently trying to get this info via inIDOMUtils.getRuleLine() and inIDOMUtils.getRuleColumn() from a cached version of the originally requested CSS. Though this has several downsides: 1. We still have to parse the cached text by our own to get the properties, which isn't trivial and pretty error-prone. 2. Having to do a lot of extra steps to get the authored value is slow. 3. Extra work needs to be done to get the original values coming from other sources than CSS requested via the network, e.g. set via '<element>.style.<property>'. So there should be an API introduced that allows to get the authored value of a CSS property. Test cases: CSS defined within a file: See the test case of the Firebug issue[1]. CSS defined via appending a <style> tag: 1. Open the Web Console (Ctrl+Shift+K) on this page 2. Type the following into the command line and hit Enter: style = document.createElement("style") style.type = "text/css" style.textContent = "#short_desc_nonedit_display { color: #f00; }"; document.body.appendChild(style) 3. Call the (not yet existing) API => The API should return '#f00'. CSS defined via .style: 1. Open the Web Console (Ctrl+Shift+K) on this page 2. Type "document.getElementById('short_desc_nonedit_display').style.color = '#00f'" (without outer quotes) into the command line and hit Enter 3. Call the (not yet existing) API => The API should return '#00f'. Sebastian [1] http://code.google.com/p/fbug/issues/detail?id=5507
Hww is this different from bug 731271?
Flags: needinfo?(sebastianzartner)
Sounds like it's not. I should get back to that bug soon...
Yes, it's a duplicate of bug 731271. I obviously didn't find that one, because I was searching for "api" as keyword. Sebastian
Flags: needinfo?(sebastianzartner)
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.