Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1665447 - Fix BoxToRect when the "relative to" frame is not an an…
…cestor. r=dholbert,mstange Right now the BoxToRect callback assumes that when it gets a RECTS_ACCOUNT_FOR_TRANSFORMS flag, the "relative to" is an ancestor. This holds for all the callers of GetAllInFlowRectsUnion except for [1], which was introduced in bug 1581876, because they pass GetContainingBlockForClientRect (that is, the root frame) as the root. But that caller passes target, so IB split continuations or such would get two siblings as the from/to frames, messing up the bounds. An alternative would be to not pass the RECTS_ACCOUNT_FOR_TRANSFORMS flag for that call (as it's computing a rect relative to self, but I don't think that'd be quite correct in the presence of fragmentation with transformed containers (if that's possible at all? would need to think harder...)), but it seems like the API should just behave more generally, or assert otherwise. To that effect, this patch adds an assertion to TransformRectToAncestor that would've caught this bug (though there are some pre-existing violations, so we'll fix them in another bug). [1]: https://searchfox.org/mozilla-central/rev/dfd9c0f72f9765bd4a187444e0c1e19e8834a506/dom/base/DOMIntersectionObserver.cpp#340-341 Differential Revision: https://phabricator.services.mozilla.com/D91883
- Loading branch information