Meta: Ignore tag namespace when rewriting paths in the WPT importer

This allows us to import SVG tests, which distinguish between HTML and
SVG script tags using namespaces.
This commit is contained in:
Tim Ledbetter 2025-06-27 07:06:19 +01:00 committed by Jelle Raaijmakers
commit c5eca713e9
Notes: github-actions[bot] 2025-06-27 06:37:42 +00:00

View file

@ -77,6 +77,8 @@ class LinkedResourceFinder(HTMLParser):
def handle_starttag(self, tag, attrs):
self._tag_stack_.append(tag)
if ":" in tag:
tag = tag.split(":", 1)[-1]
if tag in ["script", "img", "iframe"]:
attr_dict = dict(attrs)
if "src" in attr_dict:
@ -114,6 +116,8 @@ class TestTypeIdentifier(HTMLParser):
self.ref_test_link_found = False
def handle_starttag(self, tag, attrs):
if ":" in tag:
tag = tag.split(":", 1)[-1]
if tag == "link":
attr_dict = dict(attrs)
if "rel" in attr_dict and (attr_dict["rel"] == "match" or attr_dict["rel"] == "mismatch"):