mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Move viewport_percentage_vw_vh_a.html and viewport_percentage_vw_vh_b.html to wpt reftests.
This commit is contained in:
parent
797b21eaf1
commit
796c77df33
7 changed files with 86 additions and 11 deletions
|
@ -6,8 +6,6 @@ fragment=top != ../html/acid2.html acid2_ref.html
|
||||||
|
|
||||||
resolution=300x300,device-pixel-ratio=2 != pixel_snapping_border_a.html pixel_snapping_border_ref.html
|
resolution=300x300,device-pixel-ratio=2 != pixel_snapping_border_a.html pixel_snapping_border_ref.html
|
||||||
resolution=300x300,device-pixel-ratio=2 != pixel_snapping_position_a.html pixel_snapping_position_ref.html
|
resolution=300x300,device-pixel-ratio=2 != pixel_snapping_position_a.html pixel_snapping_position_ref.html
|
||||||
resolution=800x600 == viewport_percentage_vw_vh.html viewport_percentage_vw_vh_a.html
|
|
||||||
# resolution=600x800 == viewport_percentage_vw_vh.html viewport_percentage_vw_vh_b.html
|
|
||||||
|
|
||||||
# This file must be sorted alphabetically.
|
# This file must be sorted alphabetically.
|
||||||
# Please run `./mach test-tidy` to check your changes.
|
# Please run `./mach test-tidy` to check your changes.
|
||||||
|
|
|
@ -123,26 +123,29 @@ class RefTest(URLManifestItem):
|
||||||
item_type = "reftest"
|
item_type = "reftest"
|
||||||
|
|
||||||
def __init__(self, source_file, url, references, url_base="/", timeout=None,
|
def __init__(self, source_file, url, references, url_base="/", timeout=None,
|
||||||
manifest=None):
|
viewport_size=None, manifest=None):
|
||||||
URLManifestItem.__init__(self, source_file, url, url_base=url_base, manifest=manifest)
|
URLManifestItem.__init__(self, source_file, url, url_base=url_base, manifest=manifest)
|
||||||
for _, ref_type in references:
|
for _, ref_type in references:
|
||||||
if ref_type not in ["==", "!="]:
|
if ref_type not in ["==", "!="]:
|
||||||
raise ValueError, "Unrecognised ref_type %s" % ref_type
|
raise ValueError, "Unrecognised ref_type %s" % ref_type
|
||||||
self.references = tuple(references)
|
self.references = tuple(references)
|
||||||
self.timeout = timeout
|
self.timeout = timeout
|
||||||
|
self.viewport_size = viewport_size
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_reference(self):
|
def is_reference(self):
|
||||||
return self.source_file.name_is_reference
|
return self.source_file.name_is_reference
|
||||||
|
|
||||||
def meta_key(self):
|
def meta_key(self):
|
||||||
return (self.timeout,)
|
return (self.timeout, self.viewport_size)
|
||||||
|
|
||||||
def to_json(self):
|
def to_json(self):
|
||||||
rv = URLManifestItem.to_json(self)
|
rv = URLManifestItem.to_json(self)
|
||||||
rv["references"] = self.references
|
rv["references"] = self.references
|
||||||
if self.timeout is not None:
|
if self.timeout is not None:
|
||||||
rv["timeout"] = self.timeout
|
rv["timeout"] = self.timeout
|
||||||
|
if self.viewport_size is not None:
|
||||||
|
rv["viewport_size"] = self.viewport_size
|
||||||
return rv
|
return rv
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -153,6 +156,7 @@ class RefTest(URLManifestItem):
|
||||||
obj["references"],
|
obj["references"],
|
||||||
url_base=manifest.url_base,
|
url_base=manifest.url_base,
|
||||||
timeout=obj.get("timeout"),
|
timeout=obj.get("timeout"),
|
||||||
|
viewport_size=obj.get("viewport_size"),
|
||||||
manifest=manifest)
|
manifest=manifest)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -180,6 +180,23 @@ class SourceFile(object):
|
||||||
if timeout_str and timeout_str.lower() == "long":
|
if timeout_str and timeout_str.lower() == "long":
|
||||||
return timeout_str
|
return timeout_str
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def viewport_nodes(self):
|
||||||
|
"""List of ElementTree Elements corresponding to nodes in a test that
|
||||||
|
specify viewport sizes"""
|
||||||
|
return self.root.findall(".//{http://www.w3.org/1999/xhtml}meta[@name='viewport-size']")
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def viewport_size(self):
|
||||||
|
"""The viewport size of a test or reference file"""
|
||||||
|
if not self.root:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not self.viewport_nodes:
|
||||||
|
return None
|
||||||
|
|
||||||
|
return self.viewport_nodes[0].attrib.get("content", None)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def testharness_nodes(self):
|
def testharness_nodes(self):
|
||||||
"""List of ElementTree Elements corresponding to nodes representing a
|
"""List of ElementTree Elements corresponding to nodes representing a
|
||||||
|
@ -271,7 +288,7 @@ class SourceFile(object):
|
||||||
rv.append(TestharnessTest(self, url, timeout=self.timeout))
|
rv.append(TestharnessTest(self, url, timeout=self.timeout))
|
||||||
|
|
||||||
elif self.content_is_ref_node:
|
elif self.content_is_ref_node:
|
||||||
rv = [RefTest(self, self.url, self.references, timeout=self.timeout)]
|
rv = [RefTest(self, self.url, self.references, timeout=self.timeout, viewport_size=self.viewport_size)]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# If nothing else it's a helper file, which we don't have a specific type for
|
# If nothing else it's a helper file, which we don't have a specific type for
|
||||||
|
|
|
@ -4893,6 +4893,32 @@
|
||||||
"viewport_size": "500x700"
|
"viewport_size": "500x700"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"css/viewport_percentage_vw_vh_a.html": [
|
||||||
|
{
|
||||||
|
"path": "css/viewport_percentage_vw_vh_a.html",
|
||||||
|
"references": [
|
||||||
|
[
|
||||||
|
"/_mozilla/css/viewport_percentage_vw_vh_ref.html",
|
||||||
|
"=="
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"url": "/_mozilla/css/viewport_percentage_vw_vh_a.html",
|
||||||
|
"viewport_size": "700x500"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"css/viewport_percentage_vw_vh_b.html": [
|
||||||
|
{
|
||||||
|
"path": "css/viewport_percentage_vw_vh_b.html",
|
||||||
|
"references": [
|
||||||
|
[
|
||||||
|
"/_mozilla/css/viewport_percentage_vw_vh_ref.html",
|
||||||
|
"=="
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"url": "/_mozilla/css/viewport_percentage_vw_vh_b.html",
|
||||||
|
"viewport_size": "500x700"
|
||||||
|
}
|
||||||
|
],
|
||||||
"css/viewport_rule.html": [
|
"css/viewport_rule.html": [
|
||||||
{
|
{
|
||||||
"path": "css/viewport_rule.html",
|
"path": "css/viewport_rule.html",
|
||||||
|
@ -10852,6 +10878,32 @@
|
||||||
"viewport_size": "500x700"
|
"viewport_size": "500x700"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"css/viewport_percentage_vw_vh_a.html": [
|
||||||
|
{
|
||||||
|
"path": "css/viewport_percentage_vw_vh_a.html",
|
||||||
|
"references": [
|
||||||
|
[
|
||||||
|
"/_mozilla/css/viewport_percentage_vw_vh_ref.html",
|
||||||
|
"=="
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"url": "/_mozilla/css/viewport_percentage_vw_vh_a.html",
|
||||||
|
"viewport_size": "700x500"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"css/viewport_percentage_vw_vh_b.html": [
|
||||||
|
{
|
||||||
|
"path": "css/viewport_percentage_vw_vh_b.html",
|
||||||
|
"references": [
|
||||||
|
[
|
||||||
|
"/_mozilla/css/viewport_percentage_vw_vh_ref.html",
|
||||||
|
"=="
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"url": "/_mozilla/css/viewport_percentage_vw_vh_b.html",
|
||||||
|
"viewport_size": "500x700"
|
||||||
|
}
|
||||||
|
],
|
||||||
"css/viewport_rule.html": [
|
"css/viewport_rule.html": [
|
||||||
{
|
{
|
||||||
"path": "css/viewport_rule.html",
|
"path": "css/viewport_rule.html",
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<meta name=viewport-size content=700x500>
|
||||||
|
<link rel=match href=viewport_percentage_vw_vh_ref.html>
|
||||||
<style>
|
<style>
|
||||||
#box {
|
#box {
|
||||||
background: green;
|
background: green;
|
||||||
height: 300px;
|
height: 42vh;
|
||||||
width: 400px;
|
width: 50vw;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
|
@ -1,11 +1,13 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<meta name=viewport-size content=500x700>
|
||||||
|
<link rel=match href=viewport_percentage_vw_vh_ref.html>
|
||||||
<style>
|
<style>
|
||||||
#box {
|
#box {
|
||||||
background: green;
|
background: green;
|
||||||
height: 400px;
|
height: 30vh;
|
||||||
width: 300px;
|
width: 70vw;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
|
@ -4,8 +4,8 @@
|
||||||
<style>
|
<style>
|
||||||
#box {
|
#box {
|
||||||
background: green;
|
background: green;
|
||||||
height: 50vh;
|
height: 210px;
|
||||||
width: 50vw;
|
width: 350px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
Loading…
Add table
Add a link
Reference in a new issue