Re: scrollIntoView for XML documents

Boris Zbarsky <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xml
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
Martin Honnen wrote:
> Boris, if you are reading, would it be difficult the expose 
> offsetLeft/Top/Parent on arbitrary XML elements rendered in a window or 
> frame with Mozilla?

That's an interesting question.  Just exposing the property wouldn't be so bad 
(create a new nsIDOMNSElement interface and put it there).  Problem is, it'd 
increase the size of every single Element node by 4 bytes...

Once that's done, there's the question of _what_ the properties should do.  For 
example, what should offsetParent be for a random XML element?  For comparison, 
for HTML the offsetParent is more or less the nearest ancestor (in the rendering 
tree, not the content tree, mind you) that is at least one of:

1)  Absolutely positioned.
2)  Fixed positioned.
3)  A HTML <td>, <th>, or <table> node.
4)  A HTML <body> node.

I guess for general XML we could keep the same rules... A little wacky to have 
random XML depending on HTML in this way, but it's probably the only way to get 
consistent results in mixed-namespace documents.

-Boris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.