Closed Bug 1845552 Opened 11 months ago Closed 10 months ago

URL IDN WPT failures

Categories

(Core :: Networking, defect, P2)

defect

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
firefox119 --- fixed

People

(Reporter: edgul, Assigned: jfkthame)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [necko-triaged])

Attachments

(2 files)

IdnaTestV2.window.js.ini notes the currently failing WPTs for URL IDN. They are also visible on the WPT dashboard.

Let's try to address the first four issues in this file.

  [ToASCII("ä.­.c") A4_2 (ignored)]
    expected: FAIL

  [ToASCII("ä.­.c") A4_2 (ignored)]
    expected: FAIL

  [ToASCII("Ä.­.C") A4_2 (ignored)]
    expected: FAIL

  [ToASCII("Ä.­.C") A4_2 (ignored)]
    expected: FAIL

If some of the other issues in this file turn out to be similar enough to fix we can include them here, otherwise we will create followup bugs.

Severity: -- → S4
Priority: -- → P2
Whiteboard: [necko-triaged]
Blocks: url

Greg or Valentin,
How exactly are we using the interop-2023-url meta? Should this bug and others like it which are not necessarily included in the roadmap block the meta?

Flags: needinfo?(valentin.gosu)
Flags: needinfo?(ghess)
Assignee: nobody → dotoole

In this case, the fix probably belongs somewhere in nsIDNService.cpp

new URL("https://ä.\u00ad.c/x")

In this case U+00AD is soft hyphen which is supposed to be ignored by IDNA:
00AD ; ignored # SOFT HYPHEN

and the URL should be https://xn--4ca..c/x

I don't know if the issue lies in ICU or we do something wrong when the label becomes empty.

Flags: needinfo?(valentin.gosu)
Flags: needinfo?(ghess)

I think the issue here is that nsIDNService::IDNA2008StringPrep is returning an error (as ICU has set an error code in the IDNA::Info) when the label ends up empty, but in this case we should just accept the empty label. Fixing that gives us 6 new passes on the IdnaTestV2 suite.

The remaining failures in IdnaTestV2 (the great majority of the current failures) arise because of this line, where the presence of a "hyphen error" in the IDNA info means that we will ignore any other errors that may also have been present. That seems wrong; we only want to ignore the hyphen error and return success if that was the only kind of error detected, but if others are present then IDNA2008StringPrep should still return a MALFORMED_URI error.

@Dylan, do you have work in progress on this? If not, I can post a patch to address these issues.

Flags: needinfo?(dotoole)
Assignee: dotoole → nobody
Flags: needinfo?(dotoole)

(In reply to Jonathan Kew [:jfkthame] from comment #3)

I think the issue here is that nsIDNService::IDNA2008StringPrep is returning an error (as ICU has set an error code in the IDNA::Info) when the label ends up empty, but in this case we should just accept the empty label. Fixing that gives us 6 new passes on the IdnaTestV2 suite.

The remaining failures in IdnaTestV2 (the great majority of the current failures) arise because of this line, where the presence of a "hyphen error" in the IDNA info means that we will ignore any other errors that may also have been present. That seems wrong; we only want to ignore the hyphen error and return success if that was the only kind of error detected, but if others are present then IDNA2008StringPrep should still return a MALFORMED_URI error.

@Dylan, do you have work in progress on this? If not, I can post a patch to address these issues.

No, you can take it thanks.

This change gives us 46 new passes on the IdnaTestV2 test collection, with just 6 failures remaining
(to be resolved by the next patch).

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1bd11b1176e6
patch 1 - Don't let the presence of an invalid-hyphen error (which may be ignored during StringPrepForDNS) mask the presence of other (non-ignorable) types of error in the URL. r=necko-reviewers,valentin
https://hg.mozilla.org/integration/autoland/rev/19d62e534070
patch 2 - Don't return a malformed-URL error if the label is empty in StringPrepForDNS processing; just let the caller deal with that. r=necko-reviewers,valentin
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: