mirror of
https://github.com/servo/servo.git
synced 2025-06-21 15:49:04 +01:00
parent
8f2a3a64f1
commit
987c9e63aa
6 changed files with 48 additions and 2 deletions
|
@ -60,6 +60,9 @@ impl HTMLMetaElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn apply_viewport(&self) {
|
fn apply_viewport(&self) {
|
||||||
|
if !::util::prefs::get_pref("layout.viewport.enabled").as_boolean().unwrap_or(false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let element = self.upcast::<Element>();
|
let element = self.upcast::<Element>();
|
||||||
if let Some(content) = element.get_attribute(&ns!(""), &atom!("content")).r() {
|
if let Some(content) = element.get_attribute(&ns!(""), &atom!("content")).r() {
|
||||||
let content = content.value();
|
let content = content.value();
|
||||||
|
|
|
@ -69,7 +69,7 @@ resolution=300x300,device-pixel-ratio=2 != pixel_snapping_position_a.html pixel_
|
||||||
!= text_decoration_underline_subpx_a.html text_decoration_underline_subpx_ref.html
|
!= text_decoration_underline_subpx_a.html text_decoration_underline_subpx_ref.html
|
||||||
!= text_overflow_a.html text_overflow_ref.html
|
!= text_overflow_a.html text_overflow_ref.html
|
||||||
flaky_cpu,prefs:"layout.writing-mode.enabled" == vertical-lr-blocks.html vertical-lr-blocks_ref.html
|
flaky_cpu,prefs:"layout.writing-mode.enabled" == vertical-lr-blocks.html vertical-lr-blocks_ref.html
|
||||||
== viewport_meta.html viewport_rule_ref.html
|
prefs:"layout.viewport.enabled" == viewport_meta.html viewport_rule_ref.html
|
||||||
resolution=800x600 == viewport_percentage_vmin_vmax.html viewport_percentage_vmin_vmax_a.html
|
resolution=800x600 == viewport_percentage_vmin_vmax.html viewport_percentage_vmin_vmax_a.html
|
||||||
# resolution=600x800 == viewport_percentage_vmin_vmax.html viewport_percentage_vmin_vmax_b.html
|
# resolution=600x800 == viewport_percentage_vmin_vmax.html viewport_percentage_vmin_vmax_b.html
|
||||||
resolution=800x600 == viewport_percentage_vw_vh.html viewport_percentage_vw_vh_a.html
|
resolution=800x600 == viewport_percentage_vw_vh.html viewport_percentage_vw_vh_a.html
|
||||||
|
|
|
@ -4227,6 +4227,18 @@
|
||||||
"url": "/_mozilla/css/vertical_align_top_span_a.html"
|
"url": "/_mozilla/css/vertical_align_top_span_a.html"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"css/viewport_ignore_desktop.html": [
|
||||||
|
{
|
||||||
|
"path": "css/viewport_ignore_desktop.html",
|
||||||
|
"references": [
|
||||||
|
[
|
||||||
|
"/_mozilla/css/viewport_ignore_desktop_ref.html",
|
||||||
|
"=="
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"url": "/_mozilla/css/viewport_ignore_desktop.html"
|
||||||
|
}
|
||||||
|
],
|
||||||
"css/visibility_hidden.html": [
|
"css/visibility_hidden.html": [
|
||||||
{
|
{
|
||||||
"path": "css/visibility_hidden.html",
|
"path": "css/visibility_hidden.html",
|
||||||
|
@ -9424,6 +9436,18 @@
|
||||||
"url": "/_mozilla/css/vertical_align_top_span_a.html"
|
"url": "/_mozilla/css/vertical_align_top_span_a.html"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"css/viewport_ignore_desktop.html": [
|
||||||
|
{
|
||||||
|
"path": "css/viewport_ignore_desktop.html",
|
||||||
|
"references": [
|
||||||
|
[
|
||||||
|
"/_mozilla/css/viewport_ignore_desktop.html",
|
||||||
|
"=="
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"url": "/_mozilla/css/viewport_ignore_desktop.html"
|
||||||
|
}
|
||||||
|
],
|
||||||
"css/visibility_hidden.html": [
|
"css/visibility_hidden.html": [
|
||||||
{
|
{
|
||||||
"path": "css/visibility_hidden.html",
|
"path": "css/visibility_hidden.html",
|
||||||
|
@ -9802,4 +9826,4 @@
|
||||||
"rev": null,
|
"rev": null,
|
||||||
"url_base": "/_mozilla/",
|
"url_base": "/_mozilla/",
|
||||||
"version": 2
|
"version": 2
|
||||||
}
|
}
|
||||||
|
|
13
tests/wpt/mozilla/tests/css/viewport_ignore_desktop.html
Normal file
13
tests/wpt/mozilla/tests/css/viewport_ignore_desktop.html
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<!doctype html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>viewport is ignored on desktop</title>
|
||||||
|
<link rel="match" href="viewport_ignore_desktop_ref.html">
|
||||||
|
<script>
|
||||||
|
if (window.userAgent.indexOf("Mobile") === -1) {
|
||||||
|
var meta = document.creatElement("meta");
|
||||||
|
meta.name = "viewport";
|
||||||
|
meta.content = "width=100";
|
||||||
|
document.getElementsByTagName("head")[0].appendChild(meta);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<p style='border: solid'>Test
|
|
@ -0,0 +1,2 @@
|
||||||
|
prefs: ["layout.viewport.enabled:false"]
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
<!doctype html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>viewport is ignored on desktop</title>
|
||||||
|
<p style='border: solid'>Test
|
Loading…
Add table
Add a link
Reference in a new issue