From 3f57df3f82e828477f7b47975b325f01ca9a5574 Mon Sep 17 00:00:00 2001 From: Mike West Date: Wed, 5 Apr 2017 13:40:23 +0200 Subject: [PATCH 01/10] Define a 'PromiseController' and 'PromiseSignal' interface. Fetch is sketching out a cancellation mechanism in whatwg/fetch#447, and other specifications are interested in cargo-culting their way to similar behaviors. To that end, this patch defines a simple interface that provides enough control for the simple case of cancellation, while paving the way for more complex consumers like Fetch to tack on arbitrary complexity. --- dom.bs | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/dom.bs b/dom.bs index aa21deed8..6e15569d6 100644 --- a/dom.bs +++ b/dom.bs @@ -1419,6 +1419,88 @@ that gave folks all the wrong ideas. Events do not represent or cause act can only be used to influence an ongoing one. +

Controlling {{Promise}}s

+ +

Though {{Promise}} objects don't have any built-in cancellation mechanism, many +{{Promise}}-vending APIs require cancellation semantics. {{PromiseController}} is meant to support +these requirements by providing an {{PromiseController/abort()}} method that toggles the state of +a corresponding {{PromiseSignal}} object. The API which wishes to support cancelation can accept +such a {{PromiseSignal}}, and use its state to determine how (not) to proceed. + +

+ For example, a hypothetical DoAmazingness({ ... }) method could accept a + {{PromiseSignal}} object in order to support cancellation as follows: + +
+    const controller = new PromiseController();
+    const signal = controller.signal;
+    DoAmazingness({ ..., signal }).then(result => ...);
+
+    ...
+
+    controller.abort();
+  
+ + APIs that require more granular control could extend both {{PromiseController}} and + {{PromiseSignal}} according to their needs. +
+ +

Interface {{PromiseController}}

+ +
+[Constructor(), Exposed=(Window,Worker)]
+interface PromiseController {
+  readonly attribute PromiseSignal signal;
+
+  void abort();
+};
+
+
+
controller = new PromiseController() +
Returns a new controller whose {{PromiseController/signal}} attribute value is set + to a newly created {{PromiseSignal}} object. + +
controller . {{PromiseController/signal}} +
Returns the {{PromiseSignal}} object associated with this object. + +
controller . {{PromiseController/abort()}} +
Invoking this method will set this object's {{PromiseSignal}}'s [=PromiseSignal/aborted flag=], + thereby signaling to any observers that the associated activity should be aborted. +
+ +The signal attribute must return the value to which it +was initialized. When a {{PromiseController}} is created, the attribute must be initialized to a +newly created {{PromiseSignal}} object. + +The abort(), when invoked, must run these +steps: + +
    +
  1. Let signal be this object's {{PromiseController/signal}}. +
  2. Set signal's [=PromiseSignal/aborted flag=]. +
  3. [=Fire an event=] named abort at signal.
  4. +
+ +

Interface {{PromiseSignal}}

+ +
+[Exposed=(Window,Worker)]
+interface PromiseSignal : EventTarget {
+  readonly attribute boolean aborted;
+
+  attribute EventHandler onabort;
+};
+
+
+
signal . {{PromiseSignal/aborted}} +
Returns true if this {{PromiseSignal}} has been aborted, and false otherwise. +
+ +Each {{PromiseSignal}} has an aborted flag which is unset unless +otherwise specified. + +The aborted attribute's getter must return true if the +object's [=PromiseSignal/aborted flag=] is set, and false otherwise.

Nodes

From 61c6e728c9259aa221647c29499fcc99cee422cd Mon Sep 17 00:00:00 2001 From: Mike West Date: Thu, 6 Apr 2017 10:57:07 +0200 Subject: [PATCH 02/10] fixup 'abort steps' --- dom.bs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dom.bs b/dom.bs index 6e15569d6..45353108d 100644 --- a/dom.bs +++ b/dom.bs @@ -1478,7 +1478,8 @@ steps:
  1. Let signal be this object's {{PromiseController/signal}}.
  2. Set signal's [=PromiseSignal/aborted flag=]. -
  3. [=Fire an event=] named abort at signal.
  4. +
  5. [=Fire an event=] named abort at signal. +
  6. Run signal's [=PromiseSignal/abort steps=].

