mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 940036 - 3rd party gaia apps should set a meta-viewport tag. r=kats
This commit is contained in:
parent
41c47c2583
commit
b7057eae68
@ -25,10 +25,11 @@ static const int32_t kViewportDefaultScreenWidth = 980;
|
||||
class MOZ_STACK_CLASS nsViewportInfo
|
||||
{
|
||||
public:
|
||||
nsViewportInfo(const mozilla::ScreenIntSize& aDisplaySize) :
|
||||
nsViewportInfo(const mozilla::ScreenIntSize& aDisplaySize,
|
||||
bool aAllowZoom = true) :
|
||||
mDefaultZoom(1.0),
|
||||
mAutoSize(true),
|
||||
mAllowZoom(true)
|
||||
mAllowZoom(aAllowZoom)
|
||||
{
|
||||
mSize = mozilla::gfx::RoundedToInt(mozilla::ScreenSize(aDisplaySize) / mDefaultZoom);
|
||||
mozilla::CSSToLayoutDeviceScale pixelRatio(1.0f);
|
||||
|
@ -6831,6 +6831,8 @@ nsDocument::GetViewportInfo(const ScreenIntSize& aDisplaySize)
|
||||
switch (mViewportType) {
|
||||
case DisplayWidthHeight:
|
||||
return nsViewportInfo(aDisplaySize);
|
||||
case DisplayWidthHeightNoZoom:
|
||||
return nsViewportInfo(aDisplaySize, /* allowZoom */ false);
|
||||
case Unknown:
|
||||
{
|
||||
nsAutoString viewport;
|
||||
@ -6861,6 +6863,21 @@ nsDocument::GetViewportInfo(const ScreenIntSize& aDisplaySize)
|
||||
mViewportType = DisplayWidthHeight;
|
||||
return nsViewportInfo(aDisplaySize);
|
||||
}
|
||||
|
||||
// Bug 940036. This is bad. When FirefoxOS was built, apps installed
|
||||
// where not using the AsyncPanZoom code. As a result a lot of apps
|
||||
// in the marketplace does not use it yet and instead are built to
|
||||
// render correctly in FirefoxOS only. For a smooth transition the above
|
||||
// code force installed apps to render as if they have a viewport with
|
||||
// content="width=device-width, height=device-height, user-scalable=no".
|
||||
// This could be safely remove once it is known that most apps in the
|
||||
// marketplace use it and that users does not use an old version of the
|
||||
// app that does not use it.
|
||||
nsCOMPtr<nsIDocShell> docShell(mDocumentContainer);
|
||||
if (docShell && docShell->GetIsApp()) {
|
||||
mViewportType = DisplayWidthHeightNoZoom;
|
||||
return nsViewportInfo(aDisplaySize, /* allowZoom */ false);
|
||||
}
|
||||
}
|
||||
|
||||
nsAutoString minScaleStr;
|
||||
|
@ -1390,6 +1390,7 @@ private:
|
||||
|
||||
enum ViewportType {
|
||||
DisplayWidthHeight,
|
||||
DisplayWidthHeightNoZoom,
|
||||
Specified,
|
||||
Unknown
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user