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
ef9e465afe
commit
d9594062d6
@ -25,10 +25,11 @@ static const int32_t kViewportDefaultScreenWidth = 980;
|
|||||||
class MOZ_STACK_CLASS nsViewportInfo
|
class MOZ_STACK_CLASS nsViewportInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nsViewportInfo(const mozilla::ScreenIntSize& aDisplaySize) :
|
nsViewportInfo(const mozilla::ScreenIntSize& aDisplaySize,
|
||||||
|
bool aAllowZoom = true) :
|
||||||
mDefaultZoom(1.0),
|
mDefaultZoom(1.0),
|
||||||
mAutoSize(true),
|
mAutoSize(true),
|
||||||
mAllowZoom(true)
|
mAllowZoom(aAllowZoom)
|
||||||
{
|
{
|
||||||
mSize = mozilla::gfx::RoundedToInt(mozilla::ScreenSize(aDisplaySize) / mDefaultZoom);
|
mSize = mozilla::gfx::RoundedToInt(mozilla::ScreenSize(aDisplaySize) / mDefaultZoom);
|
||||||
mozilla::CSSToLayoutDeviceScale pixelRatio(1.0f);
|
mozilla::CSSToLayoutDeviceScale pixelRatio(1.0f);
|
||||||
|
@ -6831,6 +6831,8 @@ nsDocument::GetViewportInfo(const ScreenIntSize& aDisplaySize)
|
|||||||
switch (mViewportType) {
|
switch (mViewportType) {
|
||||||
case DisplayWidthHeight:
|
case DisplayWidthHeight:
|
||||||
return nsViewportInfo(aDisplaySize);
|
return nsViewportInfo(aDisplaySize);
|
||||||
|
case DisplayWidthHeightNoZoom:
|
||||||
|
return nsViewportInfo(aDisplaySize, /* allowZoom */ false);
|
||||||
case Unknown:
|
case Unknown:
|
||||||
{
|
{
|
||||||
nsAutoString viewport;
|
nsAutoString viewport;
|
||||||
@ -6861,6 +6863,21 @@ nsDocument::GetViewportInfo(const ScreenIntSize& aDisplaySize)
|
|||||||
mViewportType = DisplayWidthHeight;
|
mViewportType = DisplayWidthHeight;
|
||||||
return nsViewportInfo(aDisplaySize);
|
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;
|
nsAutoString minScaleStr;
|
||||||
|
@ -1390,6 +1390,7 @@ private:
|
|||||||
|
|
||||||
enum ViewportType {
|
enum ViewportType {
|
||||||
DisplayWidthHeight,
|
DisplayWidthHeight,
|
||||||
|
DisplayWidthHeightNoZoom,
|
||||||
Specified,
|
Specified,
|
||||||
Unknown
|
Unknown
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user