mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08: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
|
@ -180,6 +180,23 @@ class SourceFile(object):
|
|||
if timeout_str and timeout_str.lower() == "long":
|
||||
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
|
||||
def testharness_nodes(self):
|
||||
"""List of ElementTree Elements corresponding to nodes representing a
|
||||
|
@ -271,7 +288,7 @@ class SourceFile(object):
|
|||
rv.append(TestharnessTest(self, url, timeout=self.timeout))
|
||||
|
||||
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:
|
||||
# If nothing else it's a helper file, which we don't have a specific type for
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue