W3C home > Mailing lists > Public > www-style@w3.org > September 2009

Re: Proposal: getStyleAs(property, primitiveValue)

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Thu, 24 Sep 2009 11:45:51 -0700
Message-ID: <c9e12660909241145r4eb72906p6016610a67ddba86@mail.gmail.com>
To: Øyvind Stenhaug <oyvinds@opera.com>
Cc: www-style <www-style@w3.org>
On Thu, Sep 24, 2009 at 2:01 AM, Øyvind Stenhaug <oyvinds@opera.com> wrote:
> On Wed, 23 Sep 2009 23:02:54 +0200, Garrett Smith <dhtmlkitchen@gmail.com>
> wrote:
>
>> How does a program obtain a reference to an "abstract view" besides
>> document.defaultView?
>
> The assumption seems to be that the global object implements AbstractView,
> otherwise, how would 'document' give a reference to an implementation of
> DocumentView?
>

document is a property of window. It has been that way for many years
before there was ever an AbstractView.

AbstractView is relatively new, in contrast to nonstandard window and
its "document" property.

>> The DOM 2 spec does not say that there is a global function
>> "getComputedStyle". Why rely on it?
>
> Well, I can't find any place where it says that there is a global "document"
> either.
>

document is a property of window. Although window is not standard, a
scriptable web browser with no window and no document object would
fail on a majority of sites.

>>>> A corresponding method to set a value would not seem to be necessary,
>>>> as any value could be set with:
>>>>
>>>> x.style.color = "papayawhip";
>>>
>>> Well, not if there's an !important color declaration somewhere that
>>> affects
>>> x.
>>
>> OK. What are you getting at?
>
> Just pointing out that it doesn't always work, nothing more.
>

OK :-)

Garrett
Received on Thursday, 24 September 2009 18:46:31 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:39 UTC