Closed Bug 1499992 Opened 6 years ago Closed 6 years ago

.retry() is non-conforming

Categories

(Core :: DOM: Web Payments, enhancement, P3)

enhancement

Tracking

()

RESOLVED INVALID

People

(Reporter: marcosc, Unassigned)

References

(Blocks 2 open bugs)

Details

Retry in our implementation is currently:

```
  // If the dictionary argument has no required members, it must be optional.
  [NewObject]
  Promise<void> retry(optional PaymentValidationErrors errorFields);
```

But in the spec, it's:

```
  // If the dictionary argument has no required members, it must be optional.
  [NewObject]
  Promise<void> retry(PaymentValidationErrors errorFields);
```

Which means we fail WPT:
https://w3c-test.org/payment-request/idlharness.https.window.html
Priority: -- → P3
I think it might be against the webidl spec or be a webidl codegen bug.

I got a webidl error when compiling with Promise<void> retry(PaymentValidationErrors errorsFields);

WebIDL.WebIDLError: error: Dictionary argument without any required fields or union argument containing such dictionary not followed by a required argument must be optional, /Users/echuang/Firefox/gecko/dom/webidl/PaymentResponse.webidl line 38:46
  Promise<void> retry(PaymentValidationErrors errorFields);
See Also: → 1494917
Yes, you are right Eden: it's a spec bug according to WebIDL.

"If the type of an argument is a dictionary type or a union type that has a dictionary as one of its flattened member types, and that dictionary type and its ancestors have no required members, and the argument is either the final argument or is followed only by optional arguments, then the argument must be specified as optional."

Eden, always do let me (or standards folks) know if you hit things like this. I'll see if I can add some way for WebIDL2.js to do this check also. 

https://github.com/w3c/payment-request/issues/804
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.