зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1229853 - Don't apply the displayport multiplier if we don't have a frame for the element the displayport is set on. r=tn
This commit is contained in:
Родитель
1c2e83fc5a
Коммит
01ade73317
|
@ -890,10 +890,11 @@ GetDisplayPortFromMarginsData(nsIContent* aContent,
|
||||||
nsIFrame* frame = aContent->GetPrimaryFrame();
|
nsIFrame* frame = aContent->GetPrimaryFrame();
|
||||||
if (!frame) {
|
if (!frame) {
|
||||||
// Turns out we can't really compute it. Oops. We still should return
|
// Turns out we can't really compute it. Oops. We still should return
|
||||||
// something sane. Note that although we can apply the multiplier on the
|
// something sane. Note that since we can't clamp the rect without a
|
||||||
// base rect here, we can't tile-align or clamp the rect without a frame.
|
// frame, we don't apply the multiplier either as it can cause the result
|
||||||
|
// to leak outside the scrollable area.
|
||||||
NS_WARNING("Attempting to get a displayport from a content with no primary frame!");
|
NS_WARNING("Attempting to get a displayport from a content with no primary frame!");
|
||||||
return ApplyRectMultiplier(base, aMultiplier);
|
return base;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isRoot = false;
|
bool isRoot = false;
|
||||||
|
@ -903,7 +904,7 @@ GetDisplayPortFromMarginsData(nsIContent* aContent,
|
||||||
frame = frame->PresContext()->PresShell()->GetRootScrollFrame();
|
frame = frame->PresContext()->PresShell()->GetRootScrollFrame();
|
||||||
if (!frame) {
|
if (!frame) {
|
||||||
// If there is no root scrollframe, just exit.
|
// If there is no root scrollframe, just exit.
|
||||||
return ApplyRectMultiplier(base, aMultiplier);
|
return base;
|
||||||
}
|
}
|
||||||
|
|
||||||
isRoot = true;
|
isRoot = true;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче