Bug 1867925 - Mark some storage-access-api tests as intermittent after wpt-sync....
[gecko.git] / accessible / xpcom / xpcAccessibleImage.cpp
blob137ebe67911b02b4ed0dff47e13e43b0d8c4df93
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "xpcAccessibleImage.h"
9 using namespace mozilla::a11y;
11 ////////////////////////////////////////////////////////////////////////////////
12 // nsISupports
14 NS_IMPL_ISUPPORTS_INHERITED(xpcAccessibleImage, xpcAccessibleGeneric,
15 nsIAccessibleImage)
17 ////////////////////////////////////////////////////////////////////////////////
18 // nsIAccessibleImage
20 NS_IMETHODIMP
21 xpcAccessibleImage::GetImagePosition(uint32_t aCoordType, int32_t* aX,
22 int32_t* aY) {
23 NS_ENSURE_ARG_POINTER(aX);
24 *aX = 0;
25 NS_ENSURE_ARG_POINTER(aY);
26 *aY = 0;
28 if (!mIntl) return NS_ERROR_FAILURE;
30 LayoutDeviceIntPoint point = mIntl->Position(aCoordType);
31 *aX = point.x;
32 *aY = point.y;
33 return NS_OK;
36 NS_IMETHODIMP
37 xpcAccessibleImage::GetImageSize(int32_t* aWidth, int32_t* aHeight) {
38 NS_ENSURE_ARG_POINTER(aWidth);
39 *aWidth = 0;
40 NS_ENSURE_ARG_POINTER(aHeight);
41 *aHeight = 0;
43 if (!mIntl) return NS_ERROR_FAILURE;
45 LayoutDeviceIntSize size = mIntl->Size();
46 *aWidth = size.width;
47 *aHeight = size.height;
48 return NS_OK;