From a95da45fde1c81397393d87adc0f97be83919219 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 24 Sep 2025 16:38:14 +0100 Subject: [PATCH 1/5] [css-position-4] Add "afterRemoval" steps to top layer removal algorithms --- css-position-4/Overview.bs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/css-position-4/Overview.bs b/css-position-4/Overview.bs index 0e3d82e2b53..43c2e84b37e 100644 --- a/css-position-4/Overview.bs +++ b/css-position-4/Overview.bs @@ -316,7 +316,7 @@ Top Layer Manipulation {#top-manip}
To request an element to be removed from the top layer, - given an {{Element}} |el|: + given an {{Element}} |el| and an optional ist of steps |afterRemoval|: 1. Let |doc| be |el|'s [=Node/node document=]. @@ -327,12 +327,12 @@ Top Layer Manipulation {#top-manip} 3. Remove the UA !important ''overlay: auto'' rule targeting |el|. - 4. [=set/Append=] |el| to |doc|'s [=pending top layer removals=]. + 4. [=set/Append=] (|el|, |afterRemoval|) to |doc|'s [=pending top layer removals=].
To remove an element from the top layer immediately, - given an {{Element}} |el|: + given an {{Element}} |el| and an optional list of steps |afterRemoval|: 1. Let |doc| be |el|'s [=Node/node document=]. @@ -341,6 +341,8 @@ Top Layer Manipulation {#top-manip} 3. Remove the UA !important ''overlay: auto'' rule targeting |el|, if it exists. + 4. Run |afterRemoval|. + Note: This algorithm is only intended to be used in special cases where removing something from the top layer immediately (bypassing things like an 'overlay' transition) @@ -353,10 +355,13 @@ Top Layer Manipulation {#top-manip} To process top layer removals, given a {{Document}} |doc|: - 1. For each element |el| in |doc|'s [=pending top layer removals=]: - if |el|'s computed value of 'overlay' is ''none'', - or |el| is [=not rendered=], - [=remove from the top layer immediately=] |el|. + 1. For each (element |el| and steps |afterRemoval|) in |doc|'s + [=pending top layer removals=]: if |el|'s computed value of + 'overlay' is ''none'', or |el| is [=not rendered=]: + + 1. [=remove from the top layer immediately=] |el|. + + 2. Run |afterRemoval|. Note: This is intended to be called during the "Update the Rendering" step of HTML's rendering algorithm. From d9d0596399e705f0fd7098c10157926b2e812e24 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 24 Sep 2025 16:52:57 +0100 Subject: [PATCH 2/5] use callback in queue step --- css-position-4/Overview.bs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/css-position-4/Overview.bs b/css-position-4/Overview.bs index 43c2e84b37e..7fbe38e87ee 100644 --- a/css-position-4/Overview.bs +++ b/css-position-4/Overview.bs @@ -357,11 +357,8 @@ Top Layer Manipulation {#top-manip} 1. For each (element |el| and steps |afterRemoval|) in |doc|'s [=pending top layer removals=]: if |el|'s computed value of - 'overlay' is ''none'', or |el| is [=not rendered=]: - - 1. [=remove from the top layer immediately=] |el|. - - 2. Run |afterRemoval|. + 'overlay' is ''none'', or |el| is [=not rendered=], + [=remove from the top layer immediately=] |el|, and |afterRemoval|. Note: This is intended to be called during the "Update the Rendering" step of HTML's rendering algorithm. From 2b0800c270bb02f4ac4c1f9cc721723b1c46aeb5 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 24 Sep 2025 16:53:23 +0100 Subject: [PATCH 3/5] accidentally a l --- css-position-4/Overview.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css-position-4/Overview.bs b/css-position-4/Overview.bs index 7fbe38e87ee..489471d3cbc 100644 --- a/css-position-4/Overview.bs +++ b/css-position-4/Overview.bs @@ -316,7 +316,7 @@ Top Layer Manipulation {#top-manip}
To request an element to be removed from the top layer, - given an {{Element}} |el| and an optional ist of steps |afterRemoval|: + given an {{Element}} |el| and an optional list of steps |afterRemoval|: 1. Let |doc| be |el|'s [=Node/node document=]. From e0f86d169803af4e7be93d74bdc96ea80ee8c940 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 24 Sep 2025 16:55:31 +0100 Subject: [PATCH 4/5] remove a comma for great clarity --- css-position-4/Overview.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css-position-4/Overview.bs b/css-position-4/Overview.bs index 489471d3cbc..a58e4fd2533 100644 --- a/css-position-4/Overview.bs +++ b/css-position-4/Overview.bs @@ -358,7 +358,7 @@ Top Layer Manipulation {#top-manip} 1. For each (element |el| and steps |afterRemoval|) in |doc|'s [=pending top layer removals=]: if |el|'s computed value of 'overlay' is ''none'', or |el| is [=not rendered=], - [=remove from the top layer immediately=] |el|, and |afterRemoval|. + [=remove from the top layer immediately=] |el| and |afterRemoval|. Note: This is intended to be called during the "Update the Rendering" step of HTML's rendering algorithm. From 5b84068b10f5fc90e8fab971d0e9cdcaa19bf6da Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 24 Sep 2025 17:02:43 +0100 Subject: [PATCH 5/5] drop callback from "remove from top layer immediately" steps --- css-position-4/Overview.bs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/css-position-4/Overview.bs b/css-position-4/Overview.bs index a58e4fd2533..c00eb0cacb1 100644 --- a/css-position-4/Overview.bs +++ b/css-position-4/Overview.bs @@ -332,7 +332,7 @@ Top Layer Manipulation {#top-manip}
To remove an element from the top layer immediately, - given an {{Element}} |el| and an optional list of steps |afterRemoval|: + given an {{Element}} |el|: 1. Let |doc| be |el|'s [=Node/node document=]. @@ -341,8 +341,6 @@ Top Layer Manipulation {#top-manip} 3. Remove the UA !important ''overlay: auto'' rule targeting |el|, if it exists. - 4. Run |afterRemoval|. - Note: This algorithm is only intended to be used in special cases where removing something from the top layer immediately (bypassing things like an 'overlay' transition) @@ -357,8 +355,11 @@ Top Layer Manipulation {#top-manip} 1. For each (element |el| and steps |afterRemoval|) in |doc|'s [=pending top layer removals=]: if |el|'s computed value of - 'overlay' is ''none'', or |el| is [=not rendered=], - [=remove from the top layer immediately=] |el| and |afterRemoval|. + 'overlay' is ''none'', or |el| is [=not rendered=]: + + 1. [=remove from the top layer immediately=] |el|. + + 2. Run |afterRemoval|. Note: This is intended to be called during the "Update the Rendering" step of HTML's rendering algorithm.