Skip to content

IDNA cannot fail ASCII domains, even if they start with xn--#60476

Merged
annevk merged 1 commit into
masterfrom
annevk/ascii-idna
Jun 25, 2026
Merged

IDNA cannot fail ASCII domains, even if they start with xn--#60476
annevk merged 1 commit into
masterfrom
annevk/ascii-idna

Conversation

@annevk

@annevk annevk commented Jun 8, 2026

Copy link
Copy Markdown
Member

No description provided.

@wpt-pr-bot wpt-pr-bot added the url label Jun 8, 2026
webkit-commit-queue pushed a commit to annevk/WebKit that referenced this pull request Jun 9, 2026
https://bugs.webkit.org/show_bug.cgi?id=316554
rdar://177686282

Reviewed by Alex Christensen.

Unfortunately web compatibility is forcing our hand here to favor pure
ASCII inputs, even when ToUnicode cannot do anything meaningful with
them.

Specification change: whatwg/url#914

Tests: web-platform-tests/wpt#60476
Canonical link: https://commits.webkit.org/314820@main

@domenic domenic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed matches whatwg/url#914.

@domenic domenic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot green checkmark

@annevk annevk merged commit b63305b into master Jun 25, 2026
28 checks passed
@annevk annevk deleted the annevk/ascii-idna branch June 25, 2026 09:31
annevk added a commit to whatwg/url that referenced this pull request Jun 25, 2026
Unfortunately implementing Unicode ToASCII ends up rejecting websites such as

- http://xn--72czcrhaj7cpt0ed1dxb4mb1s1.blogspot.com/2018/11/blog-post_60.html
- https://xn--8i7caa.famitei.net/sekou/all
- https://xn--board-ngr.palungjit.org/members/

which is not really acceptable. So when ToASCII fails, domain is all ASCII, and there are no forbidden domain code points, we just return the lowercased domain. If an implementation does not surface validation errors this is indistinguishable from having an ASCII fast path.

We adjust domain to Unicode by returning the input domain unmodified when any error is recorded and remove validation errors as they would have already been reported when creating domain.

Tests: web-platform-tests/wpt#60476.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants