Bug 1446343 part 1 - Expose GetOuterToInner{Width,Height}DifferenceInCSSPixels to script. r=bz

MozReview-Commit-ID: 8mjIxRATTPD

--HG--
extra : rebase_source : fe4f25cf16cdff8c9651860a9adf606bd0cc6b0f
This commit is contained in:
Xidorn Quan 2018-04-06 14:59:11 +10:00
Родитель 87c5ab8f3d
Коммит 8c8cef5c1d
2 изменённых файлов: 11 добавлений и 9 удалений

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

@ -26,7 +26,7 @@ interface mozIDOMWindowProxy;
native LiveResizeListenerArray(nsTArray<RefPtr<mozilla::LiveResizeListener>>);
[scriptable, uuid(d6d7a014-e28d-4c9d-8727-1cf6d870619b)]
[builtinclass, scriptable, uuid(d6d7a014-e28d-4c9d-8727-1cf6d870619b)]
interface nsIXULWindow : nsISupports
{
/**
@ -70,8 +70,8 @@ interface nsIXULWindow : nsISupports
* Returns the difference between the inner window size (client size) and the
* outer window size, in CSS pixels.
*/
[noscript,notxpcom] uint32_t getOuterToInnerHeightDifferenceInCSSPixels();
[noscript,notxpcom] uint32_t getOuterToInnerWidthDifferenceInCSSPixels();
[infallible] readonly attribute unsigned long outerToInnerHeightDifferenceInCSSPixels;
[infallible] readonly attribute unsigned long outerToInnerWidthDifferenceInCSSPixels;
/**
* Tell this window that it has lost a child XUL window

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

@ -361,16 +361,18 @@ GetOuterToInnerSizeDifferenceInCSSPixels(nsIWidget* aWindow)
return RoundedToInt(devPixelSize / aWindow->GetDefaultScale());
}
uint32_t
nsXULWindow::GetOuterToInnerHeightDifferenceInCSSPixels()
NS_IMETHODIMP
nsXULWindow::GetOuterToInnerHeightDifferenceInCSSPixels(uint32_t* aResult)
{
return GetOuterToInnerSizeDifferenceInCSSPixels(mWindow).height;
*aResult = GetOuterToInnerSizeDifferenceInCSSPixels(mWindow).height;
return NS_OK;
}
uint32_t
nsXULWindow::GetOuterToInnerWidthDifferenceInCSSPixels()
NS_IMETHODIMP
nsXULWindow::GetOuterToInnerWidthDifferenceInCSSPixels(uint32_t* aResult)
{
return GetOuterToInnerSizeDifferenceInCSSPixels(mWindow).width;
*aResult = GetOuterToInnerSizeDifferenceInCSSPixels(mWindow).width;
return NS_OK;
}
nsTArray<RefPtr<mozilla::LiveResizeListener>>