Ticket #5561 (closed defect: wontfix)

Opened 11 months ago

Last modified 4 months ago

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
Severity: normal Keywords: html bidi
Cc:

Description (last modified by peller) (diff)

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

ie-rtl-viewport-test-5561.html (0.7 kB) - added by sjmiles 4 months ago.

Change History

Changed 11 months ago by peller

  • milestone changed from 1.0.3 to 1.1

Changed 10 months ago by peller

can you provide a test case?

Changed 9 months 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>

Changed 9 months ago by sjmiles

  • milestone changed from 1.1 to 1.1.1

Changed 6 months ago by peller

  • priority changed from normal to high
  • description modified (diff)

Changed 5 months ago by sjmiles

  • status changed from new to closed
  • resolution set to worksforme

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.

Changed 4 months ago by virsir

  • status changed from closed to reopened
  • resolution deleted

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>

Changed 4 months ago by sjmiles

  • status changed from reopened to closed
  • resolution set to wontfix

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 4 months ago by sjmiles

Note: See TracTickets for help on using tickets.