Re: Proposal: getStyleAs(property, primitiveValue)

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