Commit 39e31631 authored by Daniel Holbert's avatar Daniel Holbert
Browse files

Bug 1758199: Add null-check for GetPresContext() in...

Bug 1758199: Add null-check for GetPresContext() in nsRefreshDriver::NotifyDOMContentLoaded. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D141054
parent ebda8262
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1521,7 +1521,11 @@ void nsRefreshDriver::NotifyDOMContentLoaded() {
  // everything is flushed in the next tick. If it isn't, mark ourselves as
  // flushed now.
  if (!HasObservers()) {
    GetPresContext()->NotifyDOMContentFlushed();
    if (nsPresContext* pc = GetPresContext()) {
      pc->NotifyDOMContentFlushed();
    }
    // else, we don't have a nsPresContext, so our doc is probably being
    // destroyed and this notification doesn't need sending anyway.
  } else {
    mNotifyDOMContentFlushed = true;
  }
+13 −0
Original line number Diff line number Diff line
<script>
window.onload = () => {
  let o = document.getElementById('a')
  o.parentNode.appendChild(o)
  window.print()
  window.requestIdleCallback(() => { document.write('') })
}
</script>
<style>
:first-of-type { padding-block-start: 99% }
</style>
<mark id='a'>
<embed src='#'>
+1 −0
Original line number Diff line number Diff line
@@ -6,3 +6,4 @@ skip-if(Android) load 1662259.html
skip-if(Android) load 1663722.html
skip-if(Android) load 1671503.html
asserts-if(!Android,1-1) load 1748277.html # Bug 1751260
load 1758199-1.html