From 598bfd91a34ac63c8cc728da13ba10d83112fd8e Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Sat, 18 Apr 2026 19:50:39 +1000 Subject: [PATCH 1/3] fix(validators): re-enable skipped tests after correcting emoji expectations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Emoji like 🪳 (U+1FAB3) and 😇 (U+1F607) are in the XML NameStartChar / NameChar range [#x10000-#xEFFFF], so createAttribute/createElement correctly do NOT throw for them. Remove them from the "invalid" lists, re-enable both validator tests and the dfn-spec "handles bad attributes" test. --- tests/spec/core/dfn-spec.js | 4 +--- tests/spec/core/validators-spec.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/tests/spec/core/dfn-spec.js b/tests/spec/core/dfn-spec.js index 2877489052..f5f5adff98 100644 --- a/tests/spec/core/dfn-spec.js +++ b/tests/spec/core/dfn-spec.js @@ -418,9 +418,7 @@ describe("Core — Definitions", () => { expect(dfn.dataset.export).toBe(""); }); - // TODO: failing for Chrome, but not Firefox. Needs investigation. - // eslint-disable-next-line jasmine/no-disabled-tests - xit("handles bad attributes", async () => { + it("handles bad attributes", async () => { const body = html`

Attributes

diff --git a/tests/spec/core/validators-spec.js b/tests/spec/core/validators-spec.js index 04db28fdf6..7816033ac3 100644 --- a/tests/spec/core/validators-spec.js +++ b/tests/spec/core/validators-spec.js @@ -27,10 +27,10 @@ describe("Core - Validators", () => { } }); - // TODO: failing for Chrome, but not Firefox. Needs investigation. - // eslint-disable-next-line jasmine/no-disabled-tests - xit("generates an error if the element name is not valid", () => { - const elements = ["my element", "crypto$", "🪳", "-something", ""]; + it("generates an error if the element name is not valid", () => { + // Note: emoji like 🪳 (U+1FAB3) are valid NameStartChar per XML + // [#x10000-#xEFFFF], so Chrome correctly does NOT throw for them. + const elements = ["my element", "crypto$", "-something", ""]; for (const element of elements) { const dfn = document.createElement("dfn"); const context = `element name: ${element}`; @@ -57,10 +57,10 @@ describe("Core - Validators", () => { } }); - // TODO: failing for Chrome, but not Firefox. Needs investigation. - // eslint-disable-next-line jasmine/no-disabled-tests - xit("generates an error if the attribute name is invalid", () => { - const attributes = ["-crossorigin", "-whatever-", "aria-😇"]; + it("generates an error if the attribute name is invalid", () => { + // Note: emoji like 😇 (U+1F607) are valid NameChar per XML + // [#x10000-#xEFFFF], so "aria-😇" is valid and Chrome does not throw. + const attributes = ["-crossorigin", "-whatever-"]; for (const attribute of attributes) { const context = `attribute name: ${attribute}`; const dfn = document.createElement("dfn"); From 0e1e48e651d79f417502af8445e63c13d21d8e85 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Apr 2026 13:20:36 +0000 Subject: [PATCH 2/3] test(validators): assert emoji names are explicitly valid Agent-Logs-Url: https://github.com/speced/respec/sessions/a0ae5a98-1d11-4378-9e2d-bc5cc051a2bf --- tests/spec/core/validators-spec.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/spec/core/validators-spec.js b/tests/spec/core/validators-spec.js index 7816033ac3..efc618352a 100644 --- a/tests/spec/core/validators-spec.js +++ b/tests/spec/core/validators-spec.js @@ -14,6 +14,7 @@ describe("Core - Validators", () => { "feGaussianBlur", "body", "html", + "🪳", ]; for (const element of elements) { const dfn = document.createElement("dfn"); @@ -28,8 +29,6 @@ describe("Core - Validators", () => { }); it("generates an error if the element name is not valid", () => { - // Note: emoji like 🪳 (U+1FAB3) are valid NameStartChar per XML - // [#x10000-#xEFFFF], so Chrome correctly does NOT throw for them. const elements = ["my element", "crypto$", "-something", ""]; for (const element of elements) { const dfn = document.createElement("dfn"); @@ -44,7 +43,12 @@ describe("Core - Validators", () => { }); it("doesn't generates an error if the attribute name is valid", () => { - const attributes = ["crossorigin", "aria-hidden", "aria-roledescription"]; + const attributes = [ + "crossorigin", + "aria-hidden", + "aria-roledescription", + "aria-😇", + ]; for (const attribute of attributes) { const context = `attribute name: ${attribute}`; const dfn = document.createElement("dfn"); @@ -58,8 +62,6 @@ describe("Core - Validators", () => { }); it("generates an error if the attribute name is invalid", () => { - // Note: emoji like 😇 (U+1F607) are valid NameChar per XML - // [#x10000-#xEFFFF], so "aria-😇" is valid and Chrome does not throw. const attributes = ["-crossorigin", "-whatever-"]; for (const attribute of attributes) { const context = `attribute name: ${attribute}`; From 90c7301ca668ee8906332814fcc2b67d55ab4aa8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 19 Apr 2026 13:22:39 +0000 Subject: [PATCH 3/3] test(validators): align invalid DOM name cases with browser behavior Agent-Logs-Url: https://github.com/speced/respec/sessions/ff8300e9-1786-4975-87c5-1a2acecd2ef0 --- tests/spec/core/dfn-spec.js | 4 ++-- tests/spec/core/validators-spec.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/spec/core/dfn-spec.js b/tests/spec/core/dfn-spec.js index f5f5adff98..9433144a99 100644 --- a/tests/spec/core/dfn-spec.js +++ b/tests/spec/core/dfn-spec.js @@ -423,7 +423,7 @@ describe("Core — Definitions", () => {

Attributes

- -attribute + bad attribute

`; @@ -432,7 +432,7 @@ describe("Core — Definitions", () => { const errors = findDfnErrors(doc); expect(errors).toHaveSize(1); - expect(errors[0].message).toContain("-attribute"); + expect(errors[0].message).toContain("bad attribute"); }); it("handles attribute values", async () => { diff --git a/tests/spec/core/validators-spec.js b/tests/spec/core/validators-spec.js index efc618352a..7f813756ad 100644 --- a/tests/spec/core/validators-spec.js +++ b/tests/spec/core/validators-spec.js @@ -29,7 +29,7 @@ describe("Core - Validators", () => { }); it("generates an error if the element name is not valid", () => { - const elements = ["my element", "crypto$", "-something", ""]; + const elements = ["my element", ""]; for (const element of elements) { const dfn = document.createElement("dfn"); const context = `element name: ${element}`; @@ -62,7 +62,7 @@ describe("Core - Validators", () => { }); it("generates an error if the attribute name is invalid", () => { - const attributes = ["-crossorigin", "-whatever-"]; + const attributes = ["my attribute", ""]; for (const attribute of attributes) { const context = `attribute name: ${attribute}`; const dfn = document.createElement("dfn");