- From: Domenic Denicola <notifications@github.com>
- Date: Wed, 02 Jul 2025 19:19:22 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/1387/3030301462@github.com>
domenic left a comment (whatwg/dom#1387) So to make sure I understand: (no namespace, `:foo`): - Previously: invalid character error. - After my spec update: invalid character error. (_prefix_ is the empty string so step 6 of "validate and extract" throws) - @josepharhar's test/Chromium updates: valid. (no-namespace, `f::oo`): - Previously, namespace error. - After my spec update: invalid character error. (_localName_ is the empty string so step 7 of "validate and extract" throws) - @josepharhar's test/Chromium updates: invalid character error. (`http://example.com/`, `f::oo`): - Previously, valid. - After my spec update: invalid character error. (_localName_ is the empty string so step 7 of "validate and extract" throws) - @josepharhar's test/Chromium updates: valid. Is this correct? ---- The biggest difference between the current spec and the previous spec is that the previous spec separated "validate and extract", which did no local name validation, from `createElement()`, which did. So for example, the previous spec was permissive for the (`http://example.com/`, `f::oo`) case because it only went through `createElementNS()`. And it gave a namespace error for (no-namespace, `f::oo`) because it didn't check the empty string local name, so it got to the step that found a prefix `"f"` with a non-null namespace `http://example.com/`. I don't have a strong opinion on what the correct behavior is here. One perspective is that we should be at least as permissive as the previous spec, and that we shouldn't change the error cases. That would argue for somehow fixing the (no-namespace, `f::oo`) case to go back to a namespace error, and the (`http://example.com/`, `f::oo`) case to be valid. However, I think the current spec is pretty nice and simple, and I hope that nobody is relying on `document.createElementNS("http://example.com/", "f::oo")` creating an element with namespace prefix `"f"` and local name `""`, or on the exact error type. So maybe we should just update the tests/Chromium implementation, and leave the spec as-is? -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/1387#issuecomment-3030301462 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/dom/issues/1387/3030301462@github.com>
Received on Thursday, 3 July 2025 02:19:26 UTC