I wish that I
knew a good way in HTML to express offsets from
beginning of a document.
[...]
[...]
HTML can be rendered so
radically different on various platforms.
So what? How - or even whether - it is rendered is pretty much
irrelevant, as I understand the desire in question.
What would the offset measure? Bytes? Characters?
(those two would
be very different)
Could be, not necessarily would be. Either could work. As long as it
serves for the task and is well defined, I don't see that it matters.
Lines? How could you possibly compute that?
Count line endings? Seems like the obvious way to me.
Would a byte offset be meaningful?
It could be, if that's the level at which you want to operate.
A byte offset that lands you in the middle of a script
or code of
some other type would be the same screen position as a byte offset
that's hundreds of bytes (or thousands) different;
Or, depending on how you look at it, would not represent a screen
position at all. So what? Just because some references may be
meaningless or refer to the same point as other references does not
mean that all such references are useless, or that the idea of such
references is bad, any more than the way that most possible pointers in
most C programs don't refer to any object makes C pointers useless.
The whole point of a web browser is that the content
is rendering
engine independent.
I still don't see what this has to do with it. Provided it's defined
in terms of the page source - probably in terms of the content as
delivered on the wire - an offset-into-the-page figure is rendering
engine independent too.
These things aren't necessarily going to be used to send people to
specific points in rendered pages (though that's certainly one possible
way to use them). They could also be used to unambiguously refer to
places in the page for other purposes, such as the typo-reporting
possibility mentioned upthread.
/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse at
rodents-montreal.org
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B