Opened 12 years ago

Closed 11 years ago

#5561 closed defect (wontfix)

dojo._docScroll return wrong left value in IE+BIDI environment when document's overflow set as hidden.

Reported by: guest Owned by: sjmiles
Priority: high Milestone: 1.2
Component: HTML Version: 1.0
Keywords: html bidi Cc:
Blocked By: Blocking:

Description (last modified by Adam Peller)

dijit.getViewport called dojo_docScroll to get the left and top value. dojo._docScroll should simply return 0 back on the left value in this situation When there is no scrollbar here. I hope this can be fixed soon.

Thanks

Attachments (1)

ie-rtl-viewport-test-5561.html (721 bytes) - added by sjmiles 11 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 12 years ago by Adam Peller

Milestone: 1.0.31.1

comment:2 Changed 12 years ago by Adam Peller

can you provide a test case?

comment:3 Changed 12 years ago by guest

try below simple html in IE:

<html> <head> <script src='dojo/dojo.js'></script> <script> dojo.require("dijit._base"); function test() {

alert(dijit.getViewport().l);

} dojo.addOnLoad(test); </script> <body dir="rtl" style="direction:rtl;overflow:hidden">

<p> text </p>

</body>

comment:4 Changed 12 years ago by sjmiles

Milestone: 1.11.1.1

comment:5 Changed 12 years ago by Adam Peller

Description: modified (diff)
Priority: normalhigh

comment:6 Changed 11 years ago by sjmiles

Resolution: worksforme
Status: newclosed

I'm not sure I've read this correctly, but the test case as given alerts '0' which seems to be the behavior the user is asking for.

The implication is that this problem has been fixed otherwise from this ticket.

comment:7 Changed 11 years ago by virsir

Resolution: worksforme
Status: closedreopened

OK, i found this issue related to window.resize event. You can check it with below test code in IE. Because IE has twice resize events fired when user resize the browser window, it looks like the previous one showed a wrong left value.

This issue mainly breaks dijit.Dialog when resizing window to center the dialog. You can simply change the test_Dialog.html to RTL mode and then resize the IE window to see the problem.

<html>
    <head>
        <script>
            var djConfig = 
            {
                isDebug: true
            }
        </script>
        <script src="../dojotoolkit/dojo/dojo.js">
        </script>
        <script>
            dojo.require("dijit._base");
            function test()
            {
                var resizeHandler = function()
                {
                    console.debug("left : " + dijit.getViewport().l);
                }
                dojo.connect(window, "onresize", resizeHandler);
            }
            dojo.addOnLoad(test);
        </script>
    </head>
    <body dir="rtl">
    </body>
</html>

comment:8 Changed 11 years ago by sjmiles

Resolution: wontfix
Status: reopenedclosed

Thanks for the test case. It appears that IE has some bogus values after the first 'onresize' event; it seems to be one of those cases where IE hasn't completely sorted out the DOM until some idle processing has occurred.

The only solution I have for now is to make it clear that _docScroll (and therefore any number of measuring functions) are not available inside event handlers and necessary effects have to be handled asynchronously.

See attachment for example.

P.S. Quirks/non-quirks tends to be relevant for these discussions and should be part of the ticket text. The example given establishes quirks mode. My attachment uses strict mode. I did not see any different behavior between the modes, but the code paths are slightly different.

Changed 11 years ago by sjmiles

Note: See TracTickets for help on using tickets.