Backed out changeset 6c3a672524b7 (bug 1748878) for causing accessibility crashes. a=backout

This commit is contained in:
Butkovits Atila 2022-01-20 17:24:17 +02:00
parent f7739e2a4a
commit e5a82d2e01
48 changed files with 204 additions and 222 deletions

View file

@ -660,11 +660,11 @@ mozilla::java::GeckoBundle::LocalRef AccessibleWrap::ToBundle(bool aSmall) {
} }
mozilla::java::GeckoBundle::LocalRef AccessibleWrap::ToBundle( mozilla::java::GeckoBundle::LocalRef AccessibleWrap::ToBundle(
const uint64_t aState, const LayoutDeviceIntRect& aBounds, const uint64_t aState, const nsIntRect& aBounds, const uint8_t aActionCount,
const uint8_t aActionCount, const nsString& aName, const nsString& aName, const nsString& aTextValue,
const nsString& aTextValue, const nsString& aDOMNodeID, const nsString& aDOMNodeID, const nsString& aDescription,
const nsString& aDescription, const double& aCurVal, const double& aMinVal, const double& aCurVal, const double& aMinVal, const double& aMaxVal,
const double& aMaxVal, const double& aStep, AccAttributes* aAttributes) { const double& aStep, AccAttributes* aAttributes) {
if (!IsProxy() && IsDefunct()) { if (!IsProxy() && IsDefunct()) {
return nullptr; return nullptr;
} }

View file

@ -55,7 +55,7 @@ class AccessibleWrap : public LocalAccessible {
mozilla::java::GeckoBundle::LocalRef ToBundle(bool aSmall = false); mozilla::java::GeckoBundle::LocalRef ToBundle(bool aSmall = false);
mozilla::java::GeckoBundle::LocalRef ToBundle( mozilla::java::GeckoBundle::LocalRef ToBundle(
const uint64_t aState, const LayoutDeviceIntRect& aBounds, const uint64_t aState, const nsIntRect& aBounds,
const uint8_t aActionCount, const nsString& aName, const uint8_t aActionCount, const nsString& aName,
const nsString& aTextValue, const nsString& aDOMNodeID, const nsString& aTextValue, const nsString& aDOMNodeID,
const nsString& aDescription, const nsString& aDescription,

View file

@ -74,9 +74,7 @@ void RemoteAccessibleWrap::Value(nsString& aValue) const {
uint64_t RemoteAccessibleWrap::State() { return Proxy()->State(); } uint64_t RemoteAccessibleWrap::State() { return Proxy()->State(); }
mozilla::LayoutDeviceIntRect RemoteAccessibleWrap::Bounds() const { nsIntRect RemoteAccessibleWrap::Bounds() const { return Proxy()->Bounds(); }
return Proxy()->Bounds();
}
void RemoteAccessibleWrap::ScrollTo(uint32_t aHow) const { void RemoteAccessibleWrap::ScrollTo(uint32_t aHow) const {
Proxy()->ScrollTo(aHow); Proxy()->ScrollTo(aHow);

View file

@ -41,7 +41,7 @@ class RemoteAccessibleWrap : public AccessibleWrap {
virtual uint64_t State() override; virtual uint64_t State() override;
virtual LayoutDeviceIntRect Bounds() const override; virtual nsIntRect Bounds() const override;
MOZ_CAN_RUN_SCRIPT MOZ_CAN_RUN_SCRIPT
virtual void ScrollTo(uint32_t aHow) const override; virtual void ScrollTo(uint32_t aHow) const override;

View file

@ -105,8 +105,7 @@ AtkObject* refAccessibleAtPointHelper(AtkObject* aAtkObj, gint aX, gint aY,
node = browser->GetOwnerElement(); node = browser->GetOwnerElement();
} }
MOZ_ASSERT(node); MOZ_ASSERT(node);
mozilla::LayoutDeviceIntPoint winCoords = nsIntPoint winCoords = nsCoreUtils::GetScreenCoordsForWindow(node);
nsCoreUtils::GetScreenCoordsForWindow(node);
aX += winCoords.x; aX += winCoords.x;
aY += winCoords.y; aY += winCoords.y;
} }
@ -139,11 +138,11 @@ void getExtentsHelper(AtkObject* aAtkObj, gint* aX, gint* aY, gint* aWidth,
return; return;
} }
mozilla::LayoutDeviceIntRect screenRect = accWrap->Bounds(); nsIntRect screenRect = accWrap->Bounds();
if (screenRect.IsEmpty()) return; if (screenRect.IsEmpty()) return;
if (aCoordType == ATK_XY_WINDOW) { if (aCoordType == ATK_XY_WINDOW) {
mozilla::LayoutDeviceIntPoint winCoords = nsIntPoint winCoords =
nsCoreUtils::GetScreenCoordsForWindow(accWrap->GetNode()); nsCoreUtils::GetScreenCoordsForWindow(accWrap->GetNode());
screenRect.x -= winCoords.x; screenRect.x -= winCoords.x;
screenRect.y -= winCoords.y; screenRect.y -= winCoords.y;

View file

@ -21,7 +21,7 @@ const gchar* getDescriptionCB(AtkObject* aAtkObj);
static void getImagePositionCB(AtkImage* aImage, gint* aAccX, gint* aAccY, static void getImagePositionCB(AtkImage* aImage, gint* aAccX, gint* aAccY,
AtkCoordType aCoordType) { AtkCoordType aCoordType) {
LayoutDeviceIntPoint pos(-1, -1); nsIntPoint pos = nsIntPoint(-1, -1);
uint32_t geckoCoordType = uint32_t geckoCoordType =
(aCoordType == ATK_XY_WINDOW) (aCoordType == ATK_XY_WINDOW)
? nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE ? nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE
@ -45,7 +45,7 @@ static const gchar* getImageDescriptionCB(AtkImage* aImage) {
static void getImageSizeCB(AtkImage* aImage, gint* aAccWidth, static void getImageSizeCB(AtkImage* aImage, gint* aAccWidth,
gint* aAccHeight) { gint* aAccHeight) {
LayoutDeviceIntSize size(-1, -1); nsIntSize size = nsIntSize(-1, -1);
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage)); AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage));
if (accWrap && accWrap->IsImage()) { if (accWrap && accWrap->IsImage()) {
size = accWrap->AsImage()->Size(); size = accWrap->AsImage()->Size();

View file

@ -323,7 +323,7 @@ static void getCharacterExtentsCB(AtkText* aText, gint aOffset, gint* aX,
} }
*aX = *aY = *aWidth = *aHeight = -1; *aX = *aY = *aWidth = *aHeight = -1;
LayoutDeviceIntRect rect; nsIntRect rect;
uint32_t geckoCoordType; uint32_t geckoCoordType;
if (aCoords == ATK_XY_SCREEN) { if (aCoords == ATK_XY_SCREEN) {
geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE; geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
@ -359,7 +359,7 @@ static void getRangeExtentsCB(AtkText* aText, gint aStartOffset,
} }
aRect->x = aRect->y = aRect->width = aRect->height = -1; aRect->x = aRect->y = aRect->width = aRect->height = -1;
LayoutDeviceIntRect rect; nsIntRect rect;
uint32_t geckoCoordType; uint32_t geckoCoordType;
if (aCoords == ATK_XY_SCREEN) { if (aCoords == ATK_XY_SCREEN) {
geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE; geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;

View file

@ -547,9 +547,8 @@ Accessible* Pivot::AtPoint(int32_t aX, int32_t aY, PivotRule& aRule) {
// Match if no node below this is a match // Match if no node below this is a match
if ((filtered & nsIAccessibleTraversalRule::FILTER_MATCH) && !match) { if ((filtered & nsIAccessibleTraversalRule::FILTER_MATCH) && !match) {
LayoutDeviceIntRect childRect = child->IsLocal() nsIntRect childRect = child->IsLocal() ? child->AsLocal()->Bounds()
? child->AsLocal()->Bounds() : child->AsRemote()->Bounds();
: child->AsRemote()->Bounds();
// Double-check child's bounds since the deepest child may have been out // Double-check child's bounds since the deepest child may have been out
// of bounds. This assures we don't return a false positive. // of bounds. This assures we don't return a false positive.
if (childRect.Contains(aX, aY)) { if (childRect.Contains(aX, aY)) {

View file

@ -244,10 +244,10 @@ HyperTextAccessible* nsAccUtils::GetTextContainer(nsINode* aNode) {
return nullptr; return nullptr;
} }
LayoutDeviceIntPoint nsAccUtils::ConvertToScreenCoords( nsIntPoint nsAccUtils::ConvertToScreenCoords(int32_t aX, int32_t aY,
int32_t aX, int32_t aY, uint32_t aCoordinateType, uint32_t aCoordinateType,
LocalAccessible* aAccessible) { LocalAccessible* aAccessible) {
LayoutDeviceIntPoint coords(aX, aY); nsIntPoint coords(aX, aY);
switch (aCoordinateType) { switch (aCoordinateType) {
case nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE: case nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE:
@ -278,7 +278,7 @@ void nsAccUtils::ConvertScreenCoordsTo(int32_t* aX, int32_t* aY,
break; break;
case nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE: { case nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE: {
LayoutDeviceIntPoint coords = nsIntPoint coords =
nsCoreUtils::GetScreenCoordsForWindow(aAccessible->GetNode()); nsCoreUtils::GetScreenCoordsForWindow(aAccessible->GetNode());
*aX -= coords.x; *aX -= coords.x;
*aY -= coords.y; *aY -= coords.y;
@ -286,7 +286,7 @@ void nsAccUtils::ConvertScreenCoordsTo(int32_t* aX, int32_t* aY,
} }
case nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE: { case nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE: {
LayoutDeviceIntPoint coords = GetScreenCoordsForParent(aAccessible); nsIntPoint coords = GetScreenCoordsForParent(aAccessible);
*aX -= coords.x; *aX -= coords.x;
*aY -= coords.y; *aY -= coords.y;
break; break;
@ -297,18 +297,16 @@ void nsAccUtils::ConvertScreenCoordsTo(int32_t* aX, int32_t* aY,
} }
} }
LayoutDeviceIntPoint nsAccUtils::GetScreenCoordsForParent( nsIntPoint nsAccUtils::GetScreenCoordsForParent(LocalAccessible* aAccessible) {
LocalAccessible* aAccessible) {
LocalAccessible* parent = aAccessible->LocalParent(); LocalAccessible* parent = aAccessible->LocalParent();
if (!parent) return LayoutDeviceIntPoint(0, 0); if (!parent) return nsIntPoint(0, 0);
nsIFrame* parentFrame = parent->GetFrame(); nsIFrame* parentFrame = parent->GetFrame();
if (!parentFrame) return LayoutDeviceIntPoint(0, 0); if (!parentFrame) return nsIntPoint(0, 0);
nsRect rect = parentFrame->GetScreenRectInAppUnits(); nsRect rect = parentFrame->GetScreenRectInAppUnits();
nscoord appUnitsRatio = parentFrame->PresContext()->AppUnitsPerDevPixel(); return nsPoint(rect.X(), rect.Y())
return LayoutDeviceIntPoint::FromAppUnitsToNearest( .ToNearestPixels(parentFrame->PresContext()->AppUnitsPerDevPixel());
nsPoint(rect.X(), rect.Y()), appUnitsRatio);
} }
bool nsAccUtils::GetLiveAttrValue(uint32_t aRule, nsAString& aValue) { bool nsAccUtils::GetLiveAttrValue(uint32_t aRule, nsAString& aValue) {

View file

@ -131,24 +131,24 @@ class nsAccUtils {
/** /**
* Converts the given coordinates to coordinates relative screen. * Converts the given coordinates to coordinates relative screen.
* *
* @param aX [in] the given x coord in dev pixels * @param aX [in] the given x coord
* @param aY [in] the given y coord in dev pixels * @param aY [in] the given y coord
* @param aCoordinateType [in] specifies coordinates origin (refer to * @param aCoordinateType [in] specifies coordinates origin (refer to
* nsIAccessibleCoordinateType) * nsIAccessibleCoordinateType)
* @param aAccessible [in] the accessible if coordinates are given * @param aAccessible [in] the accessible if coordinates are given
* relative it. * relative it.
* @return converted coordinates * @return converted coordinates
*/ */
static LayoutDeviceIntPoint ConvertToScreenCoords( static nsIntPoint ConvertToScreenCoords(int32_t aX, int32_t aY,
int32_t aX, int32_t aY, uint32_t aCoordinateType, uint32_t aCoordinateType,
LocalAccessible* aAccessible); LocalAccessible* aAccessible);
/** /**
* Converts the given coordinates relative screen to another coordinate * Converts the given coordinates relative screen to another coordinate
* system. * system.
* *
* @param aX [in, out] the given x coord in dev pixels * @param aX [in, out] the given x coord
* @param aY [in, out] the given y coord in dev pixels * @param aY [in, out] the given y coord
* @param aCoordinateType [in] specifies coordinates origin (refer to * @param aCoordinateType [in] specifies coordinates origin (refer to
* nsIAccessibleCoordinateType) * nsIAccessibleCoordinateType)
* @param aAccessible [in] the accessible if coordinates are given * @param aAccessible [in] the accessible if coordinates are given
@ -159,13 +159,11 @@ class nsAccUtils {
LocalAccessible* aAccessible); LocalAccessible* aAccessible);
/** /**
* Returns screen-relative coordinates (in dev pixels) for the parent of the * Returns coordinates relative screen for the parent of the given accessible.
* given accessible.
* *
* @param [in] aAccessible the accessible * @param [in] aAccessible the accessible
*/ */
static LayoutDeviceIntPoint GetScreenCoordsForParent( static nsIntPoint GetScreenCoordsForParent(LocalAccessible* aAccessible);
LocalAccessible* aAccessible);
/** /**
* Get the 'live' or 'container-live' object attribute value from the given * Get the 'live' or 'container-live' object attribute value from the given

View file

@ -255,12 +255,12 @@ nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange,
void nsCoreUtils::ScrollFrameToPoint(nsIFrame* aScrollableFrame, void nsCoreUtils::ScrollFrameToPoint(nsIFrame* aScrollableFrame,
nsIFrame* aFrame, nsIFrame* aFrame,
const LayoutDeviceIntPoint& aPoint) { const nsIntPoint& aPoint) {
nsIScrollableFrame* scrollableFrame = do_QueryFrame(aScrollableFrame); nsIScrollableFrame* scrollableFrame = do_QueryFrame(aScrollableFrame);
if (!scrollableFrame) return; if (!scrollableFrame) return;
nsPoint point = LayoutDeviceIntPoint::ToAppUnits( nsPoint point =
aPoint, aFrame->PresContext()->AppUnitsPerDevPixel()); ToAppUnits(aPoint, aFrame->PresContext()->AppUnitsPerDevPixel());
nsRect frameRect = aFrame->GetScreenRectInAppUnits(); nsRect frameRect = aFrame->GetScreenRectInAppUnits();
nsPoint deltaPoint = point - frameRect.TopLeft(); nsPoint deltaPoint = point - frameRect.TopLeft();
@ -322,8 +322,8 @@ void nsCoreUtils::ConvertScrollTypeToPercents(uint32_t aScrollType,
*aHorizontal = ScrollAxis(whereX, whenX); *aHorizontal = ScrollAxis(whereX, whenX);
} }
LayoutDeviceIntPoint nsCoreUtils::GetScreenCoordsForWindow(nsINode* aNode) { nsIntPoint nsCoreUtils::GetScreenCoordsForWindow(nsINode* aNode) {
LayoutDeviceIntPoint coords(0, 0); nsIntPoint coords(0, 0);
nsCOMPtr<nsIDocShellTreeItem> treeItem(GetDocShellFor(aNode)); nsCOMPtr<nsIDocShellTreeItem> treeItem(GetDocShellFor(aNode));
if (!treeItem) return coords; if (!treeItem) return coords;

View file

@ -14,7 +14,6 @@
#include "nsPoint.h" #include "nsPoint.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "Units.h"
class nsRange; class nsRange;
class nsTreeColumn; class nsTreeColumn;
@ -168,10 +167,10 @@ class nsCoreUtils {
* *
* @param aScrollableFrame the scrollable frame * @param aScrollableFrame the scrollable frame
* @param aFrame the frame to scroll * @param aFrame the frame to scroll
* @param aPoint the point scroll to (in dev pixels) * @param aPoint the point scroll to
*/ */
static void ScrollFrameToPoint(nsIFrame* aScrollableFrame, nsIFrame* aFrame, static void ScrollFrameToPoint(nsIFrame* aScrollableFrame, nsIFrame* aFrame,
const mozilla::LayoutDeviceIntPoint& aPoint); const nsIntPoint& aPoint);
/** /**
* Converts scroll type constant defined in nsIAccessibleScrollType to * Converts scroll type constant defined in nsIAccessibleScrollType to
@ -187,7 +186,7 @@ class nsCoreUtils {
* *
* @param aNode the DOM node hosted in the window. * @param aNode the DOM node hosted in the window.
*/ */
static mozilla::LayoutDeviceIntPoint GetScreenCoordsForWindow(nsINode* aNode); static nsIntPoint GetScreenCoordsForWindow(nsINode* aNode);
/** /**
* Return document shell for the given DOM node. * Return document shell for the given DOM node.

View file

@ -10,7 +10,6 @@
#include "mozilla/a11y/AccTypes.h" #include "mozilla/a11y/AccTypes.h"
#include "nsString.h" #include "nsString.h"
#include "nsRect.h" #include "nsRect.h"
#include "Units.h"
class nsAtom; class nsAtom;
@ -158,10 +157,7 @@ class Accessible {
virtual double MaxValue() const = 0; virtual double MaxValue() const = 0;
virtual double Step() const = 0; virtual double Step() const = 0;
/** virtual nsIntRect Bounds() const = 0;
* Return boundaries in screen coordinates in device pixels.
*/
virtual LayoutDeviceIntRect Bounds() const = 0;
/** /**
* Returns text of accessible if accessible has text role otherwise empty * Returns text of accessible if accessible has text role otherwise empty

View file

@ -94,9 +94,7 @@ Relation ApplicationAccessible::RelationByType(
return Relation(); return Relation();
} }
mozilla::LayoutDeviceIntRect ApplicationAccessible::Bounds() const { nsIntRect ApplicationAccessible::Bounds() const { return nsIntRect(); }
return mozilla::LayoutDeviceIntRect();
}
nsRect ApplicationAccessible::BoundsInAppUnits() const { return nsRect(); } nsRect ApplicationAccessible::BoundsInAppUnits() const { return nsRect(); }

View file

@ -33,7 +33,7 @@ class ApplicationAccessible : public AccessibleWrap {
// LocalAccessible // LocalAccessible
virtual void Shutdown() override; virtual void Shutdown() override;
virtual LayoutDeviceIntRect Bounds() const override; virtual nsIntRect Bounds() const override;
virtual nsRect BoundsInAppUnits() const override; virtual nsRect BoundsInAppUnits() const override;
virtual already_AddRefed<AccAttributes> NativeAttributes() override; virtual already_AddRefed<AccAttributes> NativeAttributes() override;
virtual GroupPos GroupPosition() override; virtual GroupPos GroupPosition() override;

View file

@ -206,22 +206,22 @@ uint64_t HyperTextAccessible::NativeState() const {
return states; return states;
} }
LayoutDeviceIntRect HyperTextAccessible::GetBoundsInFrame( nsIntRect HyperTextAccessible::GetBoundsInFrame(nsIFrame* aFrame,
nsIFrame* aFrame, uint32_t aStartRenderedOffset, uint32_t aStartRenderedOffset,
uint32_t aEndRenderedOffset) { uint32_t aEndRenderedOffset) {
nsPresContext* presContext = mDoc->PresContext(); nsPresContext* presContext = mDoc->PresContext();
if (!aFrame->IsTextFrame()) { if (!aFrame->IsTextFrame()) {
return LayoutDeviceIntRect::FromAppUnitsToNearest( return aFrame->GetScreenRectInAppUnits().ToNearestPixels(
aFrame->GetScreenRectInAppUnits(), presContext->AppUnitsPerDevPixel()); presContext->AppUnitsPerDevPixel());
} }
// Substring must be entirely within the same text node. // Substring must be entirely within the same text node.
int32_t startContentOffset, endContentOffset; int32_t startContentOffset, endContentOffset;
nsresult rv = RenderedToContentOffset(aFrame, aStartRenderedOffset, nsresult rv = RenderedToContentOffset(aFrame, aStartRenderedOffset,
&startContentOffset); &startContentOffset);
NS_ENSURE_SUCCESS(rv, LayoutDeviceIntRect()); NS_ENSURE_SUCCESS(rv, nsIntRect());
rv = RenderedToContentOffset(aFrame, aEndRenderedOffset, &endContentOffset); rv = RenderedToContentOffset(aFrame, aEndRenderedOffset, &endContentOffset);
NS_ENSURE_SUCCESS(rv, LayoutDeviceIntRect()); NS_ENSURE_SUCCESS(rv, nsIntRect());
nsIFrame* frame; nsIFrame* frame;
int32_t startContentOffsetInFrame; int32_t startContentOffsetInFrame;
@ -229,7 +229,7 @@ LayoutDeviceIntRect HyperTextAccessible::GetBoundsInFrame(
// the primary frame passed in // the primary frame passed in
rv = aFrame->GetChildFrameContainingOffset( rv = aFrame->GetChildFrameContainingOffset(
startContentOffset, false, &startContentOffsetInFrame, &frame); startContentOffset, false, &startContentOffsetInFrame, &frame);
NS_ENSURE_SUCCESS(rv, LayoutDeviceIntRect()); NS_ENSURE_SUCCESS(rv, nsIntRect());
nsRect screenRect; nsRect screenRect;
while (frame && startContentOffset < endContentOffset) { while (frame && startContentOffset < endContentOffset) {
@ -248,13 +248,13 @@ LayoutDeviceIntRect HyperTextAccessible::GetBoundsInFrame(
// Add the point where the string starts to the frameScreenRect // Add the point where the string starts to the frameScreenRect
nsPoint frameTextStartPoint; nsPoint frameTextStartPoint;
rv = frame->GetPointFromOffset(startContentOffset, &frameTextStartPoint); rv = frame->GetPointFromOffset(startContentOffset, &frameTextStartPoint);
NS_ENSURE_SUCCESS(rv, LayoutDeviceIntRect()); NS_ENSURE_SUCCESS(rv, nsIntRect());
// Use the point for the end offset to calculate the width // Use the point for the end offset to calculate the width
nsPoint frameTextEndPoint; nsPoint frameTextEndPoint;
rv = frame->GetPointFromOffset(startContentOffset + frameSubStringLength, rv = frame->GetPointFromOffset(startContentOffset + frameSubStringLength,
&frameTextEndPoint); &frameTextEndPoint);
NS_ENSURE_SUCCESS(rv, LayoutDeviceIntRect()); NS_ENSURE_SUCCESS(rv, nsIntRect());
frameScreenRect.SetRectX( frameScreenRect.SetRectX(
frameScreenRect.X() + frameScreenRect.X() +
@ -269,8 +269,7 @@ LayoutDeviceIntRect HyperTextAccessible::GetBoundsInFrame(
frame = frame->GetNextContinuation(); frame = frame->GetNextContinuation();
} }
return LayoutDeviceIntRect::FromAppUnitsToNearest( return screenRect.ToNearestPixels(presContext->AppUnitsPerDevPixel());
screenRect, presContext->AppUnitsPerDevPixel());
} }
uint32_t HyperTextAccessible::DOMPointToOffset(nsINode* aNode, uint32_t HyperTextAccessible::DOMPointToOffset(nsINode* aNode,
@ -1425,12 +1424,12 @@ int32_t HyperTextAccessible::OffsetAtPoint(int32_t aX, int32_t aY,
nsIFrame* hyperFrame = GetFrame(); nsIFrame* hyperFrame = GetFrame();
if (!hyperFrame) return -1; if (!hyperFrame) return -1;
LayoutDeviceIntPoint coords = nsIntPoint coords =
nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordType, this); nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordType, this);
nsPresContext* presContext = mDoc->PresContext(); nsPresContext* presContext = mDoc->PresContext();
nsPoint coordsInAppUnits = LayoutDeviceIntPoint::ToAppUnits( nsPoint coordsInAppUnits =
coords, presContext->AppUnitsPerDevPixel()); ToAppUnits(coords, presContext->AppUnitsPerDevPixel());
nsRect frameScreenRect = hyperFrame->GetScreenRectInAppUnits(); nsRect frameScreenRect = hyperFrame->GetScreenRectInAppUnits();
if (!frameScreenRect.Contains(coordsInAppUnits.x, coordsInAppUnits.y)) { if (!frameScreenRect.Contains(coordsInAppUnits.x, coordsInAppUnits.y)) {
@ -1486,15 +1485,15 @@ int32_t HyperTextAccessible::OffsetAtPoint(int32_t aX, int32_t aY,
return -1; // Not found return -1; // Not found
} }
LayoutDeviceIntRect HyperTextAccessible::TextBounds(int32_t aStartOffset, nsIntRect HyperTextAccessible::TextBounds(int32_t aStartOffset,
int32_t aEndOffset, int32_t aEndOffset,
uint32_t aCoordType) { uint32_t aCoordType) {
index_t startOffset = ConvertMagicOffset(aStartOffset); index_t startOffset = ConvertMagicOffset(aStartOffset);
index_t endOffset = ConvertMagicOffset(aEndOffset); index_t endOffset = ConvertMagicOffset(aEndOffset);
if (!startOffset.IsValid() || !endOffset.IsValid() || if (!startOffset.IsValid() || !endOffset.IsValid() ||
startOffset > endOffset || endOffset > CharacterCount()) { startOffset > endOffset || endOffset > CharacterCount()) {
NS_ERROR("Wrong in offset"); NS_ERROR("Wrong in offset");
return LayoutDeviceIntRect(); return nsIntRect();
} }
if (CharacterCount() == 0) { if (CharacterCount() == 0) {
@ -1502,16 +1501,16 @@ LayoutDeviceIntRect HyperTextAccessible::TextBounds(int32_t aStartOffset,
// Empty content, use our own bound to at least get x,y coordinates // Empty content, use our own bound to at least get x,y coordinates
nsIFrame* frame = GetFrame(); nsIFrame* frame = GetFrame();
if (!frame) { if (!frame) {
return LayoutDeviceIntRect(); return nsIntRect();
} }
return LayoutDeviceIntRect::FromAppUnitsToNearest( return frame->GetScreenRectInAppUnits().ToNearestPixels(
frame->GetScreenRectInAppUnits(), presContext->AppUnitsPerDevPixel()); presContext->AppUnitsPerDevPixel());
} }
int32_t childIdx = GetChildIndexAtOffset(startOffset); int32_t childIdx = GetChildIndexAtOffset(startOffset);
if (childIdx == -1) return LayoutDeviceIntRect(); if (childIdx == -1) return nsIntRect();
LayoutDeviceIntRect bounds; nsIntRect bounds;
int32_t prevOffset = GetChildOffset(childIdx); int32_t prevOffset = GetChildOffset(childIdx);
int32_t offset1 = startOffset - prevOffset; int32_t offset1 = startOffset - prevOffset;
@ -1541,9 +1540,8 @@ LayoutDeviceIntRect HyperTextAccessible::TextBounds(int32_t aStartOffset,
// screen coordinates. // screen coordinates.
nsPresContext* presContext = mDoc->PresContext(); nsPresContext* presContext = mDoc->PresContext();
nsIFrame* rootFrame = presContext->PresShell()->GetRootFrame(); nsIFrame* rootFrame = presContext->PresShell()->GetRootFrame();
LayoutDeviceIntRect orgRectPixels = nsIntRect orgRectPixels =
LayoutDeviceIntRect::FromAppUnitsToNearest( rootFrame->GetScreenRectInAppUnits().ToNearestPixels(
rootFrame->GetScreenRectInAppUnits(),
presContext->AppUnitsPerDevPixel()); presContext->AppUnitsPerDevPixel());
bounds.MoveBy(-orgRectPixels.X(), -orgRectPixels.Y()); bounds.MoveBy(-orgRectPixels.X(), -orgRectPixels.Y());
bounds.ScaleRoundOut(presContext->PresShell()->GetResolution()); bounds.ScaleRoundOut(presContext->PresShell()->GetResolution());
@ -1805,7 +1803,7 @@ LayoutDeviceIntRect HyperTextAccessible::GetCaretRect(nsIWidget** aWidget) {
// focus. // focus.
return LayoutDeviceIntRect(); return LayoutDeviceIntRect();
} }
LayoutDeviceIntRect charRect = CharBounds( nsIntRect charRect = CharBounds(
caretOffset, nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE); caretOffset, nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE);
if (!charRect.IsEmpty()) { if (!charRect.IsEmpty()) {
caretRect.SetTopEdge(charRect.Y()); caretRect.SetTopEdge(charRect.Y());
@ -1947,7 +1945,7 @@ void HyperTextAccessible::ScrollSubstringToPoint(int32_t aStartOffset,
nsIFrame* frame = GetFrame(); nsIFrame* frame = GetFrame();
if (!frame) return; if (!frame) return;
LayoutDeviceIntPoint coords = nsIntPoint coords =
nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordinateType, this); nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordinateType, this);
RefPtr<nsRange> domRange = nsRange::Create(mContent); RefPtr<nsRange> domRange = nsRange::Create(mContent);
@ -1957,8 +1955,8 @@ void HyperTextAccessible::ScrollSubstringToPoint(int32_t aStartOffset,
} }
nsPresContext* presContext = frame->PresContext(); nsPresContext* presContext = frame->PresContext();
nsPoint coordsInAppUnits = LayoutDeviceIntPoint::ToAppUnits( nsPoint coordsInAppUnits =
coords, presContext->AppUnitsPerDevPixel()); ToAppUnits(coords, presContext->AppUnitsPerDevPixel());
bool initialScrolled = false; bool initialScrolled = false;
nsIFrame* parentFrame = frame; nsIFrame* parentFrame = frame;

View file

@ -184,19 +184,18 @@ class HyperTextAccessible : public AccessibleWrap,
int32_t OffsetAtPoint(int32_t aX, int32_t aY, uint32_t aCoordType); int32_t OffsetAtPoint(int32_t aX, int32_t aY, uint32_t aCoordType);
/** /**
* Return a rect (in dev pixels) of the given text range relative given * Return a rect of the given text range relative given coordinate system.
* coordinate system.
*/ */
LayoutDeviceIntRect TextBounds( nsIntRect TextBounds(
int32_t aStartOffset, int32_t aEndOffset, int32_t aStartOffset, int32_t aEndOffset,
uint32_t aCoordType = uint32_t aCoordType =
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE); nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE);
/** /**
* Return a rect (in dev pixels) for character at given offset relative given * Return a rect for character at given offset relative given coordinate
* coordinate system. * system.
*/ */
LayoutDeviceIntRect CharBounds(int32_t aOffset, uint32_t aCoordType) { nsIntRect CharBounds(int32_t aOffset, uint32_t aCoordType) {
int32_t endOffset = aOffset == static_cast<int32_t>(CharacterCount()) int32_t endOffset = aOffset == static_cast<int32_t>(CharacterCount())
? aOffset ? aOffset
: aOffset + 1; : aOffset + 1;
@ -395,13 +394,11 @@ class HyperTextAccessible : public AccessibleWrap,
EWordMovementType aWordMovementType = eDefaultBehavior); EWordMovementType aWordMovementType = eDefaultBehavior);
/** /**
* Return the boundaries (in dev pixels) of the substring in case of textual * Return the boundaries of the substring in case of textual frame or
* frame or frame boundaries in case of non textual frame, offsets are * frame boundaries in case of non textual frame, offsets are ignored.
* ignored.
*/ */
LayoutDeviceIntRect GetBoundsInFrame(nsIFrame* aFrame, nsIntRect GetBoundsInFrame(nsIFrame* aFrame, uint32_t aStartRenderedOffset,
uint32_t aStartRenderedOffset, uint32_t aEndRenderedOffset);
uint32_t aEndRenderedOffset);
// Selection helpers // Selection helpers

View file

@ -23,7 +23,7 @@
#include "nsPIDOMWindow.h" #include "nsPIDOMWindow.h"
#include "nsIURI.h" #include "nsIURI.h"
namespace mozilla::a11y { using namespace mozilla::a11y;
NS_IMPL_ISUPPORTS_INHERITED(ImageAccessible, LinkableAccessible, NS_IMPL_ISUPPORTS_INHERITED(ImageAccessible, LinkableAccessible,
imgINotificationObserver) imgINotificationObserver)
@ -137,7 +137,7 @@ bool ImageAccessible::DoAction(uint8_t aIndex) const {
nsCOMPtr<nsPIDOMWindowOuter> piWindow = document->GetWindow(); nsCOMPtr<nsPIDOMWindowOuter> piWindow = document->GetWindow();
if (!piWindow) return false; if (!piWindow) return false;
RefPtr<dom::BrowsingContext> tmp; RefPtr<mozilla::dom::BrowsingContext> tmp;
return NS_SUCCEEDED(piWindow->Open(spec, u""_ns, u""_ns, return NS_SUCCEEDED(piWindow->Open(spec, u""_ns, u""_ns,
/* aLoadInfo = */ nullptr, /* aLoadInfo = */ nullptr,
/* aForceNoOpener = */ false, /* aForceNoOpener = */ false,
@ -147,13 +147,13 @@ bool ImageAccessible::DoAction(uint8_t aIndex) const {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// ImageAccessible // ImageAccessible
LayoutDeviceIntPoint ImageAccessible::Position(uint32_t aCoordType) { nsIntPoint ImageAccessible::Position(uint32_t aCoordType) {
LayoutDeviceIntPoint point = Bounds().TopLeft(); nsIntPoint point = Bounds().TopLeft();
nsAccUtils::ConvertScreenCoordsTo(&point.x, &point.y, aCoordType, this); nsAccUtils::ConvertScreenCoordsTo(&point.x, &point.y, aCoordType, this);
return point; return point;
} }
LayoutDeviceIntSize ImageAccessible::Size() { return Bounds().Size(); } nsIntSize ImageAccessible::Size() { return Bounds().Size(); }
// LocalAccessible // LocalAccessible
already_AddRefed<AccAttributes> ImageAccessible::NativeAttributes() { already_AddRefed<AccAttributes> ImageAccessible::NativeAttributes() {
@ -247,5 +247,3 @@ void ImageAccessible::Notify(imgIRequest* aRequest, int32_t aType,
mImageRequestStatus = status; mImageRequestStatus = status;
} }
} // namespace mozilla::a11y

View file

@ -37,8 +37,8 @@ class ImageAccessible : public LinkableAccessible,
virtual bool DoAction(uint8_t aIndex) const override; virtual bool DoAction(uint8_t aIndex) const override;
// ImageAccessible // ImageAccessible
LayoutDeviceIntPoint Position(uint32_t aCoordType); nsIntPoint Position(uint32_t aCoordType);
LayoutDeviceIntSize Size(); nsIntSize Size();
protected: protected:
virtual ~ImageAccessible(); virtual ~ImageAccessible();

View file

@ -501,7 +501,7 @@ LocalAccessible* LocalAccessible::LocalChildAtPoint(
// If we can't find the point in a child, we will return the fallback answer: // If we can't find the point in a child, we will return the fallback answer:
// we return |this| if the point is within it, otherwise nullptr. // we return |this| if the point is within it, otherwise nullptr.
LocalAccessible* fallbackAnswer = nullptr; LocalAccessible* fallbackAnswer = nullptr;
LayoutDeviceIntRect rect = Bounds(); nsIntRect rect = Bounds();
if (rect.Contains(aX, aY)) fallbackAnswer = this; if (rect.Contains(aX, aY)) fallbackAnswer = this;
if (nsAccUtils::MustPrune(this)) { // Do not dig any further if (nsAccUtils::MustPrune(this)) { // Do not dig any further
@ -611,7 +611,7 @@ LocalAccessible* LocalAccessible::LocalChildAtPoint(
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) { for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
LocalAccessible* child = accessible->LocalChildAt(childIdx); LocalAccessible* child = accessible->LocalChildAt(childIdx);
LayoutDeviceIntRect childRect = child->Bounds(); nsIntRect childRect = child->Bounds();
if (childRect.Contains(aX, aY) && if (childRect.Contains(aX, aY) &&
(child->State() & states::INVISIBLE) == 0) { (child->State() & states::INVISIBLE) == 0) {
if (aWhichChild == EWhichChildAtPoint::DeepestChild) { if (aWhichChild == EWhichChildAtPoint::DeepestChild) {
@ -786,9 +786,9 @@ nsRect LocalAccessible::BoundsInAppUnits() const {
return unionRectTwips; return unionRectTwips;
} }
LayoutDeviceIntRect LocalAccessible::Bounds() const { nsIntRect LocalAccessible::Bounds() const {
return LayoutDeviceIntRect::FromAppUnitsToNearest( return BoundsInAppUnits().ToNearestPixels(
BoundsInAppUnits(), mDoc->PresContext()->AppUnitsPerDevPixel()); mDoc->PresContext()->AppUnitsPerDevPixel());
} }
nsIntRect LocalAccessible::BoundsInCSSPixels() const { nsIntRect LocalAccessible::BoundsInCSSPixels() const {
@ -2296,7 +2296,7 @@ void LocalAccessible::ScrollToPoint(uint32_t aCoordinateType, int32_t aX,
nsIFrame* frame = GetFrame(); nsIFrame* frame = GetFrame();
if (!frame) return; if (!frame) return;
LayoutDeviceIntPoint coords = nsIntPoint coords =
nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordinateType, this); nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordinateType, this);
nsIFrame* parentFrame = frame; nsIFrame* parentFrame = frame;

View file

@ -406,7 +406,10 @@ class LocalAccessible : public nsISupports, public Accessible {
*/ */
virtual nsRect BoundsInAppUnits() const; virtual nsRect BoundsInAppUnits() const;
virtual LayoutDeviceIntRect Bounds() const override; /**
* Return boundaries in screen coordinates.
*/
virtual nsIntRect Bounds() const override;
/** /**
* Return boundaries in screen coordinates in CSS pixels. * Return boundaries in screen coordinates in CSS pixels.

View file

@ -77,7 +77,7 @@ role OuterDocAccessible::NativeRole() const { return roles::INTERNAL_FRAME; }
LocalAccessible* OuterDocAccessible::LocalChildAtPoint( LocalAccessible* OuterDocAccessible::LocalChildAtPoint(
int32_t aX, int32_t aY, EWhichChildAtPoint aWhichChild) { int32_t aX, int32_t aY, EWhichChildAtPoint aWhichChild) {
LayoutDeviceIntRect docRect = Bounds(); nsIntRect docRect = Bounds();
if (!docRect.Contains(aX, aY)) return nullptr; if (!docRect.Contains(aX, aY)) return nullptr;
// Always return the inner doc as direct child accessible unless bounds // Always return the inner doc as direct child accessible unless bounds
@ -212,7 +212,7 @@ Accessible* OuterDocAccessible::ChildAt(uint32_t aIndex) const {
Accessible* OuterDocAccessible::ChildAtPoint(int32_t aX, int32_t aY, Accessible* OuterDocAccessible::ChildAtPoint(int32_t aX, int32_t aY,
EWhichChildAtPoint aWhichChild) { EWhichChildAtPoint aWhichChild) {
LayoutDeviceIntRect docRect = Bounds(); nsIntRect docRect = Bounds();
if (!docRect.Contains(aX, aY)) return nullptr; if (!docRect.Contains(aX, aY)) return nullptr;
// Always return the inner doc as direct child accessible unless bounds // Always return the inner doc as direct child accessible unless bounds

View file

@ -194,8 +194,8 @@ uint64_t HTMLSelectOptionAccessible::NativeState() const {
// <select> is not collapsed: compare bounds to calculate OFFSCREEN // <select> is not collapsed: compare bounds to calculate OFFSCREEN
LocalAccessible* listAcc = LocalParent(); LocalAccessible* listAcc = LocalParent();
if (listAcc) { if (listAcc) {
LayoutDeviceIntRect optionRect = Bounds(); nsIntRect optionRect = Bounds();
LayoutDeviceIntRect listRect = listAcc->Bounds(); nsIntRect listRect = listAcc->Bounds();
if (optionRect.Y() < listRect.Y() || if (optionRect.Y() < listRect.Y() ||
optionRect.YMost() > listRect.YMost()) { optionRect.YMost() > listRect.YMost()) {
state |= states::OFFSCREEN; state |= states::OFFSCREEN;

View file

@ -916,10 +916,10 @@ void DocAccessibleParent::MaybeInitWindowEmulation() {
MOZ_ASSERT(rootDocument); MOZ_ASSERT(rootDocument);
bool isActive = true; bool isActive = true;
LayoutDeviceIntRect rect(CW_USEDEFAULT, CW_USEDEFAULT, 0, 0); nsIntRect rect(CW_USEDEFAULT, CW_USEDEFAULT, 0, 0);
if (Compatibility::IsDolphin()) { if (Compatibility::IsDolphin()) {
rect = Bounds(); rect = Bounds();
LayoutDeviceIntRect rootRect = rootDocument->Bounds(); nsIntRect rootRect = rootDocument->Bounds();
rect.MoveToX(rootRect.X() - rect.X()); rect.MoveToX(rootRect.X() - rect.X());
rect.MoveToY(rect.Y() - rootRect.Y()); rect.MoveToY(rect.Y() - rootRect.Y());

View file

@ -270,12 +270,12 @@ Maybe<nsRect> RemoteAccessibleBase<Derived>::RetrieveCachedBounds() const {
} }
template <class Derived> template <class Derived>
LayoutDeviceIntRect RemoteAccessibleBase<Derived>::Bounds() const { nsIntRect RemoteAccessibleBase<Derived>::Bounds() const {
if (mCachedFields) { if (mCachedFields) {
Maybe<nsRect> maybeBounds = RetrieveCachedBounds(); Maybe<nsRect> maybeBounds = RetrieveCachedBounds();
if (maybeBounds) { if (maybeBounds) {
nsRect bounds = *maybeBounds; nsRect bounds = *maybeBounds;
LayoutDeviceIntRect devPxBounds; nsIntRect devPxBounds;
dom::CanonicalBrowsingContext* cbc = dom::CanonicalBrowsingContext* cbc =
static_cast<dom::BrowserParent*>(mDoc->Manager()) static_cast<dom::BrowserParent*>(mDoc->Manager())
->GetBrowsingContext() ->GetBrowsingContext()
@ -290,11 +290,11 @@ LayoutDeviceIntRect RemoteAccessibleBase<Derived>::Bounds() const {
const_cast<Accessible*>(acc)->AsLocal()) { const_cast<Accessible*>(acc)->AsLocal()) {
// LocalAccessible::Bounds returns screen-relative bounds in // LocalAccessible::Bounds returns screen-relative bounds in
// dev pixels. // dev pixels.
LayoutDeviceIntRect localBounds = localAcc->Bounds(); nsIntRect localBounds = localAcc->Bounds();
// Convert our existing `bounds` rect from app units to dev pixels // Convert our existing `bounds` rect from app units to dev pixels
devPxBounds = LayoutDeviceIntRect::FromAppUnitsToNearest( devPxBounds =
bounds, presContext->AppUnitsPerDevPixel()); bounds.ToNearestPixels(presContext->AppUnitsPerDevPixel());
// We factor in our zoom level before offsetting by // We factor in our zoom level before offsetting by
// `localBounds`, which has already taken zoom into account. // `localBounds`, which has already taken zoom into account.
@ -351,14 +351,14 @@ LayoutDeviceIntRect RemoteAccessibleBase<Derived>::Bounds() const {
// viewport. We calculate the difference and translate our bounds here. // viewport. We calculate the difference and translate our bounds here.
nsPoint viewportOffset = presShell->GetVisualViewportOffset() - nsPoint viewportOffset = presShell->GetVisualViewportOffset() -
presShell->GetLayoutViewportOffset(); presShell->GetLayoutViewportOffset();
devPxBounds.MoveBy(-(LayoutDeviceIntPoint::FromAppUnitsToNearest( devPxBounds.MoveBy(-(
viewportOffset, presContext->AppUnitsPerDevPixel()))); viewportOffset.ToNearestPixels(presContext->AppUnitsPerDevPixel())));
return devPxBounds; return devPxBounds;
} }
} }
return LayoutDeviceIntRect(); return nsIntRect();
} }
template <class Derived> template <class Derived>

View file

@ -176,7 +176,7 @@ class RemoteAccessibleBase : public Accessible, public HyperTextAccessibleBase {
virtual double MaxValue() const override; virtual double MaxValue() const override;
virtual double Step() const override; virtual double Step() const override;
virtual LayoutDeviceIntRect Bounds() const override; virtual nsIntRect Bounds() const override;
virtual uint64_t State() override; virtual uint64_t State() override;

View file

@ -94,12 +94,12 @@ void GetTextBeforeOffset(int32_t aOffset, AccessibleTextBoundary aBoundaryType,
char16_t CharAt(int32_t aOffset); char16_t CharAt(int32_t aOffset);
LayoutDeviceIntRect TextBounds( nsIntRect TextBounds(
int32_t aStartOffset, int32_t aEndOffset, int32_t aStartOffset, int32_t aEndOffset,
uint32_t aCoordType = uint32_t aCoordType =
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE); nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE);
LayoutDeviceIntRect CharBounds(int32_t aOffset, uint32_t aCoordType); nsIntRect CharBounds(int32_t aOffset, uint32_t aCoordType);
int32_t OffsetAtPoint(int32_t aX, int32_t aY, uint32_t aCoordType); int32_t OffsetAtPoint(int32_t aX, int32_t aY, uint32_t aCoordType);
@ -133,9 +133,9 @@ bool DeleteText(int32_t aStartPos, int32_t aEndPos);
bool PasteText(int32_t aPosition); bool PasteText(int32_t aPosition);
LayoutDeviceIntPoint ImagePosition(uint32_t aCoordType); nsIntPoint ImagePosition(uint32_t aCoordType);
LayoutDeviceIntSize ImageSize(); nsIntSize ImageSize();
uint32_t EndOffset(bool* aOk); uint32_t EndOffset(bool* aOk);
@ -234,7 +234,7 @@ RemoteAccessible* FocusedChild();
virtual Accessible* ChildAtPoint( virtual Accessible* ChildAtPoint(
int32_t aX, int32_t aY, int32_t aX, int32_t aY,
LocalAccessible::EWhichChildAtPoint aWhichChild) override; LocalAccessible::EWhichChildAtPoint aWhichChild) override;
LayoutDeviceIntRect Bounds() const override; nsIntRect Bounds() const override;
nsIntRect BoundsInCSSPixels(); nsIntRect BoundsInCSSPixels();
void Language(nsString& aLocale); void Language(nsString& aLocale);

View file

@ -109,12 +109,12 @@ mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvTextForRange(
mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvBoundsForRange( mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvBoundsForRange(
const uint64_t& aID, const int32_t& aStartOffset, const uint64_t& aID, const int32_t& aStartOffset,
const uint64_t& aEndContainer, const int32_t& aEndOffset, const uint64_t& aEndContainer, const int32_t& aEndOffset,
LayoutDeviceIntRect* aBounds) { nsIntRect* aBounds) {
HyperTextAccessibleWrap* acc = IdToHyperTextAccessibleWrap(aID); HyperTextAccessibleWrap* acc = IdToHyperTextAccessibleWrap(aID);
HyperTextAccessibleWrap* endContainer = HyperTextAccessibleWrap* endContainer =
IdToHyperTextAccessibleWrap(aEndContainer); IdToHyperTextAccessibleWrap(aEndContainer);
if (!acc || !endContainer) { if (!acc || !endContainer) {
*aBounds = LayoutDeviceIntRect(); *aBounds = nsIntRect();
return IPC_OK(); return IPC_OK();
} }

View file

@ -41,7 +41,7 @@ class DocAccessiblePlatformExtChild : public PDocAccessiblePlatformExtChild {
const int32_t& aStartOffset, const int32_t& aStartOffset,
const uint64_t& aEndContainer, const uint64_t& aEndContainer,
const int32_t& aEndOffset, const int32_t& aEndOffset,
LayoutDeviceIntRect* aBounds); nsIntRect* aBounds);
mozilla::ipc::IPCResult RecvLengthForRange(const uint64_t& aID, mozilla::ipc::IPCResult RecvLengthForRange(const uint64_t& aID,
const int32_t& aStartOffset, const int32_t& aStartOffset,

View file

@ -11,7 +11,7 @@ include "mozilla/GfxMessageUtils.h";
using mozilla::a11y::EWhichRange from "mozilla/a11y/IPCTypes.h"; using mozilla::a11y::EWhichRange from "mozilla/a11y/IPCTypes.h";
using mozilla::a11y::EWhichPostFilter from "mozilla/a11y/IPCTypes.h"; using mozilla::a11y::EWhichPostFilter from "mozilla/a11y/IPCTypes.h";
[RefCounted] using mozilla::a11y::AccAttributes from "mozilla/a11y/IPCTypes.h"; [RefCounted] using mozilla::a11y::AccAttributes from "mozilla/a11y/IPCTypes.h";
using mozilla::LayoutDeviceIntRect from "Units.h"; using nsIntRect from "nsRect.h";
namespace mozilla { namespace mozilla {
namespace a11y { namespace a11y {
@ -43,7 +43,7 @@ child:
returns(nsString aText); returns(nsString aText);
[Nested=inside_sync] sync BoundsForRange(uint64_t aID, int32_t aStartOffset, uint64_t aEndContainer, int32_t aEndOffset) [Nested=inside_sync] sync BoundsForRange(uint64_t aID, int32_t aStartOffset, uint64_t aEndContainer, int32_t aEndOffset)
returns(LayoutDeviceIntRect aRetVal); returns(nsIntRect aRetVal);
[Nested=inside_sync] sync LengthForRange(uint64_t aID, int32_t aStartOffset, uint64_t aEndContainer, int32_t aEndOffset) [Nested=inside_sync] sync LengthForRange(uint64_t aID, int32_t aStartOffset, uint64_t aEndContainer, int32_t aEndOffset)
returns(int32_t aLength); returns(int32_t aLength);

View file

@ -419,7 +419,7 @@ mozilla::ipc::IPCResult DocAccessibleChild::RecvDefaultTextAttributes(
mozilla::ipc::IPCResult DocAccessibleChild::RecvTextBounds( mozilla::ipc::IPCResult DocAccessibleChild::RecvTextBounds(
const uint64_t& aID, const int32_t& aStartOffset, const int32_t& aEndOffset, const uint64_t& aID, const int32_t& aStartOffset, const int32_t& aEndOffset,
const uint32_t& aCoordType, LayoutDeviceIntRect* aRetVal) { const uint32_t& aCoordType, nsIntRect* aRetVal) {
HyperTextAccessible* acc = IdToHyperTextAccessible(aID); HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
if (acc && acc->IsTextRole()) { if (acc && acc->IsTextRole()) {
*aRetVal = acc->TextBounds(aStartOffset, aEndOffset, aCoordType); *aRetVal = acc->TextBounds(aStartOffset, aEndOffset, aCoordType);
@ -430,7 +430,7 @@ mozilla::ipc::IPCResult DocAccessibleChild::RecvTextBounds(
mozilla::ipc::IPCResult DocAccessibleChild::RecvCharBounds( mozilla::ipc::IPCResult DocAccessibleChild::RecvCharBounds(
const uint64_t& aID, const int32_t& aOffset, const uint32_t& aCoordType, const uint64_t& aID, const int32_t& aOffset, const uint32_t& aCoordType,
LayoutDeviceIntRect* aRetVal) { nsIntRect* aRetVal) {
HyperTextAccessible* acc = IdToHyperTextAccessible(aID); HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
if (acc && acc->IsTextRole()) { if (acc && acc->IsTextRole()) {
*aRetVal = acc->CharBounds(aOffset, aCoordType); *aRetVal = acc->CharBounds(aOffset, aCoordType);
@ -606,8 +606,7 @@ mozilla::ipc::IPCResult DocAccessibleChild::RecvPasteText(
} }
mozilla::ipc::IPCResult DocAccessibleChild::RecvImagePosition( mozilla::ipc::IPCResult DocAccessibleChild::RecvImagePosition(
const uint64_t& aID, const uint32_t& aCoordType, const uint64_t& aID, const uint32_t& aCoordType, nsIntPoint* aRetVal) {
LayoutDeviceIntPoint* aRetVal) {
ImageAccessible* acc = IdToImageAccessible(aID); ImageAccessible* acc = IdToImageAccessible(aID);
if (acc) { if (acc) {
*aRetVal = acc->Position(aCoordType); *aRetVal = acc->Position(aCoordType);
@ -616,8 +615,8 @@ mozilla::ipc::IPCResult DocAccessibleChild::RecvImagePosition(
return IPC_OK(); return IPC_OK();
} }
mozilla::ipc::IPCResult DocAccessibleChild::RecvImageSize( mozilla::ipc::IPCResult DocAccessibleChild::RecvImageSize(const uint64_t& aID,
const uint64_t& aID, LayoutDeviceIntSize* aRetVal) { nsIntSize* aRetVal) {
ImageAccessible* acc = IdToImageAccessible(aID); ImageAccessible* acc = IdToImageAccessible(aID);
if (acc) { if (acc) {
*aRetVal = acc->Size(); *aRetVal = acc->Size();
@ -1644,10 +1643,10 @@ mozilla::ipc::IPCResult DocAccessibleChild::RecvExtents(
*aHeight = 0; *aHeight = 0;
LocalAccessible* acc = IdToAccessible(aID); LocalAccessible* acc = IdToAccessible(aID);
if (acc && !acc->IsDefunct()) { if (acc && !acc->IsDefunct()) {
LayoutDeviceIntRect screenRect = acc->Bounds(); nsIntRect screenRect = acc->Bounds();
if (!screenRect.IsEmpty()) { if (!screenRect.IsEmpty()) {
if (aNeedsScreenCoords) { if (aNeedsScreenCoords) {
LayoutDeviceIntPoint winCoords = nsIntPoint winCoords =
nsCoreUtils::GetScreenCoordsForWindow(acc->GetNode()); nsCoreUtils::GetScreenCoordsForWindow(acc->GetNode());
screenRect.x -= winCoords.x; screenRect.x -= winCoords.x;
screenRect.y -= winCoords.y; screenRect.y -= winCoords.y;

View file

@ -143,14 +143,16 @@ class DocAccessibleChild : public DocAccessibleChildBase {
virtual mozilla::ipc::IPCResult RecvDefaultTextAttributes( virtual mozilla::ipc::IPCResult RecvDefaultTextAttributes(
const uint64_t& aID, RefPtr<AccAttributes>* aAttributes) override; const uint64_t& aID, RefPtr<AccAttributes>* aAttributes) override;
virtual mozilla::ipc::IPCResult RecvTextBounds( virtual mozilla::ipc::IPCResult RecvTextBounds(const uint64_t& aID,
const uint64_t& aID, const int32_t& aStartOffset, const int32_t& aStartOffset,
const int32_t& aEndOffset, const uint32_t& aCoordType, const int32_t& aEndOffset,
LayoutDeviceIntRect* aRetVal) override; const uint32_t& aCoordType,
nsIntRect* aRetVal) override;
virtual mozilla::ipc::IPCResult RecvCharBounds( virtual mozilla::ipc::IPCResult RecvCharBounds(const uint64_t& aID,
const uint64_t& aID, const int32_t& aOffset, const uint32_t& aCoordType, const int32_t& aOffset,
LayoutDeviceIntRect* aRetVal) override; const uint32_t& aCoordType,
nsIntRect* aRetVal) override;
virtual mozilla::ipc::IPCResult RecvOffsetAtPoint(const uint64_t& aID, virtual mozilla::ipc::IPCResult RecvOffsetAtPoint(const uint64_t& aID,
const int32_t& aX, const int32_t& aX,
@ -217,10 +219,10 @@ class DocAccessibleChild : public DocAccessibleChildBase {
virtual mozilla::ipc::IPCResult RecvImagePosition( virtual mozilla::ipc::IPCResult RecvImagePosition(
const uint64_t& aID, const uint32_t& aCoordType, const uint64_t& aID, const uint32_t& aCoordType,
LayoutDeviceIntPoint* aRetVal) override; nsIntPoint* aRetVal) override;
virtual mozilla::ipc::IPCResult RecvImageSize( virtual mozilla::ipc::IPCResult RecvImageSize(const uint64_t& aID,
const uint64_t& aID, LayoutDeviceIntSize* aRetVal) override; nsIntSize* aRetVal) override;
virtual mozilla::ipc::IPCResult RecvStartOffset(const uint64_t& aID, virtual mozilla::ipc::IPCResult RecvStartOffset(const uint64_t& aID,
uint32_t* aRetVal, uint32_t* aRetVal,

View file

@ -12,14 +12,14 @@ include DocAccessibleTypes;
include "mozilla/GfxMessageUtils.h"; include "mozilla/GfxMessageUtils.h";
using LayoutDeviceIntRect from "Units.h"; using nsIntRect from "nsRect.h";
using LayoutDeviceIntPoint from "Units.h";
using LayoutDeviceIntSize from "Units.h";
using mozilla::a11y::role from "mozilla/a11y/IPCTypes.h"; using mozilla::a11y::role from "mozilla/a11y/IPCTypes.h";
using mozilla::a11y::AccType from "mozilla/a11y/IPCTypes.h"; using mozilla::a11y::AccType from "mozilla/a11y/IPCTypes.h";
using mozilla::a11y::AccGenericType from "mozilla/a11y/IPCTypes.h"; using mozilla::a11y::AccGenericType from "mozilla/a11y/IPCTypes.h";
[RefCounted] using mozilla::a11y::AccAttributes from "mozilla/a11y/IPCTypes.h"; [RefCounted] using mozilla::a11y::AccAttributes from "mozilla/a11y/IPCTypes.h";
using mozilla::a11y::CacheUpdateType from "mozilla/a11y/IPCTypes.h"; using mozilla::a11y::CacheUpdateType from "mozilla/a11y/IPCTypes.h";
using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
using mozilla::gfx::IntPoint from "mozilla/gfx/Point.h";
namespace mozilla { namespace mozilla {
namespace a11y { namespace a11y {
@ -44,7 +44,7 @@ struct BatchData
OriginDocument Document; OriginDocument Document;
uint64_t ID; uint64_t ID;
uint64_t State; uint64_t State;
LayoutDeviceIntRect Bounds; nsIntRect Bounds;
uint8_t ActionCount; uint8_t ActionCount;
nsString Name; nsString Name;
nsString TextValue; nsString TextValue;
@ -200,9 +200,9 @@ child:
[Nested=inside_sync] sync TextBounds(uint64_t aID, int32_t aStartOffset, int32_t aEndOffset, [Nested=inside_sync] sync TextBounds(uint64_t aID, int32_t aStartOffset, int32_t aEndOffset,
uint32_t aCoordType) uint32_t aCoordType)
returns(LayoutDeviceIntRect aRetVal); returns(nsIntRect aRetVal);
[Nested=inside_sync] sync CharBounds(uint64_t aID, int32_t aOffset, uint32_t aCoordType) [Nested=inside_sync] sync CharBounds(uint64_t aID, int32_t aOffset, uint32_t aCoordType)
returns(LayoutDeviceIntRect aRetVal); returns(nsIntRect aRetVal);
[Nested=inside_sync] sync OffsetAtPoint(uint64_t aID, int32_t aX, int32_t aY, uint32_t aCoordType) [Nested=inside_sync] sync OffsetAtPoint(uint64_t aID, int32_t aX, int32_t aY, uint32_t aCoordType)
returns(int32_t aRetVal); returns(int32_t aRetVal);
@ -238,8 +238,8 @@ child:
[Nested=inside_sync] sync PasteText(uint64_t aID, int32_t aPosition) [Nested=inside_sync] sync PasteText(uint64_t aID, int32_t aPosition)
returns(bool aValid); returns(bool aValid);
[Nested=inside_sync] sync ImagePosition(uint64_t aID, uint32_t aCoordType) returns(LayoutDeviceIntPoint aRetVal); [Nested=inside_sync] sync ImagePosition(uint64_t aID, uint32_t aCoordType) returns(IntPoint aRetVal);
[Nested=inside_sync] sync ImageSize(uint64_t aID) returns(LayoutDeviceIntSize aRetVal); [Nested=inside_sync] sync ImageSize(uint64_t aID) returns(IntSize aRetVal);
[Nested=inside_sync] sync StartOffset(uint64_t aID) returns(uint32_t aRetVal, bool aOk); [Nested=inside_sync] sync StartOffset(uint64_t aID) returns(uint32_t aRetVal, bool aOk);
[Nested=inside_sync] sync EndOffset(uint64_t aID) returns(uint32_t aRetVal, bool aOk); [Nested=inside_sync] sync EndOffset(uint64_t aID) returns(uint32_t aRetVal, bool aOk);

View file

@ -260,18 +260,16 @@ already_AddRefed<AccAttributes> RemoteAccessible::DefaultTextAttributes() {
return attrs.forget(); return attrs.forget();
} }
LayoutDeviceIntRect RemoteAccessible::TextBounds(int32_t aStartOffset, nsIntRect RemoteAccessible::TextBounds(int32_t aStartOffset, int32_t aEndOffset,
int32_t aEndOffset, uint32_t aCoordType) {
uint32_t aCoordType) { nsIntRect rect;
LayoutDeviceIntRect rect;
Unused << mDoc->SendTextBounds(mID, aStartOffset, aEndOffset, aCoordType, Unused << mDoc->SendTextBounds(mID, aStartOffset, aEndOffset, aCoordType,
&rect); &rect);
return rect; return rect;
} }
LayoutDeviceIntRect RemoteAccessible::CharBounds(int32_t aOffset, nsIntRect RemoteAccessible::CharBounds(int32_t aOffset, uint32_t aCoordType) {
uint32_t aCoordType) { nsIntRect rect;
LayoutDeviceIntRect rect;
Unused << mDoc->SendCharBounds(mID, aOffset, aCoordType, &rect); Unused << mDoc->SendCharBounds(mID, aOffset, aCoordType, &rect);
return rect; return rect;
} }
@ -367,14 +365,14 @@ bool RemoteAccessible::PasteText(int32_t aPosition) {
return valid; return valid;
} }
LayoutDeviceIntPoint RemoteAccessible::ImagePosition(uint32_t aCoordType) { nsIntPoint RemoteAccessible::ImagePosition(uint32_t aCoordType) {
LayoutDeviceIntPoint retVal; nsIntPoint retVal;
Unused << mDoc->SendImagePosition(mID, aCoordType, &retVal); Unused << mDoc->SendImagePosition(mID, aCoordType, &retVal);
return retVal; return retVal;
} }
LayoutDeviceIntSize RemoteAccessible::ImageSize() { nsIntSize RemoteAccessible::ImageSize() {
LayoutDeviceIntSize retVal; nsIntSize retVal;
Unused << mDoc->SendImageSize(mID, &retVal); Unused << mDoc->SendImageSize(mID, &retVal);
return retVal; return retVal;
} }
@ -874,7 +872,7 @@ Accessible* RemoteAccessible::ChildAtPoint(
if (target->IsOuterDoc()) { if (target->IsOuterDoc()) {
if (target->ChildCount() == 0) { if (target->ChildCount() == 0) {
// Return the OuterDoc if the requested point is within its bounds. // Return the OuterDoc if the requested point is within its bounds.
LayoutDeviceIntRect rect = target->Bounds(); nsIntRect rect = target->Bounds();
if (rect.Contains(aX, aY)) { if (rect.Contains(aX, aY)) {
return target; return target;
} }
@ -887,7 +885,7 @@ Accessible* RemoteAccessible::ChildAtPoint(
// process, so they stop at OOP iframes. // process, so they stop at OOP iframes.
if (aWhichChild == Accessible::EWhichChildAtPoint::DirectChild) { if (aWhichChild == Accessible::EWhichChildAtPoint::DirectChild) {
// Return the child document if it's within the bounds of the iframe. // Return the child document if it's within the bounds of the iframe.
LayoutDeviceIntRect docRect = target->Bounds(); nsIntRect docRect = target->Bounds();
if (docRect.Contains(aX, aY)) { if (docRect.Contains(aX, aY)) {
return childDoc; return childDoc;
} }
@ -910,12 +908,12 @@ Accessible* RemoteAccessible::ChildAtPoint(
return target; return target;
} }
LayoutDeviceIntRect RemoteAccessible::Bounds() const { nsIntRect RemoteAccessible::Bounds() const {
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) { if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
return RemoteAccessibleBase<RemoteAccessible>::Bounds(); return RemoteAccessibleBase<RemoteAccessible>::Bounds();
} }
LayoutDeviceIntRect rect; nsIntRect rect;
Unused << mDoc->SendExtents(mID, false, &(rect.x), &(rect.y), &(rect.width), Unused << mDoc->SendExtents(mID, false, &(rect.x), &(rect.y), &(rect.width),
&(rect.height)); &(rect.height));
return rect; return rect;

View file

@ -223,12 +223,12 @@ uint64_t RemoteAccessible::State() {
return state; return state;
} }
LayoutDeviceIntRect RemoteAccessible::Bounds() const { nsIntRect RemoteAccessible::Bounds() const {
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) { if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
return RemoteAccessibleBase<RemoteAccessible>::Bounds(); return RemoteAccessibleBase<RemoteAccessible>::Bounds();
} }
LayoutDeviceIntRect rect; nsIntRect rect;
RefPtr<IAccessible> acc; RefPtr<IAccessible> acc;
if (!GetCOMInterface((void**)getter_AddRefs(acc))) { if (!GetCOMInterface((void**)getter_AddRefs(acc))) {

View file

@ -530,7 +530,7 @@ int32_t GeckoTextMarkerRange::Length() const {
} }
NSValue* GeckoTextMarkerRange::Bounds() const { NSValue* GeckoTextMarkerRange::Bounds() const {
LayoutDeviceIntRect rect; nsIntRect rect;
if (mStart.mContainer->IsRemote() && mEnd.mContainer->IsRemote()) { if (mStart.mContainer->IsRemote() && mEnd.mContainer->IsRemote()) {
DocAccessibleParent* ipcDoc = mStart.mContainer->AsRemote()->Document(); DocAccessibleParent* ipcDoc = mStart.mContainer->AsRemote()->Document();
Unused << ipcDoc->GetPlatformExtension()->SendBoundsForRange( Unused << ipcDoc->GetPlatformExtension()->SendBoundsForRange(

View file

@ -29,9 +29,9 @@ class HyperTextAccessibleWrap : public HyperTextAccessible {
HyperTextAccessible* aEndContainer, HyperTextAccessible* aEndContainer,
int32_t aEndOffset); int32_t aEndOffset);
LayoutDeviceIntRect BoundsForRange(int32_t aStartOffset, nsIntRect BoundsForRange(int32_t aStartOffset,
HyperTextAccessible* aEndContainer, HyperTextAccessible* aEndContainer,
int32_t aEndOffset); int32_t aEndOffset);
int32_t LengthForRange(int32_t aStartOffset, int32_t LengthForRange(int32_t aStartOffset,
HyperTextAccessible* aEndContainer, HyperTextAccessible* aEndContainer,

View file

@ -313,13 +313,13 @@ void HyperTextAccessibleWrap::AttributedTextForRange(
} }
} }
LayoutDeviceIntRect HyperTextAccessibleWrap::BoundsForRange( nsIntRect HyperTextAccessibleWrap::BoundsForRange(
int32_t aStartOffset, HyperTextAccessible* aEndContainer, int32_t aStartOffset, HyperTextAccessible* aEndContainer,
int32_t aEndOffset) { int32_t aEndOffset) {
LayoutDeviceIntRect rect; nsIntRect rect;
HyperTextIterator iter(this, aStartOffset, aEndContainer, aEndOffset); HyperTextIterator iter(this, aStartOffset, aEndContainer, aEndOffset);
while (iter.Next()) { while (iter.Next()) {
LayoutDeviceIntRect stringRect = iter.mCurrentContainer->TextBounds( nsIntRect stringRect = iter.mCurrentContainer->TextBounds(
iter.mCurrentStartOffset, iter.mCurrentEndOffset); iter.mCurrentStartOffset, iter.mCurrentEndOffset);
rect.UnionRect(rect, stringRect); rect.UnionRect(rect, stringRect);
} }

View file

@ -689,9 +689,9 @@ struct RoleDescrComparator {
- (NSValue*)moxFrame { - (NSValue*)moxFrame {
MOZ_ASSERT(mGeckoAccessible); MOZ_ASSERT(mGeckoAccessible);
LayoutDeviceIntRect rect = mGeckoAccessible->IsLocal() nsIntRect rect = mGeckoAccessible->IsLocal()
? mGeckoAccessible->AsLocal()->Bounds() ? mGeckoAccessible->AsLocal()->Bounds()
: mGeckoAccessible->AsRemote()->Bounds(); : mGeckoAccessible->AsRemote()->Bounds();
NSScreen* mainView = [[NSScreen screens] objectAtIndex:0]; NSScreen* mainView = [[NSScreen screens] objectAtIndex:0];
CGFloat scaleFactor = nsCocoaUtils::GetBackingScaleFactor(mainView); CGFloat scaleFactor = nsCocoaUtils::GetBackingScaleFactor(mainView);
@ -906,11 +906,12 @@ struct RoleDescrComparator {
- (void)moxPerformShowMenu { - (void)moxPerformShowMenu {
MOZ_ASSERT(mGeckoAccessible); MOZ_ASSERT(mGeckoAccessible);
nsIntRect bounds = mGeckoAccessible->IsLocal()
? mGeckoAccessible->AsLocal()->Bounds()
: mGeckoAccessible->AsRemote()->Bounds();
// We don't need to convert this rect into mac coordinates because the // We don't need to convert this rect into mac coordinates because the
// mouse event synthesizer expects layout (gecko) coordinates. // mouse event synthesizer expects layout (gecko) coordinates.
LayoutDeviceIntRect bounds = mGeckoAccessible->IsLocal() LayoutDeviceIntRect geckoRect = LayoutDeviceIntRect::FromUnknownRect(bounds);
? mGeckoAccessible->AsLocal()->Bounds()
: mGeckoAccessible->AsRemote()->Bounds();
LocalAccessible* rootAcc = mGeckoAccessible->IsLocal() LocalAccessible* rootAcc = mGeckoAccessible->IsLocal()
? mGeckoAccessible->AsLocal()->RootAccessible() ? mGeckoAccessible->AsLocal()->RootAccessible()
@ -920,8 +921,9 @@ struct RoleDescrComparator {
id objOrView = id objOrView =
GetObjectOrRepresentedView(GetNativeFromGeckoAccessible(rootAcc)); GetObjectOrRepresentedView(GetNativeFromGeckoAccessible(rootAcc));
LayoutDeviceIntPoint p = LayoutDeviceIntPoint( LayoutDeviceIntPoint p =
bounds.X() + (bounds.Width() / 2), bounds.Y() + (bounds.Height() / 2)); LayoutDeviceIntPoint(geckoRect.X() + (geckoRect.Width() / 2),
geckoRect.Y() + (geckoRect.Height() / 2));
nsIWidget* widget = [objOrView widget]; nsIWidget* widget = [objOrView widget];
widget->SynthesizeNativeMouseEvent( widget->SynthesizeNativeMouseEvent(
p, nsIWidget::NativeMouseMessage::ButtonDown, MouseButton::eSecondary, p, nsIWidget::NativeMouseMessage::ButtonDown, MouseButton::eSecondary,

View file

@ -54,7 +54,7 @@ ia2AccessibleComponent::get_locationInParent(long* aX, long* aY) {
uint64_t state = acc->State(); uint64_t state = acc->State();
if (state & states::INVISIBLE) return S_OK; if (state & states::INVISIBLE) return S_OK;
LayoutDeviceIntRect rect = acc->Bounds(); nsIntRect rect = acc->Bounds();
// The coordinates of the returned position are relative to this object's // The coordinates of the returned position are relative to this object's
// parent or relative to the screen on which this object is rendered if it // parent or relative to the screen on which this object is rendered if it
@ -67,7 +67,7 @@ ia2AccessibleComponent::get_locationInParent(long* aX, long* aY) {
// The coordinates of the bounding box are given relative to the parent's // The coordinates of the bounding box are given relative to the parent's
// coordinate system. // coordinate system.
LayoutDeviceIntRect parentRect = acc->LocalParent()->Bounds(); nsIntRect parentRect = acc->LocalParent()->Bounds();
*aX = rect.X() - parentRect.X(); *aX = rect.X() - parentRect.X();
*aY = rect.Y() - parentRect.Y(); *aY = rect.Y() - parentRect.Y();
return S_OK; return S_OK;

View file

@ -63,7 +63,7 @@ ia2AccessibleImage::get_imagePosition(enum IA2CoordinateType aCoordType,
? nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE ? nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE
: nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE; : nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE;
LayoutDeviceIntPoint pos = imageAcc->Position(geckoCoordType); nsIntPoint pos = imageAcc->Position(geckoCoordType);
*aX = pos.x; *aX = pos.x;
*aY = pos.y; *aY = pos.y;
return S_OK; return S_OK;
@ -79,7 +79,7 @@ ia2AccessibleImage::get_imageSize(long* aHeight, long* aWidth) {
ImageAccessible* imageAcc = ImageAcc(); ImageAccessible* imageAcc = ImageAcc();
if (!imageAcc) return CO_E_OBJNOTCONNECTED; if (!imageAcc) return CO_E_OBJNOTCONNECTED;
LayoutDeviceIntSize size = imageAcc->Size(); nsIntSize size = imageAcc->Size();
*aHeight = size.width; *aHeight = size.width;
*aWidth = size.height; *aWidth = size.height;
return S_OK; return S_OK;

View file

@ -111,7 +111,7 @@ ia2AccessibleText::get_characterExtents(long aOffset,
(aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE)
? nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE ? nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE
: nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE; : nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE;
LayoutDeviceIntRect rect; nsIntRect rect;
auto [textAcc, hr] = LocalTextAcc(); auto [textAcc, hr] = LocalTextAcc();
if (!textAcc) { if (!textAcc) {
return hr; return hr;

View file

@ -77,10 +77,10 @@ void DocAccessibleWrap::DoInitialUpdate() {
MOZ_ASSERT(XRE_IsParentProcess()); MOZ_ASSERT(XRE_IsParentProcess());
a11y::RootAccessible* rootDocument = RootAccessible(); a11y::RootAccessible* rootDocument = RootAccessible();
bool isActive = true; bool isActive = true;
LayoutDeviceIntRect rect(CW_USEDEFAULT, CW_USEDEFAULT, 0, 0); nsIntRect rect(CW_USEDEFAULT, CW_USEDEFAULT, 0, 0);
if (Compatibility::IsDolphin()) { if (Compatibility::IsDolphin()) {
rect = Bounds(); rect = Bounds();
LayoutDeviceIntRect rootRect = rootDocument->Bounds(); nsIntRect rootRect = rootDocument->Bounds();
rect.MoveToX(rootRect.X() - rect.X()); rect.MoveToX(rootRect.X() - rect.X());
rect.MoveByY(-rootRect.Y()); rect.MoveByY(-rootRect.Y());

View file

@ -1523,7 +1523,7 @@ MsaaAccessible::accLocation(
kVarChildIdSelf); kVarChildIdSelf);
} }
LayoutDeviceIntRect rect = Acc()->Bounds(); nsIntRect rect = Acc()->Bounds();
*pxLeft = rect.X(); *pxLeft = rect.X();
*pyTop = rect.Y(); *pyTop = rect.Y();
*pcxWidth = rect.Width(); *pcxWidth = rect.Width();
@ -1654,7 +1654,7 @@ MsaaAccessible::accHitTest(
// This is an OOP iframe. ChildAtPoint can't traverse inside it. If the // This is an OOP iframe. ChildAtPoint can't traverse inside it. If the
// coordinates are inside this iframe, return the COM proxy for the // coordinates are inside this iframe, return the COM proxy for the
// OOP document. // OOP document.
LayoutDeviceIntRect docRect = mAcc->AsLocal()->Bounds(); nsIntRect docRect = mAcc->AsLocal()->Bounds();
if (docRect.Contains(xLeft, yTop)) { if (docRect.Contains(xLeft, yTop)) {
pvarChild->vt = VT_DISPATCH; pvarChild->vt = VT_DISPATCH;
disp.forget(&pvarChild->pdispVal); disp.forget(&pvarChild->pdispVal);

View file

@ -61,10 +61,10 @@ sdnTextAccessible::get_clippedSubstringBounds(
document, document,
"There must always be a doc accessible, but there isn't. Crash!"); "There must always be a doc accessible, but there isn't. Crash!");
LayoutDeviceIntRect docRect = document->Bounds(); nsIntRect docRect = document->Bounds();
LayoutDeviceIntRect unclippedRect(x, y, width, height); nsIntRect unclippedRect(x, y, width, height);
LayoutDeviceIntRect clippedRect; nsIntRect clippedRect;
clippedRect.IntersectRect(unclippedRect, docRect); clippedRect.IntersectRect(unclippedRect, docRect);
*aX = clippedRect.X(); *aX = clippedRect.X();

View file

@ -408,7 +408,7 @@ xpcAccessible::GetBounds(int32_t* aX, int32_t* aY, int32_t* aWidth,
if (!IntlGeneric()) return NS_ERROR_FAILURE; if (!IntlGeneric()) return NS_ERROR_FAILURE;
LayoutDeviceIntRect rect; nsIntRect rect;
if (LocalAccessible* acc = IntlGeneric()->AsLocal()) { if (LocalAccessible* acc = IntlGeneric()->AsLocal()) {
rect = acc->Bounds(); rect = acc->Bounds();
} else { } else {

View file

@ -231,7 +231,7 @@ xpcAccessibleHyperText::GetCharacterExtents(int32_t aOffset, int32_t* aX,
if (!mIntl) return NS_ERROR_FAILURE; if (!mIntl) return NS_ERROR_FAILURE;
LayoutDeviceIntRect rect; nsIntRect rect;
if (mIntl->IsLocal()) { if (mIntl->IsLocal()) {
rect = IntlLocal()->CharBounds(aOffset, aCoordType); rect = IntlLocal()->CharBounds(aOffset, aCoordType);
} else { } else {
@ -258,7 +258,7 @@ xpcAccessibleHyperText::GetRangeExtents(int32_t aStartOffset,
if (!mIntl) return NS_ERROR_FAILURE; if (!mIntl) return NS_ERROR_FAILURE;
LayoutDeviceIntRect rect; nsIntRect rect;
if (mIntl->IsLocal()) { if (mIntl->IsLocal()) {
rect = IntlLocal()->TextBounds(aStartOffset, aEndOffset, aCoordType); rect = IntlLocal()->TextBounds(aStartOffset, aEndOffset, aCoordType);
} else { } else {

View file

@ -29,7 +29,7 @@ xpcAccessibleImage::GetImagePosition(uint32_t aCoordType, int32_t* aX,
if (!Intl()) return NS_ERROR_FAILURE; if (!Intl()) return NS_ERROR_FAILURE;
LayoutDeviceIntPoint point = Intl()->Position(aCoordType); nsIntPoint point = Intl()->Position(aCoordType);
*aX = point.x; *aX = point.x;
*aY = point.y; *aY = point.y;
return NS_OK; return NS_OK;
@ -44,7 +44,7 @@ xpcAccessibleImage::GetImageSize(int32_t* aWidth, int32_t* aHeight) {
if (!Intl()) return NS_ERROR_FAILURE; if (!Intl()) return NS_ERROR_FAILURE;
LayoutDeviceIntSize size = Intl()->Size(); nsIntSize size = Intl()->Size();
*aWidth = size.width; *aWidth = size.width;
*aHeight = size.height; *aHeight = size.height;
return NS_OK; return NS_OK;