I am confused as to what getClientRects() called on an element object returns in Mozilla. For IE, as far as I understand it, it returns a collection of TextRectangle objects, one for each rendered line of text in the element. For Mozilla I always get a collection of one rectangle.
Test case is here: http://home.arcor.de/martin.honnen/javascript/2008/08/test2008082301.html For IE 6 the output is 'P' element has 3 line(s). 'P' element has 4 line(s). 'UL' element has 3 line(s). (where the result for the first 'P' element obviously depends on the browser window width). For Mozilla the output however is 'P' element has 1 line(s). 'P' element has 1 line(s). 'UL' element has 1 line(s). Tested with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 The documentation at http://developer.mozilla.org/en/DOM/element.getClientRects also has a code example saying var rects = obj.getClientRects(); var numLines = rects.length; which with numLines suggests there should be a rectangle for each line of text. Is the result Mozilla gives the intended result? How would the markup look for an element where getClientRects() in Mozilla would return a collection with more than one rectangle? -- Martin Honnen http://JavaScript.FAQTs.com/ _______________________________________________ dev-tech-layout mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-layout

