mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 1531173 - Drop nsIContentViewer.scrollToNode. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D21458 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
1c7e3fffd8
commit
163a45f495
@ -232,10 +232,6 @@ interface nsIContentViewer : nsISupports
|
||||
* Set collector for navigation timing data (load, unload events).
|
||||
*/
|
||||
[noscript,notxpcom,nostdcall] void setNavigationTiming(in nsDOMNavigationTimingPtr aTiming);
|
||||
/*
|
||||
Scrolls to a given DOM content node.
|
||||
*/
|
||||
void scrollToNode(in Node node);
|
||||
|
||||
/** The amount by which to scale all text. Default is 1.0. */
|
||||
attribute float textZoom;
|
||||
|
@ -2672,28 +2672,6 @@ NS_IMETHODIMP nsDocumentViewer::SetCommandNode(nsINode* aNode) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDocumentViewer::ScrollToNode(nsINode* aNode) {
|
||||
NS_ENSURE_ARG(aNode);
|
||||
NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);
|
||||
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
|
||||
|
||||
// Get the nsIContent interface, because that's what we need to
|
||||
// get the primary frame
|
||||
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
|
||||
NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);
|
||||
|
||||
// Tell the PresShell to scroll to the primary frame of the content.
|
||||
NS_ENSURE_SUCCESS(
|
||||
presShell->ScrollContentIntoView(
|
||||
content,
|
||||
nsIPresShell::ScrollAxis(nsIPresShell::SCROLL_TOP,
|
||||
nsIPresShell::SCROLL_ALWAYS),
|
||||
nsIPresShell::ScrollAxis(), nsIPresShell::SCROLL_OVERFLOW_HIDDEN),
|
||||
NS_ERROR_FAILURE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsDocumentViewer::CallChildren(CallChildFunc aFunc, void* aClosure) {
|
||||
nsCOMPtr<nsIDocShell> docShell(mContainer);
|
||||
if (docShell) {
|
||||
|
Loading…
Reference in New Issue
Block a user