Babele Dunnit wrote:
Hi,
I was used to programmatically scroll embedded browser content using
some code like this:
nsCOMPtr<nsIDOMWindow> domWindow;
mWebBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
domWindow->ScrollTo(xScroll, yScroll);
and everything was working fine. BUT this kind of code has no effect
on Google Docs pages, i.e. if I point my browser on (for example)
http://docs.google.com/gview?embedded=true&url=http://www.itu.int/dms_pub/itu-s/md/03/wsis/doc/S03-WSIS-DOC-0004!!MSW-E.doc
nothing happens. Also, if I use methods like nsIDOMWindow::GetScrollX,
I always get 0.
Any DIV or block-level element in HTML, smaller or larger, can have
scrollbars and can scroll the inner content. Now if such a DIV is set to
always be as large as the window and holds the page's content, then what
you really need to scroll is one of the DIV elements in your page.
Scrolling the page is useless because the page needs no scrollbar as it
only contains the DIV, which is always as large as the window is so it
always fits.
There is little use in trying to modify the window scrolling functions
to have them scroll such an element instead, because the HTML elements
already have scroll methods on them, and because this behavior is well
standardized in the DOM, published by World Wide Web Consortium.
Good luck finding the DIV.
Timothy Madden
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding