Skip to content

Commit

Permalink
Backed out changeset cf2c8ac2f33c (bug 1853255) for causing failures …
Browse files Browse the repository at this point in the history
…in Browser_zero_area.js CLOSED TREE

accessible/tests/browser/bounds/browser_position.js
  • Loading branch information
nerli1 committed Sep 20, 2023
1 parent 3c4fce5 commit 6c25733
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 50 deletions.
27 changes: 9 additions & 18 deletions accessible/generic/LocalAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 0 additions & 32 deletions accessible/tests/browser/bounds/browser_position.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
);

0 comments on commit 6c25733

Please sign in to comment.