Bug 1728670. Restore null check accidentally removed in previous patch. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D124513
This commit is contained in:
Timothy Nikkel 2021-09-04 03:57:10 +00:00
parent bb61392c9b
commit 26dd73646b
4 changed files with 23 additions and 10 deletions

View File

@ -959,17 +959,14 @@ nsRect Element::GetClientAreaRect() {
if (overlayScrollbars &&
!doc->StyleOrLayoutObservablyDependsOnParentDocumentLayout() &&
doc->IsScrollingElement(this)) {
// We will always have a pres shell if we have a pres context, and we will
// only get here if we have a pres context from the root content document
// check
PresShell* presShell = doc->GetPresShell();
// Ensure up to date dimensions, but don't reflow
RefPtr<nsViewManager> viewManager = presShell->GetViewManager();
if (viewManager) {
viewManager->FlushDelayedResize(false);
if (PresShell* presShell = doc->GetPresShell()) {
// Ensure up to date dimensions, but don't reflow
RefPtr<nsViewManager> viewManager = presShell->GetViewManager();
if (viewManager) {
viewManager->FlushDelayedResize(false);
}
return nsRect(nsPoint(), presContext->GetVisibleArea().Size());
}
return nsRect(nsPoint(), presContext->GetVisibleArea().Size());
}
nsIFrame* frame;

View File

@ -0,0 +1,12 @@
<html>
<script>
document.documentElement.clientHeight;
document.body.clientHeight;
</script>
<body>
<script>
document.documentElement.clientHeight;
document.body.clientHeight;
</script>
</body>
</html>

View File

@ -0,0 +1,3 @@
<html>
<iframe src="http://example.org/1728670-1-child.html" style="display: none;">
</html>

View File

@ -263,3 +263,4 @@ skip-if(ThreadSanitizer) load 1681729.html
skip-if(ThreadSanitizer) load 1693049.html
skip-if(ThreadSanitizer||Android) load 1697525.html
skip-if(ThreadSanitizer||Android) load 1712198.html # Mysterious failure that should be investigated (bug 1712866).
skip-if(Android) HTTP load 1728670-1.html