From eb3bd6beb1f3f1fbac11a1763aaf8b2c136ac356 Mon Sep 17 00:00:00 2001 From: Chris Mills Date: Thu, 28 Dec 2023 11:25:15 +0000 Subject: [PATCH] fix: descriptions of discrete animation behavior between visible and hidden (#690) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Description In https://github.com/mdn/data/pull/688, part of the work was to add descriptions of the new specific animation behavior of certain "discrete" animated properties — `display`, `content-visibility`, and `overlay` — when animating from a hidden state or a visible state. However, on talking to some Chrome engineering folks about this, I realized that some of my descriptions were not quite right. This PR aims to fix those descriptions. The description I was sent by the Chrome engineering folk is as follows: "The idea behind "p = 1" is that during transitions between certain values for certain properties which we consider invisible to visible or vice versa, the browser will automatically choose the "visible" option for the duration of the animation it creates. For example, if you transition from "display:none" to "display:block", the element will be "display:block" for the entire animation created by the transition. And likewise if you transition from "display:block" to "display:none", the element will be "display:block" for the entire animation created by the transition. However, if you transition from "display:flex" to "display:block", the element's display value will switch halfway through the animation. This behavior is applied to content-visibility:hidden, display:none, visibility:hidden, and overlay:none." ### Motivation ### Additional details ### Related issues and pull requests --- css/properties.json | 6 +++--- css/properties.schema.json | 5 ++--- l10n/css.json | 11 ++++------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/css/properties.json b/css/properties.json index 0334ff3c..451bc12d 100644 --- a/css/properties.json +++ b/css/properties.json @@ -4483,7 +4483,7 @@ "syntax": "visible | auto | hidden", "media": "all", "inherited": false, - "animationType": "discreteHiddenSwapAt0", + "animationType": "discreteButVisibleForDurationWhenAnimatedHidden", "percentages": "no", "groups": [ "CSS Containment" @@ -4582,7 +4582,7 @@ "syntax": "[ || ] | | | | ", "media": "all", "inherited": false, - "animationType": "discreteNoneSwapAt0", + "animationType": "discreteButVisibleForDurationWhenAnimatedNone", "percentages": "no", "groups": [ "CSS Display" @@ -7619,7 +7619,7 @@ "syntax": "none | auto", "media": "visual", "inherited": false, - "animationType": "discreteSwapAt1", + "animationType": "discreteButVisibleForDurationWhenAnimatedNone", "percentages": "no", "groups": [ "CSS Positioning" diff --git a/css/properties.schema.json b/css/properties.schema.json index e29479e9..cebf15ff 100644 --- a/css/properties.schema.json +++ b/css/properties.schema.json @@ -21,9 +21,8 @@ "byComputedValueTypeNormalAnimatesAsObliqueZeroDeg", "color", "discrete", - "discreteHiddenSwapAt0", - "discreteNoneSwapAt0", - "discreteSwapAt1", + "discreteButVisibleForDurationWhenAnimatedHidden", + "discreteButVisibleForDurationWhenAnimatedNone", "eachOfShorthandPropertiesExceptUnicodeBiDiAndDirection", "filterList", "fontStretch", diff --git a/l10n/css.json b/l10n/css.json index c60b62f1..ef895f86 100644 --- a/l10n/css.json +++ b/l10n/css.json @@ -654,14 +654,11 @@ "fr": "discrète", "ja": "離散値" }, - "discreteHiddenSwapAt0": { - "en-US": "Discrete behavior but when animating from hidden swaps to end value at progress > 0 rather than 0.5" + "discreteButVisibleForDurationWhenAnimatedHidden": { + "en-US": "Discrete behavior except when animating to or from hidden is visible for the entire duration" }, - "discreteNoneSwapAt0": { - "en-US": "Discrete behavior but when animating from none swaps to end value at progress > 0 rather than 0.5" - }, - "discreteSwapAt1": { - "en-US": "Discrete behavior but swaps to end value at progress 1 rather than 0.5" + "discreteButVisibleForDurationWhenAnimatedNone": { + "en-US": "Discrete behavior except when animating to or from none is visible for the entire duration" }, "eachOfShorthandPropertiesExceptUnicodeBiDiAndDirection": { "de": "wie jede der Kurzschreibweisen Eigenschaften (alle Eigenschaften außer {{cssxref(\"unicode-bidi\")}} und {{cssxref(\"direction\")}})",