From 3f3a848fde52b235d2abceac9742a4c0873c5fab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Mon, 28 Oct 2024 13:50:08 +0100 Subject: [PATCH] Treat a null elementNs in getPropertyType/geAtributeType as the HTML namespace (#557) This is the behavior that Chromium and WebKit currently implement, see https://phabricator.services.mozilla.com/D226547 Currently, it seems that the "interface for localName and elementNs" would fallback to `Element`, similarly to what happens with `document.createElementNS(null, "div")` for example. Note that a null attrNs is already handled by the spec. See also https://github.com/w3c/trusted-types/issues/553 for details. --- spec/index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/index.bs b/spec/index.bs index 19bfc45..1958751 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -676,7 +676,7 @@ Its value is initially « ». This function returns the result of the following algorithm: 1. Set |localName| to |tagName| in [=ASCII lowercase=]. - 1. If |elementNs| is an empty string, set |elementNs| to [=HTML namespace=]. + 1. If |elementNs| is null or an empty string, set |elementNs| to [=HTML namespace=]. 1. Let |interface| be the [=element interface=] for |localName| and |elementNs|. 1. Let |expectedType| be null. 1. Find the row in the following table, where the first column is "*" or |interface|'s name, and |property| is in the second column. @@ -714,7 +714,7 @@ Its value is initially « ». 1. Set |localName| to |tagName| in [=ASCII lowercase=]. 1. Set |attribute| to |attribute| in [=ASCII lowercase=]. - 1. If |elementNs| is an empty string, set |elementNs| to [=HTML namespace=]. + 1. If |elementNs| is null or an empty string, set |elementNs| to [=HTML namespace=]. 1. If |attrNs| is an empty string, set |attrNs| to null. 1. Let |interface| be the [=element interface=] for |localName| and |elementNs|. 1. Let |expectedType| be null.