gecko-dev/layout/reftests/meta-viewport/initial-scale-10-ref.html
Hiroyuki Ikezoe d243910c35 Bug 1550105 - Implement the parser for scale values in viewport meta tag as what the spec defines. r=botond
The relevant definition in the spec;
 https://drafts.csswg.org/css-device-adapt/#min-scale-max-scale

Before this change, if both of initial-scale and maximum-scale are negative,
both values are clamped to 0.25. Whereas with this change, negative scale
values are treated as if it's not specified so that initial-scale value is
automatically calculated based on the layout viewport size.
negative-initial-and-maximum-scale.html is a test case for the case.

Also with this change, initial-scale values are going to be clamped to the
range [0.25, 10] during parsing it so that initial-scale-0.html and
initial-scale-100.html need to be modified, now the former is scaled by 0.25x,
the latter is scaled by 10x.
(Before this change, initial-scale=0 and initial-scale=100 were treated as
 invalid scale values in nsViewportInfo::ConstrainViewportValues[1])

[1] https://searchfox.org/mozilla-central/rev/6c9f60f8cc064a1005cd8141ecd526578ae9da7a/dom/base/nsViewportInfo.cpp#15,19

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

--HG--
extra : moz-landing-system : lando
2019-05-23 06:35:52 +00:00

25 lines
382 B
HTML

<!DOCTYPE html>
<meta name="viewport" content="initial-scale=10,width=device-width">
<style>
html, body {
margin: 0;
width: 100%;
height: 100%;
scrollbar-width: none;
}
#container {
position: relative;
}
#inner {
position: absolute;
top: 0;
left: 0;
width: 10px;
height: 10px;
background: green;
}
</style>
<div id="container">
<div id="inner"></div>
</div>