Re: RegExp for hyphen to camelCase?
- From: Martin Honnen <mahotrash@xxxxxxxx>
- Date: Thu, 21 Jul 2005 16:38:43 +0200
Michael Winter wrote:
On 21/07/2005 14:10, Martin Honnen wrote:
so in Mozilla and Opera you can do return window.getComputedStyle(el, '')[prop]
You could but the global object has never been defined as an instance of the AbstractView interface. I would use the slightly longer, but better defined route through the document object:
document.defaultView.getComputedStyle(...)
Right, I was mainly following Rob's code and only changing the part after the getComputedStyle. I have myself pointed out that document.defaultView and window don't have to be the same as far as the W3C DOM says but as far as Mozilla goes Brendan Eich himself said the current behaviour is not going to be changed:
<http://groups-beta.google.com/group/netscape.public.mozilla.dom/msg/aa219bf41334c22e?hl=en&>
And the current WHAT WG drafts also try to ensure that the current praxis that browsers implement document.defaultView as the window object becomes standardized:
<http://www.whatwg.org/specs/web-apps/current-work/#documentwindow>
so it seems pretty safe to do window.getComputedStyle.
Neither Safari nor Konqueror support the getComputedStyle method. Though it exists as a property of the defaultView object in Konqueror, it always returns null.
Ouch, one more case for not only checking for the existance of a method in the DOM but to check for the result too.
--
Martin Honnen http://JavaScript.FAQTs.com/ .
- Follow-Ups:
- Re: RegExp for hyphen to camelCase?
- From: RobG
- Re: RegExp for hyphen to camelCase?
- References:
- RegExp for hyphen to camelCase?
- From: RobG
- Re: RegExp for hyphen to camelCase?
- From: Martin Honnen
- Re: RegExp for hyphen to camelCase?
- From: Michael Winter
- RegExp for hyphen to camelCase?
- Prev by Date: redirect
- Next by Date: Re: Select list without a helper button
- Previous by thread: Re: RegExp for hyphen to camelCase?
- Next by thread: Re: RegExp for hyphen to camelCase?
- Index(es):
Relevant Pages
|