[prev in list] [next in list] [prev in thread] [next in thread] 

List:       htmlunit-develop
Subject:    [HtmlUnit] [ htmlunit-Bugs-3478204 ] getBoundingClientRect not supported
From:       SourceForge.net <noreply () sourceforge ! net>
Date:       2012-01-25 21:37:58
Message-ID: E1RqAXY-00077d-VK () sfs-ml-1 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Bugs item #3478204, was opened at 2012-01-23 21:40
Message generated for change (Comment added) made by jevonwright
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=3478204&group_id=47038

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: Accepted
Priority: 5
Private: No
Submitted By: Jevon Wright (jevonwright)
Assigned to: RBRi (rbri)
Summary: getBoundingClientRect not supported

Initial Comment:
I'm using HtmlUnit 2.9 with JWebUnit 3.0, and I am trying to test a web application \
that uses YUI 2.9.0. However, when trying to access the site, the following exception \
occurs:

com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function \
getBoundingClientRect in object [object HTMLDivElement]. \
(http://localhost:8080/share/res/js/yui-common.js#11)  at \
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:595) \
~[htmlunit-2.9.jar:2.9]  at \
net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537) \
~[htmlunit-core-js-2.9.jar:na]  at \
net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538) \
~[htmlunit-core-js-2.9.jar:na]  at \
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:545) \
~[htmlunit-2.9.jar:2.9]

This problem has already been noticed on a clone of HtmlUnit, with a fairly simple \
fix: https://github.com/jenkinsci/htmlunit/commit/dde9b5fe3a6739e8a9a6976a20b5ea78c769fd7d


In particular, "YUI 2.9.0 dom module uses getBoundingClientRect. HtmlUnit defines \
this to be IE only, but YUI doesn't make any defensive check. \
http://www.quirksmode.org/dom/w3c_cssom.html also indicates that this method is \
available on all the browsers, so I'm making this available in all the \
configurations."

Is there any workaround to this? If I add the linked patch manually and rebuild \
HtmlUnit from source using Maven, do you think this exception will disappear?

----------------------------------------------------------------------

> Comment By: Jevon Wright (jevonwright)
Date: 2012-01-25 13:37

Message:
Thanks again for looking into this. I just had to install Maven anyway, so
I might just build HtmlUnit myself. I'll reopen this if the bug is still
there. Thanks :)

----------------------------------------------------------------------

Comment By: RBRi (rbri)
Date: 2012-01-24 23:39

Message:
Ok, did some more checks. We already have unit test for this. But the jar
you downloaded is to old. But there is no newer build for download, because
of some problem with our CI build. It will take some time to fix the
build.
If you like, you can make your own using maven. Or you have to wait a
bit...

And yes our fix is different from the jenkinsci one,

----------------------------------------------------------------------

Comment By: RBRi (rbri)
Date: 2012-01-24 23:22

Message:
Ok, please give me some time for writing some tests.

----------------------------------------------------------------------

Comment By: Jevon Wright (jevonwright)
Date: 2012-01-24 15:14

Message:
Thanks for looking into it. I did look into the sources and initially it
didn't look like it was fixed, at least not in the way that jenkinsci fixed
it.

I just updated my HtmlUnit JARs to 2.10-SNAPSHOT-with-dependencies from
http://build.canoo.com/htmlunit/artifacts/ (1,024,400 bytes, modified
2011-12-19), and I still get the following error:

12697 [JS executor for com.gargoylesoftware.htmlunit.WebClient@4adf2940]
ERROR c.g.h.j.b.JavaScriptJobManagerImpl - Job run failed with unexpected
RuntimeException: TypeError: Cannot find function getBoundingClientRect in
object [object HTMLDivElement].
(http://localhost:8080/share/res/js/yui-common.js#11) 
com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find
function getBoundingClientRect in object [object HTMLDivElement].
(http://localhost:8080/share/res/js/yui-common.js#11)
	at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:584)
 ~[htmlunit-2.10-SNAPSHOT.jar:2.10-SNAPSHOT]
	at
net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)
~[htmlunit-core-js-2.10-SNAPSHOT.jar:na]
	at
net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)
 ~[htmlunit-core-js-2.10-SNAPSHOT.jar:na]
	at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:534)
 ~[htmlunit-2.10-SNAPSHOT.jar:2.10-SNAPSHOT]
	at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:509)
 ~[htmlunit-2.10-SNAPSHOT.jar:2.10-SNAPSHOT]
	at
com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:902)
 ~[htmlunit-2.10-SNAPSHOT.jar:2.10-SNAPSHOT]
	at
com.gargoylesoftware.htmlunit.javascript.background.JavaScriptFunctionJob.runJavaScript(JavaScriptFunctionJob.java:53)
 ~[htmlunit-2.10-SNAPSHOT.jar:2.10-SNAPSHOT]
	at
com.gargoylesoftware.htmlunit.javascript.background.JavaScriptExecutionJob.run(JavaScriptExecutionJob.java:101)
 ~[htmlunit-2.10-SNAPSHOT.jar:2.10-SNAPSHOT]
	at
com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl.runSingleJob(JavaScriptJobManagerImpl.java:324)
 ~[htmlunit-2.10-SNAPSHOT.jar:2.10-SNAPSHOT]
	at
com.gargoylesoftware.htmlunit.javascript.background.DefaultJavaScriptExecutor.run(DefaultJavaScriptExecutor.java:153)
 [htmlunit-2.10-SNAPSHOT.jar:2.10-SNAPSHOT]
	at java.lang.Thread.run(Unknown Source) [na:1.6.0_25]
Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError:
Cannot find function getBoundingClientRect in object [object
HTMLDivElement]. (http://localhost:8080/share/res/js/yui-common.js#11)
	at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3790)
 ~[htmlunit-core-js-2.10-SNAPSHOT.jar:na]
	at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3768)
 ~[htmlunit-core-js-2.10-SNAPSHOT.jar:na]
	at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3796)
 ~[htmlunit-core-js-2.10-SNAPSHOT.jar:na]
	at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3815)
 ~[htmlunit-core-js-2.10-SNAPSHOT.jar:na]
	at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3885)
 ~[htmlunit-core-js-2.10-SNAPSHOT.jar:na]
	at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2363)
 ~[htmlunit-core-js-2.10-SNAPSHOT.jar:na]
	at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2315)
 ~[htmlunit-core-js-2.10-SNAPSHOT.jar:na]
	at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getElemFunctionAndThis(ScriptRuntime.java:2267)
 ~[htmlunit-core-js-2.10-SNAPSHOT.jar:na]

Are the built snapshots not up-to-date?

----------------------------------------------------------------------

Comment By: RBRi (rbri)
Date: 2012-01-24 01:33

Message:
Did a check with the sources. This is already fixed. Please use the latest
snapshot (don't forget to update the dependent libs also).

----------------------------------------------------------------------

Comment By: RBRi (rbri)
Date: 2012-01-24 01:24

Message:
Will fix that in the next days. It is a bit more work than changing the
configuration because i have to work on the unit tests also.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=3478204&group_id=47038

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
HtmlUnit-develop mailing list
HtmlUnit-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic