W3C home > Mailing lists > Public > www-style@w3.org > February 2013

Re: [cssom] Proposal for obtaining robust style information via Javascript - getStyle()

From: Mike Sherov <mike.sherov@gmail.com>
Date: Thu, 31 Jan 2013 21:02:30 -0500
Message-ID: <CAD1Dv_+w4USNBr5S8D7tdfzsnezRtxNcbYmy1bnNnJF_w2AABw@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: "www-style@w3.org" <www-style@w3.org>
Boris,

I believe the proposal is a bit broader, but I'll take any interest :-) I
believe is what we're talking about, so you can get "used", "computed",
"specified", "resolved", "actual", "initial", "default" or any other value
type for a CSS property or an element

elem.getStyle( prop, type[, psuedoElem] )

Examples:
<div style="width:100px;"><div id="aDiv"
style="margin:auto;width:50%;"></div></div>

document.getElementById("aDiv").getStyle("marginLeft", "used"); //25px
document.getElementById("aDiv").getStyle("marginLeft", "computed"); //auto
document.getElementById("aDiv").getStyle("width", "used"); //50px
document.getElementById("aDiv").getStyle("width", "computed"); //50%
document.getElementById("aDiv").getStyle("display", "specified"); //""
document.getElementById("aDiv").getStyle("display", "computed"); //block
document.getElementById("aDiv").getStyle("display", "default"); //block


On Thu, Jan 31, 2013 at 8:43 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 1/31/13 8:18 PM, Tab Atkins Jr. wrote:
>
>> Next step is figuring out if there is implementor interest in exposing
>> this information, and then someone writing it up in the CSSOM spec.
>>
>
> This information being specified/cascaded style values?
>
> There's certainly interest from me.  ;)
>
> -Boris
>
>


-- 
Mike Sherov
Lead Developer
SNAP Interactive, Inc.
Ticker: STVI.OB
Received on Friday, 1 February 2013 02:03:18 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:05 GMT