mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1018324 Add scrollElementIntoView to inIDOMUtils as inIFlasher is going away r=roc
This commit is contained in:
parent
9c2ebc48cb
commit
47e0580a88
@ -878,3 +878,22 @@ inDOMUtils::ParseStyleSheet(nsIDOMCSSStyleSheet *aSheet,
|
||||
|
||||
return sheet->ParseSheet(aInput);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inDOMUtils::ScrollElementIntoView(nsIDOMElement *aElement)
|
||||
{
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
|
||||
NS_ENSURE_ARG_POINTER(content);
|
||||
|
||||
nsIPresShell* presShell = content->OwnerDoc()->GetShell();
|
||||
if (!presShell) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
presShell->ScrollContentIntoView(content,
|
||||
nsIPresShell::ScrollAxis(),
|
||||
nsIPresShell::ScrollAxis(),
|
||||
nsIPresShell::SCROLL_OVERFLOW_HIDDEN);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ interface nsIDOMFontFaceList;
|
||||
interface nsIDOMRange;
|
||||
interface nsIDOMCSSStyleSheet;
|
||||
|
||||
[scriptable, uuid(ceae6c68-f5d4-4597-a3d9-ca5646c25f1a)]
|
||||
[scriptable, uuid(948792a7-b786-4a2c-910d-f55b0773c2ca)]
|
||||
interface inIDOMUtils : nsISupports
|
||||
{
|
||||
// CSS utilities
|
||||
@ -103,6 +103,13 @@ interface inIDOMUtils : nsISupports
|
||||
* The new source string for the style sheet.
|
||||
*/
|
||||
void parseStyleSheet(in nsIDOMCSSStyleSheet aSheet, in DOMString aInput);
|
||||
/**
|
||||
* Scroll an element completely into view, if possible.
|
||||
* This is similar to ensureElementIsVisible but for all ancestors.
|
||||
*
|
||||
* @param DOMElement aElement
|
||||
*/
|
||||
void scrollElementIntoView(in nsIDOMElement aElement);
|
||||
};
|
||||
|
||||
%{ C++
|
||||
|
Loading…
Reference in New Issue
Block a user