[HtmlUnit] [htmlunit:bugs] #1899 Cannot calculate getOffsetHeight when having img after svg

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] [htmlunit:bugs] #1899 Cannot calculate getOffsetHeight when having img after svg

HtmlUnit - Dev mailing list

[bugs:#1899] Cannot calculate getOffsetHeight when having img after svg

Status: open
Group: 2.27
Created: Sun Jul 09, 2017 07:07 PM UTC by Christian Rösch
Last Updated: Sun Jul 09, 2017 07:07 PM UTC
Owner: nobody
Attachments:

Hi,

trying to automate some tasks I got the following exception which is (as far as I analyzed) caused by having an after a and then calling getOffsetHeight.

The cause IMO is

Caused by: java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.svg.SVGSVGElement cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1389)

for which I attached a diff to fix it. Generated with "$ svn diff" - hope that works for you :)

Exception in thread "main" ======= EXCEPTION START ========
Exception class=[java.lang.RuntimeException]
com.gargoylesoftware.htmlunit.ScriptException: Exception invoking getOffsetHeight
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:894)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:823)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:795)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2504)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2497)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeEventHandler(EventListenersContainer.java:289)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:309)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget.fireEvent(EventTarget.java:201)
    at com.gargoylesoftware.htmlunit.html.DomElement$2.run(DomElement.java:1375)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.html.DomElement.fireEvent(DomElement.java:1380)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1208)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:289)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPageIfPossible(BaseFrameElement.java:185)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPage(BaseFrameElement.java:123)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames(HtmlPage.java:1884)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:244)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:461)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:446)
    at [my application]
Caused by: java.lang.RuntimeException: Exception invoking getOffsetHeight
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:182)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject$GetterSlot.getValue(ScriptableObject.java:334)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.get(ScriptableObject.java:500)
    at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:83)
    at com.gargoylesoftware.htmlunit.javascript.host.Element.get(Element.java:520)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.getProperty(ScriptableObject.java:2387)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1500)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1494)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1253)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:800)
    at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:416)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:322)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3264)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:816)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:879)
    ... 28 more
Caused by: java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.svg.SVGSVGElement cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1389)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1408)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.getOffsetHeight(HTMLElement.java:1187)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:153)
    ... 43 more
Enclosed exception: 
java.lang.RuntimeException: Exception invoking getOffsetHeight
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:182)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject$GetterSlot.getValue(ScriptableObject.java:334)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.get(ScriptableObject.java:500)
    at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:83)
    at com.gargoylesoftware.htmlunit.javascript.host.Element.get(Element.java:520)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.getProperty(ScriptableObject.java:2387)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1500)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1494)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1253)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:800)
    at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:416)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:322)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3264)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:816)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:879)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:823)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:795)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2504)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2497)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeEventHandler(EventListenersContainer.java:289)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:309)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget.fireEvent(EventTarget.java:201)
    at com.gargoylesoftware.htmlunit.html.DomElement$2.run(DomElement.java:1375)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.html.DomElement.fireEvent(DomElement.java:1380)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1208)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:289)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPageIfPossible(BaseFrameElement.java:185)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPage(BaseFrameElement.java:123)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames(HtmlPage.java:1884)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:244)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:461)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:446)
    at [my application]
Caused by: java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.svg.SVGSVGElement cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1389)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1408)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.getOffsetHeight(HTMLElement.java:1187)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:153)
    ... 43 more

Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] [htmlunit:bugs] #1899 Cannot calculate getOffsetHeight when having img after svg

HtmlUnit - Dev mailing list
  • status: open --> accepted
  • assigned_to: RBRi

[bugs:#1899] Cannot calculate getOffsetHeight when having img after svg

Status: accepted
Group: 2.27
Created: Sun Jul 09, 2017 07:07 PM UTC by Christian Rösch
Last Updated: Sun Jul 09, 2017 07:07 PM UTC
Owner: RBRi
Attachments:

Hi,

trying to automate some tasks I got the following exception which is (as far as I analyzed) caused by having an after a and then calling getOffsetHeight.

The cause IMO is

Caused by: java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.svg.SVGSVGElement cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1389)

for which I attached a diff to fix it. Generated with "$ svn diff" - hope that works for you :)

Exception in thread "main" ======= EXCEPTION START ========
Exception class=[java.lang.RuntimeException]
com.gargoylesoftware.htmlunit.ScriptException: Exception invoking getOffsetHeight
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:894)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:823)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:795)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2504)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2497)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeEventHandler(EventListenersContainer.java:289)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:309)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget.fireEvent(EventTarget.java:201)
    at com.gargoylesoftware.htmlunit.html.DomElement$2.run(DomElement.java:1375)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.html.DomElement.fireEvent(DomElement.java:1380)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1208)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:289)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPageIfPossible(BaseFrameElement.java:185)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPage(BaseFrameElement.java:123)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames(HtmlPage.java:1884)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:244)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:461)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:446)
    at [my application]
