Re: [cssom] Element size/positioning information

There's some discussion about this here:
https://bugzilla.mozilla.org/show_bug.cgi?id=626359

There I proposed defining a Quad object containing four float points, and a
QuadList object, then defining a method element.getQuads(relativeTo)
returning a QuadList, where relativeTo is an element. The method returns a
list of Quads in CSS pixels relative to the top-left of relativeTo's first
CSS box's border-box ... but arguably it should be content-box.

It would probably be worth specializing that to getBorderQuads,
getPaddingQuads and getContentQuads.

For mouse event coordinates, you probably want another method
element.transformPoint(relativeTo, x, y) returning a simple x,y Point
object, transforming from a point relative to the element's first CSS box's
content-box to a point relative to relativeTo's first CSS box's content-box.

Rob
-- 
"Now the Bereans were of more noble character than the Thessalonians, for
they received the message with great eagerness and examined the Scriptures
every day to see if what Paul said was true." [Acts 17:11]

Received on Tuesday, 12 April 2011 17:58:01 UTC