Backed out changeset cf2c8ac2f33c (bug 1853255) for causing failures in Browser_zero_area.js CLOSED TREE

accessible/tests/browser/bounds/browser_position.js
This commit is contained in:
Noemi Erli 2023-09-20 09:19:03 +03:00
Родитель 8720fef314
Коммит 44a7ece862
2 изменённых файлов: 9 добавлений и 50 удалений

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

@ -622,27 +622,18 @@ nsRect LocalAccessible::ParentRelativeBounds() {
result.MoveBy(frame->GetOffsetTo(boundingFrame));
}
if (nsLayoutUtils::GetNextContinuationOrIBSplitSibling(boundingFrame)) {
// Constructing a bounding box across a frame that has an IB split means
// the origin is likely be different from that of boundingFrame.
// Descendants will need their parent-relative bounds adjusted
// accordingly, since parent-relative bounds are constructed to the
// bounding box of the entire element and not each individual IB split
// frame. In the case that boundingFrame's rect is empty,
// GetAllInFlowRectsUnion might exclude its origin. For example, if
// boundingFrame is empty with an origin of (0, -840) but has a non-empty
// ib-split-sibling with (0, 0), the union rect will originate at (0, 0).
// This means the bounds returned for our parent Accessible might be
// offset from boundingFrame's rect. Since result is currently relative to
// boundingFrame's rect, we might need to adjust it to make it parent
// relative.
if (boundingFrame->GetRect().IsEmpty()) {
// boundingFrame might be the first in an ib-split-sibling chain. If its
// rect is empty, GetAllInFlowRectsUnion might exclude its origin. For
// example, if boundingFrame is empty with an origin of (0, -840) but
// has a non-empty ib-split-sibling with (0, 0), the union rect will
// originate at (0, 0). This means the bounds returned for our parent
// Accessible might be offset from boundingFrame's rect. Since result is
// currently relative to boundingFrame's rect, we might need to adjust it
// to make it parent relative.
nsRect boundingUnion =
nsLayoutUtils::GetAllInFlowRectsUnion(boundingFrame, boundingFrame);
if (!boundingUnion.IsEmpty()) {
// The origin of boundingUnion is relative to boundingFrame, meaning
// when we call MoveBy on result with this value we're offsetting
// `result` by the distance boundingFrame's origin was moved to
// construct its bounding box.
result.MoveBy(-boundingUnion.TopLeft());
} else {
// Since GetAllInFlowRectsUnion returned an empty rect on our parent

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

@ -101,35 +101,3 @@ addAccessibleTask(
},
{ chrome: true, topLevel: true, remoteIframe: true }
);
/**
* Test the bounds of items in an inline list with content that offsets the
* origin of the list's bounding box (creating an IB split within the UL frame).
*/
addAccessibleTask(
`
<style>
ul,li {
display:inline;
list-style-type:none;
list-style-position:inside;
margin:0;
padding:0;
}
</style>
<div id="container" style="background:green; max-width: 400px;">List of information: <ul id="list"><li id="one">item one</li> | <li id="two">item two</li> | <li id="three">item three</li> | <li id="four">item four</li> | <li id="five">item five</li></ul></div>
`,
async function (browser, docAcc) {
await testBoundsWithContent(docAcc, "list", browser);
await testBoundsWithContent(docAcc, "one", browser);
await testBoundsWithContent(docAcc, "two", browser);
await testBoundsWithContent(docAcc, "three", browser);
await testBoundsWithContent(docAcc, "four", browser);
await testBoundsWithContent(docAcc, "five", browser);
},
{
chrome: true,
topLevel: true,
iframe: true,
}
);