Skip to content

Commit

Permalink
Add IDL patches for CSS Typed OM and Payment Request (#213)
Browse files Browse the repository at this point in the history
- CSS Typed OM: restore previous definition of CSSColor as new definition
references not yet defined CSSPercentishArray type
- Payment Request: restore PaymentAddress and AddressErrors interfaces, dropped
from the spec but still referenced by "Method Payment: Basic Card" and by the
Contacts API
  • Loading branch information
tidoust authored May 17, 2021
1 parent d43f5d1 commit f812ce6
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
31 changes: 31 additions & 0 deletions ed/idlpatches/css-typed-om.idl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 19fbd9a43ddae066c864e4dbcd3493cd96e7aadb Mon Sep 17 00:00:00 2001
From: Francois Daoust <fd@tidoust.net>
Date: Mon, 17 May 2021 14:21:51 +0200
Subject: [PATCH] Restore previous definition for CSSColor

https://github.com/w3c/css-houdini-drafts/issues/1041
---
ed/idl/css-typed-om.idl | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/ed/idl/css-typed-om.idl b/ed/idl/css-typed-om.idl
index 9be9a1a76..262d2884e 100644
--- a/ed/idl/css-typed-om.idl
+++ b/ed/idl/css-typed-om.idl
@@ -371,10 +371,9 @@ interface CSSLab : CSSColorValue {

[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSColor : CSSColorValue {
- constructor(CSSKeywordish colorSpace, sequence<CSSNumberish> channels, optional CSSNumberish alpha = 1);
- attribute CSSKeywordish colorSpace;
- attribute CSSPercentishArray channels;
- attribute CSSNumberish alpha;
+ constructor(sequence<(DOMString or CSSNumberish)> variant);
+ /* CSSColor(["foo", 0, 1, .5], ["bar", "yellow"], 1, fallbackColor) */
+ /* or just make the alpha and fallback successive optional args? */
};

[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
--
2.31.1.windows.1

53 changes: 53 additions & 0 deletions ed/idlpatches/payment-request.idl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From d00f84ad858cc457d0e894218931ef6b28cc6d4d Mon Sep 17 00:00:00 2001
From: Francois Daoust <fd@tidoust.net>
Date: Mon, 17 May 2021 13:47:50 +0200
Subject: [PATCH] Restore PaymentAddress and AddressErrors interface

Still used in Contact API:
https://github.com/WICG/contact-api/pull/39

Still referenced by Basic Card Payment Method:
https://github.com/w3c/payment-method-basic-card/issues/89
---
ed/idl/payment-request.idl | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

diff --git a/ed/idl/payment-request.idl b/ed/idl/payment-request.idl
index b66bb1592..cd16e2aab 100644
--- a/ed/idl/payment-request.idl
+++ b/ed/idl/payment-request.idl
@@ -103,3 +103,31 @@ interface PaymentRequestUpdateEvent : Event {
};

dictionary PaymentRequestUpdateEventInit : EventInit {};
+
+[SecureContext, Exposed=(Window)]
+interface PaymentAddress {
+ [Default] object toJSON();
+ readonly attribute DOMString city;
+ readonly attribute DOMString country;
+ readonly attribute DOMString dependentLocality;
+ readonly attribute DOMString organization;
+ readonly attribute DOMString phone;
+ readonly attribute DOMString postalCode;
+ readonly attribute DOMString recipient;
+ readonly attribute DOMString region;
+ readonly attribute DOMString sortingCode;
+ readonly attribute FrozenArray<DOMString> addressLine;
+};
+
+dictionary AddressErrors {
+ DOMString addressLine;
+ DOMString city;
+ DOMString country;
+ DOMString dependentLocality;
+ DOMString organization;
+ DOMString phone;
+ DOMString postalCode;
+ DOMString recipient;
+ DOMString region;
+ DOMString sortingCode;
+};
--
2.31.1.windows.1

0 comments on commit f812ce6

Please sign in to comment.