W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2011

[whatwg] Question about the bookmark in the adoption agency algorithm

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 13 Dec 2011 23:50:08 +0000 (UTC)
Message-ID: <Pine.LNX.4.64.1112132348340.18028@ps20323.dreamhostps.com>
On Thu, 6 Oct 2011, David Flanagan wrote:
>
> I'm trying to implement the HTML parser's adoption agency algorithm and am
> puzzled by this step:
> > Let a bookmark note the position of the formatting element in the list of
> > active formatting elements
> > <http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#list-of-active-formatting-elements>
> > relative to the elements on either side of it in the list.
>
> The metaphor of a bookmark is such that it marks a position between two 
> pages (or list elements in this case), and I'm having trouble with the 
> phrase "the elements on either side of it": I don't understand how this 
> bookmark can mark the position of one element relative to both the 
> element before and the element after.  That would require two bookmarks!  
> My guess, from the other steps that involve the bookmark is that it is 
> supposed to mark the position after the formatting element, but I'm 
> hoping that someone can confirm that for me.
> 
> The second time the bookmark is mentioned it is to be moved " 
> immediately after the new node".  This is a bookmark position that I can 
> understand. And the final time the bookmark is mentioned, it is to " 
> insert the new element into the list...at the position of the 
> aforementioned bookmark." Like a cursor in text, a bookmark works as an 
> insertion position, so I get this part.
> 
> I think that the first mention of the bookmark in the spec should be 
> clarified so that it is clear whether the bookmark marks the position 
> before the formatting element or the position after the formatting 
> element.

The formatting element referenced above is removed before the bookmark is 
used. Thus the bookmark is literally keeping track of the position of the 
formatting element itself, as if it was itself the bookmark. You can 
picture this as the bookmark being wrapped around the formatting element.

HTH,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 13 December 2011 15:50:08 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:38 UTC