Bug 1363650 - (intersection-observer) Use content area as the intersection rectangle for custom root with overflow clip. r=mattwoodrow
This commit is contained in:
@@ -268,17 +268,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->IsScrollFrame()) {
|
if (rootFrame->IsScrollFrame()) {
|
||||||
|
// 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();
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
[containing-block.html]
|
[containing-block.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1363650
|
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
[remove-element.html]
|
[remove-element.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1363650
|
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
[same-document-root.html]
|
[same-document-root.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1363650
|
|
||||||
|
|||||||
Reference in New Issue
Block a user