Caused by: java.lang.RuntimeException: Exception invoking getOffsetHeight
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:182)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject$GetterSlot.getValue(ScriptableObject.java:334)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.get(ScriptableObject.java:500)
    at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:83)
    at com.gargoylesoftware.htmlunit.javascript.host.Element.get(Element.java:520)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.getProperty(ScriptableObject.java:2387)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1500)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1494)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1253)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:800)
    at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:416)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:322)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3264)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:816)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:879)
    ... 28 more
Caused by: java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.svg.SVGSVGElement cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1389)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1408)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.getOffsetHeight(HTMLElement.java:1187)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:153)
    ... 43 more
Enclosed exception: 
java.lang.RuntimeException: Exception invoking getOffsetHeight
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:182)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject$GetterSlot.getValue(ScriptableObject.java:334)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.get(ScriptableObject.java:500)
    at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:83)
    at com.gargoylesoftware.htmlunit.javascript.host.Element.get(Element.java:520)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.getProperty(ScriptableObject.java:2387)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1500)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1494)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1253)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:800)
    at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:416)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:322)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3264)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:816)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:879)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:823)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:795)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2504)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2497)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeEventHandler(EventListenersContainer.java:289)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:309)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget.fireEvent(EventTarget.java:201)
    at com.gargoylesoftware.htmlunit.html.DomElement$2.run(DomElement.java:1375)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.html.DomElement.fireEvent(DomElement.java:1380)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1208)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:289)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPageIfPossible(BaseFrameElement.java:185)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPage(BaseFrameElement.java:123)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames(HtmlPage.java:1884)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:244)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:461)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:446)
    at [my application]
Caused by: java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.svg.SVGSVGElement cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1389)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1408)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.getOffsetHeight(HTMLElement.java:1187)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:153)
    ... 43 more

Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] [htmlunit:bugs] #1899 Cannot calculate getOffsetHeight when having img after svg

HtmlUnit - Dev mailing list
In reply to this post by HtmlUnit - Dev mailing list
  • status: accepted --> closed
  • Comment:

Hi Christian,

many thanks for your report and the patch. The fix is in SVN. Give me a hint if you need a new SNAPSHOT build.


[bugs:#1899] Cannot calculate getOffsetHeight when having img after svg

Status: closed
Group: 2.27
Created: Sun Jul 09, 2017 07:07 PM UTC by Christian Rösch
Last Updated: Mon Jul 10, 2017 06:18 AM UTC
Owner: RBRi
Attachments:

Hi,

trying to automate some tasks I got the following exception which is (as far as I analyzed) caused by having an after a and then calling getOffsetHeight.

The cause IMO is

Caused by: java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.svg.SVGSVGElement cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1389)

for which I attached a diff to fix it. Generated with "$ svn diff" - hope that works for you :)

Exception in thread "main" ======= EXCEPTION START ========
Exception class=[java.lang.RuntimeException]
com.gargoylesoftware.htmlunit.ScriptException: Exception invoking getOffsetHeight
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:894)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:823)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:795)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2504)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2497)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeEventHandler(EventListenersContainer.java:289)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:309)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget.fireEvent(EventTarget.java:201)
    at com.gargoylesoftware.htmlunit.html.DomElement$2.run(DomElement.java:1375)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.html.DomElement.fireEvent(DomElement.java:1380)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1208)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:289)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPageIfPossible(BaseFrameElement.java:185)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPage(BaseFrameElement.java:123)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames(HtmlPage.java:1884)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:244)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:461)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:446)
    at [my application]
Caused by: java.lang.RuntimeException: Exception invoking getOffsetHeight
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:182)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject$GetterSlot.getValue(ScriptableObject.java:334)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.get(ScriptableObject.java:500)
    at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:83)
    at com.gargoylesoftware.htmlunit.javascript.host.Element.get(Element.java:520)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.getProperty(ScriptableObject.java:2387)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1500)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1494)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1253)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:800)
    at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:416)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:322)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3264)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:816)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:879)
    ... 28 more
Caused by: java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.svg.SVGSVGElement cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1389)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1408)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.getOffsetHeight(HTMLElement.java:1187)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:153)
    ... 43 more
