Commit 423dd4a3 authored by Timothy Nikkel's avatar Timothy Nikkel
Browse files

Bug 1724808. Take into account ancestor documents in other processes'...

Bug 1724808. Take into account ancestor documents in other processes' resolution when pre-decoding images. r=hiro

Depends on D122212

Differential Revision: https://phabricator.services.mozilla.com/D122213
parent 50cee5c3
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@

#include "mozilla/dom/Link.h"
#include "mozilla/dom/HTMLAnchorElement.h"
#include "mozilla/dom/BrowserChild.h"

using namespace mozilla;
using namespace mozilla::dom;
@@ -1064,6 +1065,12 @@ void nsImageFrame::MaybeDecodeForPredictedSize() {
      presShell->GetCumulativeResolution() *
      nsLayoutUtils::GetTransformToAncestorScaleExcludingAnimated(this));

  // If we are in a remote browser, then apply scaling from ancestor browsers
  if (BrowserChild* browserChild = BrowserChild::GetFrom(presShell)) {
    resolutionToScreen.xScale *= browserChild->GetEffectsInfo().mScaleX;
    resolutionToScreen.yScale *= browserChild->GetEffectsInfo().mScaleY;
  }

  // ...and this frame's content box...
  const nsPoint offset =
      GetOffsetToCrossDoc(nsLayoutUtils::GetReferenceFrame(this));