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]>
conor325 wrote:
> where the xml file is xhtml2 (section, h etc). It's easy to split the
> xpointer now and use xpath resolution to resolve a selection of text.
> The missing piece is being able to scrollIntoView!

No, the missing piece is "what does it mean to scroll into view?"  For HTML, the 
answer is simple -- "we're implementing an IE extension, so do about what IE 
does."  For XML, we can decide what to do, so the question becomes what that 
should be.  What does it mean to scroll a content node into view, really?  What 
does it mean to scroll an HTML <area> element into view, say, if it's referenced 
from 10 different images on the page?  What about an SVG paint server of some 
sort that's being reused in several different documents, in multiple places in each?

> I don't think styled XML is ever arbitrary - after all the style sheet
> defines what to render as a block or inline etc.

Which is absolutely useless, in general, to someone reading your web page with a 
braille reader....  On the other hand, knowing where the paragraph breaks are 
and which of your blocks are section headings could be somewhat useful there.

> it could allow full navigation using intra-doc links, menus etc.

You can already do full navigation using intra-doc links.  I suggest you look up 
XLink (and note that the href of one can be an XPointer expression).  No need 
for script, no need for scrollIntoView, just nice reasonably semantic (in that 
it's clearly a link) markup.

-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.