aboutsummaryrefslogtreecommitdiff
path: root/www/waterfox/files/patch-bug1401416
blob: 63f0f8e8e71301f7ec58b8d78de41e4fd38d2ea0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
commit c5123938eb1e
Author: Tobias Schneider <schneider@jancona.com>
Date:   Thu Sep 21 12:43:35 2017 -0700

    Bug 1401416 - [intersection-observer] Let intersection rect be empty if do_QueryFrame(rootFrame) returns null. r=dholbert, a=sledru
    
    --HG--
    extra : source : 90be30b5206c2b2724d61f4f6782197bfa768428
---
 dom/base/DOMIntersectionObserver.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git dom/base/DOMIntersectionObserver.cpp dom/base/DOMIntersectionObserver.cpp
index 606a1de5ed8c..1ca909e3cfbf 100644
--- dom/base/DOMIntersectionObserver.cpp
+++ dom/base/DOMIntersectionObserver.cpp
@@ -308,7 +308,11 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
         }
         root = rootFrame->GetContent()->AsElement();
         nsIScrollableFrame* scrollFrame = do_QueryFrame(rootFrame);
-        rootRect = scrollFrame->GetScrollPortRect();
+        // If we end up with a null root frame for some reason, we'll proceed
+        // with an empty root intersection rect.
+        if (scrollFrame) {
+          rootRect = scrollFrame->GetScrollPortRect();
+        }
       }
     }
   }