I don't know how to to it in the playground since I believe the problem may be specific to the body element.
I however attach a miniapp demonstrating the problem: it is an Inline Application, the only changed files are Application.js and index.html index.html contains a body with margin to 0, an island to put the button, a tall div to put the last one out of the window, and a div I attempt to scroll into view. Clicking the button calls qx.bom.element.Scroll.intoView(document.getElementById("OutOfWindow")); and does exactly nothing because body.scrollHeight and body.clientHeight are equal. Note the fact that if I don't set the body margin to zero, Safari set it to a positive value by default, which makes scrollHeight and clientHeight different, which makes the application behave normally and scroll the div in view without a problem. This doesn't seem to be the case on FF, where scrollHeight is always equal to clientHeight and the application doesn't scroll whatever the body margin. On Wed, Sep 28, 2011 at 3:26 PM, Alexander Steitz <alexander.ste...@1und1.de > wrote: > Hi David, > > can you post a (playground) demo so we can take a look at your code? > > Regards, > Alex > > On Wednesday 28 September 2011 14:20:23 david leray wrote: > > Hi everyone, > > I am currently trying to use qx.bom.element.Scroll.intoView to scroll an > > element into view in the main window and completely failing. My window > > doesn't scroll at all both under Safari and Firefox. > > > > After taking a look at the code and logging lots of stuff, I really don't > > understand how it is supposed to work. > > > > Excerpt from qx.bom.element.Scroll: > > ---------------- > > intoViewY : function(element, stop, align) > > { > > var parent = element.parentNode; > > var doc = qx.dom.Node.getDocument(element); > > var body = doc.body; > > > > […] > > > > while (parent && parent != stop) > > { > > if (parent.scrollHeight > parent.clientHeight && (parent > === > > body || qx.bom.element.Overflow.getY(parent) != "visible")) { > > [Main work code] > > } > > parent = parent.parentNode; > > } > > } > > ---------------- > > > > When the parent chain reaches body, body.scrollHeight and > body.clientHeight > > are always equal, both under FF and Safari, whatever the size of the > > (viewport) main window, and so no work is ever done and nothing scrolls > > into view. > > > > As a fast and dirty workaround, if I replace > > ---------------- > > if (parent.scrollHeight > parent.clientHeight && (parent > === > > body || qx.bom.element.Overflow.getY(parent) != "visible")) > > ---------------- > > with > > ---------------- > > if ((parent.scrollHeight > parent.clientHeight && (parent === body > || > > qx.bom.element.Overflow.getY(parent) != "visible")) || > > (parent.scrollHeight > window.innerHeight && (parent === body))) > > ---------------- > > it seems to work as expected. > > > > I guess I'd like someone to confirm it is a bug, because I am not sure my > > expectations as to how this function should work are correct and I don't > > see how this bug could not have been detected before if anyone uses this > > function. > > > > Thanks in advance, > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2dcopy1 > _______________________________________________ > qooxdoo-devel mailing list > qooxdoo-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > -- David Leray
scrollme.tgz
Description: GNU Zip compressed data
------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel