Backed out changeset eeb0a65afa6d (bug 1363650) for wpt failures in intersection-observer/bounding-box.html and intersection-observer/unclipped-root.html

MozReview-Commit-ID: HycwX8lA9sw
This commit is contained in:
Phil Ringnalda
2017-06-20 20:50:08 -07:00
parent 38b75abc22
commit b2ecb07c37
4 changed files with 10 additions and 11 deletions

View File

@@ -268,21 +268,17 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
root = mRoot;
rootFrame = root->GetPrimaryFrame();
if (rootFrame) {
nsRect rootRectRelativeToRootFrame;
if (rootFrame->IsScrollFrame()) {
// rootRectRelativeToRootFrame should be the content rect of rootFrame, not including the scrollbars.
nsIScrollableFrame* scrollFrame = do_QueryFrame(rootFrame);
rootRectRelativeToRootFrame = scrollFrame->GetScrollPortRect();
rootRect = nsLayoutUtils::TransformFrameRectToAncestor(
rootFrame,
rootFrame->GetContentRectRelativeToSelf(),
scrollFrame->GetScrolledFrame());
} else {
// rootRectRelativeToRootFrame should be the content rect of rootFrame.
rootRectRelativeToRootFrame = rootFrame->GetContentRectRelativeToSelf();
rootRect = nsLayoutUtils::GetAllInFlowRectsUnion(rootFrame,
nsLayoutUtils::GetContainingBlockForClientRect(rootFrame),
nsLayoutUtils::RECTS_ACCOUNT_FOR_TRANSFORMS);
}
nsIFrame* containingBlock =
nsLayoutUtils::GetContainingBlockForClientRect(rootFrame);
rootRect =
nsLayoutUtils::TransformFrameRectToAncestor(rootFrame,
rootRectRelativeToRootFrame,
containingBlock);
}
} else {
nsCOMPtr<nsIPresShell> presShell = aDocument->GetShell();