I guess the latest snapshot (which I have) is not 2.6 - my bad! The manifest in 
the webtest.jar shows build R_1708.
Anyway, window.getComputedStyle is only supported in Firefox mode, so I had to 
add a config step to setup the User-Agent (see below). Now that works - no more 
errors. On to the next problem!

<config>
    <header name="User-Agent" value="Mozilla/5.0 (X11; U; Linux i686; en-US; 
rv:1.8.1.11) Gecko/20061201 Firefox/2.0.0.11 (Ubuntu-feisty)" />
</config>


----- Original Message ----
From: Marc Guillemot <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, June 17, 2008 1:21:37 AM
Subject: Re: [Webtest] browser specific JavaScript

W C wrote:
> I'm running version 2.6 and HtmlUnit 2.1.

surely not: they are not compatible ;-)

> The third party library is actually a spell checker - JSpell Evolution.
> It modifies the page in different ways to insert its component,
> depending on what type of browser it thinks is running. If it detects a
> window.getComputedStyle function, then it uses it and modifies styles by
> appending raw HTML. Otherwise, it uses element.currentStyle and modifies
> styles by manipulating the document.styleSheets object. The problem is
> that it doesn't detect window.getComputedStyle, but the other path uses
> IE specific calls (styleSheet.addRule), which are not supported by
> HtmlUnit either..
> 
> So, it seems we need an implementation of window.getComputedStyle or
> styleSheet.addRule in HtmlUnit.

window.getComputedStyle is supported since 1.14 but you are right,
addRule is not yet supported.

Cheers,
Marc.
-- 
Blog: http://mguillem.wordpress.com

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest



      

Reply via email to