mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-23 07:37:29 +09:00
Use content area as the intersection rectangle ...
... for custom root with overflow clip. Tag #249
This commit is contained in:
parent
475d865c14
commit
d3a8693d52
1 changed files with 11 additions and 7 deletions
|
|
@ -269,17 +269,21 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
|
||||||
root = mRoot;
|
root = mRoot;
|
||||||
rootFrame = root->GetPrimaryFrame();
|
rootFrame = root->GetPrimaryFrame();
|
||||||
if (rootFrame) {
|
if (rootFrame) {
|
||||||
|
nsRect rootRectRelativeToRootFrame;
|
||||||
if (rootFrame->GetType() == nsGkAtoms::scrollFrame) {
|
if (rootFrame->GetType() == nsGkAtoms::scrollFrame) {
|
||||||
|
// rootRectRelativeToRootFrame should be the content rect of rootFrame, not including the scrollbars.
|
||||||
nsIScrollableFrame* scrollFrame = do_QueryFrame(rootFrame);
|
nsIScrollableFrame* scrollFrame = do_QueryFrame(rootFrame);
|
||||||
rootRect = nsLayoutUtils::TransformFrameRectToAncestor(
|
rootRectRelativeToRootFrame = scrollFrame->GetScrollPortRect();
|
||||||
rootFrame,
|
|
||||||
rootFrame->GetContentRectRelativeToSelf(),
|
|
||||||
scrollFrame->GetScrolledFrame());
|
|
||||||
} else {
|
} else {
|
||||||
rootRect = nsLayoutUtils::GetAllInFlowRectsUnion(rootFrame,
|
// rootRectRelativeToRootFrame should be the border rect of rootFrame.
|
||||||
nsLayoutUtils::GetContainingBlockForClientRect(rootFrame),
|
rootRectRelativeToRootFrame = rootFrame->GetRectRelativeToSelf();
|
||||||
nsLayoutUtils::RECTS_ACCOUNT_FOR_TRANSFORMS);
|
|
||||||
}
|
}
|
||||||
|
nsIFrame* containingBlock =
|
||||||
|
nsLayoutUtils::GetContainingBlockForClientRect(rootFrame);
|
||||||
|
rootRect =
|
||||||
|
nsLayoutUtils::TransformFrameRectToAncestor(rootFrame,
|
||||||
|
rootRectRelativeToRootFrame,
|
||||||
|
containingBlock);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
nsCOMPtr<nsIPresShell> presShell = aDocument->GetShell();
|
nsCOMPtr<nsIPresShell> presShell = aDocument->GetShell();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue