Another thing I forgot to mention. In the CSS file, the div has an absolute position (which is probably why the browser can calculate its size). After reading the comment in the source:
if (width && (positionedWidth === width)) { // If the element's width is the same both before and after // we set absolute positioning, that means: // (a) it was already absolutely-positioned; or // (b) it has an explicitly-set width, instead of width: auto. // Either way, it means the element is the width it needs to be // in order to report an accurate height. newWidth = getPixelValue(width); } else if (width && (position === 'absolute' || position === 'fixed')) { It would seem that the width should be obtained in 'if' part. However, there is no width, since element.style.width is empty. On the other hand, positionedWidth is correct. The 'position' is also absolute, so it could also go into the else if, but it won't, since the width is null. On Apr 22, 1:40 pm, Viktor Kojouharov <vkojouha...@gmail.com> wrote: > I'm having a bit of a problem with measuring the width of a hidden > (with display: none) element, that has the 'body' as its parent. I > don't have a set width for this element (which is a div), but the > browsers do calculate a finite width for it, which is much smaller > than the size of the page body. However, with the layout changes, > since there is no predefined width, prototype will not use the > computed width, but will take the parent's width, which just happens > to be the width of the entire page. > > will there be any plans for fixing this? otherwise I can always use > the old code for this special case. > > -- > You received this message because you are subscribed to the Google Groups > "Prototype: Core" group. > To post to this group, send email to prototype-core@googlegroups.com > To unsubscribe from this group, send email to > prototype-core-unsubscr...@googlegroups.com > For more options, visit this group > athttp://groups.google.com/group/prototype-core?hl=en -- You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en