Bug 1629466. Don't clear wasPainted on the display port data if we don't have a frame. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D70666

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Timothy Nikkel 2020-04-13 19:14:14 +00:00
Родитель 7ebea17a8e
Коммит 0d27141b16
1 изменённых файлов: 13 добавлений и 2 удалений

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

@ -1043,6 +1043,17 @@ static bool GetDisplayPortData(
return true;
}
static bool GetWasDisplayPortPainted(nsIContent* aContent) {
DisplayPortPropertyData* rectData = nullptr;
DisplayPortMarginsPropertyData* marginsData = nullptr;
if (!GetDisplayPortData(aContent, &rectData, &marginsData)) {
return false;
}
return rectData ? rectData->mPainted : marginsData->mPainted;
}
bool nsLayoutUtils::IsMissingDisplayPortBaseRect(nsIContent* aContent) {
DisplayPortPropertyData* rectData = nullptr;
DisplayPortMarginsPropertyData* marginsData = nullptr;
@ -1283,7 +1294,7 @@ bool nsLayoutUtils::SetDisplayPortMargins(nsIContent* aContent,
nsRect oldDisplayPort;
bool hadDisplayPort = false;
bool wasPainted = false;
bool wasPainted = GetWasDisplayPortPainted(aContent);
if (scrollFrame) {
// We only use the two return values from this function to call
// InvalidateForDisplayPortChange. InvalidateForDisplayPortChange does
@ -1291,7 +1302,7 @@ bool nsLayoutUtils::SetDisplayPortMargins(nsIContent* aContent,
// useless if the content has no frame, so we avoid calling this to avoid
// triggering a warning about not having a frame.
hadDisplayPort =
GetHighResolutionDisplayPort(aContent, &oldDisplayPort, &wasPainted);
GetHighResolutionDisplayPort(aContent, &oldDisplayPort);
}
aContent->SetProperty(