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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 31 Jan 2013 22:06:25 -0800
Message-ID: <CAAWBYDB91jerSeHigNyefD9tr1pdBudGMmqTkCKhHzPth7JTxw@mail.gmail.com>
To: "L. David Baron" <dbaron@dbaron.org>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, www-style list <www-style@w3.org>
On Thu, Jan 31, 2013 at 7:15 PM, L. David Baron <dbaron@dbaron.org> wrote:
> On Thursday 2013-01-31 18:23 -0800, Tab Atkins Jr. wrote:
>> On Thu, Jan 31, 2013 at 6:21 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
>> > On 1/31/13 9:11 PM, Tab Atkins Jr. wrote:
>> >> In that case, let's get this done.  Francois' outline of a solution
>> >> earlier in this thread sounds great to me.  The only thing I'd change
>> >> is to make the property name optional too, in which case it's
>> >> identical to calling getComputedStyle() on the element.
>> >
>> > So it returns a string if you pass in the property name but a random live
>> > object if you don't?
>> Wait, getComputedStyle is a live object?  Jeezus.  Nah, let's just
>> return a dead object.  It's for when you do need to request multiple
> Returning a dead object would be substantially more expensive in
> many cases.
> For example, today getComputedStyle(elt, "").color doesn't require
> flushing layout.  If getComputedStyle() returned a dead object, it
> would require flushing layout, and also making lots of copies.
> (This is one of the contexts where returning a live object is much
> simpler than returning a dead one.  Some contexts are the other way
> around.)

You and Boris are giving me conflicting information about which is
better.  Decide amongst yourselves, and I'll go with it. ^_^

Received on Friday, 1 February 2013 06:07:12 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:08 UTC