Friday, 18 May 2012

Re: More examples using libcss [Xpost from netsurf-users]

On Fri, 2012-05-18 at 16:55 +0530, Syed Mushtaq wrote:


> Maybe I am getting the example wrong. So you begin by giving creating
> a selector context with the node to be search as the selector ( h1 to
> h7 ) in the example. At this point the parse tree would have already
> been created. The function css_select_style() stores the result of the
> search in a css_select_results * . Now I am unable to understand why
> we pass a handler struct which contains various function pointers.
> When will those functions get called ?

LibCSS knows nothing about your document structure, but it needs to be
able to move between nodes in the document when working out which style
rules to apply to the target element. To achieve this, it requires you
provide it with a handler struct containing pointers to functions it may
use when considering selectors.


J.

No comments:

Post a Comment