зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1018324 Add scrollElementIntoView to inIDOMUtils as inIFlasher is going away r=roc
This commit is contained in:
Родитель
9c2ebc48cb
Коммит
47e0580a88
|
@ -878,3 +878,22 @@ inDOMUtils::ParseStyleSheet(nsIDOMCSSStyleSheet *aSheet,
|
||||||
|
|
||||||
return sheet->ParseSheet(aInput);
|
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 nsIDOMRange;
|
||||||
interface nsIDOMCSSStyleSheet;
|
interface nsIDOMCSSStyleSheet;
|
||||||
|
|
||||||
[scriptable, uuid(ceae6c68-f5d4-4597-a3d9-ca5646c25f1a)]
|
[scriptable, uuid(948792a7-b786-4a2c-910d-f55b0773c2ca)]
|
||||||
interface inIDOMUtils : nsISupports
|
interface inIDOMUtils : nsISupports
|
||||||
{
|
{
|
||||||
// CSS utilities
|
// CSS utilities
|
||||||
|
@ -103,6 +103,13 @@ interface inIDOMUtils : nsISupports
|
||||||
* The new source string for the style sheet.
|
* The new source string for the style sheet.
|
||||||
*/
|
*/
|
||||||
void parseStyleSheet(in nsIDOMCSSStyleSheet aSheet, in DOMString aInput);
|
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++
|
%{ C++
|
||||||
|
|
Загрузка…
Ссылка в новой задаче