зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1696023: Report accessible's position even when bounds rect is empty r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D107001
This commit is contained in:
Родитель
5a66c4b4a4
Коммит
750392fbde
|
@ -1682,11 +1682,13 @@ mozilla::ipc::IPCResult DocAccessibleChild::RecvExtents(
|
|||
screenRect.y -= winCoords.y;
|
||||
}
|
||||
|
||||
*aX = screenRect.x;
|
||||
*aY = screenRect.y;
|
||||
*aWidth = screenRect.width;
|
||||
*aHeight = screenRect.height;
|
||||
}
|
||||
// We should always report the position of our acc, even if
|
||||
// the returned screenRect is empty.
|
||||
*aX = screenRect.x;
|
||||
*aY = screenRect.y;
|
||||
}
|
||||
return IPC_OK();
|
||||
}
|
||||
|
@ -1702,11 +1704,13 @@ mozilla::ipc::IPCResult DocAccessibleChild::RecvExtentsInCSSPixels(
|
|||
if (acc && !acc->IsDefunct()) {
|
||||
nsIntRect screenRect = acc->BoundsInCSSPixels();
|
||||
if (!screenRect.IsEmpty()) {
|
||||
*aX = screenRect.x;
|
||||
*aY = screenRect.y;
|
||||
*aWidth = screenRect.width;
|
||||
*aHeight = screenRect.height;
|
||||
}
|
||||
// We should always report the position of our acc, even if
|
||||
// the returned screenRect is empty.
|
||||
*aX = screenRect.x;
|
||||
*aY = screenRect.y;
|
||||
}
|
||||
return IPC_OK();
|
||||
}
|
||||
|
|
|
@ -11,3 +11,4 @@ skip-if = e10s && os == 'win' # bug 1372296
|
|||
[browser_test_zoom.js]
|
||||
[browser_test_zoom_text.js]
|
||||
skip-if = e10s && os == 'win' # bug 1372296
|
||||
[browser_zero_area.js]
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
/* import-globals-from ../../mochitest/layout.js */
|
||||
|
||||
async function testContentBounds(browser, acc, expectedWidth, expectedHeight) {
|
||||
let [expectedX, expectedY] = await getContentBoundsForDOMElm(
|
||||
browser,
|
||||
getAccessibleDOMNodeID(acc)
|
||||
);
|
||||
|
||||
let contentDPR = await getContentDPR(browser);
|
||||
let [x, y, width, height] = getBounds(acc, contentDPR);
|
||||
let prettyAccName = prettyName(acc);
|
||||
is(x, expectedX, "Wrong x coordinate of " + prettyAccName);
|
||||
is(y, expectedY, "Wrong y coordinate of " + prettyAccName);
|
||||
is(width, expectedWidth, "Wrong width of " + prettyAccName);
|
||||
is(height, expectedHeight, "Wrong height of " + prettyAccName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure frames with zero area have their x, y coordinates correctly reported
|
||||
* in bounds()
|
||||
*/
|
||||
addAccessibleTask(
|
||||
`
|
||||
<br>
|
||||
<div id="a" style="height:0; width:0;"></div>
|
||||
`,
|
||||
async function(browser, accDoc) {
|
||||
let a = findAccessibleChildByID(accDoc, "a");
|
||||
await testContentBounds(browser, a, 0, 0);
|
||||
}
|
||||
);
|
Загрузка…
Ссылка в новой задаче