namespace
{
- rectangle get_elem_rect(nsIDOMNSDocument * ns_doc,
- nsIDOMElement * elem)
+#if MOZ_VERSION_GE(2,0,-1)
+ rectangle get_elem_rect(nsIDocument * doc, nsIDOMElement * elem)
+#else
+ rectangle get_elem_rect(nsIDOMNSDocument * doc, nsIDOMElement * elem)
+#endif
{
rectangle result;
// Start with this element's bounding box
nsCOMPtr<nsIBoxObject> box;
- check(ns_doc->GetBoxObjectFor(elem, getter_AddRefs(box)));
+ check(doc->GetBoxObjectFor(elem, getter_AddRefs(box)));
int width, height;
check(box->GetScreenX(&result.left));
check(box->GetScreenY(&result.top));
{
nsCOMPtr<nsIDOMElement> child_elem(
do_QueryInterface(child_node));
- result |= get_elem_rect(ns_doc, child_elem);
+ result |= get_elem_rect(doc, child_elem);
}
}
nsCOMPtr<nsIDOMNSDocument> ns_doc(do_QueryInterface(basic_doc));
assert(ns_doc);
+#if MOZ_VERSION_GE(2,0,-1)
+ nsCOMPtr<nsIDocument> doc(do_QueryInterface(basic_doc));
+ assert(doc);
+#endif
nsCOMPtr<nsIPresShell> pres_shell;
check(doc_shell->GetPresShell(getter_AddRefs(pres_shell)));
nsCOMPtr<nsIEventStateManager> event_state_man(
// window.
nsCOMPtr<nsIDOMElement> elem(do_QueryInterface(node));
assert(elem);
+#if MOZ_VERSION_GE(2,0,-1)
+ state->link_rect = get_elem_rect(doc, elem);
+#else
state->link_rect = get_elem_rect(ns_doc, elem);
+#endif
state->link_rect &= window_rect;
if (state->link_rect.empty())