Interface {{PromiseSignal}}

@@ -1499,6 +1500,15 @@ interface PromiseSignal : EventTarget { Each {{PromiseSignal}} has an aborted flag which is unset unless otherwise specified. +Each {{PromiseSignal}} has an abort steps algorithm which is +executed when its [=PromiseSignal/aborted flag=] is set. Unless otherwise specified, this +algorithm is a no-op. + +

The [=PromiseSignal/abort steps=] algorithm enables APIs with more +complex requirements to react in a reasonable way to {{PromiseController/abort()}}. For example, +a given API's [=PromiseSignal/aborted flag=] may need to be propagated to a cross-thread +environment (like a Service Worker). + The aborted attribute's getter must return true if the object's [=PromiseSignal/aborted flag=] is set, and false otherwise. From 9282bf3aa59384ab8ea0820bccb47a926c0246fe Mon Sep 17 00:00:00 2001 From: Mike West Date: Thu, 6 Apr 2017 11:19:27 +0200 Subject: [PATCH 03/10] fixup AbortError and whitespace. --- dom.bs | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/dom.bs b/dom.bs index 45353108d..ddb477d46 100644 --- a/dom.bs +++ b/dom.bs @@ -1421,28 +1421,33 @@ can only be used to influence an ongoing one.

Controlling {{Promise}}s

-

Though {{Promise}} objects don't have any built-in cancellation mechanism, many -{{Promise}}-vending APIs require cancellation semantics. {{PromiseController}} is meant to support -these requirements by providing an {{PromiseController/abort()}} method that toggles the state of -a corresponding {{PromiseSignal}} object. The API which wishes to support cancelation can accept -such a {{PromiseSignal}}, and use its state to determine how (not) to proceed. +Though {{Promise}} objects don't have any built-in cancellation mechanism, many {{Promise}}-vending +APIs require cancellation semantics. {{PromiseController}} is meant to support these requirements by +providing an {{PromiseController/abort()}} method that toggles the state of a corresponding +{{PromiseSignal}} object. The API which wishes to support cancellation can accept such a +{{PromiseSignal}}, and use its state to determine how (not) to proceed. + +Upon {{PromiseController/abort()}}, the relevant {{Promise}} will reject with an +AbortError [=simple exception=].

- For example, a hypothetical DoAmazingness({ ... }) method could accept a - {{PromiseSignal}} object in order to support cancellation as follows: + For example, a hypothetical DoAmazingness({ ... }) method could accept a + {{PromiseSignal}} object in order to support cancellation as follows:
-    const controller = new PromiseController();
-    const signal = controller.signal;
-    DoAmazingness({ ..., signal }).then(result => ...);
+   const controller = new PromiseController();
+   const signal = controller.signal;
+   DoAmazingness({ ..., signal })
+     .then(result => ...)
+     .catch(e => ...);
 
-    ...
+   ...
 
-    controller.abort();
+   controller.abort();
   
- APIs that require more granular control could extend both {{PromiseController}} and - {{PromiseSignal}} according to their needs. + APIs that require more granular control could extend both {{PromiseController}} and + {{PromiseSignal}} according to their needs.

Interface {{PromiseController}}

From 8681c81ca74efa6a739eb499c95f2cece0f325f1 Mon Sep 17 00:00:00 2001 From: Mike West Date: Thu, 6 Apr 2017 12:33:26 +0200 Subject: [PATCH 04/10] fixup abort steps before event. --- dom.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom.bs b/dom.bs index ddb477d46..74eda52c3 100644 --- a/dom.bs +++ b/dom.bs @@ -1483,8 +1483,8 @@ steps:
  1. Let signal be this object's {{PromiseController/signal}}.
  2. Set signal's [=PromiseSignal/aborted flag=]. -
  3. [=Fire an event=] named abort at signal.
  4. Run signal's [=PromiseSignal/abort steps=]. +
  5. [=Fire an event=] named abort at signal.

Interface {{PromiseSignal}}

From edce169f388027bdbff3a95aba79726cbcc4844d Mon Sep 17 00:00:00 2001 From: Mike West Date: Thu, 6 Apr 2017 16:25:24 +0200 Subject: [PATCH 05/10] fixup rename to 'CancellationController'. Initial feedback. --- dom.bs | 120 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 62 insertions(+), 58 deletions(-) diff --git a/dom.bs b/dom.bs index 74eda52c3..190113dfe 100644 --- a/dom.bs +++ b/dom.bs @@ -1419,103 +1419,107 @@ that gave folks all the wrong ideas. Events do not represent or cause act can only be used to influence an ongoing one. -

Controlling {{Promise}}s

+

Canceling Ongoing Activities

-Though {{Promise}} objects don't have any built-in cancellation mechanism, many {{Promise}}-vending -APIs require cancellation semantics. {{PromiseController}} is meant to support these requirements by -providing an {{PromiseController/abort()}} method that toggles the state of a corresponding -{{PromiseSignal}} object. The API which wishes to support cancellation can accept such a -{{PromiseSignal}}, and use its state to determine how (not) to proceed. +Though {{Promise}} objects don't have any built-in cancellation mechanism, many APIs using these +concepts require cancellation semantics. {{CancellationController}} is meant to support these +requirements by providing an {{CancellationController/cancel()}} method that toggles the state of a +corresponding {{CancellationSignal}} object. The API which wishes to support cancellation can accept +such a {{CancellationSignal}}, and use its state to determine how (not) to proceed. -Upon {{PromiseController/abort()}}, the relevant {{Promise}} will reject with an -AbortError [=simple exception=]. +APIs that rely upon {{CancellationController}} are encouraged to respond to +{{CancellationController/cancel()}} by rejecting any unsettled {{Promise}} with a +CancellationError exception.
- For example, a hypothetical DoAmazingness({ ... }) method could accept a - {{PromiseSignal}} object in order to support cancellation as follows: + For example, a hypothetical doAmazingness({ ... }) method could accept a + {{CancellationSignal}} object in order to support cancellation as follows: -
-   const controller = new PromiseController();
-   const signal = controller.signal;
-   DoAmazingness({ ..., signal })
-     .then(result => ...)
-     .catch(e => ...);
+ 
+  const controller = new CancellationController();
+  const signal = controller.signal;
+  doAmazingness({ ..., signal })
+    .then(result => ...)
+    .catch(e => ...);
 
-   ...
+  ...
 
-   controller.abort();
+  controller.cancel();
   
- APIs that require more granular control could extend both {{PromiseController}} and - {{PromiseSignal}} according to their needs. + APIs that require more granular control could extend both {{CancellationController}} and + {{CancellationSignal}} according to their needs.
-

Interface {{PromiseController}}

+

Interface {{CancellationController}}

 [Constructor(), Exposed=(Window,Worker)]
-interface PromiseController {
-  readonly attribute PromiseSignal signal;
+interface CancellationController {
+  readonly attribute CancellationSignal signal;
 
-  void abort();
+  void cancel();
 };
 
-
controller = new PromiseController() -
Returns a new controller whose {{PromiseController/signal}} attribute value is set - to a newly created {{PromiseSignal}} object. +
controller = new CancellationController() +
Returns a new controller whose {{CancellationController/signal}} is set to a newly + created {{CancellationSignal}} object. -
controller . {{PromiseController/signal}} -
Returns the {{PromiseSignal}} object associated with this object. +
controller . {{CancellationController/signal}} +
Returns the {{CancellationSignal}} object associated with this object. -
controller . {{PromiseController/abort()}} -
Invoking this method will set this object's {{PromiseSignal}}'s [=PromiseSignal/aborted flag=], - thereby signaling to any observers that the associated activity should be aborted. +
controller . {{CancellationController/cancel()}} +
Invoking this method will set this object's {{CancellationSignal}}'s + [=CancellationSignal/cancelled flag=], thereby signaling to any observers that the associated + activity should be cancelled.
-The signal attribute must return the value to which it -was initialized. When a {{PromiseController}} is created, the attribute must be initialized to a -newly created {{PromiseSignal}} object. +The signal attribute must return the value +to which it was initialized. When a {{CancellationController}} is created, the attribute must be +initialized to a newly created {{CancellationSignal}} object. -The abort(), when invoked, must run these -steps: +The cancel() method, when invoked, must run +these steps:
    -
  1. Let signal be this object's {{PromiseController/signal}}. -
  2. Set signal's [=PromiseSignal/aborted flag=]. -
  3. Run signal's [=PromiseSignal/abort steps=]. -
  4. [=Fire an event=] named abort at signal. +
  5. Let signal be this object's {{CancellationController/signal}}. +
  6. Set signal's [=CancellationSignal/cancelled flag=]. +
  7. Run signal's [=CancellationSignal/cancellation steps=]. +
  8. [=Fire an event=] named cancel at signal.
-

Interface {{PromiseSignal}}

+

Interface {{CancellationSignal}}

 [Exposed=(Window,Worker)]
-interface PromiseSignal : EventTarget {
-  readonly attribute boolean aborted;
+interface CancellationSignal : EventTarget {
+  readonly attribute boolean cancelled;
 
-  attribute EventHandler onabort;
+  attribute EventHandler oncancel;
 };
 
-
signal . {{PromiseSignal/aborted}} -
Returns true if this {{PromiseSignal}} has been aborted, and false otherwise. +
signal . {{CancellationSignal/cancelled}} +
Returns true if this {{CancellationSignal}} has been cancelled, and false otherwise.
-Each {{PromiseSignal}} has an aborted flag which is unset unless -otherwise specified. +Each {{CancellationSignal}} has an cancelled flag which is +unset unless otherwise specified. + +Each {{CancellationSignal}} has an cancellation steps algorithm +which is executed when its [=CancellationSignal/cancelled flag=] is set. Unless otherwise +specified, this algorithm is a no-op. + +

The [=CancellationSignal/cancellation steps=] algorithm enables APIs with +more complex requirements to react in a reasonable way to {{CancellationController/cancel()}}. For +example, a given API's [=CancellationSignal/cancelled flag=] may need to be propagated to a +cross-thread environment (like a Service Worker). -Each {{PromiseSignal}} has an abort steps algorithm which is -executed when its [=PromiseSignal/aborted flag=] is set. Unless otherwise specified, this -algorithm is a no-op. +The cancelled attribute's getter must return true if the +object's [=CancellationSignal/cancelled flag=] is set, and false otherwise. -

The [=PromiseSignal/abort steps=] algorithm enables APIs with more -complex requirements to react in a reasonable way to {{PromiseController/abort()}}. For example, -a given API's [=PromiseSignal/aborted flag=] may need to be propagated to a cross-thread -environment (like a Service Worker). -The aborted attribute's getter must return true if the -object's [=PromiseSignal/aborted flag=] is set, and false otherwise.

Nodes

From f64a92fe4728c67dbfa6fc5749821f7b39b5b2b0 Mon Sep 17 00:00:00 2001 From: Mike West Date: Fri, 7 Apr 2017 08:36:28 +0200 Subject: [PATCH 06/10] fixup matching DOM's strange spelling of 'cancelled' --- dom.bs | 90 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/dom.bs b/dom.bs index 190113dfe..9373088be 100644 --- a/dom.bs +++ b/dom.bs @@ -564,7 +564,7 @@ algorithm below. the operation that caused event to be dispatched that it needs to be canceled.
event . {{Event/defaultPrevented}} -
Returns true if {{Event/preventDefault()}} was invoked successfully to indicate cancellation, +
Returns true if {{Event/preventDefault()}} was invoked successfully to indicate cancelation, and false otherwise.
event . {{Event/composed}} @@ -1421,22 +1421,22 @@ can only be used to influence an ongoing one.

Canceling Ongoing Activities

-Though {{Promise}} objects don't have any built-in cancellation mechanism, many APIs using these -concepts require cancellation semantics. {{CancellationController}} is meant to support these -requirements by providing an {{CancellationController/cancel()}} method that toggles the state of a -corresponding {{CancellationSignal}} object. The API which wishes to support cancellation can accept -such a {{CancellationSignal}}, and use its state to determine how (not) to proceed. +Though {{Promise}} objects don't have any built-in cancelation mechanism, many APIs using these +concepts require cancelation semantics. {{CancelationController}} is meant to support these +requirements by providing an {{CancelationController/cancel()}} method that toggles the state of a +corresponding {{CancelationSignal}} object. The API which wishes to support cancelation can accept +such a {{CancelationSignal}}, and use its state to determine how (not) to proceed. -APIs that rely upon {{CancellationController}} are encouraged to respond to -{{CancellationController/cancel()}} by rejecting any unsettled {{Promise}} with a -CancellationError exception. +APIs that rely upon {{CancelationController}} are encouraged to respond to +{{CancelationController/cancel()}} by rejecting any unsettled {{Promise}} with a +CancelationError exception.
For example, a hypothetical doAmazingness({ ... }) method could accept a - {{CancellationSignal}} object in order to support cancellation as follows: + {{CancelationSignal}} object in order to support cancelation as follows:
-  const controller = new CancellationController();
+  const controller = new CancelationController();
   const signal = controller.signal;
   doAmazingness({ ..., signal })
     .then(result => ...)
@@ -1447,77 +1447,77 @@ APIs that rely upon {{CancellationController}} are encouraged to respond to
   controller.cancel();
   
- APIs that require more granular control could extend both {{CancellationController}} and - {{CancellationSignal}} according to their needs. + APIs that require more granular control could extend both {{CancelationController}} and + {{CancelationSignal}} according to their needs.
-

Interface {{CancellationController}}

+

Interface {{CancelationController}}

 [Constructor(), Exposed=(Window,Worker)]
-interface CancellationController {
-  readonly attribute CancellationSignal signal;
+interface CancelationController {
+  readonly attribute CancelationSignal signal;
 
   void cancel();
 };
 
-
controller = new CancellationController() -
Returns a new controller whose {{CancellationController/signal}} is set to a newly - created {{CancellationSignal}} object. +
controller = new CancelationController() +
Returns a new controller whose {{CancelationController/signal}} is set to a newly + created {{CancelationSignal}} object. -
controller . {{CancellationController/signal}} -
Returns the {{CancellationSignal}} object associated with this object. +
controller . {{CancelationController/signal}} +
Returns the {{CancelationSignal}} object associated with this object. -
controller . {{CancellationController/cancel()}} -
Invoking this method will set this object's {{CancellationSignal}}'s - [=CancellationSignal/cancelled flag=], thereby signaling to any observers that the associated - activity should be cancelled. +
controller . {{CancelationController/cancel()}} +
Invoking this method will set this object's {{CancelationSignal}}'s + [=CancelationSignal/canceled flag=], thereby signaling to any observers that the associated + activity should be canceled.
-The signal attribute must return the value -to which it was initialized. When a {{CancellationController}} is created, the attribute must be -initialized to a newly created {{CancellationSignal}} object. +The signal attribute must return the value +to which it was initialized. When a {{CancelationController}} is created, the attribute must be +initialized to a newly created {{CancelationSignal}} object. -The cancel() method, when invoked, must run +The cancel() method, when invoked, must run these steps:
    -
  1. Let signal be this object's {{CancellationController/signal}}. -
  2. Set signal's [=CancellationSignal/cancelled flag=]. -
  3. Run signal's [=CancellationSignal/cancellation steps=]. +
  4. Let signal be this object's {{CancelationController/signal}}. +
  5. Set signal's [=CancelationSignal/canceled flag=]. +
  6. Run signal's [=CancelationSignal/cancelation steps=].
  7. [=Fire an event=] named cancel at signal.
-

Interface {{CancellationSignal}}

+

Interface {{CancelationSignal}}

 [Exposed=(Window,Worker)]
-interface CancellationSignal : EventTarget {
-  readonly attribute boolean cancelled;
+interface CancelationSignal : EventTarget {
+  readonly attribute boolean canceled;
 
   attribute EventHandler oncancel;
 };
 
-
signal . {{CancellationSignal/cancelled}} -
Returns true if this {{CancellationSignal}} has been cancelled, and false otherwise. +
signal . {{CancelationSignal/canceled}} +
Returns true if this {{CancelationSignal}} has been canceled, and false otherwise.
-Each {{CancellationSignal}} has an cancelled flag which is +Each {{CancelationSignal}} has an canceled flag which is unset unless otherwise specified. -Each {{CancellationSignal}} has an cancellation steps algorithm -which is executed when its [=CancellationSignal/cancelled flag=] is set. Unless otherwise +Each {{CancelationSignal}} has an cancelation steps algorithm +which is executed when its [=CancelationSignal/canceled flag=] is set. Unless otherwise specified, this algorithm is a no-op. -

The [=CancellationSignal/cancellation steps=] algorithm enables APIs with -more complex requirements to react in a reasonable way to {{CancellationController/cancel()}}. For -example, a given API's [=CancellationSignal/cancelled flag=] may need to be propagated to a +

The [=CancelationSignal/cancelation steps=] algorithm enables APIs with +more complex requirements to react in a reasonable way to {{CancelationController/cancel()}}. For +example, a given API's [=CancelationSignal/canceled flag=] may need to be propagated to a cross-thread environment (like a Service Worker). -The cancelled attribute's getter must return true if the -object's [=CancellationSignal/cancelled flag=] is set, and false otherwise. +The canceled attribute's getter must return true if the +object's [=CancelationSignal/canceled flag=] is set, and false otherwise. From 36028dd814d2144acfd4efa88b36b66742208d79 Mon Sep 17 00:00:00 2001 From: Mike West Date: Fri, 7 Apr 2017 08:51:05 +0200 Subject: [PATCH 07/10] fixup SameObject --- dom.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom.bs b/dom.bs index 9373088be..0ac5ef2ab 100644 --- a/dom.bs +++ b/dom.bs @@ -1456,7 +1456,7 @@ APIs that rely upon {{CancelationController}} are encouraged to respond to

 [Constructor(), Exposed=(Window,Worker)]
 interface CancelationController {
-  readonly attribute CancelationSignal signal;
+  [SameObject] readonly attribute CancelationSignal signal;
 
   void cancel();
 };

From b744aa7185d5b83aefcd9b5239b51d125cbd433e Mon Sep 17 00:00:00 2001
From: Mike West 
Date: Fri, 7 Apr 2017 11:57:53 +0200
Subject: [PATCH 08/10] fixup ordered set of callbacks.

---
 dom.bs | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/dom.bs b/dom.bs
index 0ac5ef2ab..376e9e0f6 100644
--- a/dom.bs
+++ b/dom.bs
@@ -1485,7 +1485,14 @@ these steps:
 
  1. Let signal be this object's {{CancelationController/signal}}.
  2. Set signal's [=CancelationSignal/canceled flag=]. -
  3. Run signal's [=CancelationSignal/cancelation steps=]. +
  4. +

    For each algorithm in signal's + [=CancelationSignal/cancelation callbacks=]:

    + +
      +
    1. Run algorithm. +
    +
  5. [=Fire an event=] named cancel at signal.
@@ -1507,14 +1514,14 @@ interface CancelationSignal : EventTarget { Each {{CancelationSignal}} has an canceled flag which is unset unless otherwise specified. -Each {{CancelationSignal}} has an cancelation steps algorithm -which is executed when its [=CancelationSignal/canceled flag=] is set. Unless otherwise -specified, this algorithm is a no-op. +Each {{CancelationSignal}} has a cancelation callbacks, which is +an [=ordered set=] of algorithms which are to be executed when its +[=CancelationSignal/canceled flag=] is set. Unless otherwise specified, its value is the empty set. -

The [=CancelationSignal/cancelation steps=] algorithm enables APIs with -more complex requirements to react in a reasonable way to {{CancelationController/cancel()}}. For -example, a given API's [=CancelationSignal/canceled flag=] may need to be propagated to a -cross-thread environment (like a Service Worker). +

The [=CancelationSignal/cancelation callbacks=] enable APIs with complex +requirements to react in a reasonable way to {{CancelationController/cancel()}}. For example, a +given API's [=CancelationSignal/canceled flag=] may need to be propagated to a cross-thread +environment (like a Service Worker). The canceled attribute's getter must return true if the object's [=CancelationSignal/canceled flag=] is set, and false otherwise. From 28b01bcde202385fd91706909b2589de5c4148b0 Mon Sep 17 00:00:00 2001 From: Mike West Date: Fri, 7 Apr 2017 12:45:56 +0200 Subject: [PATCH 09/10] fixup disambiguate canceled flag. --- dom.bs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dom.bs b/dom.bs index 376e9e0f6..f49a447ab 100644 --- a/dom.bs +++ b/dom.bs @@ -685,7 +685,7 @@ The bubbles and must return the values they were initialized to. The preventDefault() method, when invoked, must set the -canceled flag if the {{Event/cancelable}} attribute value is true and the +[=Event/canceled flag=] if the {{Event/cancelable}} attribute value is true and the in passive listener flag is unset.

This means there are scenarios where invoking {{Event/preventDefault()}} @@ -693,7 +693,7 @@ has no effect. User agents are encouraged to log the precise cause in a develope debugging.

The defaultPrevented attribute's getter must return -true if context object's canceled flag is set, and false otherwise.

+true if context object's [=Event/canceled flag=] is set, and false otherwise.

The composed attribute's getter must return true if context object's composed flag is set, and false otherwise.

@@ -731,7 +731,7 @@ To initialize an
  • Set the initialized flag.
  • Unset the stop propagation flag, stop immediate propagation flag, and - canceled flag. + [=Event/canceled flag=].
  • Set the {{Event/isTrusted}} attribute to false.
  • Set the {{Event/target}} attribute to @@ -1240,7 +1240,7 @@ for discussion).

    If activationTarget is non-null, then:

      -
    1. If event's canceled flag is unset, then run +

    2. If event's [=Event/canceled flag=] is unset, then run activationTarget's activation behavior with event.

    3. Otherwise, if activationTarget has @@ -1248,7 +1248,7 @@ for discussion). activationTarget's legacy-canceled-activation behavior.

    -
  • Return false if event's canceled flag is set, and true otherwise. +

  • Return false if event's [=Event/canceled flag=] is set, and true otherwise.

    To invoke an object with From 4273de9b54cb61dc59dc1f56e80e46f9f2698aff Mon Sep 17 00:00:00 2001 From: Mike West Date: Fri, 7 Apr 2017 13:55:37 +0200 Subject: [PATCH 10/10] fixup 'CancelationError' is now a 'DOMException'. --- dom.bs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dom.bs b/dom.bs index f49a447ab..d939da6e8 100644 --- a/dom.bs +++ b/dom.bs @@ -55,6 +55,10 @@ urlPrefix: https://w3c.github.io/ServiceWorker/#; spec: SERVICE-WORKERS urlPrefix: https://tc39.github.io/ecma262/#; spec: ECMASCRIPT text: Construct; url: sec-construct; type: abstract-op text: Realm; url: realm; type: dfn + + +urlPrefix: https://heycam.github.io/webidl/; spec: WEBIDL + text: CancelationError; url: cancelationerror; type: exception