PATCH - Add offset* methods to HTMLElement API

David Faure faure at kde.org
Wed Jan 12 15:20:24 GMT 2005


On Wednesday 12 January 2005 16:19, Jason Keirstead wrote:
> The XML DOM is not supposed to be tied to the renderer in any way, since it 
> can exist independant of any render at all. As such, the XML DOM shouldn't 
> have any methods like getRect() either.. getRect() depends on a rendered 
> layout.. the DOM has nothing at all to do with rendering. 

... but you're the one who wants to get rendering information using DOM calls :-)

> However, after further inspection of the KHTML API and it's internals, I can 
> see that the KHTML XML DOM is indeed tired very closely to the renderer in 
> how it's methods behave (read: I do not believe you can use the KHTML DOM 
> independant of a KHTMLPart?). While I do question why this was done somewhat, 
> I withdraw my objection to having the method in the XML DOM impl, since as 
> currently implimented, an XML DOM node will always be rendered.

Well, ideally KHTML could also be used to parse HTML into a DOM tree without
rendering... And yet getRect and offsetLeft/offsetTop methods exist, for convenience,
that's unrelated, and certainly not specific to HTML (it's all true for XML too).

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kfm-devel mailing list