Steps to reproduce: 1. Open http://президент.рф Expected results: address bar shows just this. Actual results: it's converted to punycode. There is no security risk in allowing Cyrillic characters in this TLD - to the contrary, Latin ones aren't allowed per registrar rules. <rdar://problem/7974044>
Created attachment 56027 [details] proposed fix
Comment on attachment 56027 [details] proposed fix r=me I'd like to see more use of early-return so the nesting could be a bit more shallow. Also, we should find a way to make regression tests for this.
Some examples of what needs to be tested: shouldBe("presentDomainName('президент.рф')", "'президент.рф'"); shouldBe("presentDomainName('президент.рф.')", "'президент.рф.'"); shouldBe("presentDomainName('www.президент.рф')", "'www.президент.рф'"); shouldBe("presentDomainName('почта.президент.рф')", "'почта.президент.рф'"); shouldBe("presentDomainName('0ж9.рф')", "'0ж9.рф'"); shouldBe("presentDomainName('туда-сюда.рф')", "'туда-сюда.рф'"); shouldBe("presentDomainName('прeзидент.рф')", "'punycode'"); // spoof: Roman "e" shouldBe("presentDomainName('caxap.рф')", "'punycode'"); // spoof: all characters in "caxap" are Roman
Committed <http://trac.webkit.org/changeset/59391>.