Enclosed exception: 
java.lang.RuntimeException: Exception invoking getOffsetHeight
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:182)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject$GetterSlot.getValue(ScriptableObject.java:334)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.get(ScriptableObject.java:500)
    at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:83)
    at com.gargoylesoftware.htmlunit.javascript.host.Element.get(Element.java:520)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.getProperty(ScriptableObject.java:2387)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1500)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1494)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1253)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:800)
    at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:416)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:322)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3264)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:816)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:879)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:823)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:795)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2504)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2497)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeEventHandler(EventListenersContainer.java:289)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:309)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget.fireEvent(EventTarget.java:201)
    at com.gargoylesoftware.htmlunit.html.DomElement$2.run(DomElement.java:1375)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.html.DomElement.fireEvent(DomElement.java:1380)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1208)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:289)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPageIfPossible(BaseFrameElement.java:185)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPage(BaseFrameElement.java:123)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames(HtmlPage.java:1884)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:244)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:461)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:446)
    at [my application]
Caused by: java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.svg.SVGSVGElement cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1389)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1408)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.getOffsetHeight(HTMLElement.java:1187)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:153)
    ... 43 more

Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] [htmlunit:bugs] #1899 Cannot calculate getOffsetHeight when having img after svg

HtmlUnit - Dev mailing list
In reply to this post by HtmlUnit - Dev mailing list

Hi thanks for merging and improving the test :)

No, thanks - for development purpose I built the SNAPSHOT yesterday. So I'm all fine..


[bugs:#1899] Cannot calculate getOffsetHeight when having img after svg

Status: closed
Group: 2.27
Created: Sun Jul 09, 2017 07:07 PM UTC by Christian Rösch
Last Updated: Mon Jul 10, 2017 06:47 AM UTC
Owner: RBRi
Attachments:

Hi,

trying to automate some tasks I got the following exception which is (as far as I analyzed) caused by having an after a and then calling getOffsetHeight.

The cause IMO is

Caused by: java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.svg.SVGSVGElement cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1389)

for which I attached a diff to fix it. Generated with "$ svn diff" - hope that works for you :)

Exception in thread "main" ======= EXCEPTION START ========
Exception class=[java.lang.RuntimeException]
com.gargoylesoftware.htmlunit.ScriptException: Exception invoking getOffsetHeight
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:894)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:823)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:795)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2504)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2497)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeEventHandler(EventListenersContainer.java:289)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:309)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget.fireEvent(EventTarget.java:201)
    at com.gargoylesoftware.htmlunit.html.DomElement$2.run(DomElement.java:1375)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.html.DomElement.fireEvent(DomElement.java:1380)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1208)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:289)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPageIfPossible(BaseFrameElement.java:185)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPage(BaseFrameElement.java:123)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames(HtmlPage.java:1884)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:244)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:461)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:446)
    at [my application]
Caused by: java.lang.RuntimeException: Exception invoking getOffsetHeight
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:182)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject$GetterSlot.getValue(ScriptableObject.java:334)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.get(ScriptableObject.java:500)
    at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:83)
    at com.gargoylesoftware.htmlunit.javascript.host.Element.get(Element.java:520)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.getProperty(ScriptableObject.java:2387)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1500)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1494)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1253)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:800)
    at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:416)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:322)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3264)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:816)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:879)
    ... 28 more
Caused by: java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.svg.SVGSVGElement cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1389)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1408)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.getOffsetHeight(HTMLElement.java:1187)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:153)
    ... 43 more
Enclosed exception: 
java.lang.RuntimeException: Exception invoking getOffsetHeight
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:182)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject$GetterSlot.getValue(ScriptableObject.java:334)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.get(ScriptableObject.java:500)
    at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:83)
    at com.gargoylesoftware.htmlunit.javascript.host.Element.get(Element.java:520)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.getProperty(ScriptableObject.java:2387)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1500)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1494)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1253)
    at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:800)
    at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:416)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:322)
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3264)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:816)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:879)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:823)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:795)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2504)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunction(HtmlPage.java:2497)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeEventHandler(EventListenersContainer.java:289)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:309)
    at com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget.fireEvent(EventTarget.java:201)
    at com.gargoylesoftware.htmlunit.html.DomElement$2.run(DomElement.java:1375)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:637)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:518)
    at com.gargoylesoftware.htmlunit.html.DomElement.fireEvent(DomElement.java:1380)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1208)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:289)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPageIfPossible(BaseFrameElement.java:185)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPage(BaseFrameElement.java:123)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames(HtmlPage.java:1884)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:244)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:529)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:313)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:461)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:446)
    at [my application]
Caused by: java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.svg.SVGSVGElement cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1389)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1408)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
    at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
    at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.getOffsetHeight(HTMLElement.java:1187)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:153)
    ... 43 more

Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop