Reviewers: ecc, Description: Description: ============ Issue 3172 reports that sub menus do not line up with the ManuBar in IE when zoomed in: http://code.google.com/p/google-web-toolkit/issues/detail?id=3172
This is actually a much deeper issue where getAbsoluteLeft/Top() return incorrect values in IE while zoomed in. There are two types of zoom in IE: text zoom and page zoom. Text zoom enlarges the text size, and subsequently shifts the content on the page to a greater absoluteLeft/Top, and IE works fine in this case. Page zoom (the default) enlarges the content on the page AND maps top and left indexes to new coordinates. So, when a user zooms in to 200%, the absoluteLeft position of an element remains the same, but it appears twice as far to the left. Currently, GWT returns an absoluteLeft that reflects the screen position, not the logical position. Note that this bug also affects SuggestBox. Fix: ==== We now determine the zoom multiple in IE and divide by before returning the absoluteLeft coordinate. The DOCTYPE actually makes a difference. The following DOCTYPE (default in AppHtml.htmlsrc) works fine: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> However, adding the loose.dtd makes body.parentElement return the same size as body.element. The following DOCTYPE was used in the code-museum, so I changed it back to the DOCTYPE from AppHtml.htmlsrc. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> Testing: ======== Unfortunately, this isn't unit testable. I created a code museum test to check for this. Please review this at http://gwt-code-reviews.appspot.com/807 Affected files: reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/DefaultMuseum.java reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3172.java reference/code-museum/src/com/google/gwt/museum/public/DefaultMuseum.html reference/code-museum/src/com/google/gwt/museum/public/Museum.html reference/code-museum/src/com/google/gwt/museum/public/SingleIssue.html user/src/com/google/gwt/dom/client/DOMImplIE6.java --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
