Bug 1353529 - Crash when using IntersectionObserver in XUL pages. r=mstange

MozReview-Commit-ID: 9RBrnst4Wkb

--HG--
extra : rebase_source : 257874993e1a1fa81931b2c513357c92b6f705a9
This commit is contained in:
Tobias Schneider 2017-04-04 20:14:46 -07:00
Родитель 2af51dd331
Коммит fa547be7bd
4 изменённых файлов: 27 добавлений и 1 удалений

Просмотреть файл

@ -289,7 +289,12 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
if (!presContext) {
break;
}
rootFrame = presContext->PresShell()->GetRootScrollFrame();
nsIFrame* rootScrollFrame = presContext->PresShell()->GetRootScrollFrame();
if (rootScrollFrame) {
rootFrame = rootScrollFrame;
} else {
break;
}
}
root = rootFrame->GetContent()->AsElement();
nsIScrollableFrame* scrollFrame = do_QueryFrame(rootFrame);

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<body onload="boom()">
<div id="target"></div>
<script>
function boom() {
var io = new IntersectionObserver(function () { }, { });
io.observe(document.getElementById('target'));
}
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<xhtml:div>
<iframe src="1353529-inner.html"></iframe>
</xhtml:div>
</window>

Просмотреть файл

@ -212,4 +212,5 @@ pref(dom.IntersectionObserver.enabled,true) load 1324209.html
pref(dom.IntersectionObserver.enabled,true) load 1326194-1.html
pref(dom.IntersectionObserver.enabled,true) load 1326194-2.html
pref(dom.IntersectionObserver.enabled,true) load 1332939.html
pref(dom.IntersectionObserver.enabled,true) load 1353529.xul
pref(dom.webcomponents.enabled,true) load 1341693.html