+ method center_on_href href =
+ (*eprintf "Centering viewport on uri %s\n%!" href;*)
+ let attrs =
+ List.find
+ (fun attrs ->
+ try List.assoc "href" attrs = href with Not_found -> false)
+ map in
+ try
+ let x1, y1, x2, y2 = parse_coords (List.assoc "coords" attrs) in
+ viewport#hadjustment#clamp_page ~lower:x1 ~upper:x2;
+ viewport#vadjustment#clamp_page ~lower:y1 ~upper:y2;
+ with Not_found -> ()
+