Bug 898580 - Add nsIDOMWindowUtils.getViewId(element). r=smaug

This commit is contained in:
Botond Ballo 2013-08-08 15:56:09 -04:00
Родитель a5fb538393
Коммит e2eae8dab7
2 изменённых файлов: 17 добавлений и 1 удалений

Просмотреть файл

@ -1694,6 +1694,16 @@ nsDOMWindowUtils::FindElementWithViewId(nsViewID aID,
return content ? CallQueryInterface(content, aResult) : NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetViewId(nsIDOMElement* aElement, nsViewID* aResult)
{
nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
if (content && nsLayoutUtils::FindIDFor(content, aResult)) {
return NS_OK;
}
return NS_ERROR_NOT_AVAILABLE;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetScreenPixelsPerCSSPixel(float* aScreenPixels)
{

Просмотреть файл

@ -42,7 +42,7 @@ interface nsIURI;
interface nsIDOMEventTarget;
interface nsIRunnable;
[scriptable, uuid(ff1cec22-b183-40d3-8b42-b81a2f0ba4e6)]
[scriptable, uuid(d6e733ef-492b-4e67-b723-28571c2959f0)]
interface nsIDOMWindowUtils : nsISupports {
/**
@ -1177,6 +1177,12 @@ interface nsIDOMWindowUtils : nsISupports {
*/
nsIDOMElement findElementWithViewId(in nsViewID aId);
/**
* Find the view ID for a given element. This is the reverse of
* findElementWithViewId().
*/
nsViewID getViewId(in nsIDOMElement aElement);
/**
* Checks the layer tree for this window and returns true
* if all layers have transforms that are translations by integers,