[HtmlUnit] [htmlunit:bugs] #1986 getPosX, getPosY, getBoundingClientRect return incorrect values
RBRi via HtmlUnit-develop <[email protected]> Wed, 24 Oct 2018 18:29:31 -0000
| Newsgroups | gmane.comp.java.htmlunit.devel |
|---|---|
| Message-ID | </p/htmlunit/bugs/1986/7d799bd9706b7969d9b94bc39ba6d7be73552bae.bugs@htmlunit.p.sourceforge.net> |
It will be great if you can help a bit with this. The whole source code is on github, i hope you are able to checkout the code. To do some more layout fixes i need simple test cases pointing to a simple problem. Maybe you can reduce your sampe step by step to find the first real isolated problem. Than you can create a new test case (have a look at this commit https://github.com/HtmlUnit/htmlunit/commit/90bc9caf824ae71d7c2715b89e734d8d37e9a7c0) and make pull requests out of this (or patches if you like).
Usually nailing down the problem list the most time consuming task, having this simple test cases will really help.
Thanks for your support
---
** [bugs:#1986] getPosX, getPosY, getBoundingClientRect return incorrect values**
**Status:** pending
**Group:** 2.32
**Created:** Thu Aug 23, 2018 08:39 AM UTC by Bogdan
**Last Updated:** Wed Oct 24, 2018 06:06 PM UTC
**Owner:** RBRi
Im running htmlunit 2.32, all dependecies are checked.
To reproduce I compare GoogleChrome console result with the HmlUnit:
load for test the HTML page at:
https://www.le.ac.uk/oerresources/bdra/html/page_09.htm
In Google Chrome Console run:
document.getElementById("toc").getBoundingClientRect()
result:
DOMRect {x: 1, y: 63.609375, width: 180, height: 458.609375, top: 63.609375, …}
bottom:522.21875
height:458.609375
left:1
right:181
top:63.609375
width:180
x:1
y:63.609375
In HtmlUnit:
webClient = new WebClient(BrowserVersion.CHROME));
webClient.getOptions().setJavaScriptEnabled(true);
webClient.getOptions().setRedirectEnabled(true);
webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);
webClient.getOptions().setThrowExceptionOnScriptError(false);
webClient.setRefreshHandler(new RefreshHandler() {
public void handleRefresh(Page page, URL url, int seconds) throws IOException {
}
});
webClient.getOptions().setCssEnabled(true);
webClient.getOptions().setTimeout(timeout * 1000);
webClient.setJavaScriptTimeout(1000);
Page somepage = webClient.getPage(url);
then:
HtmlDivision div = (HtmlDivision) page.getElementById("toc");
ClientRect rect = ((HTMLElement) (div).getScriptableObject()).getBoundingClientRect();
rect values:
bottom: 90
left: 9195
right : 10451
top: 90
getPosX and GetPosY return:
x: 9195
y: 90
---
Sent from sourceforge.net because [email protected] 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.
_______________________________________________
HtmlUnit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop