mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 1689371 - Use nsLayoutUtils::GetContentViewerSize to query the device display size if there is no MobileViewportManager. r=botond
Depends on D103611 Differential Revision: https://phabricator.services.mozilla.com/D103612
This commit is contained in:
parent
c9712128ee
commit
643a59ce4e
5
layout/base/crashtests/1689371.html
Normal file
5
layout/base/crashtests/1689371.html
Normal file
@ -0,0 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="UTF-8">
|
||||
<div style="height: 200vh;"></div>
|
||||
</html>
|
@ -555,4 +555,5 @@ load 1599518.html
|
||||
load 1599532.html
|
||||
pref(layout.accessiblecaret.enabled,true) load 1606492.html
|
||||
load 1676301-1.html
|
||||
pref(apz.mvm.force-enabled,false) pref(dom.meta-viewport.enabled,false) pref(apz.allow_zooming,false) pref(layout.dynamic-toolbar-max-height,100) load 1689371.html
|
||||
load 1689912.html
|
||||
|
@ -9488,13 +9488,20 @@ nsSize nsLayoutUtils::ExpandHeightForViewportUnits(nsPresContext* aPresContext,
|
||||
template <typename SizeType>
|
||||
/* static */ SizeType ExpandHeightForDynamicToolbarImpl(
|
||||
const nsPresContext* aPresContext, const SizeType& aSize) {
|
||||
RefPtr<MobileViewportManager> MVM =
|
||||
aPresContext->PresShell()->GetMobileViewportManager();
|
||||
MOZ_ASSERT(MVM);
|
||||
MOZ_ASSERT(aPresContext);
|
||||
|
||||
LayoutDeviceIntSize displaySize;
|
||||
if (RefPtr<MobileViewportManager> MVM =
|
||||
aPresContext->PresShell()->GetMobileViewportManager()) {
|
||||
displaySize = MVM->DisplaySize();
|
||||
} else if (!nsLayoutUtils::GetContentViewerSize(aPresContext, displaySize)) {
|
||||
return aSize;
|
||||
}
|
||||
|
||||
float toolbarHeightRatio =
|
||||
mozilla::ScreenCoord(aPresContext->GetDynamicToolbarMaxHeight()) /
|
||||
mozilla::ViewAs<mozilla::ScreenPixel>(
|
||||
MVM->DisplaySize(),
|
||||
displaySize,
|
||||
mozilla::PixelCastJustification::LayoutDeviceIsScreenForBounds)
|
||||
.height;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user