Re: Anchors in current file...

David Martland ([email protected])
Fri, 16 Jul 93 10:54:44 +0100


----- Begin Included Message -----
Well, it's not quite *that* simple. The original decision (and yes,
it was a decision) was to put _documents_ in the history list. Moving
around inside a document was thought to be different than moving to a
new document.

Like I said, 2.x reverses this policy. Now, the question is: I go to
document foo.html and scroll to line 58. A hypertext reference leads
to #myanch and I follow it, jumping to line 699 (which is where the
named anchor 'myanch' sits). Now my history list looks like --

foo.html [cached line 58]
--> foo.html#myanch [explicit line 699]

So then I scroll down to line 784, and then go 'back' (which jumps me
up to line 58). Now the history list is:

--> foo.html [cached line 58]
foo.html#myanch [explicit line 699, cached line 784]

NOW, if I go 'forward', should Mosaic put me on line 699 or line 784?

Hope this makes some sense,
Marc

----- End Included Message -----

Surely it depends on whether the significant "objects" from the readers
point of view are the just the anchors, or also include points from which jumps
have been made.

If only anchors are considered, then the history list as in the example above
is correct, and the forward jump should be to line 699.

If however, the point from which the Back command was issued is also of
interest, then it should also be included in the list. However, it should be put
in front of the previous anchor... so we would now have ....

--> foo.html [cached line 58]
foo.html - back ref to line 784
foo.html#myanch [explicit line 699]

What is now going on is that instead of having a single list, there are really
two lists - its a fairly standard data structures situation - you could use code
something like ....

BACK (docstate(doc,#line), (d1,#n1):backlist, forwardlist)
= (docstate(d1,#n1), backlist, (doc,#line):forwardlist)

FORWARD (docstate (doc,#line), backlist, (d1,#n1):forwardlist)
= (docstate(d1,#n1), (doc, #line):backlist, forwardlist)

{ I hope I got this right....mmmm!}

The problem with this is that sometimes there will be a need to discard items -
and also that if the state of each document is maintained as it was before each
"jump", then the size of the forwardlist and backlists will increase, simply
by alternating between FORWARD and BACK, but moving the cursor in between times.

Discard policy would then have to be considered more carefully. If ONLY anchors
are stored in the forwardlist and backlist, then this particular problem should
not occur.

As it is, I am not sure what policies browsers, such as Mosaic, actually use to
discard document states from the forward and backward lists - perhaps trying to
reach an document state which is already on the backward list should be noted,
and be stored - but even this could be upsetting for some - thus

Visiting: A B C A D

could store A B C A D
with full retracins, or

only A D where it is noted that docstate A has already been visited

I guess the storage for the necessary lists is only going to be of the order
of a few KiloBytes for each session, so that isn't a major problem - there is an
additional difficulty if the data referred to is also going to be cached, since
this could put the storage requirements up considerably. However, the issue of
maintaining the history list is not directly related to the caching problem - it
is not necessary to discard items from the history list, simply because local
space for caching is not available - it should be possible to fetch the data
again.

I hope this helps.

Dave