#10020 closed defect (fixed)
[patch][ccla]IE: dojo.position failing with dojo.withGlobal
Reported by: | Douglas Hays | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | Core | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
When you run dojo.position with a different window context via withGlobal, you often get incorrect x/y values which is causing several rendering problems.
There are 2 separate problems:
1) dojo.isQuirks is used by dojo.position, but this is not reset when withDoc is called, causng position() to use the wrong computations.
2) if isQuirks is true, position() subtracts clientLeft/Top but offsetLeft/Top should also be subtracted since these values can be nonzero when padding is applied to HTML elements.
Technically, position() could recompute its own isQuirks variable if we don't want to fix withDoc. I'd like to get this fixed for 1.4 since its breaking dijit.scrollIntoView.
Attachments (6)
Change History (14)
Changed 11 years ago by
Attachment: | absBug.html added |
---|
Changed 11 years ago by
Attachment: | absBugIframe.html added |
---|
iframe source file loaded by main test file
comment:1 Changed 11 years ago by
Summary: | IE: dojo.position failing with dojo.withGlobal → [patch][ccla]IE: dojo.position failing with dojo.withGlobal |
---|
comment:2 Changed 11 years ago by
Milestone: | tbd → 1.4 |
---|---|
Owner: | changed from James Burke to Douglas Hays |
Patch looks fine, if it is possible to integrate the test file with the DOH tests, that is great, otherwise check it in so we have it laying around to test manually.
Feel free to commit it.
Changed 11 years ago by
Attachment: | 10020.2.patch added |
---|
updated patch with DOH tests and additional fixes
comment:3 Changed 11 years ago by
Fixed additional problems:
1) withDoc did not delete dojo._isBodyLtr in finally which could cause the withDoc value to stick around.
2) _getIeDocumentElementOffset failed when working with iframes. The iframe border made the offsets go negative for IE6/7. For IE6, testing window was bad and should have been dojo.global. But after that was fixed, then the calculation for RTL/IE6 was messed up since html.clientWidth can be 0 causing the returned offset to be hugely negative.
3) After fixing these problems, then a workaround in scrollIntoView when using IE/RTL needed to be removed since it was no longer needed.
Added iframe test to html.html.
comment:4 Changed 11 years ago by
Visual inspection of the new patch looks good to me, feel free to apply it.
comment:5 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [20428]) Fixes #10020. References #9859. Fixed several problems related to dojo.position()'s use inside iframes. Fixed several IE-specific problems related to inaccurate position() attributes caused by iframe style. Fixed withDoc to restore _isBodyLtr and to properly set/restore isQuirks. Changed isQuirks definition to only check for "BackCompat?" since other values are for ancient unsupported browsers. Added automated iframe tests to html.html. Removed workaround from dijit's scroll.js that's no longer needed after these fixes. Verified all html.html and test_scroll.html tests pass on all supported browsers. !strict
comment:6 Changed 11 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Since [20428] the html_rtl.html is failing on IE6 (and maybe other browsers too). Actually, it works standalone, but fails when run as part of suite (from runTests.html).
comment:7 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
The testcase is failing due to timing (unhides an element and then immediately checks the position before the browser has had time to render). This will be fixed under a separate ticket #10147 since its unrelated to this ticket. This changeset just tweaked the timing enough such that the problem happens frequently now.
main test file showing incorrect position values