W3C home > Mailing lists > Public > www-style@w3.org > April 2011

Re: [cssom] Element size/positioning information

From: Robert O'Callahan <robert@ocallahan.org>
Date: Tue, 12 Apr 2011 10:57:32 -0700
Message-ID: <BANLkTi=hY2O=HgreSaHqE+o4FdFwHoQAeQ@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Simon Fraser <smfr@me.com>, www-style list <www-style@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:39 GMT