diff --git a/.github/README.md b/.github/README.md
new file mode 100644
index 000000000000..af8c69edbed7
--- /dev/null
+++ b/.github/README.md
@@ -0,0 +1,6 @@
+Types of Workflows
+==================
+
+* `workflows/build-specs.yml` - builds the entire repository of Editor's Drafts, along with a summary page. Also builds any `.issues` Issues-List files, and Markdown files. Deploys all the results to the repo's gh-pages
+
+* `workflows/SPEC-NAME-1.yml` - each of these auto-publish *one* spec in the repo. Do not modify them by hand; they are auto-generated by [`generate-auto-publish-workflows.py`](https://github.com/w3c/csswg-drafts/blob/main/.github/generate-auto-publish-workflows.py) and [`auto-publish-template.yml`](https://github.com/w3c/csswg-drafts/blob/main/.github/auto-publish-template.yml). Instead, update and run this `.py` file and commit the results.
\ No newline at end of file
diff --git a/.github/auto-publish-template.yml b/.github/auto-publish-template.yml
new file mode 100644
index 000000000000..2a739765723e
--- /dev/null
+++ b/.github/auto-publish-template.yml
@@ -0,0 +1,37 @@
+######################################################################
+# This is the template used to generate auto-publication workflows for
+# the different documents in the repository. Check generate script for
+# details. Edit this file and run the script again to update the
+# workflows.
+######################################################################
+
+name: Publish {{shortname}} on /TR
+
+on:
+ pull_request:
+ paths:
+ - "{{shortname}}/**"
+ push:
+ branches: [main]
+ paths:
+ - "{{shortname}}/**"
+ workflow_dispatch:
+
+jobs:
+ publish-TR-{{shortname}}:
+ name: Publish {{shortname}}
+ if: github.repository == 'w3c/csswg-drafts'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v6
+ - uses: w3c/spec-prod@v2
+ with:
+ TOOLCHAIN: bikeshed
+ SOURCE: {{shortname}}/Overview.bs
+ DESTINATION: {{shortname}}/index.html
+ BUILD_FAIL_ON: warning
+ VALIDATE_MARKUP: false
+ W3C_ECHIDNA_TOKEN: ${{ secrets.{{tokenName}} }}
+ W3C_WG_DECISION_URL: https://www.w3.org/2025/08/21-css-minutes.html#fc30
+ W3C_BUILD_OVERRIDE: |
+ status: {{publicationStatus}}
diff --git a/.github/generate-auto-publish-workflows.py b/.github/generate-auto-publish-workflows.py
new file mode 100644
index 000000000000..d1617672bea0
--- /dev/null
+++ b/.github/generate-auto-publish-workflows.py
@@ -0,0 +1,110 @@
+#!/usr/bin/env python3
+"""
+Script to generate auto publication workflows for given specs
+"""
+
+import re
+from pathlib import Path
+
+# -----------------------------------------------------------------------------
+# List of properties that can appear to describe a spec.
+# -----------------------------------------------------------------------------
+
+PROPERTIES = [
+ "shortname",
+ "publicationStatus",
+ "tokenName",
+]
+
+# -----------------------------------------------------------------------------
+# List of specs for which an auto-publish script needs to be created.
+# -----------------------------------------------------------------------------
+
+SPECS = [
+ {
+ "shortname": "css-color-4",
+ "publicationStatus": "CRD",
+ },
+ {
+ "shortname": "css-color-5",
+ "publicationStatus": "WD",
+ },
+ {
+ "shortname": "css-color-hdr-1",
+ "publicationStatus": "WD",
+ },
+ {
+ "shortname": "css-fonts-4",
+ "publicationStatus": "WD",
+ },
+ {
+ "shortname": "css-fonts-5",
+ "publicationStatus": "WD",
+ },
+ {
+ "shortname": "css-2026",
+ "publicationStatus": "NOTE",
+ },
+ {
+ "shortname": "css-2027",
+ "publicationStatus": "NOTE",
+ },
+]
+
+# -----------------------------------------------------------------------------
+# Main
+# -----------------------------------------------------------------------------
+
+def main():
+ script_path = Path(__file__).parent
+ template_path = script_path / "auto-publish-template.yml"
+ workflows_dir = script_path / "workflows"
+
+ workflows_dir.mkdir(parents=True, exist_ok=True)
+
+ template = template_path.read_text(encoding="utf-8")
+
+ # Replace the large comment header block (#####...#####)
+ template = re.sub(
+ r"#{5,}.*?#{5,}",
+ """######################################################################
+# IMPORTANT: Do not edit this file directly!
+#
+# This workflow was automatically generated through the
+# generate-auto-publish-workflows.py script. To update the workflow,
+# make changes to the template file and run the script again.
+######################################################################""",
+ template,
+ flags=re.S,
+ )
+
+ for spec in SPECS:
+ spec = spec.copy()
+
+ # Derive shortname from source if not provided
+ if "shortname" not in spec or not spec["shortname"]:
+ spec["shortname"] = spec["source"].split(".")[0].replace("_", "-")
+
+ # Derive tokenName if not provided
+ if "tokenName" not in spec or not spec["tokenName"]:
+ token = (
+ spec["shortname"]
+ .upper()
+ .replace("-", "_")
+ )
+ spec["tokenName"] = f"TR_TOKEN_{token}"
+
+ # Apply template substitutions
+ content = template
+ for prop in PROPERTIES:
+ value = spec.get(prop, "")
+ content = content.replace(f"{{{{{prop}}}}}", value)
+
+ # Write workflow file
+ filename = workflows_dir / f"{spec['shortname']}.yml"
+ filename.write_text(content, encoding="utf-8", newline="\n")
+ print(f"Generated {filename}")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/.github/workflows/build-specs.yml b/.github/workflows/build-specs.yml
index 355593e91f69..3277819b332a 100644
--- a/.github/workflows/build-specs.yml
+++ b/.github/workflows/build-specs.yml
@@ -17,6 +17,7 @@ concurrency:
jobs:
build-specs:
+ if: github.repository == 'w3c/csswg-drafts'
runs-on: ubuntu-latest
environment:
diff --git a/.github/workflows/css-2026.yml b/.github/workflows/css-2026.yml
new file mode 100644
index 000000000000..a3726b9ac784
--- /dev/null
+++ b/.github/workflows/css-2026.yml
@@ -0,0 +1,37 @@
+######################################################################
+# IMPORTANT: Do not edit this file directly!
+#
+# This workflow was automatically generated through the
+# generate-auto-publish-workflows.py script. To update the workflow,
+# make changes to the template file and run the script again.
+######################################################################
+
+name: Publish css-2026 on /TR
+
+on:
+ pull_request:
+ paths:
+ - "css-2026/**"
+ push:
+ branches: [main]
+ paths:
+ - "css-2026/**"
+ workflow_dispatch:
+
+jobs:
+ publish-TR-css-2026:
+ name: Publish css-2026
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v6
+ - uses: w3c/spec-prod@v2
+ with:
+ TOOLCHAIN: bikeshed
+ SOURCE: css-2026/Overview.bs
+ DESTINATION: css-2026/index.html
+ BUILD_FAIL_ON: warning
+ VALIDATE_MARKUP: false
+ W3C_ECHIDNA_TOKEN: ${{ secrets.TR_TOKEN_CSS_2026 }}
+ W3C_WG_DECISION_URL: https://www.w3.org/2025/08/21-css-minutes.html#fc30
+ W3C_BUILD_OVERRIDE: |
+ status: NOTE
diff --git a/.github/workflows/css-2027.yml b/.github/workflows/css-2027.yml
new file mode 100644
index 000000000000..0e9b4e234e59
--- /dev/null
+++ b/.github/workflows/css-2027.yml
@@ -0,0 +1,37 @@
+######################################################################
+# IMPORTANT: Do not edit this file directly!
+#
+# This workflow was automatically generated through the
+# generate-auto-publish-workflows.py script. To update the workflow,
+# make changes to the template file and run the script again.
+######################################################################
+
+name: Publish css-2027 on /TR
+
+on:
+ pull_request:
+ paths:
+ - "css-2027/**"
+ push:
+ branches: [main]
+ paths:
+ - "css-2027/**"
+ workflow_dispatch:
+
+jobs:
+ publish-TR-css-2027:
+ name: Publish css-2027
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v6
+ - uses: w3c/spec-prod@v2
+ with:
+ TOOLCHAIN: bikeshed
+ SOURCE: css-2027/Overview.bs
+ DESTINATION: css-2027/index.html
+ BUILD_FAIL_ON: warning
+ VALIDATE_MARKUP: false
+ W3C_ECHIDNA_TOKEN: ${{ secrets.TR_TOKEN_CSS_2027 }}
+ W3C_WG_DECISION_URL: https://www.w3.org/2025/08/21-css-minutes.html#fc30
+ W3C_BUILD_OVERRIDE: |
+ status: NOTE
diff --git a/.github/workflows/css-color-4.yml b/.github/workflows/css-color-4.yml
new file mode 100644
index 000000000000..008171aed895
--- /dev/null
+++ b/.github/workflows/css-color-4.yml
@@ -0,0 +1,38 @@
+######################################################################
+# IMPORTANT: Do not edit this file directly!
+#
+# This workflow was automatically generated through the
+# generate-auto-publish-workflows.py script. To update the workflow,
+# make changes to the template file and run the script again.
+######################################################################
+
+name: Publish css-color-4 on /TR
+
+on:
+ pull_request:
+ paths:
+ - "css-color-4/**"
+ push:
+ branches: [main]
+ paths:
+ - "css-color-4/**"
+ workflow_dispatch:
+
+jobs:
+ publish-TR-css-color-4:
+ name: Publish css-color-4
+ if: github.repository == 'w3c/csswg-drafts'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v6
+ - uses: w3c/spec-prod@v2
+ with:
+ TOOLCHAIN: bikeshed
+ SOURCE: css-color-4/Overview.bs
+ DESTINATION: css-color-4/index.html
+ BUILD_FAIL_ON: warning
+ VALIDATE_MARKUP: false
+ W3C_ECHIDNA_TOKEN: ${{ secrets.TR_TOKEN_CSS_COLOR_4 }}
+ W3C_WG_DECISION_URL: https://www.w3.org/2025/08/21-css-minutes.html#fc30
+ W3C_BUILD_OVERRIDE: |
+ status: CRD
diff --git a/.github/workflows/css-color-5.yml b/.github/workflows/css-color-5.yml
new file mode 100644
index 000000000000..d4bba04747c2
--- /dev/null
+++ b/.github/workflows/css-color-5.yml
@@ -0,0 +1,38 @@
+######################################################################
+# IMPORTANT: Do not edit this file directly!
+#
+# This workflow was automatically generated through the
+# generate-auto-publish-workflows.py script. To update the workflow,
+# make changes to the template file and run the script again.
+######################################################################
+
+name: Publish css-color-5 on /TR
+
+on:
+ pull_request:
+ paths:
+ - "css-color-5/**"
+ push:
+ branches: [main]
+ paths:
+ - "css-color-5/**"
+ workflow_dispatch:
+
+jobs:
+ publish-TR-css-color-5:
+ name: Publish css-color-5
+ if: github.repository == 'w3c/csswg-drafts'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v6
+ - uses: w3c/spec-prod@v2
+ with:
+ TOOLCHAIN: bikeshed
+ SOURCE: css-color-5/Overview.bs
+ DESTINATION: css-color-5/index.html
+ BUILD_FAIL_ON: warning
+ VALIDATE_MARKUP: false
+ W3C_ECHIDNA_TOKEN: ${{ secrets.TR_TOKEN_CSS_COLOR_5 }}
+ W3C_WG_DECISION_URL: https://www.w3.org/2025/08/21-css-minutes.html#fc30
+ W3C_BUILD_OVERRIDE: |
+ status: WD
diff --git a/.github/workflows/css-color-hdr-1.yml b/.github/workflows/css-color-hdr-1.yml
new file mode 100644
index 000000000000..c1e4d3cbdd8b
--- /dev/null
+++ b/.github/workflows/css-color-hdr-1.yml
@@ -0,0 +1,38 @@
+######################################################################
+# IMPORTANT: Do not edit this file directly!
+#
+# This workflow was automatically generated through the
+# generate-auto-publish-workflows.py script. To update the workflow,
+# make changes to the template file and run the script again.
+######################################################################
+
+name: Publish css-color-hdr-1 on /TR
+
+on:
+ pull_request:
+ paths:
+ - "css-color-hdr-1/**"
+ push:
+ branches: [main]
+ paths:
+ - "css-color-hdr-1/**"
+ workflow_dispatch:
+
+jobs:
+ publish-TR-css-color-hdr-1:
+ name: Publish css-color-hdr-1
+ if: github.repository == 'w3c/csswg-drafts'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v6
+ - uses: w3c/spec-prod@v2
+ with:
+ TOOLCHAIN: bikeshed
+ SOURCE: css-color-hdr-1/Overview.bs
+ DESTINATION: css-color-hdr-1/index.html
+ BUILD_FAIL_ON: warning
+ VALIDATE_MARKUP: false
+ W3C_ECHIDNA_TOKEN: ${{ secrets.TR_TOKEN_CSS_COLOR_HDR_1 }}
+ W3C_WG_DECISION_URL: https://www.w3.org/2025/08/21-css-minutes.html#fc30
+ W3C_BUILD_OVERRIDE: |
+ status: WD
diff --git a/.github/workflows/css-fonts-4.yml b/.github/workflows/css-fonts-4.yml
new file mode 100644
index 000000000000..adde93a731c2
--- /dev/null
+++ b/.github/workflows/css-fonts-4.yml
@@ -0,0 +1,38 @@
+######################################################################
+# IMPORTANT: Do not edit this file directly!
+#
+# This workflow was automatically generated through the
+# generate-auto-publish-workflows.py script. To update the workflow,
+# make changes to the template file and run the script again.
+######################################################################
+
+name: Publish css-fonts-4 on /TR
+
+on:
+ pull_request:
+ paths:
+ - "css-fonts-4/**"
+ push:
+ branches: [main]
+ paths:
+ - "css-fonts-4/**"
+ workflow_dispatch:
+
+jobs:
+ publish-TR-css-fonts-4:
+ name: Publish css-fonts-4
+ if: github.repository == 'w3c/csswg-drafts'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v6
+ - uses: w3c/spec-prod@v2
+ with:
+ TOOLCHAIN: bikeshed
+ SOURCE: css-fonts-4/Overview.bs
+ DESTINATION: css-fonts-4/index.html
+ BUILD_FAIL_ON: warning
+ VALIDATE_MARKUP: false
+ W3C_ECHIDNA_TOKEN: ${{ secrets.TR_TOKEN_CSS_FONTS_4 }}
+ W3C_WG_DECISION_URL: https://www.w3.org/2025/08/21-css-minutes.html#fc30
+ W3C_BUILD_OVERRIDE: |
+ status: WD
diff --git a/.github/workflows/css-fonts-5.yml b/.github/workflows/css-fonts-5.yml
new file mode 100644
index 000000000000..2e3f71aa31da
--- /dev/null
+++ b/.github/workflows/css-fonts-5.yml
@@ -0,0 +1,38 @@
+######################################################################
+# IMPORTANT: Do not edit this file directly!
+#
+# This workflow was automatically generated through the
+# generate-auto-publish-workflows.py script. To update the workflow,
+# make changes to the template file and run the script again.
+######################################################################
+
+name: Publish css-fonts-5 on /TR
+
+on:
+ pull_request:
+ paths:
+ - "css-fonts-5/**"
+ push:
+ branches: [main]
+ paths:
+ - "css-fonts-5/**"
+ workflow_dispatch:
+
+jobs:
+ publish-TR-css-fonts-5:
+ name: Publish css-fonts-5
+ if: github.repository == 'w3c/csswg-drafts'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v6
+ - uses: w3c/spec-prod@v2
+ with:
+ TOOLCHAIN: bikeshed
+ SOURCE: css-fonts-5/Overview.bs
+ DESTINATION: css-fonts-5/index.html
+ BUILD_FAIL_ON: warning
+ VALIDATE_MARKUP: false
+ W3C_ECHIDNA_TOKEN: ${{ secrets.TR_TOKEN_CSS_FONTS_5 }}
+ W3C_WG_DECISION_URL: https://www.w3.org/2025/08/21-css-minutes.html#fc30
+ W3C_BUILD_OVERRIDE: |
+ status: WD
diff --git a/.gitignore b/.gitignore
index 1a828cf51514..05b36344b236 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,3 +20,4 @@ node_modules
css-color-4/ICCprofiles/old-Display P3.icc
.vscode
+.idea
diff --git a/animation-triggers-1/Overview.bs b/animation-triggers-1/Overview.bs
new file mode 100644
index 000000000000..a0e5dbe1a760
--- /dev/null
+++ b/animation-triggers-1/Overview.bs
@@ -0,0 +1,637 @@
+
+
+Title: Animation Triggers
+Group: CSSWG
+Status: ED
+Work Status: revising
+Shortname: animation-triggers
+Level: 1
+Group: CSSWG
+TR: https://www.w3.org/TR/animation-triggers-1/
+ED: https://drafts.csswg.org/animation-triggers-1/
+Abstract: Defines CSS properties and an API for creating mechanisms that affect animation
+ playback, based on DOM events resulting from user interaction, or on entry/exit
+ of ranges on animation timelines.
+Editor: Robert Flack, Google, flackr@google.com, w3cid 98451
+Editor: David Awogbemila, Google, awogbemila@google.com
+Editor: Yehonatan Daniv, Wix.com, yehonatand@wix.com, w3cid 136300
+Markup Shorthands: markdown yes
+
+urlPrefix: https://www.w3.org/TR/web-animations-1/; type: dfn
+ text: active interval
+ text: playback control
+
+
+# Introduction # {#intro}
+
+ This specification defines mechanisms for
+ affecting an animation’s playback
+ based on various user interactions invoking a specified trigger.
+ By specifying a trigger for an animation, that animation
+ becomes a triggered animation, making its
+ playback start delayed until that trigger occurs.
+ These triggers can be certain {{Event}}s defined in [[!DOM]],
+ or timeline based, such as [=view progress timelines=]. [[!SCROLL-ANIMATIONS-1]]
+
+ This module provides both an imperative API building on the
+ Web Animations API as well as a declarative API building
+ on CSS Animations. [[!CSS-ANIMATIONS-2]] [[!WEB-ANIMATIONS-1]]
+
+## Relationship to other specifications ## {#other-specs}
+
+ Web Animations [[WEB-ANIMATIONS-1]] defines
+ an abstract conceptual model for animations on the Web platform,
+ with elements of the model including [=animations=] and [=timelines=],
+ and associated programming interfaces.
+ This specification extends the Web Animations model
+ by defining [=triggered animation=]
+ and allowing to perform [=playback control=] functions
+ on them using triggers.
+
+ This specification introduces both
+ programming interfaces for interacting with these concepts,
+ as well as CSS properties that apply these concepts
+ to CSS Animations [[CSS-ANIMATIONS-2]].
+ To the extent the behavior of these CSS properties is described
+ in terms of the programming interfaces,
+ [=User Agents=] that do not support scripting
+ may still conform to this specification
+ by implementing the CSS features to behave
+ as if the underlying programming interfaces were in place.
+
+ This specification uses the timeline and ranges concept introduced
+ in the Scroll-Driven Animations module [[!SCROLL-ANIMATIONS-1]] for
+ specifying progress-based timelines and animations.
+
+ Like most operations in CSS besides [=selector=] matching,
+ features in this specification operate over
+ the [=flattened element tree=].
+
+## Value Definitions ## {#values}
+
+ This specification follows the
+ CSS property definition conventions
+ from [[!CSS2]]
+ using the value definition syntax
+ from [[!CSS-VALUES-3]].
+ Value types not defined in this specification
+ are defined in CSS Values & Units [[!CSS-VALUES-3]].
+ Combination with other CSS modules may expand the definitions of these value types.
+
+ In addition to the property-specific values listed in their definitions,
+ all properties defined in this specification
+ also accept the CSS-wide keywords as their property value.
+ For readability they have not been repeated explicitly.
+
+
+
+# Triggers # {#triggers}
+
+ While CSS animations are, by default,
+ automatically run as soon as the appropriate 'animation' values have been set on an element,
+ the 'animation-trigger' property allows the animation's start to be delayed
+ until an appropriate trigger occurs,
+ and even paused, restarted, or reset by triggers
+ (making it a [=triggered animation=]).
+
+ Currently, two types of triggers are defined:
+
+ * [=timeline triggers=], managed by the 'timeline-trigger' properties,
+ which allow animations to be triggered by entering or leaving certain timeline ranges.
+ (Usually, [=view progress timelines=],
+ so an animation can be started when an element comes on-screen.)
+
+ * [=event triggers=], managed by the 'event-trigger' properties,
+ which allow animations to be triggered by certain user-interaction events,
+ such as clicking an element or pressing certain keys.
+
+ A [=trigger=] is defined on some specific triggering element.
+ All triggers have a trigger name,
+ and the specific type of trigger dictates how and when it's activated.
+ A trigger can define multiple "types" of activation.
+ (For example, [=timeline triggers=] can do different things on entry and exit.)
+
+ A [=trigger=] is used on potentially any element,
+ creating a trigger instance on the element.
+ (For example, 'animation-trigger' associates a [=trigger instance=]
+ with a specific animation on the element.)
+ The trigger-using element specifies what actions to take
+ when the [=trigger=] activates.
+
+ Note: This design for [=triggers=] and [=trigger instances=],
+ and the way they're associated with [=triggered animations=] and <>s,
+ is intentionally somewhat generic,
+ intended to support using [=triggers=] for other purposes in the future.
+ For now, though, [=triggered animations=] are the only user of this feature.
+
+ If a single element attempts to define multiple [=triggers=] of different types
+ with the same [=trigger name=],
+ it only exposes one of the [=triggers=],
+ with [=event triggers=] winning over [=timeline triggers=].
+
+ Note: This order is completely arbitrary
+ (based on alphabetic order of the concept name),
+ as this is just an error case.
+
+## Trigger Name Scoping: the 'trigger-scope' property ## {#trigger-scope}
+
+ [=Trigger names=] are global by default,
+ usable by other elements regardless of their position.
+ (Though they are [=tree-scoped names=],
+ so have interactions with [=shadow roots=]).
+ If multiple elements define [=triggers=] with the same [=trigger name=],
+ the [=trigger=] defined by the later element in [=tree order=] is used.
+
+ The 'trigger-scope' property can limit the scope of a name
+ to a subtree of the document,
+ so elements outside won't see the chosen [=trigger name=],
+ and elements inside will only see the version of the [=trigger name=]
+ defined inside the scope.
+
+
+ Name: trigger-scope
+ Value: none | all | <>#
+ Initial: none
+ Applies to: all elements
+ Inherited: no
+ Animation type: not animatable
+ Computed value: as specified
+
+
+ This property scopes [=trigger names=] to the subtree of the matching element.
+ Its values are:
+
+
+
none
+
+ No changes in [=trigger name=] scope.
+
+
all
+
+ Specifies that all [=trigger names=] defined by this element or its descendants--
+ whose scope is not already limited by a descendant using 'trigger-scope'--
+ to be in scope only for this element's [=flat tree=] descendants;
+ and limits descendants to only match [=trigger names=]
+ to [=triggers=] within this subtree.
+
+ This value only affects [=trigger names=] in the same tree scope,
+ as if it were a [=tree-scoped name/strictly matched=] [=tree-scoped name=].
+ (That is, ''trigger-scope: all'' acts identically
+ to ''trigger-scope: --foo, --bar, ...'',
+ listing all relevant [=trigger names=].)
+
+
<>
+
+ Specifies that a matching [=trigger name=] defined by this element or its descendants--
+ whose scope is not already limited by a descendant using 'trigger-scope'--
+ to be in scope only for this element's [=flat tree=] descendants;
+ and limits descendants to only match these [=trigger names=]
+ to [=triggers=] within this subtree.
+
+ The <> represents a [=tree-scoped name/strictly matched=] [=tree-scoped name=],
+ i.e. it can only match against [=trigger names=] in the same shadow tree.[[!CSS-SCOPING-1]]
+
+
+
+
+## Timeline Triggers ## {#timeline-triggers}
+
+ A timeline trigger is a [=trigger=]
+ which is activated when some [=timeline=]
+ enters the trigger's activation range,
+ or leaves the trigger's active range.
+ It is defined on an element with the 'timeline-trigger' shorthand property,
+ or its longhands.
+
+ A [=timeline trigger=] has a binary trigger state associated with it;
+ it is initially "inactive".
+ While it's "inactive",
+ the associated [=timeline=] entering (or starting in) the trigger's [=activation range=]
+ performs an associated entry action
+ and switches the [=timeline trigger/trigger state=] to "active";
+ while it's "active",
+ the associated timeline leaving the trigger's [=active range=]
+ performs an associated exit action
+ and switches the [=timeline trigger/trigger state=] to "inactive".
+
+ Note: By default, the [=active range=] is the same as the [=activation range=];
+ even when manually specified,
+ the [=active range=] is always a superset of the [=activation range=].
+ The two ranges allow, for example,
+ an 'animation-trigger' to start an animation
+ when an element is scrolled close to the center of the screen
+ (using a [=view progress timeline=] with a relatively small window as the [=activation range=]),
+ but not stop it until the element is fully off-screen
+ (using ''animation-timeline-range/cover'' as the [=active range=]).
+
+ A [=timeline trigger=] can have one or two actions associated with it
+ when used as a trigger on an element
+ (such as by 'animation-trigger').
+ If two are specified, the first is the trigger's [=timeline trigger/entry action=]
+ and the second is the trigger's [=timeline trigger/exit action=];
+ if only one is specified, the first is the trigger's [=timeline trigger/entry action=]
+ and its [=timeline trigger/exit action=] is to do nothing.
+
+ An element can define multiple [=timeline triggers=],
+ using the same [=timeline=] (potentially with different ranges)
+ or different ones.
+ The set of 'timeline-trigger' longhands
+ form a [=coordinating list property group=],
+ with 'timeline-trigger-name' as the [=coordinating list base property=],
+ and each item in the [=coordinated value list=]
+ defining the properties of a single [=timeline trigger=].
+
+
+### Naming the Trigger: the 'timeline-trigger-name' property ### {#timeline-trigger-name}
+
+
+ Name: timeline-trigger-name
+ Value: none | <>#
+ Initial: none
+ Applies to: all elements
+ Inherited: no
+ Percentages: N/A
+ Computed value: as specified
+ Canonical order: per grammar
+ Animation type: not animatable
+
+
+ If ''timeline-trigger-name/none'' is specified,
+ the element does not define any [=timeline triggers=].
+
+ If the same <> appears multiple times in the list,
+ only the last one defines a [=timeline trigger=];
+ the preceding ones have no effect.
+
+### Linking a Timeline: the 'timeline-trigger-source' property ### {#timeline-trigger-source}
+
+
+ Name: timeline-trigger-source
+ Value: <>#
+ Initial: auto
+ Applies to: all elements
+ Inherited: no
+ Percentages: N/A
+ Computed value: list, each item either
+ the keyword ''single-animation-timeline/none'',
+ the keyword ''single-animation-timeline/auto'',
+ a case-sensitive [=css identifier=],
+ a computed ''scroll()'' function,
+ or
+ a computed ''view()'' function
+ Canonical order: per grammar
+ Animation type: not animatable
+
+
+ The 'timeline-trigger-source' property
+ specifies the [=timeline trigger's=] associated [=timeline=].
+ Values have the same meaning as those of 'animation-timeline',
+ except that ''timeline-trigger-source/none''
+ instead causes the corresponding entry in the [=coordinated value list=]
+ to not define a [=timeline trigger=].
+
+### The Activation Range: the 'timeline-trigger-activation-range' property ### {#timeline-trigger-activation-range-prop}
+
+
+
+ The 'timeline-trigger-activation-range' property is a [=shorthand property=]
+ that sets 'timeline-trigger-activation-range-start' and 'timeline-trigger-activation-range-end'
+ together in a single declaration.
+ It has the same syntax as the 'animation-range' property.
+
+ The behavior of 'timeline-trigger-activation-range' is defined in [[web-animations-2#trigger-ranges]].
+
+
+ Name: timeline-trigger-activation-range-start, timeline-trigger-activation-range-end
+ Value: [ normal | <> | <> <>? ]#
+ Initial: normal
+ Applies to: all elements
+ Inherited: no
+ Percentages: relative to the specified [=named timeline range=] if one was specified, else to the entire timeline
+ Computed value: list, each item either the keyword ''timeline-trigger-activation-range-start/normal'' or a timeline range and progress percentage
+ Animation type: not animatable
+
+
+ The 'timeline-trigger-activation-range-start' and 'timeline-trigger-activation-range-end' properties
+ specify the [=timeline trigger=]’s associated [=timeline trigger/activation range=].
+ Values have the same meaning as 'animation-range-start' and 'animation-range-end'.
+
+### The Active Range: the 'timeline-trigger-active-range' property ### {#timeline-trigger-active-range-prop}
+
+
+
+ The 'timeline-trigger-active-range' property is a [=shorthand property=]
+ that sets 'timeline-trigger-active-range-start' and 'timeline-trigger-active-range-end'
+ together in a single declaration.
+ It has the same syntax as the 'animation-range' property.
+
+ The behavior of 'timeline-trigger-active-range' is defined in [[web-animations-2#trigger-ranges]].
+
+
+ Name: timeline-trigger-active-range-start, timeline-trigger-active-range-end
+ Value: [ auto | normal | <> | <> <>? ]#
+ Initial: auto
+ Applies to: all elements
+ Inherited: no
+ Percentages: relative to the specified [=named timeline range=] if one was specified, else to the entire timeline
+ Computed value: list, each item either the keyword ''timeline-trigger-active-range-start/normal'' or a timeline range and progress percentage
+ Animation type: not animatable
+
+
+ The 'timeline-trigger-active-range-start' and 'timeline-trigger-active-range-end' properties
+ specify the [=timeline trigger=]’s associated [=timeline trigger/active range=].
+ Values have the same meaning as 'animation-range-start' and 'animation-range-end',
+ with the following addition:
+
+
+ : auto
+ ::
+ The start (for 'timeline-trigger-active-range-start')
+ or end (for 'timeline-trigger-active-range-end')
+ is equal to the start/end of the [=timeline trigger's=] [=activation range=].
+
+
+### The 'timeline-trigger' Shorthand ### {#timeline-trigger-shorthand}
+
+
+
+ The 'timeline-trigger' [=shorthand property=]
+ sets all of 'timeline-trigger-name',
+ 'timeline-trigger-source',
+ 'timeline-trigger-activation-range',
+ and optionally 'timeline-trigger-active-range'
+ at once.
+
+ A value of none
+ is equivalent to ''none none normal''.
+
+ Note: Due to significant potential ambiguities in the syntax
+ ('timeline-trigger-name' vs [=timeline=] names in 'timeline-trigger-source';
+ [=activation ranges=] vs [=active ranges=]),
+ this shorthand's values must be given in the specified order,
+ rather than being settable in any order as is more common.
+
+
+
+## Event Triggers ## {#event-triggers}
+
+ An event trigger is a [=trigger=]
+ which is activated when certain {{Event}}s are fired at the element.
+ It is defined on an element with the 'event-trigger' shorthand property,
+ or its longhands.
+
+ An [=event trigger=] can be defined as either stateless or stateful:
+
+ * If stateless, it has a single set of enter events
+ that activate it.
+ * If stateful, it has two sets of events, its [=enter events=]
+ and another set of exit events.
+
+ [=Event triggers=] are activated when one of its associated {{Event}}s are fired on the page
+ with the trigger-defining element as its {{Event/target}}.
+ If it's stateful,
+ it has a binary trigger state associated with it,
+ initially "inactive":
+ while "inactive", it only activates when the defining element receives one of its [=enter events=],
+ performing an associated enter action
+ and switching its [=event trigger/trigger state=] to "active";
+ while "active", it only deactivates when it receives one of its [=exit events=],
+ performing an associated exit action
+ and switching its [=event trigger/trigger state=] back to "inactive".
+
+ A stateless [=event trigger=] must be given exactly one action for its [=trigger instance=].
+ A stateful one can be given one or two:
+ the first is its [=event trigger/enter action=],
+ and the second, if provided, is its [=event trigger/exit action=];
+ if the second is not provided,
+ the [=event trigger/exit action=] is to do nothing.
+
+ Note: A stateful and stateless [=event trigger=] act differently
+ even if you only assign a single action;
+ a single-action stateful [=event trigger=] will effectively "turn off"
+ until it receives one of its [=exit events=],
+ ignoring any of the [=enter events=] after the first,
+ while a stateless one will repeatedly trigger for every [=enter event=].
+
+ An element can define multiple [=event triggers=],
+ using the same {{Event}}s or different ones.
+ The set of 'event-trigger' longhands
+ form a [=coordinating list property group=],
+ with 'event-trigger-name' as the [=coordinating list base property=],
+ and each item in the [=coordinated value list=]
+ defining the properties of a single [=event trigger=].
+
+ Issue: The proposal I drew this text from
+ specified that it only cares if the element is the *target* of the event.
+ We probably want to allow for bubbling and/or capturing,
+ possibly as an opt in/out.
+
+### Naming the Trigger: the 'event-trigger-name' property ### {#event-trigger-name}
+
+
+ Name: event-trigger-name
+ Value: none | <>#
+ Initial: none
+ Applies to: all elements
+ Inherited: no
+ Percentages: N/A
+ Computed value: as specified
+ Canonical order: per grammar
+ Animation type: not animatable
+
+
+ If ''event-trigger-name/none'' is specified,
+ the element does not define any [=event triggers=].
+
+ If the same <> appears multiple times in the list,
+ only the last one defines an [=event trigger=];
+ the preceding ones have no effect.
+
+### Linking an Event: the 'event-trigger-source' property ### {#event-trigger-source}
+
+
+ Name: event-trigger-source
+ Value: [ none | <>+ [ / <>+ ]? ]#
+ Initial: none
+ Applies to: all elements
+ Inherited: no
+ Percentages: N/A
+ Computed value: as specified
+ Animation type: not animatable
+
+
+ The 'event-trigger-source' property
+ specifies what event or events activate the [=event trigger=].
+ Its values are:
+
+
+ : none
+ :: The corresponding entry in the [=coordinated value list=] does not define a trigger.
+
+ : <>+ [ / <>+ ]?
+ :: Defines what event(s) the [=event trigger=] responds to.
+
+ If a ''/'' is used in the value,
+ the [=event trigger=] is stateful;
+ the set of events before the ''/'' are the [=event trigger's=] [=enter events=],
+ while those after the ''/'' are the [=exit events=].
+ (The same events can occur in both sets.)
+
+ Otherwise,
+ the [=event trigger=] is stateless,
+ and the provided events are its [=enter events=].
+
+
+ Issue: Figure out the full set of events we want to handle.
+
+### The 'event-trigger' Shorthand ### {#event-trigger-shorthand}
+
+
+ Name: event-trigger
+ Value: none | [ <<'event-trigger-name'>> <<'event-trigger-source'>> ]#
+ Initial: none
+ Applies to: all elements
+ Inherited: no
+ Percentages: N/A
+ Computed value: as specified
+ Animation type: not animatable
+
+
+ The 'event-trigger' [=shorthand property=]
+ sets both 'event-trigger-name' and 'event-trigger-source' at once.
+
+ A value of none
+ is equivalent to ''none none''.
+
+### The 'animation-trigger' property ### {#animation-trigger-shorthand}
+
+
+ Name: animation-trigger
+ Value: [ none | [ <> <>+ ]+ ]#
+ Initial: none
+ Applies to: all elements
+ Inherited: no
+ Percentages: N/A
+ Computed value: as specified
+ Animation type: not animatable
+ Canonical order: per grammar
+
+
+ The 'animation-trigger' property
+ specifies whether the animation is a [=triggered animation=],
+ and if it is,
+ what trigger it responds to
+ and what actions it takes in response.
+ 'animation-trigger' is a [=reset-only sub-property=] of the 'animation' shorthand.
+ Its values are:
+
+
+ : none
+ ::
+ The corresponding animation is not a [=triggered animation=].
+
+ : [ <> <>+ ]+
+ ::
+ The corresponding animation is a [=triggered animation=],
+ responding to the triggers named by each <>,
+ and responding by taking the action named by the corresponding <>.
+ (See [[#trigger-scope]] for how <>s are resolved to [=triggers=].)
+
+ How many <>s a trigger accepts,
+ and what exactly activates them,
+ is determined by the type of the trigger.
+ ([=Event triggers=] take one and possibly an optional second, depending on whether they're stateless or stateful;
+ [=timeline triggers=] take one and optionally a second.)
+ Specifying the wrong number of actions
+ (too many or too few)
+ is valid syntactically,
+ but causes the trigger to have no effect.
+
+ If multiple triggers occur simultaneously,
+ they take effect in the order specified.
+
+ If the same <> is specified multiple times,
+ all but the last have no effect.
+
+
+ The possible <> values,
+ and what effect they have in each animation state:
+
+
+
+
Keyword
Extra Effect
initial
playing
paused
finished
+
+
none
—
—
—
—
—
+
play
—
{{play()}}
—
{{play()}}
{{play()}}
+
play-once
—
{{play()}}
—
{{play()}}
—
+
play-forwards
set playback rate to positive
{{play()}}
—
{{play()}}
{{play()}}
+
play-backwards
set playback rate to negative
{{play()}}
—
{{play()}}
{{play()}}
+
pause
—
—
{{pause()}}
—
—
+
reset
set progress to 0
—
{{pause()}}
{{pause()}}
{{pause()}}
+
replay
set progress to 0
{{play()}}
—
{{play()}}
{{play()}}
+
+ If there is an "effect",
+ it happens regardless of the current state,
+ before the state-specific action
+
+
+
+# Privacy Considerations # {#privacy-considerations}
+
+ There are no known privacy impacts of the features in this specification.
+
+# Security Considerations # {#security-considerations}
+
+ There are no known security impacts of the features in this specification.
diff --git a/bin/bikeshed-curl b/bin/bikeshed-curl
index d9706a69364d..a2c747dacc9f 100755
--- a/bin/bikeshed-curl
+++ b/bin/bikeshed-curl
@@ -1,2 +1,2 @@
-curl http://api.csswg.org/bikeshed/ -F file=@Overview.bs -F output=err
-curl http://api.csswg.org/bikeshed/ -F file=@Overview.bs -F force=1 > Overview.html
+curl https://www.w3.org/publications/spec-generator/ -F file=@Overview.bs -F type=bikeshed-spec -F output=messages
+curl https://www.w3.org/publications/spec-generator/ -F file=@Overview.bs -F type=bikeshed-spec -F die-on=nothing > Overview.html
diff --git a/bin/build-index.py b/bin/build-index.py
index 340b2be81b6f..7404dfacea24 100644
--- a/bin/build-index.py
+++ b/bin/build-index.py
@@ -644,6 +644,7 @@ def escape_html(text):
});
function sortRecent() {
+ window.localStorage.setItem('index-sort', 'recent');
specList.querySelectorAll('.group-header').forEach(function(h) { h.remove(); });
specs.sort(function(a, b) {
return parseInt(b.dataset.ts) - parseInt(a.dataset.ts);
@@ -657,6 +658,7 @@ def escape_html(text):
}
function sortGrouped() {
+ window.localStorage.setItem('index-sort', 'grouped');
specList.querySelectorAll('.group-header').forEach(function(h) { h.remove(); });
specs.sort(function(a, b) {
var c = a.dataset.shortname.localeCompare(b.dataset.shortname);
@@ -685,6 +687,9 @@ def escape_html(text):
btnRecent.addEventListener('click', sortRecent);
btnGrouped.addEventListener('click', sortGrouped);
+ if (window.localStorage.getItem('index-sort') === 'grouped') {
+ sortGrouped();
+ }
// Mobile: tap spec header to expand/collapse (accordion)
specs.forEach(function(el) {
diff --git a/css-2026/Overview.bs b/css-2026/Overview.bs
index cad24466fe58..7197d81dba07 100644
--- a/css-2026/Overview.bs
+++ b/css-2026/Overview.bs
@@ -7,6 +7,7 @@ Prepare for TR: no
Group: CSSWG
Work Status: revising
URL: https://drafts.csswg.org/css-2026/
+TR: https://www.w3.org/TR/css-2026/
Editor: Tab Atkins Jr., Google, http://xanthir.com/, w3cid 42199
Editor: Elika J. Etemad / fantasai, Apple, http://fantasai.inkedblade.net/contact, w3cid 35400
Editor: Florian Rivoal, Invited Expert, https://florian.rivoal.net, w3cid 43241
@@ -32,8 +33,10 @@ Boilerplate: index no
spec:css-ui-3; type:property; text:cursor
spec:css-ui-3; type:property; text:outline
spec:css-display-3; type:property; text:display
+spec:css-env-1; type:function; text:env()
spec:selectors-4;
type:dfn; text:document language
+ type:dfn; text:pseudo-elements
type:selector;
text::fullscreen
text::open
@@ -636,6 +639,14 @@ Modules with Rough Interoperability
This module defines basic basic geometric interfaces to represent points, rectangles, quadrilaterals,
and transformation matrices.
+
+ This module introduces the ability to nest one style rule
+ inside another, with the selector of the child rule
+ relative to the selector of the parent rule.
+ This increases the modularity and maintainability of CSS stylesheets.
+
@@ -981,7 +992,7 @@ Safe to Release pre-CR Exceptions
The [=pseudo-classes=] '':scope'', '':defined'', '':focus-within'', '':dir()'', '':any-link'', '':open'', '':popover-open'', '':modal'', '':fullscreen'', '':placeholder-shown'', '':default'', '':valid'', '':invalid'', '':required'', '':optional'', and selector lists for the '':nth-child()'' and '':nth-last-child()'' [=pseudo-classes=], defined in [[!SELECTORS-4]]
-
The 'accent-color' property and ''outline-color/auto'' value for the 'outline-color' property, defined in [[CSS-UI-4]]
+
The 'accent-color' property, the ''outline-color/auto'' value for the 'outline-color' property, and the <> data type for the [[css-ui-4#cursor|cursor]] property, defined in [[CSS-UI-4]]
Everything in
CSS Animations Level 1
@@ -1040,6 +1051,8 @@ Additional information:
Deprecated alias names for this type: N/A
Magic number(s): N/A
File extension(s): .css
+ macOS Uniform Type Identifier(s): public.css
+ Windows clipboard name(s): N/A
Person & email address to contact for further information:
@@ -1070,6 +1083,18 @@ Fallback encoding:
document declares its encoding to be UTF-8.
+
+ Security Considerations
+
+
+Please see the Security Considerations of the individual CSS modules.
+
+
+ Privacy Considerations
+
+
+Please see the Privacy Considerations of the individual CSS modules.
+
Indices
These sections are non-normative.
diff --git a/css-align-3/Overview.bs b/css-align-3/Overview.bs
index 98b975ee7e3c..023b07495c7c 100644
--- a/css-align-3/Overview.bs
+++ b/css-align-3/Overview.bs
@@ -2036,185 +2036,23 @@ Default Alignment Shorthand: the 'place-items' property
Gaps Between Boxes
- While 'margin' and 'padding' can be used to specify visual spacing around individual boxes,
- it's sometimes more convenient to globally specify spacing
- between adjacent boxes within a given layout context,
- particularly when the spacing is different between sibling boxes
- as opposed to between the first/last box and the container's edge.
-
- The 'gap' property,
- and its 'row-gap' and 'column-gap' sub-properties,
- provide this functionality for
- multi-column,
- flex,
- and grid layout.
-
-
-Row and Column Gutters: the 'row-gap' and 'column-gap' properties
-
-
- Name: row-gap, column-gap
- Value: normal | <>
- Initial: normal
- Applies to: multi-column containers, flex containers, grid containers
- Inherited: no
- Percentages: see [[#gap-percent]]
- Computed value: specified keyword, else a computed <> value
- Animation type: by computed value type
-
-
- These properties specify fixed-length gutters
- between items in the container,
- adding space between them--
- in a manner similar to the ''justify-content/space-between'' keyword
- of the content-distribution properties,
- but of a fixed size instead of as a fraction of remaining space.
- The 'column-gap' property specifies spacing between “columns”,
- separating boxes in the container's inline axis
- similar to inline-axis margin;
- while 'row-gap' indicates spacing between “rows”,
- separating boxes in the container's block axis.
-
- Values have the following meanings:
-
-
- : <>
- ::
- Specifies a gap between “rows” or “columns”,
- as defined by the layout modes to which it applies;
- see subsections below for details.
-
- Negative values are invalid.
- For percentages,
- see [[#gap-percent]].
-
- : normal
- :: The value ''gap/normal'' represents
- a used value of ''1em'' on multi-column containers,
- and a used value of ''0px'' in all other contexts.
-
-
- Gutters effect a minimum spacing between items:
- additional spacing may be added by 'justify-content'/'align-content'.
- Such additional space effectively increases the size of these gutters.
-
- The exact handling of these properties varies by layout container:
-
-
- 'column-gap' specifies the [=gutter=] between adjacent column boxes,
- see [[CSS-MULTICOL-1]].
- 'row-gap' specifies the [=gutter=] between the rows of [=column boxes=] established by 'column-height',
- see [[CSS-MULTICOL-2]].
-
-
- When applied to the main axis
- (e.g. 'column-gap' in a ''flex-flow/row'' flex container),
- indicates the [=gutter=] between items
- (as if an additional fixed-size margin were inserted
- between adjacent flex items
- in a single line).
-
- When applied to the cross axis
- (e.g. 'row-gap' in a ''flex-flow/row'' flex container),
- indicates the [=gutter=] between adjacent flex lines.
-
-
- The 'row-gap' and 'column-gap' properties,
- when specified on a grid container,
- define the [=gutters=] between grid rows and grid columns,
- respectively.
- See [[css-grid-1#gutters]] for precise details.
-
-
- In all cases, the [=gutter=] disappears when it coincides with
- a [=fragmentation break=]. [[CSS-BREAK-3]]
-
- Note: Table boxes do not use the 'gap' properties
- to specify separation between their cells.
- Instead, they use the 'border-spacing' property,
- which has slightly different functionality:
- it inherits,
- and it also specifies the additional spacing between the outermost cells
- and the border of the table
- (similar to ''space-evenly'' rather than ''space-between'').
-
-
-Gap Shorthand: the 'gap' property
-
-
- Name: gap
- Value: <<'row-gap'>> <<'column-gap'>>?
- Initial: see individual properties
- Applies to: multi-column containers, flex containers, grid containers
- Inherited: no
- Percentages: refer to corresponding dimension of the content area
- Computed value: see individual properties
- Animation type: by computed value type
-
-
- This property is a shorthand that sets 'row-gap' and 'column-gap' in one declaration.
- If <<'column-gap'>> is omitted,
- it's set to the same value as <<'row-gap'>>.
-
-
-
-
-
-
- Note: The 'gap' property is only one component of the visible “gutter” or “alley” created between boxes.
- Margins, padding, or the use of distributed alignment
- may increase the visible separation between boxes
- beyond what is specified in 'gap'.
-
-
-
-Percentages In 'gap' Properties
-
- In general,
- gaps introduced by the 'gap' properties
- are intended to act like an empty item/track/etc
- with the gap's size;
- in other words,
- an author should be able to reproduce the effects of 'gap'
- by just inserting additional empty items/tracks/etc
- into the container.
-
- 'gap' always resolves percentages against
- the corresponding size of the [=content box=]
- of the element.
- When this size is definite,
- the behavior is well-defined
- and consistent across layout modes.
- But since different layout modes treat [=cyclic percentage sizes=] for items/tracks/etc differently,
- 'gap' does as well:
-
- : In Grid Layout
- ::
- As in the min size properties and margins/paddings [[CSS-SIZING-3]],
- [=cyclic percentage sizes=] resolve against zero
- for determining intrinsic size contributions,
- but resolve against the box’s content box
- when laying out the box’s contents.
-
- : In Flex Layout
- ::
- [=Cyclic percentage sizes=] resolve against zero in all cases.
-
-
-Legacy Gap Properties: the 'grid-row-gap', 'grid-column-gap', and 'grid-gap' properties
-
- The Grid Layout module was originally written with its own set of [=gutter=] properties,
- before all such properties were unified into the existing 'row-gap'/'column-gap' naming.
- For compatibility with legacy content,
- these grid-prefixed names must be supported as follows:
-
- * grid-row-gap as a [=legacy name alias=] of the 'row-gap' property
- * grid-column-gap as a [=legacy name alias=] of the 'column-gap' property
- * grid-gap as a [=legacy name alias=] of the 'gap' property
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This section has been moved to [[CSS-GAPS-1#gaps]].
+
+ 4. Otherwise, if the row is not empty,
+ [=synthesize=] from the lowest and highest [=content edges=]
+ of all the cells in the row.
+ See [[css2#height-layout]].
+
+ 5. Otherwise,
+ use the [=block-start=] [=content edge=] of the [=table row box=] itself
+ as the [=alignment baseline=].
+
+ For this purpose,
+ any [=table cell=] that spans multiple rows
+ is ignored if it’s span does not start in this row;
+ except that for step 2,
+ it's ignored if its span does not end in this row.
+
+ Last baselines are analogous
+ (with “first”/“last” and “start”/“end” inverted).
Spanning cells participate only in the first/last row that they span
for the purpose of ''first baseline''/''last baseline''.
@@ -2554,6 +2420,8 @@ Changes
* Defined that 'justify-self' affects the [=automatic size=] of block-level boxes
the same way it does for flex and grid items.
(Issue 12102)
+ * Moved the gap properties to [[!CSS-GAPS-1]].
+ (Issue 13089)
See also previous changes.
diff --git a/css-anchor-position-1/Overview.bs b/css-anchor-position-1/Overview.bs
index 26dd34b9fe15..8a8911346c51 100644
--- a/css-anchor-position-1/Overview.bs
+++ b/css-anchor-position-1/Overview.bs
@@ -2,7 +2,7 @@
Title: CSS Anchor Positioning Module Level 1
Shortname: css-anchor-position
Level: 1
-Status: ED
+Status: WD
Group: csswg
Work Status: refining
ED: https://drafts.csswg.org/css-anchor-position-1/
@@ -31,6 +31,7 @@ spec:css-cascade-5; type:dfn; text:property
spec:dom; type:dfn; text:shadow tree
spec:css-align-3; type:value; text:center
spec:css-values-5; type:dfn; text:invalid at computed-value time
+spec:css-env-1; type:function; text:env()
@@ -457,7 +458,7 @@ in anchor positioning.
if all of the following are true:
* |possible anchor| is either an [=element=]
- or a fully styleable [=tree-abiding pseudo-element=].
+ or a [=fully styleable pseudo-elements=].
* |possible anchor| is in scope for |positioned el|,
per the effects of 'anchor-scope' on |possible anchor|
@@ -503,7 +504,7 @@ Default Anchors: the 'position-anchor' property
Name: position-anchor
-Value: normal | none | auto | <>
+Value: normal | none | auto | <> | match-parent
Initial: normal
Applies to: [=absolutely positioned boxes=]
Inherited: no
@@ -536,6 +537,13 @@ and (by default) all [=anchor functions=] applied to this element.
::
The [=target anchor element=] selected by the specified <>
is the box's [=default anchor element=].
+
+ : match-parent
+ ::
+ Uses the same [=default anchor element=] as the parent--
+ or [=originating element=], if this is a [=pseudo-element=]--
+ if any, and if that would be an [=acceptable anchor element=].
+ Otherwise, the box has no [=default anchor element=].
The [=principal box=] of the [=default anchor element=]
@@ -565,6 +573,12 @@ is the box's default anchor box.
+If an element has a [=default anchor element=],
+then the [=scrollable containing block=] is used in place of the [=local containing block=]
+when the [=absolute-position containing block=] is generated by a [=scroll container=],
+so that the entire [=scrollable overflow area=] (typically) is available
+for positioning.
+
### Implicit Anchor Elements ### {#implicit}
Some specifications can define that,
@@ -637,7 +651,7 @@ Value: none | <>
Initial: none
Inherited: no
Applies to: positioned boxes with a [=default anchor box=]
-Animation type: TBD
+Animation type: discrete
Computed value: the keyword ''position-area/none'' or a pair of keywords, see [[#position-area-computed]]
@@ -679,10 +693,6 @@ what area of this [=position-area grid=] to lay out the positioned box in.
Values other than ''position-area/none'' have the following additional effects:
-* The [=scrollable containing block=] is used in place of the [=local containing block=]
- when the [=absolute-position containing block=] is generated by a [=scroll container=],
- so that the entire [=scrollable overflow area=] (typically) is available
- for positioning.
* The [=used value=] of any ''top/auto'' [=inset properties=]
and ''margin/auto'' [=margin properties=]
resolves to ''0''.
@@ -967,35 +977,46 @@ etc.
Because the ''anchor()'' function resolves to a <>,
it can be used in [=math functions=] like any other length.
- ISSUE(10776): Add a better example; this one can be accomplished easily with ''align-self/anchor-center''.
-
- For example, the following will set up the element
- so that its [=inset-modified containing block=]
- is centered on the [=anchor box=]
- and as wide as possible without overflowing the [=containing block=]:
-
-
- .centered-message {
- position: fixed;
- max-width: max-content;
- justify-self: center;
-
- --center: anchor(--x 50%);
- --half-distance: min(
- abs(0% - var(--center)),
- abs(100% - var(--center))
- );
- left: calc(var(--center) - var(--half-distance));
- right: calc(var(--center) - var(--half-distance));
- bottom: anchor(--x top);
+ For example, in the following chart,
+ the three bars are set up as possible anchors,
+ and the min/max lines and tooltips use ''min()'' and ''max()''
+ to combine ''anchor()'' functions referring to all three
+ to find where to position themselves.
+ You can use the range inputs below each column to adjust the heights,
+ and see that the anchored lines and tooltips dynamically adjust
+ to whichever bar is the highest/lowest.
+
+
+
+ Full Example
+
+
+ The important fragment of the code to accomplish this is:
+
+
+ #bar-1 { anchor-name: --anchor-1; }
+ #bar-2 { anchor-name: --anchor-2; }
+ #bar-3 { anchor-name: --anchor-3; }
+ .line {
+ position: absolute;
+ left: anchor(--chart left);
+ right: anchor(--chart right);
+ &.max {
+ bottom: max(
+ anchor(--anchor-1 top),
+ anchor(--anchor-2 top),
+ anchor(--anchor-3 top)
+ );
+ }
+ &.min {
+ bottom: min(
+ anchor(--anchor-1 top),
+ anchor(--anchor-2 top),
+ anchor(--anchor-3 top)
+ );
+ }
}
-
-
- This might be appropriate for an error message
- on an <{input}> element,
- for example,
- as the centering will make it easier to discover
- which input is being referred to.
+
@@ -1327,7 +1348,7 @@ Centering on the Anchor: the ''anchor-center'' alignment value {#anchor-center}
--------------------------------------------------------------
@@ -1340,17 +1361,14 @@ but a common case for anchored positioning--
centering over the [=anchor box=]--
requires careful and somewhat complex set-up to achieve.
-The new anchor-center value
+The new anchor-center value
makes this case extremely simple:
if the positioned box has a [=default anchor box=],
then it is centered (insofar as possible)
over the [=default anchor box=]
in the relevant axis.
Additionally:
-* The [=scrollable containing block=] is used in place of the [=local containing block=]
- where applicable,
- so that the entire [=scrollable overflow area=] (typically) is available
- for positioning.
+
* The [=used value=] of any ''top/auto'' [=inset properties=]
and ''margin/auto'' [=margin properties=]
resolves to ''0''.
@@ -1485,12 +1503,12 @@ or being positioned partially off screen.
To ameliorate this, an [=absolutely positioned=] box
can use the 'position-try-fallbacks' property
-to specify additional [=position options=]
+to specify additional position options
(variant sets of positioning/alignment properties
generated from the box's existing styles,
or specified in ''@position-try'' rules)
that the UA can try if the box overflows its initial position.
-Each is applied to the box,
+Each [=position option=] is applied to the box,
one by one in the order specified by 'position-try-order',
and the first that doesn't cause the box
to overflow its [=containing block=]
@@ -1544,17 +1562,18 @@ Applies to: [=absolutely positioned boxes=]
Animation type: discrete
-This property provides a list of alternate positioning styles
-to try when the [=absolutely positioned box=]
-overflows its [=inset-modified containing block=].
-This position options list
-initially contains a single [=position option=]
-generated from the element's fallback base styles,
-i.e. the [=computed values|computed styles=] without applying 'position-try-fallbacks'.
+This property provides a list of additional, alternative [=position options=]
+to try in order to prevent the [=absolutely positioned box=]
+from overflowing its [=inset-modified containing block=].
-Each comma-separated entry in the list is a separate option:
+Each comma-separated entry in the list is a separate [=position option=]:
either the name of a ''@position-try'' block,
-or a <> representing an automatic transformation of the box's existing computed style.
+or a <> representing an automatic transformation
+of the box's existing computed style (its fallback base styles).
+Together with the [=fallback base styles=],
+these options form the position options list
+from which the effective style is chosen,
+see [[#fallback-apply]].
Values have the following meanings:
@@ -1562,7 +1581,8 @@ Values have the following meanings:
: none
::
The property has no effect;
- the box's [=position options list=] is empty.
+ the box's [=position options list=]
+ consists only of the [=fallback base styles=].
: <>
::
@@ -1578,8 +1598,8 @@ Values have the following meanings:
::
Automatically creates a [=position option=]
by [=executing a try-tactic|executing the specified try tactic=]
- to the box's [=base styles=],
- then adding the constructed [=position option=]
+ on the box's [=base styles=],
+ then adding this constructed [=position option=]
to the box's [=position options list=].
@@ -1666,10 +1686,10 @@ Inherited: no
Animation Type: discrete
-This property allows an element to sort its [=position options=]
-by the available space they define,
-if it's more important for the box to have as much space as possible
-rather than strictly following the order declared in 'position-try-fallbacks'.
+This property allows an element to sort its [=position option list=]
+by the available space they produce.
+This allows the box to prioritize having more layout space
+over strictly following the order declared in 'position-try-fallbacks'.
<> = most-width | most-height | most-block-size | most-inline-size
@@ -1827,11 +1847,10 @@ The ''@position-try'' Rule {#fallback-rule}
-------------------------------
The @position-try rule
-defines a position option
-with a given name,
+defines a [=position option=] with a given name,
specifying one or more sets of positioning properties
that can be applied to a box
-via 'position-try-fallbacks',
+via 'position-try-fallbacks'.
The syntax of the ''@position-try'' rule is:
@@ -1844,10 +1863,10 @@ The syntax of the ''@position-try'' rule is:
The <> specified in the prelude
is the rule's name.
If multiple ''@position-try'' rules are declared with the same name,
-they [=cascade=] the same as ''@keyframe'' rules do.
+they [=cascade=] (overriding each other) the same as ''@keyframes'' rules do.
-The ''@position-try'' rule only accepts
-the following [=properties=]:
+The ''@position-try'' rule only accepts
+the following accepted @position-try properties:
* [=inset properties=]
* [=margin properties=]
@@ -2016,7 +2035,7 @@ and thus trigger special behavior. These fallback-sensitive changes i
have been added, removed, or mutated.
For this purpose, only changes to the computed base style are considered,
- i.e. the [=computed style=] ignoring any declarations originating
+ i.e. the [=computed value=] ignoring any declarations originating
from the Transitions or Animations [=cascade origins=].
@@ -2200,8 +2219,8 @@ Conditional Hiding: the 'position-visibility' property {#position-visibility}
Name: position-visibility
-Value: always | [ anchors-valid || anchors-visible || no-overflow ]
-Initial: anchors-visible
+Value: always | [ anchor-valid || anchor-visible || no-overflow ]
+Initial: anchor-visible
Applies to: [=absolutely positioned boxes=]
Percentages: n/a
Inherited: no
@@ -2220,23 +2239,14 @@ depending on some commonly needed layout conditions.
(The box is displayed without regard for its anchors
or its overflowing status.)
- : anchors-valid
+ : anchor-valid
::
- If any of the box's [=required anchor references=]
- do not resolve to a [=target anchor element=],
+ If the box references the [=default anchor box=]
+ (e.g. using 'position-area', 'anchor()' or 'anchor-size()' functions, or ''anchor-center''),
+ but the [=default anchor box=] cannot be resolved,
the box's 'visibility' property computes to ''force-hidden''.
- Issue: What is a required anchor reference?
- ''anchor()'' functions that don't have a fallback value;
- the default anchor *sometimes*?
- Need more detail here.
-
- Issue: Any anchors are missing,
- or all anchors are missing?
- I can see use-cases for either, potentially.
- Do we want to make a decision here, or make it controllable somehow?
-
- : anchors-visible
+ : anchor-visible
::
If the box has a [=default anchor box=]
but that [=anchor box=] is [=invisible=] or [=clipped by intervening boxes=],
@@ -2290,6 +2300,10 @@ depending on some commonly needed layout conditions.
rather than also floating in a nonsensical location.
+User agents may recognize anchors-valid and anchors-visible
+as [=legacy value aliases=] of ''anchor-valid'' and ''anchor-visible''
+(but are not required to).
+
-
-
-Triggers
-
-While CSS animations are, by default,
-automatically run as soon as the appropriate 'animation' values have been set on an element,
-the 'animation-trigger' property allows the animation's start to be delayed
-until an appropriate trigger occurs,
-and even paused, restarted, or reset by triggers
-(making it a triggered animation).
-
-This is a simplified and streamlined version
-of what can be achieved with the Web Animations API in Javascript,
-allowing simple, common interaction patterns
-to be created and managed purely in CSS.
-
-Currently, two types of triggers are defined:
-
-* [=timeline triggers=], managed by the 'timeline-trigger' properties,
- which allow animations to be triggered by entering or leaving certain timeline ranges.
- (Usually, [=view progress timelines=],
- so an animation can be started when an element comes on-screen,
- without actually driving the animation with the scroll progress.)
-
-* [=event triggers=], managed by the 'event-trigger' properties,
- which allow animations to be triggered by certain user-interaction events,
- such as clicking an element or pressing certain keys.
-
-A [=trigger=] is defined on some specific triggering element.
-All triggers have a trigger name,
-and the specific type of trigger dictates how and when it's activated.
-A trigger can define multiple "types" of activation.
-(For example, [=timeline triggers=] can do different things on entry and exit.)
-
-A [=trigger=] is used on potentially any element,
-creating a trigger instance on the element.
-(For example, 'animation-trigger' associates a [=trigger instance=]
-with a specific animation on the element.)
-The trigger-using element specifies what actions to take
-when the [=trigger=] activates.
-
-Note: This design for [=triggers=] and [=trigger instances=],
-and the way they're associated with [=triggered animations=] and <>s,
-is intentionally somewhat generic,
-intended to support using [=triggers=] for other purposes in the future.
-For now, though, [=triggered animations=] are the only user of this feature.
-
-If a single element attempts to define multiple [=triggers=] of different types
-with the same [=trigger name=],
-it only exposes one of the [=triggers=],
-with [=event triggers=] winning over [=timeline triggers=].
-
-Note: This order is completely arbitrary
-(based on alphabetic order of the concept name),
-as this is just an error case.
-
-
-
-Trigger Name Scoping: the 'trigger-scope' property
-
-[=Trigger names=] are global by default,
-usable by other elements regardless of their position.
-(Though they are [=tree-scoped names=],
-so have interactions with [=shadow roots=]).
-If multiple elements define [=triggers=] with the same [=trigger name=],
-the [=trigger=] defined by the later element in [=tree order=] is used.
-
-The 'trigger-scope' property can limit the scope of a name
-to a subtree of the document,
-so elements outside won't see the chosen [=trigger name=],
-and elements inside will only see the version of the [=trigger name=]
-defined inside the scope.
-
-
-Name: trigger-scope
-Value: none | all | <>#
-Initial: none
-Applies to: all elements
-Inherited: no
-Animation type: not animatable
-Computed value: as specified
-
-
-This property scopes [=trigger names=] to the subtree of the matching element.
-Its values are:
-
-
-
none
-
- No changes in [=trigger name=] scope.
-
-
all
-
- Specifies that all [=trigger names=] defined by this element or its descendants--
- whose scope is not already limited by a descendant using 'trigger-scope'--
- to be in scope only for this element's [=flat tree=] descendants;
- and limits descendants to only match [=trigger names=]
- to [=triggers=] within this subtree.
-
- This value only affects [=trigger names=] in the same tree scope,
- as if it were a [=tree-scoped name/strictly matched=] [=tree-scoped name=].
- (That is, ''trigger-scope: all'' acts identically
- to ''trigger-scope: --foo, --bar, ...'',
- listing all relevant [=trigger names=].)
-
-
<>
-
- Specifies that a matching [=trigger name=] defined by this element or its descendants--
- whose scope is not already limited by a descendant using 'trigger-scope'--
- to be in scope only for this element's [=flat tree=] descendants;
- and limits descendants to only match these [=trigger names=]
- to [=triggers=] within this subtree.
-
- The <> represents a [=tree-scoped name/strictly matched=] [=tree-scoped name=],
- i.e. it can only match against [=trigger names=] in the same shadow tree.[[!CSS-SCOPING-1]]
-
-
-
-
-
-Timeline Triggers
-
-A timeline trigger is a [=trigger=]
-which is activated when some [=timeline=]
-enters the trigger's enter range,
-or leaves the trigger's exit range.
-It is defined on an element with the 'timeline-trigger' shorthand property,
-or its longhands.
-
-A [=timeline trigger=] has a binary trigger state associated with it;
-it is initially "untriggered".
-While it's "untriggered",
-the associated [=timeline=] entering (or starting in) the trigger's [=enter range=]
-performs an associated enter action
-and switches the [=timeline trigger/trigger state=] to "triggered";
-while it's "triggered",
-the associated timeline leaving the trigger's [=exit range=]
-performs an associated exit action
-and switches the [=timeline trigger/trigger state=] to "untriggered".
-
-Note: By default, the [=exit range=] is the same as the [=enter range=];
-even when manually specified,
-the [=exit range=] is always a superset of the [=enter range=].
-The two ranges allow, for example,
-an 'animation-trigger' to start an animation
-when an element is scrolled close the center of the screen
-(using a [=view progress timeline=] with a relatively small window as the [=enter range=]),
-but not stop it until the element is fully off-screen
-(using ''animation-timeline-range/cover'' as the [=exit range=]).
-
-Issue: I think it's WebAnim2 that needs to define
-that exit ranges are interpreted
-as the bounding range of the [=enter range=]
-and what's specified for the [=exit range=].
-
-A [=timeline trigger=] can have one or two actions associated with it
-when used as a trigger on an element
-(such as by 'animation-trigger').
-If two are specified, the first is the trigger's [=timeline trigger/enter action=]
-and the second is the trigger's [=timeline trigger/exit action=];
-if only one is specified, the first is the trigger's [=timeline trigger/enter action=]
-and its [=timeline trigger/exit action=] is to do nothing.
-
-An element can define multiple [=timeline triggers=],
-using the same [=timeline=] (potentially with different ranges)
-or different ones.
-The set of 'timeline-trigger' longhands
-form a [=coordinating list property group=],
-with 'timeline-trigger-name' as the [=coordinating list base property=],
-and each item in the [=coordinated value list=]
-defining the properties of a single [=timeline trigger=].
-
-
-
-Naming the Trigger: the 'timeline-trigger-name' property
-
-
-Name: timeline-trigger-name
-Value: none | <>#
-Initial: none
-Applies to: all elements
-Inherited: no
-Percentages: N/A
-Computed value: as specified
-Canonical order: per grammar
-Animation type: not animatable
-
-
-If ''timeline-trigger-name/none'' is specified,
-the element does not define any [=timeline triggers=].
-
-If the same <> appears multiple times in the list,
-only the last one defines a [=timeline trigger=];
-the preceding ones have no effect.
-
-
-
-Linking a Timeline: the 'timeline-trigger-source' property
-
-
-Name: timeline-trigger-source
-Value: <>#
-Initial: auto
-Applies to: all elements
-Inherited: no
-Percentages: N/A
-Computed value: list, each item either
- the keyword ''single-animation-timeline/none'',
- the keyword ''single-animation-timeline/auto'',
- a case-sensitive [=css identifier=],
- a computed ''scroll()'' function,
- or
- a computed ''view()'' function
-Canonical order: per grammar
-Animation Type: not animatable
-
-
-The 'timeline-trigger-source' property
-specifies the [=timeline trigger's=] associated [=timeline=].
-Values have the same meaning as those of 'animation-timeline',
-except that ''timeline-trigger-source/none''
-instead causes the corresponding entry in the [=coordinated value list=]
-to not define a [=timeline trigger=].
-
-
-The Enter Range: the 'timeline-trigger-range' property
-
-The 'timeline-trigger-range' property is a [=shorthand property=]
-that sets 'timeline-trigger-range-start' and 'timeline-trigger-range-end'
-together in a single declaration.
-It has the same syntax as the 'animation-range' property.
-
-The behavior of 'timeline-trigger-range' is defined in [[web-animations-2#trigger-ranges]].
-
-Issue: Need to rewrite WebAnim2 to use the term "enter range".
-
-
-Name: timeline-trigger-range-start, timeline-trigger-range-end
-Value: [ normal | <> | <> <>? ]#
-Initial: normal
-Applies to: all elements
-Inherited: no
-Percentages: relative to the specified [=named timeline range=] if one was specified, else to the entire timeline
-Computed value: list, each item either the keyword ''animation-trigger-range-start/normal'' or a timeline range and progress percentage
-Animation type: not animatable
-
-
-The 'timeline-trigger-range-start' and 'timeline-trigger-range-end' properties
-specify the [=timeline trigger=]’s associated [=timeline trigger/enter range=].
-Values have the same meaning as 'animation-range-start' and 'animation-range-end'.
-
-
-
-The Exit Range: the 'timeline-trigger-exit-range' property
-
-The 'timeline-trigger-exit-range' property is a [=shorthand property=]
-that sets 'timeline-trigger-exit-range-start' and 'timeline-trigger-exit-range-end'
-together in a single declaration.
-It has the same syntax as the 'animation-range' property.
-
-The behavior of 'timeline-trigger-exit-range' is defined in [[web-animations-2#trigger-ranges]].
-
-
-
-Name: timeline-trigger-exit-range-start, timeline-trigger-exit-range-end
-Value: [ auto | normal | <> | <> <>? ]#
-Initial: auto
-Applies to: all elements
-Inherited: no
-Percentages: relative to the specified [=named timeline range=] if one was specified, else to the entire timeline
-Computed value: list, each item either the keyword ''animation-trigger-range-start/normal'' or a timeline range and progress percentage
-Animation type: not animatable
-
-
-The 'timeline-trigger-exit-range-start' and 'timeline-trigger-exit-range-end' properties
-specify the [=timeline trigger=]’s associated [=timeline trigger/exit range=].
-Values have the same meaning as 'animation-range-start' and 'animation-range-end',
-with the following addition:
-
-
- : auto
- ::
- The start (for 'timeline-trigger-exit-range-start')
- or end (for 'timeline-trigger-exit-range-end')
- is equal to the start/end of the [=timeline trigger's=] [=enter range=].
-
-
-An event trigger is a [=trigger=]
-which is activated when certain {{Event}}s are fired at the element.
-It is defined on an element with the 'event-trigger' shorthand property,
-or its longhands.
-
-An [=event trigger=] can be defined as either stateless or stateful:
-
-* If stateless, it has a single set of enter events
- that activate it.
-* If stateful, it has two sets of events, its [=enter events=]
- and another set of exit events.
-
-[=Event triggers=] are activated when one of its associated {{Event}}s are fired on the page
-with the trigger-defining element as its {{Event/target}}.
-If it's stateful,
-it has a binary trigger state associated with it,
-initially "untriggered":
-while "untriggered", it only activates when the defining element receives one of its [=enter events=],
-performing an associated enter action
-and switching its [=event trigger/trigger state=] to "triggered";
-while "triggered", it only activates when it receives one of its [=exit events=],
-performing an associated exit action
-and switching its [=event trigger/trigger state=] back to "untriggered".
-
-A stateless [=event trigger=] must be given exactly one action for its [=trigger instance=].
-A stateful one can be given one or two:
-the first is its [=event trigger/enter action=],
-and the second, if provided, is its [=event trigger/exit action=];
-if the second is not provided,
-the [=event trigger/exit action=] is to do nothing.
-
-Note: A stateful and stateless [=event trigger=] act differently
-even if you only assign a single action;
-a single-action stateful [=event trigger=] will effectively "turn off"
-until it receives one of its [=exit events=],
-ignoring any of the [=enter events=] after the first,
-while a stateless one will repeatedly trigger for every [=enter event=].
-
-An element can define multiple [=event triggers=],
-using the same {{Event}}s or different ones.
-The set of 'event-trigger' longhands
-form a [=coordinating list property group=],
-with 'event-trigger-name' as the [=coordinating list base property=],
-and each item in the [=coordinated value list=]
-defining the properties of a single [=event trigger=].
-
-Issue: The proposal I drew this text from
-specified that it only cares if the element is the *target* of the event.
-We probably want to allow for bubbling and/or capturing,
-possibly as an opt in/out.
-
-
-
-Naming the Trigger: the 'event-trigger-name' property
-
-
-Name: event-trigger-name
-Value: none | <>#
-Initial: none
-Applies to: all elements
-Inherited: no
-Percentages: N/A
-Computed value: as specified
-Canonical order: per grammar
-Animation type: not animatable
-
-
-If ''event-trigger-name/none'' is specified,
-the element does not define any [=event triggers=].
-
-If the same <> appears multiple times in the list,
-only the last one defines a [=event trigger=];
-the preceding ones have no effect.
-
-
-Linking an Event: the 'event-trigger-source' property
-
-
-Name: event-trigger-source
-Value: [ none | <>+ [ / <>+ ]? ]#
-Initial: none
-Applies to: all elements
-Inherited: no
-Percentages: N/A
-Computed value: as specified
-Animation type: not animatable
-
-
-The 'event-trigger-source' property
-specifies what event or events activate the [=event trigger=].
-Its values are:
-
-
- : none
- :: The corresponding entry in the [=coordinated value list=] does not define a trigger.
-
- : <>+ [ / <>+ ]?
- :: Defines what event(s) the [=event trigger=] responds to.
-
- If a ''/'' is used in the value,
- the [=event trigger=] is stateful;
- the set of events before the ''/'' are the [=event trigger's=] [=enter events=],
- while those after the ''/'' are the [=exit events=].
- (The same events can occur in both sets.)
-
- Otherwise,
- the [=event trigger=] is stateless,
- and the provided events are its [=enter events=].
-
-
-Issue: Figure out the full set of events we want to handle.
-
-
-
-The 'event-trigger' Shorthand
-
-
-Name: event-trigger
-Value: none | [ <<'event-trigger-name'>> <<'event-trigger-source'>> ]#
-Initial: none
-Applies to: all elements
-Inherited: no
-Percentages: N/A
-Computed value: as specified
-Animation type: not animatable
-
-
-The 'event-trigger' [=shorthand property=]
-sets both 'event-trigger-name' and 'event-trigger-source' at once.
-
-A value of none
-is equivalent to ''none none''.
-
-
-
-
# Animation Events # {#events}
## Event dispatch ## {#event-dispatch}
@@ -1436,6 +882,33 @@ expressed in milliseconds, it must be divided by 1,000 to produce a value in
seconds before being assigned to the {{AnimationEvent/elapsedTime}} member of
the {{AnimationEvent}}.
+## The AnimationEvent Interface ## {#interface-animationevent}
+
+### IDL Definition ### {#interface-animationevent-idl}
+
+Add {{AnimationEvent/animation}} to the {{AnimationEvent}} interface and {{AnimationEventInit}} dictionary as follows:
+
+
Added ''animation-duration/auto'' as the [=initial value=] of 'animation-duration'.
diff --git a/css-backgrounds-3/Makefile b/css-backgrounds-3/Makefile
index b5201a8abdfb..13863c77b724 100644
--- a/css-backgrounds-3/Makefile
+++ b/css-backgrounds-3/Makefile
@@ -7,11 +7,8 @@
# http://www.w3.org/TR/[YEAR]/CR-[SHORTNAME]-[CDATE]/
# Or set that URL to [VERSION] and call Make as: make status=CR
#
-#
-# Possible other options to add to the curl command below:
-# -F ids=on
-# -F omitdchtml=on
-# e.g., like this: make opts="-F ids=on -F omitdchtml=on"
+# Additional options may be specified via opts, e.g.:
+# make opts='-F md-prepare-for-tr=yes'
cdate =
status =
@@ -43,11 +40,11 @@ opts =
all: check Overview.html
-# egrep will exit with a zero exit code if there is anything left
+# fgrep will exit with a zero exit code if there is anything left
check: Overview.err
@cat $<
- @if egrep -v '^(Warning:|\(Processed in .* seconds\)|No errors)' $<;\
- then false; else true; fi
+ @if fgrep -q '"messageType":"success"' $<;\
+ then true; else false; fi
# A handy shortcut:
diff --git a/css-borders-4/Overview.bs b/css-borders-4/Overview.bs
index b51561c765f4..502d9ddb0803 100644
--- a/css-borders-4/Overview.bs
+++ b/css-borders-4/Overview.bs
@@ -379,12 +379,18 @@ Line Thickness: the 'border-width' properties
i.e. the border width.
Where
-
<> = <> | thin | medium | thick
+
<> = <> | hairline | thin | medium | thick
Negative values are invalid.
The thin, medium, and thick keywords
are equivalent to ''1px'', ''3px'', and ''5px'', respectively.
+ The hairline keyword is a UA-defined length,
+ less than or equal to ''1px''
+ and equal to an integer number of device pixels at the default page zoom,
+ which represents a "just visible" line.
+ (While it can be as large as ''1px'',
+ on many devices it will be approximately ''0.3px'' to ''0.5px''.)
The [=resolved value=] for the 'border-width' properties is the [=used value=].
@@ -3341,10 +3347,10 @@ Interaction with 'border-radius' and 'corner-shape'
Interaction with 'box-shadow'
- An [=outer box-shadow=] follows the outside of the outer path,
- and an [=inner box-shadow=] follows the inside of the inner path.
- Both are rendered as a stroke, with a stroke width of spread * 2,
- clipped by the border shape.
+ An [=outer box-shadow=] is cast as if the shape defined by the outer path were opaque.
+ An [=inner box-shadow=] is cast as if everything outside the shape defined by the inner path were opaque.
+ For both inner and outer shadows, the shadow shape is expanded or contracted by the spread distance,
+ blurred by the blur radius, and then clipped by the 'border-shape', adhering to the standard 'box-shadow' painting rules.
diff --git a/css-box-3/Makefile b/css-box-3/Makefile
index 925fedd77443..d39600454d53 100755
--- a/css-box-3/Makefile
+++ b/css-box-3/Makefile
@@ -9,18 +9,14 @@
# http://www.w3.org/TR/[YEAR]/CR-[SHORTNAME]-[CDATE]/
# Or set that URL to [VERSION] and call Make as: make status=CR
#
-#
-# Possible other options to add to the curl command below:
-# -F ids=on
-# -F omitdchtml=on
-# e.g., like this: make opts="-F ids=on -F omitdchtml=on"
+# Additional options may be specified via opts, e.g.:
+# make opts='-F md-prepare-for-tr=yes'
date ?=
status ?= ED
group ?= CSS
opts ?=
target ?= Overview
-markup ?= html
cdate ?= $(date)
@@ -37,14 +33,13 @@ cdate ?= $(date)
%.html: %.bs
@echo "- Calling Bikeshed to generate $@..."
@curl -o $@ -s -L -F file=@$< -F md-date=$(cdate) -F md-status=$(status) \
- -F output=html -F paragraph=$(markup) $(opts) http://api.csswg.org/bikeshed/
+ -F type=bikeshed-spec -F output=html $(opts) https://www.w3.org/publications/spec-generator/
%.err: %.bs
@echo "- Calling Bikeshed to check $<..."
@rm -f $@
@touch $@
@curl -o $@ -s -L -F file=@$< -F md-date=$(cdate) -F md-status=$(status) \
- -F output=err -F paragraph=$(markup) $(opts) http://api.csswg.org/bikeshed/
- @sed -i 's/\\033\[[0-9;]*m//g' $@
+ -F type=bikeshed-spec -F output=messages $(opts) https://www.w3.org/publications/spec-generator/
# For Dispositions of Comments in css3-background:
%.html: %.txt; awk -f issues-txt-to-html.awk $< >$@
@@ -61,13 +56,12 @@ cdate ?= $(date)
all: check $(target).html
-# egrep will exit with a zero exit code if there is anything left
+# fgrep will exit with a zero exit code if there is anything left
check: $(target).err
@cat $<
@echo
- @if egrep -qv '^(Warning:|\(Processed in .* seconds\)|No errors)' $< &&\
- ! egrep -q '[^A-Z]* Successfully generated' $<;\
- then false; else true; fi
+ @if fgrep -q '"messageType":"success"' $<;\
+ then true; else false; fi
# A handy shortcut:
diff --git a/css-cascade-3/Overview.bs b/css-cascade-3/Overview.bs
index b206c0776e71..c337b916047b 100644
--- a/css-cascade-3/Overview.bs
+++ b/css-cascade-3/Overview.bs
@@ -343,7 +343,7 @@ Value Processing
it must assign,
to every element in the tree,
and correspondingly to every box in the formatting structure,
- a value to every property that applies to the target media type.
+ a value to every property that applies to the target [=media type=].
The final value of a CSS property for a given element or box
is the result of a multi-step calculation:
diff --git a/css-cascade-4/Overview.bs b/css-cascade-4/Overview.bs
index 5fc5a0310bef..3e6dec6c1daa 100644
--- a/css-cascade-4/Overview.bs
+++ b/css-cascade-4/Overview.bs
@@ -524,7 +524,7 @@ Value Processing
it must assign,
to every element in the [=flat tree=],
and correspondingly to every box in the formatting structure,
- a value to every property that applies to the target media type.
+ a value to every property that applies to the target [=media type=].
The final value of a CSS property for a given element or box
is the result of a multi-step calculation:
diff --git a/css-cascade-5/Overview.bs b/css-cascade-5/Overview.bs
index 9afe53cdd0a8..aad064f4251d 100644
--- a/css-cascade-5/Overview.bs
+++ b/css-cascade-5/Overview.bs
@@ -492,7 +492,7 @@ Value Processing
it must assign,
to every element in the [=flat tree=],
and correspondingly to every box in the formatting structure,
- a value to every property that applies to the target media type.
+ a value to every property that applies to the target [=media type=].
The final value of a CSS property for a given element or box
is the result of a multi-step calculation:
@@ -1264,10 +1264,10 @@ Cascade Layers
and come first in the order of appearance.
- Name-defining [=at-rules=]
- such as ''@keyframes'' or ''@font-face''
+ [=At-rules=]
+ (such as ''@keyframes'', ''@font-face'', ''@page'', etc.)
that are defined inside [=cascade layers=]
- also use the layer order when resolving name collisions.
+ also use the layer order when resolving collisions or [=cascading=].
if you are implementing anything, please use Level 5 as a reference.
We will merge the Level 5 text into this draft once it reaches CR.
+
+
+
+Importing Style Sheets: the ''@import'' rule
+
+ The @import rule allows users to import style rules from other style sheets.
+ If an ''@import'' rule refers to a valid stylesheet,
+ user agents must treat the contents of the stylesheet as if they were written in place of the ''@import'' rule,
+ with two exceptions:
+
+ * If a feature
+ (such as the ''@namespace'' rule)
+ explicitly defines that it only applies to a particular stylesheet,
+ and not any imported ones,
+ then it doesn't apply to the imported stylesheet.
+
+ * If a feature relies on the relative ordering of two or more constructs in a stylesheet
+ (such as the requirement that ''@namespace'' rules must not have any other rules other than
+ ''@import'' preceding it),
+ it only applies between constructs in the same stylesheet.
+
+
+ For example, [=declarations=] in style rules from imported stylesheets interact with the cascade
+ as if they were written literally into the stylesheet at the point of the ''@import''.
+
+ Any ''@import'' rules must precede all other valid at-rules and style rules in a style sheet
+ (ignoring ''@charset'', ''@supports-condition'', and @layer statement rules)
+ and must not have any other valid at-rules or style rules between it and previous ''@import'' rules,
+ or else the ''@import'' rule is invalid.
+ The syntax of ''@import'' is:
+
+
+
+ where:
+
+ * the <> or <>
+ gives the URL of the style sheet to be imported.
+
+ and optionally:
+
+ * the ''layer'' keyword or ''layer()'' function,
+ which assigns the contents of the style sheet
+ into its own anonymous [=cascade layer=]
+ or into the named [=cascade layer=].
+
+ The layer is added to the [[#layer-ordering|layer order]]
+ even if the import fails to load the stylesheet,
+ but is subject to any [=import conditions=]
+ (just as if declared by an ''@layer'' rule wrapped
+ in the appropriate [=conditional group rules=]).
+ * the ''scope'' keyword or ''scope()'' function,
+ which [=scopes=] the [=style rules=] within the stylesheet,
+ using the [=scoping roots=] and [=scoping limits=]
+ as described by [[#scope-limits]].
+
+ Note: The ''scope'' keyword behaves like a ''@scope'' rule with an empty prelude,
+ scoping the imported rules to the [=parent element=] of the [=owner node=]
+ of the stylesheet containing the ''@import'' rule.
+
+ Note: While the [=style rules=] within the imported stylesheet
+ become [=scoped=],
+ they do not become [=nested style rule|nested=].
+ In particular,
+ top-level selectors are not re-interpreted as [=relative selectors=],
+ and the ''&'' pseudo-class maintains its non-nested behavior.
+
+ * the [=import conditions=],
+ <> and <>,
+ which state the conditions under which the ''@import'' rule applies.
+
+
+
+ Import conditions allow the import to be media– or feature-support–dependent.
+ In the absence of any import conditions, the import is unconditional.
+ (Specifying ''@media/all'' for the <> has the same effect.)
+ If the import conditions do not match,
+ the rules in the imported stylesheet do not apply,
+ exactly as if the imported stylesheet were wrapped in ''@media'' and/or ''@supports'' blocks with the given conditions.
+
+
+ The following rules illustrate how ''@import'' rules can be made media-dependent:
+
+
+
+ User agents may therefore avoid fetching a conditional import
+ as long as the import conditions do not match.
+ Additionally, if a <> blocks the application of the imported style sheet,
+ the UA must not fetch the style sheet (unless it is loaded through some other link)
+ and must return null for the import rule's CSSImportRule.styleSheet value
+ (even if it is loaded through some other link).
+
+
+ The following rule illustrates how an author can provide fallback rules for legacy user agents
+ without impacting network performance on newer user agents:
+
+
+
+ The [=import conditions=] are given by
+ <>, which is parsed and interpreted as a media query list,
+ and <>, is parsed and interpreted as a [=supports query=].
+ If a <> is given in place of a <>,
+ it must be interpreted as a <>
+ (i.e. the extra set of parentheses is implied)
+ and treated as a <>.
+
+
+ For example, the following two lines are equivalent:
+
+
+ When the same style sheet is imported or linked to a document in multiple places,
+ user agents must process (or act as though they do) each link
+ as though the link were to an independent style sheet.
+
+ Note: This does not place any requirements on resource fetching,
+ only how the style sheet is reflected in the CSSOM and used in specs such as this one.
+ Assuming appropriate caching,
+ it is perfectly appropriate for a UA to fetch a style sheet only once,
+ even though it's linked or imported multiple times.
+
+ The [=cascade origin=] of an imported style sheet is the [=cascade origin=] of the style sheet that imported it.
+
+ The environment encoding of an imported style sheet is the encoding of the style sheet that imported it. [[css-syntax-3]]
+
+
+Content-Type of CSS Style Sheets
+
+ The processing of imported style sheets depends on the actual type of the linked resource:
+
+ * If the resource does not have [=Content-Type metadata=],
+ the type is treated as text/css.
+ * If the host document is in [=quirks mode=],
+ and the host document's origin is [=same origin=]
+ with the linked resource [=/response's=] [=response/URL's=] origin,
+ the type is treated as text/css.
+ * Otherwise, the type is determined from its [=Content-Type metadata=].
+
+ If the linked resource's type is text/css,
+ it must be interpreted as a CSS style sheet.
+ Otherwise, it must be interpreted as a network error.
+
+
+
+Comparing <> Values
+
+ Two <> values are equivalent colors
+ when they compare as equal using the algorithm below.
+ This comparison is used,
+ for example,
+ by ''style()'' container queries [[CSS-CONDITIONAL-5]]
+ and by CSS Transitions [[CSS-TRANSITIONS-1]]
+ to determine whether a color value has changed.
+
+ Given two <> values C1 and C2,
+ they are [=equivalent colors=] if and only if
+ the following algorithm returns true:
+
+
+
+ For each of C1 and C2,
+ convert any [=powerless component=]s to [=missing component=]s.
+
+
+ If C1 and C2 share the same <>:
+
+
+ Compare their components one by one,
+ including the alpha channel.
+ A [=missing component=] is only equal to
+ another [=missing component=].
+ Two numeric components are considered equal
+ if they differ by no more than a small
+ implementation-defined ε.
+
+
+ Return true if and only if
+ all components compare as equal.
+
+
+
+
+ Otherwise, C1 and C2 are in different <>s.
+ If either color has at least one [=missing component=],
+ return false.
+
+
+ Otherwise, neither color has any [=missing component=].
+ Convert both C1 and C2 to ''oklab'',
+ then return true if and only if
+ all components (including alpha) of the converted colors
+ compare as equal,
+ using a standardized Oklab ε of 0.00001.
+
+
+
+ Note: Two colors that are expressed in different <>s
+ but are colorimetrically identical—for example,
+ ''red'' and ''color(srgb 1 0 0)''—are [=equivalent colors=]
+ by step 4 of this algorithm,
+ since they convert to the same ''oklab'' value.
+
+ For the purposes of this comparison,
+ ''rgb()'', ''rgba()'', ''hsl()'', ''hsla()'', ''hwb()'',
+ [=hex colors=], [=named colors=], and [=system colors=]
+ are all considered to be in the ''srgb'' <>.
+
+
+ query-style-color.html
+
if abs(|d|) < 1E-12
let |inv_d| be 1 / |d|
-
let |t1| be (|bmin|[i] - |a|) * |inv_d|
-
let |t2| be (|bmax|[i] - |a|) * |inv_d|
-
let |tnear| be max(min(|t1|, |t2|), |tnear|)
-
let |tfar| be min(max(|t1|, |t2|), |tfar|)
+
let |t1| be (|bmin| [i] - |a| ) * |inv_d|
+
let |t2| be (|bmax| [i] - |a| ) * |inv_d|
+
let |tnear| be max(min(|t1|, |t2|), |tnear| )
+
let |tfar| be min(max(|t1|, |t2|), |tfar| )
@@ -6196,7 +6394,7 @@ Sample Pseudocode for the Ray Trace Gamut Mapping
for (i =0; i < 3; i++):
-
let |result|[i] be |start|[i] + |direction|[i] * |tnear|
+
let |result| [i] be |start| [i] + |direction| [i] * |tnear|
return |result|
@@ -6207,31 +6405,31 @@ Sample Pseudocode for the Ray Trace Gamut Mapping
It is assumed the minimum value is 0
- and that all channels have the same minimum.
- The value should be small relative to the unit type.
+ and that all channels have the same minimum.
+ The value should be small relative to the unit type.
64 bit could easily be as small as 1e-14, but 1e-6 is fine in practice.
1.0 represents the maximum in-gamut channel value,
and it is assumed all channels have the same maximum.
- This places the current color back on the chroma reduction curve,
+ This places the |current| color back on the chroma reduction curve,
if it has deviated.
- This means |origin_rgb| is below the gamut surface,
+ This means |origin_rgb| is below the gamut surface,
so we use it as an anchor closer to the gamut surface.
- This is provided for catastrophic failures
- where a specific, perceptual mapping space
- completely breaks down
+ This is provided for catastrophic failures
+ where a specific, perceptual mapping space
+ completely breaks down
due to ridiculously wide colors (outside the visible spectrum).
It is expected that non-imaginary colors in CSS should never trigger this.
- For typical RGB spaces
+ For typical RGB spaces
where the gamut bounds are 0 and 1 for each component
this simplifies to a single constant
rather than a 3-element array.
- favoring the first intersection in the direction |start| -> |end|.
+ favoring the first intersection in the direction |start| -> |end| .
@@ -6405,7 +6603,7 @@ Resolving Lab and LCH values
lch(52.2345% 72.2 56.2)
- Although the values of a, b and C
+ Although the values of a, b and C
are theoretically unbounded,
there may be an
[=implementation-defined limit for values approaching infinity=].
@@ -6433,7 +6631,7 @@ Resolving Oklab and OkLCh values
oklch(42.1% 0.192 328.6)
- Although the values of a, b and C
+ Although the values of a, b and C
are theoretically unbounded,
there may be an
[=implementation-defined limit for values approaching infinity=].
@@ -6470,7 +6668,7 @@ Resolving values of the ''color()'' function
color(xyz-d65 0.472 0.372 0.131)
- Although the values of r, g, b, x, y and z
+ Although the values of r, g, b, x, y and z
are theoretically unbounded,
there may be an
[=implementation-defined limit for values approaching infinity=].
@@ -6492,7 +6690,7 @@ Resolving values of the ''color()'' function
The computed value
is the corresponding color in its color space.
However, such colors must not be altered by
- 'forced colors mode'.
+ [=forced colors mode=].
For example, in this html:
@@ -6510,7 +6708,7 @@ Resolving values of the ''color()'' function
The ''currentcolor'' keyword computes to itself.
In the 'color' property,
- the used value of ''color>/currentcolor'' is the
+ the used value of ''color>/currentcolor'' is the
resolved [=inherited value=].
In any other property,
its used value is the used value of the 'color' property on the same element.
@@ -6777,7 +6975,18 @@ Serializing sRGB values
During serialization,
any [=missing=] values
- are converted to 0.
+ are converted to 0
+ if the chosen serialization form
+ (such as the legacy color syntax with comma separators,
+ or the
+ HTML-compatible serialization
+ of sRGB values)
+ cannot represent the ''none'' keyword.
+ When at least one component is [=missing=]
+ and the value can be serialized in a form which supports ''none'',
+ the form is chosen as described in
+ [[#css-serialization-of-srgb]]
+ so that [=missing color components=] are preserved as ''none''.
- The color space is sRGB, the representation is 8 bits per component,
- the data format does not produce ''none'' values nor does it support extended range values,
+ The color space is sRGB, the representation is 8 bits per component,
+ the data format does not produce ''none'' values nor does it support extended range values,
and the alpha is 1.
The HTML-compatible serialization is the string "#ff00ff" (not "#FF00FF").
@@ -6814,7 +7023,7 @@ Serializing sRGB values
For example, fill style is set to a dark brown, in CIE Lab:
-
- The alpha is not 1, so the CSS serialization is the string
+ The alpha is not 1, so the CSS serialization is the string
"rgba(255, 0, 255, 0.93)".
CSS serialization of sRGB values
- Corresponding sRGB values use either the ''rgb()'' or ''rgba()'' form
+ If the value has no [=missing color components=],
+ corresponding sRGB values use either the ''rgb()'' or ''rgba()'' form
(depending on whether the (clamped) alpha is exactly 1, or not),
with all ASCII lowercase
letters for the function name.
@@ -6875,7 +7085,77 @@ Serializing sRGB values
to separate the blue component of ''rgba()''
from the alpha value.
-
+ However, the legacy color syntax with comma separators
+ cannot represent ''none''.
+ If the value has at least one [=missing color component=],
+ the serialization form is chosen
+ to preserve those components as the ''none'' keyword,
+ based on the color function of the [=declared value=]:
+
+ * For ''rgb()'' and ''rgba()'' values
+ (the only sRGB form in this list whose syntax accepts ''none'';
+ [=hex colors=], [=named colors=], [=system colors=],
+ deprecated-colors,
+ and ''transparent'' have no parametric syntax
+ and so never have [=missing color components=]),
+ the value is serialized as a ''color()'' function
+ in the ''srgb'' [=color space=]
+ rather than as the modern space-separated form of ''rgb()'',
+ even though that form would also accept ''none'':
+ "color(srgb"
+ followed by a single space,
+ followed by a space-separated list of the three
+ non-alpha components serialized as <>s
+ in the [0, 1] reference range
+ (or as ''none'' if [=missing=]),
+ followed (only if the alpha is non-unity or [=missing=])
+ by " / "
+ and the alpha component
+ (serialized per the
+ alpha rules,
+ or as ''none'' if [=missing=]),
+ followed by ")".
+
+ * For ''hsl()'' and ''hsla()'' values,
+ the value is serialized using the
+ modern (whitespace-separated) ''hsl()'' syntax,
+ with a slash before the alpha component when present.
+ The function name is "hsl" (in
+ ASCII lowercase)
+ regardless of whether the value was authored
+ using the ''hsla()'' alias.
+ The hue is serialized as a canonicalized <> in degrees,
+ the saturation and lightness as <>s,
+ and the alpha
+ (included only if non-unity or [=missing=])
+ per the alpha rules;
+ any [=missing component=] is serialized as the ''none'' keyword.
+
+ * For ''hwb()'' values,
+ the value is serialized using the
+ modern (whitespace-separated) ''hwb()'' syntax,
+ with a slash before the alpha component when present.
+ The function name is "hwb"
+ in ASCII lowercase.
+ The hue is serialized as a canonicalized <> in degrees,
+ the whiteness and blackness as <>s,
+ and the alpha
+ (included only if non-unity or [=missing=])
+ per the alpha rules;
+ any [=missing component=] is serialized as the ''none'' keyword.
+
+ Note: this means that an ''hsl()'' or ''hwb()'' value
+ containing ''none'' round-trips through serialization
+ in its own color function,
+ rather than degrading to ''rgba()'' (whose legacy form cannot represent ''none''),
+ while an ''rgb()'' value containing ''none''
+ is serialized via ''color(srgb …)''.
+ The modern space-separated form of ''rgb()'' could itself represent ''none'',
+ but the [[#serializing-color-values|sRGB CSS serialization]] uses ''color(srgb …)'' instead
+ for consistency with how all other [=color spaces=] are serialized
+ in their non-legacy form.
+ This parallels the behavior of relative color syntax
+ defined in [[css-color-5#serial-origin-color]].
For example, the serialized value of
@@ -6907,6 +7187,34 @@ Serializing sRGB values
+
+ For example, the author-supplied value
+
+
hwb(20 none 30% / none)
+
+ contains [=missing color components=]
+ (both the whiteness and the alpha are ''none''),
+ so it is not serialized through ''rgba()''.
+ Instead, it is serialized using the modern ''hwb()'' syntax as
+
+
hwb(20 none 30% / none)
+
+ preserving each ''none'' value.
+
+
+
+ Similarly, the author-supplied value
+
+
rgb(none 0 0)
+
+ is serialized as
+
+
color(srgb none 0 0)
+
+ because ''rgb()'' (in its serialized legacy comma form)
+ cannot represent ''none''.
+
+
Note: contrary to CSS Color 3,
the parameters of the ''rgb()'' function
are of type <>, not <>.
@@ -7263,14 +7571,14 @@ Serializing other colors
The serialized form of ''currentColor'' is the string "currentcolor".
-
@@ -7284,10 +7592,10 @@ Serializing <>
(i.e. does not use ''calc()'')
it should be serialized as the equivalent
<> (0% maps to 0, 100% maps to 1) value.
- value.
- Otherwise, the specified value
- for an opacity value
- should serialize using
+ value.
+ Otherwise, the specified value
+ for an opacity value
+ should serialize using
the standard serialization for the grammar.
+
For color comparisons in Oklab, standardized ε to be 0.00001
+ (Issue 13157)
+
+
Added a new section defining when two <> values are [=equivalent colors=],
+ covering same-color-space component comparison, the treatment of [=missing component=]s,
+ and cross-color-space comparison via ''oklab''.
+ (Issue 13157)
+
+
Clarified in the main Color interpolation section that, if the hue interpolaton method is not specified, shorter is the default. (This was already specified in the Hue Interpolation section).
+ (Issue 13788)
+
+
Expanded the concept of analogous components to analogous sets of components, to minimize ''none'' → ''0'' conversions
+ (Issue 10210)
+
+
Split color conversion into two stages
+ (Issue 10211)
+
+
Clarified how system colors react to the used color scheme
+ (Issue 13719)
+
Updated abstract to mention color interpolation and gamut mapping.
+
Clarified wording regarding the aims of CSS gamut mapping
+
Corrected ray trace algorithm to not overwrite end
+ (Issue 10579)
+
+
Added pseudocode for the ray trace gamut mapping algorithm
+ (Issue 10579)
+
+
Added EdgeSeeker and Ray Trace Gamut Mapping Algorithms. Allowed choice of three GMA
+ (Issue 10579)
+
+
Added a diagram showing imaginary colors in CIE Lab
+
Differentiated between out of gamut but physically realizable colors, and imaginary colors
+
More even-handed description of clipping,
+ showing some cases which give acceptable results
+ (Issue 10579)
+
+
Fixed discrepency in ΔE2000 sample implementation
+ (Issue 13322)
+
Updated ''AccentColor'' to take its value from 'accent-color', unless in [=Forced Colors Mode=]
(Issue 5900)
@@ -7796,13 +8154,13 @@ Changes
Added display-p3-linear to predefined colorspaces
(Issue 11250)
-
Clarified serializing opacity values with calc()
+
Clarified serializing opacity values with calc()
(Issue 10426)
Interpolation between legacy sRGB colors is (once again) in sRGB space, for compatibility
(Issue 7949)
-
Clarified real-world CIE Lab range for a and b
+
Clarified real-world CIE Lab range for a and b
(Issue 12208)
Clarified that Opacity value does not affect hit testing
@@ -7813,7 +8171,6 @@ Changes
Clarified that inside the color property, it is the resolved inherited value (not the raw inherited value) that is used
Listed categories of colors, such as those that resolve to sRGB or support legacy color syntax
Added hue normalization examples
diff --git a/css-color-5/Overview.bs b/css-color-5/Overview.bs
index 03841e19cfd4..240843095d65 100644
--- a/css-color-5/Overview.bs
+++ b/css-color-5/Overview.bs
@@ -2,9 +2,8 @@
Title: CSS Color Module Level 5
Shortname: css-color
Level: 5
-Status: WD
-Date: 2026-01-13
-Prepare for TR: yes
+Status: ED
+Prepare for TR: no
Group: csswg
TR: https://www.w3.org/TR/css-color-5/
ED: https://drafts.csswg.org/css-color-5/
@@ -19,6 +18,7 @@ Abstract: This module extends CSS Color [[css-color-4]] to add color modificatio
Repository: w3c/csswg-drafts
WPT Path Prefix: css/css-color/
WPT Display: open
+At Risk: Custom Color Spaces, '@color-profile', 'device-cmyk()', Relative Alpha Colors
@@ -125,7 +125,7 @@ Introduction {#intro}
<color> = <> | currentColor | <> |
- <> | <> | <>
+ <> | <> | <>
<color-base> = <> | <> | <> | <> | transparent
<color-function> = <> | <> |
@@ -142,7 +142,7 @@ Introduction {#intro}
* ''currentColor'' (which depends on the value of the 'color' property)
* a <> (which depends on the color mode)
- * <> (which depends on the color mode)
+ * <> (which depends on the color mode)
* <> (which depends on the color mode)
* <> (which has no colorimetric basis)
@@ -237,6 +237,16 @@ Mixing Colors: the ''color-mix()'' Function {#color-mix}
If no color interpolation method is specified, assume Oklab.
Otherwise, use the specified colorspace for mixing.
+
+ For example, these two are exactly equivalent:
+
+
@@ -285,12 +295,14 @@ Otherwise, use the specified colorspace for mixing.
1. [=Normalize mix percentages=] from the list of [=mix items=] passed to the function,
with the "forced normalization" flag set to true,
letting |items| and |leftover| be the result.
+
+ 2. Let |alpha mult| be 1 - |leftover|,
interpreting |leftover| as a number between 0 and 1.
- 4. If |items| is length 1,
+ 3. If |items| is length 1,
set |color| to the color of that sole item,
converted to the specified interpolation <>.
@@ -304,7 +316,10 @@ Otherwise, use the specified colorspace for mixing.
Let |combined percentage| be the sum of |a| and |b|’s percentages.
2. Interpolate |a| and |b|’s colors
as described in [[css-color-4#interpolation]],
- with a progress percentage equal to (|b|’s percentage) / |combined percentage|).
+ with a progress percentage equal to
+ (|b|’s percentage) / |combined percentage|),
+ if |combined percentage| is greater than 0,
+ and 0.5 otherwise.
If the specified color space is a [=cylindrical polar color=] space,
then the <> controls the
interpolation of hue, as described in
@@ -315,8 +330,8 @@ Otherwise, use the specified colorspace for mixing.
and a percentage of |combined percentage|,
and [=stack/push=] it onto |item stack|.
3. Set |color| to the color of the sole remaining item in |item stack|.
- 5. Multiply the alpha component of |color| by |alpha mult|.
- 6. Return |color|.
+ 4. Multiply the alpha component of |color| by |alpha mult|.
+ 5. Return |color|.
Note: In [=cylindrical polar color=] spaces,
mixing is order-dependent,
@@ -439,6 +454,23 @@ Otherwise, use the specified colorspace for mixing.
oklch(0% 0 none / 0)
+
+ In this example three colors are mixed,
+ and no percentages are given
+ so each color contributes one-third of the final result.
+
+
color-mix(in oklab, teal, olive, blue);
+
+ The calculation is as follows:
+ * teal (#008080) is oklab(54.31% -0.0896 -0.0236)
+ * olive (#808000) is oklab(58.07% -0.0428 0.1191)
+ * blue (#0000FF) is oklab(45.20% -0.0325 -0.3115)
+ * mixed lightness is (54.31 + 58.07 + 45.20) / 3 = 52.53%
+ * mixed a is (-0.0896 + -0.0428 + -0.0325) / 3 = -0.0550
+ * mixed b is (-0.0236 + 0.1191 + -0.3115) / 3 = -0.0720
+ * mixed result is oklab(52.53% -0.0550 -0.0720)
+
+
Effect of Mixing Color Space on color-mix
@@ -1052,6 +1084,9 @@ in the range [0, 360].
relative-currentcolor-lab-01.html
relative-currentcolor-rec2020-02.html
relative-currentcolor-visited-getcomputedstyle.html
+ parsing/alpha-color-computed.html
+ parsing/alpha-color-parsing-invalid.html
+ parsing/alpha-color-parsing-valid.html
parsing/color-computed-relative-color.html
parsing/color-invalid-relative-color.html
parsing/color-valid-relative-color.html
@@ -1746,6 +1781,12 @@ The color components of the [=origin color=] are unchanged,
the alpha component is modified or replaced.
The result of this function is in the color space of the origin color.
+
+ parsing/alpha-color-computed.html
+ parsing/alpha-color-parsing-invalid.html
+ parsing/alpha-color-parsing-valid.html
+
+
For example, here the result is the same as the origin color,
but the alpha is changed to 80%
@@ -2035,7 +2076,7 @@ or any other color or monochrome output device which has been characterized.
The ''@color-profile'' rule accepts the descriptors defined in this specification.
-
+
Name: src
Value: <>
For: @color-profile
@@ -2167,7 +2208,7 @@ or any other color or monochrome output device which has been characterized.
but fall just inside the gamut.
-
+
Name: components
Value: <>#
For: @color-profile
@@ -2745,21 +2786,102 @@ or any other color or monochrome output device which has been characterized.
Reacting to the used color-scheme: the ''light-dark()'' Function
- System colors have the ability to react to the current used ''color-scheme'' value.
+ [=System colors=] have the ability to react to an element's [=color scheme=].
The ''light-dark()'' function exposes the same capability to authors.
+ There are two forms of this function: one takes a pair of colors
+ while the other takes a pair of images.
+ Attempting to use one image and one color
+ will result in a parse-time error.
+
+
+
- This function computes to the computed value of the first color,
- if the used color scheme is ''light'' or unknown,
+ For the color form, this function computes to the computed value of the first color,
+ if the element color scheme is ''light'',
or to the computed value of the second color,
- if the used color scheme is ''dark''.
+ if the element color scheme is ''dark''.
+
+ For the image form, this function returns the first image,
+ if the element color scheme is ''light'',
+ or the second image,
+ if the element color scheme is ''dark''.
+
+ The none keyword
+ computes to ''image(transparent)''
+ (a fully transparent image with no natural size).
+
+
+ For example, to maintain a legible contrast on links,
+ for light mode and dark mode:
+
+
+
+ The traditional blue link text
+ is legible on a white background
+ (WCAG contrast 8.59:1, AAA pass)
+ but would not be legible on a black background
+ (WCAG contrast 2.44:1, AA fail).
+ Instead, a lighter blue #81D9FE
+ is used in dark mode.
+ (WCAG contrast 13.28:1, AAA pass).
+
+
+
Legible link text
+
Illegible link text
+
Legible link text
+
+
+
+
+ For example, to provide easily visible list bullets
+ for light mode and dark mode:
+
+
+
+
light-dark-basic.html
light-dark-currentcolor.html
+ light-dark-image.html
+ light-dark-image-none-interpolation.html
+ light-dark-image-none.html
light-dark-inheritance.html
light-dark-currentcolor-in-color.html
/css/css-pseudo/highlight-styling-004.html
@@ -2802,9 +2924,12 @@ or any other color or monochrome output device which has been characterized.
contrast-color-001.html
+ contrast-color-currentcolor-inherited.html
+ animation/contrast-color-interpolation.html
parsing/color-computed-contrast-color-function.html
parsing/color-invalid-contrast-color-function.html
parsing/color-valid-contrast-color-function.html
+ parsing/contrast-color-function-calc-container.html
- - else, |p1| is serialized as is.
- - else if ONLY the first percentage |p1| is specified:
- - if |p1| is equal to 50%, nothing is serialized.
- - else, |p1| is serialized as is.
- - else if ONLY the second percentage |p2| is specified:
- - if |p2| equals 50%, nothing is serialized.
- - if |p2| is not ''calc()'', the value of 100% - |p2| is serialized.
- - else, nothing is serialized.
- - else if NEITHER is specified:
- - nothing is serialized.
-
-The serialization of the second percentage of a declared value of a ''color-mix()'' function is defined as:
-
- - If BOTH the first percentage p1 and second percentages p2 are specified:
- - if neither p1 nor p2 is calc(), and p1 + p2 equals 100%, nothing is serialized.
- - else, p2 is serialized as is.
- - else if ONLY the first percentage p1 is specified:
- - nothing is serialized.
- - else if ONLY the second percentage p2 is specified:
- - if p2 equals 50%, nothing is serialized.
- - if p2 is not calc(), nothing is serialized.
- - else, p2 is serialized as is.
- - else if NEITHER is specified:
- - nothing is serialized.
-
-Note: ''calc()'' values are consider to be unknown,
-so are never equal 50%,
-and never sum with something else to equal 100%.
+Each color argument is serialized as
+the serialized <>,
+followed by, if a percentage is serialized for this argument (see below),
+ " " and the serialized percentage.
+
+Each color argument is serialized individually;
+in particular,
+identical colors are not collapsed into a single argument.
+
+The serialized percentages
+of the declared value of a ''color-mix()'' function
+are determined as follows.
+Let |N| be the number of color arguments.
+
+For each argument,
+let its effective percentage be:
+ - its specified <>,
+ if one was explicitly provided
+ and is not a ''calc()'' expression;
+ - if its <> was omitted,
+ and none of the other specified <>s
+ are ''calc()'' expressions:
+ (100% − |specified sum|) / |omitted count|,
+ where |specified sum| is the sum of the explicitly specified <>s
+ and |omitted count| is the number of arguments
+ with omitted <>s;
+ - otherwise, unknown.
+
+If all [=effective percentage=]s are known
+and equal to 100% / |N|,
+no percentages are serialized.
+Otherwise, each argument's percentage is serialized as follows:
+ - If a <> was explicitly specified,
+ it is serialized as-is.
+ - If a <> was omitted
+ and none of the other specified <>s
+ are ''calc()'' expressions:
+ the value
+ (100% − |specified sum|) / |omitted count|
+ is serialized,
+ where |specified sum| and |omitted count| are as defined above.
+ - Otherwise (a <> was omitted
+ but another argument has a ''calc()'' <>):
+ nothing is serialized.
+
+Note: ''calc()'' values are considered unknown,
+so are never equal to 100% / |N|,
+and prevent computation of omitted <>s.
For example, the serialized declared value of
color-mix(in oklab, teal, peru 40%)
- would be the string "color-mix(in oklab, teal 60%, peru)".
+ would be the string "color-mix(teal 60%, peru 40%)":
+ the color space is omitted because it is the default (''oklab''),
+ and all percentages are serialized
+ because they are not all equal to 100%/2 = 50%.
The serialized declared value of
color-mix(in oklab, teal 50%, peru 50%)
- would be the string "color-mix(in oklab, teal, peru)".
+ would be the string "color-mix(teal, peru)":
+ both percentages equal 100%/2 = 50%, so they are all omitted.
The serialized declared value of
color-mix(in oklab, teal 70%, peru 70%)
- would be the string "color-mix(in oklab, teal 70%, peru 70%)"
- because the fact that these normalize to 50% each
- is only discovered after percentage normalization.
+ would be the string "color-mix(teal 70%, peru 70%)":
+ the specified percentages are 70%, not 50%,
+ so they are not omitted,
+ even though they normalize to 50% each during computation.
+
+ The serialized declared value of
+
color-mix(in oklch longer hue, red, green, blue)
+ would be the string "color-mix(in oklch longer hue, red, green, blue)":
+ the color space (''oklch'') is not the default,
+ the hue interpolation method (''longer'') is not the default (''shorter''),
+ and all percentages equal 100%/3, so they are all omitted.
+
+ The serialized declared value of
+
color-mix(red 50%, green, blue)
+ would be the string "color-mix(red 50%, green 25%, blue 25%)":
+ the percentages are not all equal to 100%/3,
+ so all are serialized,
+ including the omitted ones
+ which each get (100% − 50%) / 2 = 25%.
The serialization of the result of a ''color-mix()'' function
@@ -3168,6 +3333,16 @@ depends on the color space specified with "in":
+However, if the result of mixing in the ''hsl'' or ''hwb'' [=color space=]
+has at least one [=missing color component=]
+(including a [=missing=] alpha [=carried forward=]
+per [[css-color-4#interpolation-missing]]),
+the form used is the modern ''hsl(h s l / a)'' or ''hwb(h w b / a)'' syntax respectively,
+preserving the original color function and each ''none'' value
+per [[css-color-4#css-serialization-of-srgb]],
+rather than degrading to ''color(srgb r g b)'' (which would lose
+the ''hsl''/''hwb'' identity).
+
parsing/color-valid-color-mix-function.html
color-mix-currentcolor-visited-getcomputedstyle.html
@@ -3351,6 +3526,23 @@ while the serialization of the computed value
is the string "color(srgb 0.55 0.45 0.45)".
+
+For example, the serialization of the declared value of
+
+
hsl(from rebeccapurple none none none / none);
+
+is the string "hsl(from rebeccapurple none none none / none)".
+
+The computed value carries forward the [=missing=] alpha
+(alpha is its own [=analogous components|analogous component=]),
+giving an ''hsl()'' [=relative color=]
+whose hue, saturation, lightness, and alpha are all [=missing=].
+Because the resolved value contains [=missing color components=],
+the serialization uses the modern ''hsl()'' form,
+yielding the string "hsl(none none none / none)"
+rather than ''color(srgb 0 0 0 / none)''.
+
+
For example, the serialization of the declared value of
@@ -3459,6 +3651,19 @@ depends on the color space of the [=relative color=]:
+However, if the resolved value of an ''hsl()'' or ''hwb()'' [=relative color=]
+has at least one [=missing color component=]
+(including a [=missing=] alpha [=carried forward=]
+from the [=origin color=] per [[css-color-4#interpolation-missing]]),
+the form used is the modern ''hsl(h s l / a)'' or ''hwb(h w b / a)'' syntax respectively,
+preserving the original color function and each ''none'' value,
+rather than degrading to ''color(srgb r g b)'' (which would lose
+the ''hsl''/''hwb'' identity).
+This parallels [[#serial-origin-color]],
+which always emits the modern slash syntax for origin colors,
+and follows the general sRGB serialization rules in
+[[css-color-4#css-serialization-of-srgb]].
+
@@ -3700,6 +3905,43 @@ This specification adds a way to ensure adequate contrast for text whose backgro
Changes
+
Removed special casing of 100% from the color-mix() algorithm,
+ thus avoiding a discontinuity near fully-transparent colors
+ (Issue 14014),
+ (Issue 13996)
+
+
+ Guarded against division by zero in the color-mix() algorithm
+ (Issue 14013),
+ (Issue 13996)
+
+
Added a backlink from Color Interpolation in this specification,
+ to the same section in CSS Color 4 where most of this is defined
+ (Issue 13788)
+
+
Added a second form of the light-dark() function,
+ which takes a pair of images rather than a pair of colors
+ (Issue 12513)
+
+
Added a "none" option to the image form of light-dark()
+ (Issue 12513)
+
+
Added a color-mix() example with three colors, now that it is no longer restricted to just two.
+
Updated color-mix() serialization:
+ omit color space when it is the default (oklab),
+ serialize hue interpolation method when non-default,
+ generalize percentage rules for N colors
+ (omit all when equal to 100%/N, otherwise serialize all),
+ and clarify that identical colors are not collapsed
+ (Issue 13320)
+
diff --git a/css-color-adjust-1/Overview.bs b/css-color-adjust-1/Overview.bs
index ab79a23479fd..6add2cb7d4d6 100644
--- a/css-color-adjust-1/Overview.bs
+++ b/css-color-adjust-1/Overview.bs
@@ -20,7 +20,6 @@ Editor: Tab Atkins Jr., Google, http://www.xanthir.com/contact/, w3cid 42199
Abstract: This module introduces a model and controls over automatic color adjustment by the user agent to handle user preferences, such as "Dark Mode", contrast adjustment, or specific desired color schemes.
Ignored Terms: -webkit-tap-highlight-color, name, the head element
WPT Path Prefix: css/css-color-adjust/
-WPT Display: open
spec:css2; type:dfn; text:canvas
@@ -124,30 +123,131 @@ Preferred Color Schemes {#preferred}
consists of the opposite,
with dark background colors and light foreground/text colors.
- Advisement: The [=light=] and [=dark color schemes=]
- don't represent an exact color palette (such as black-and-white),
+ Note: [=Light=] and [=dark=] [=color schemes=]
+ are not specific color palettes,
but a range of possible palettes.
- To guarantee specific colors, authors must specify those colors themselves.
+ For example,
+ a stark black-on-white scheme and a sepia dark-on-tan scheme
+ would both be considered [=light color schemes=].
+ To guarantee specific colors, authors must specify those colors themselves.
Note also that, consequently,
pairing default or <> colors with author-specified colors
cannot guarantee any particular contrast level;
- it might be necessary to set both foreground and background colors together
- to ensure legibility [[WCAG22]].
-
- To enable pages to adapt to the user's [=preferred color scheme=],
- user agents will match the '@media/prefers-color-scheme' media query
- to the user's [=preferred color scheme=].
- [[!MEDIAQUERIES-5]]
- Complementing this, the 'color-scheme' property defined here
- lets the author indicate appropriate [=color schemes=]
- for UA-provided UI and colors in the page.
+ to ensure legibility,
+ generally either both foreground and background should be paired [=system colors=]
+ or both be manually specified colors.
+ [[WCAG22]]
+
+ The user's [=preferred color scheme=]
+ is then combined with the [=page's supported color schemes=]
+ to produce a page color scheme.
+ The [=page color scheme=] also records whether it's default or not.
+ The [=page color scheme=] is queryable with the '@media/prefers-color-scheme' [=media query=]. [[!MEDIAQUERIES-5]]
+
+ Individual elements have an element color scheme,
+ which by default matches the [=page color scheme=],
+ but can be overriden using the 'color-scheme' property.
+ The [=element color scheme=] affects things such as the value of [=system colors=] on the element,
+ the value of the ''light-dark()'' function,
+ and how user interface elements (like scrollbars) render.
+ (See [[#color-scheme-effect]].)
User agents may support additional [=color schemes=],
however CSS does not support negotiation of additional [=color schemes=]:
user agents should pursue standardization of these schemes,
so that '@media/prefers-color-scheme' and 'color-scheme' can reflect the additional values.
-Opting Into a Preferred Color Scheme: the 'color-scheme' property {#color-scheme-prop}
+ Note: Because many pages were authored before [=color scheme=] support existed,
+ and thus pages were authored with the assumption of the default ([=light=]) color scheme,
+ user agents cannot automatically adapt the colors used in elements under their control,
+ as it might cause unreadable color contrast with the surrounding page.
+ Pages have to opt into [=color scheme=] support
+ by setting the [=page color scheme=],
+ or manually setting the 'color-scheme' property on individual elements.
+
+Opting Into a Preferred Color Scheme {#color-scheme-page}
+------------------------------------
+
+ The [=page color scheme=]
+ represents the [=color scheme=] that will be used for the page overall
+ (queryable with the ''prefers-color-scheme'' [=media feature=])
+ and for all elements that don't specifically override the [=page color scheme=] with the 'color-scheme' property.
+ See [[#color-scheme-effect]] for a full description of what the [=color scheme=] effects.
+
+ Note: In HTML, the <{meta/name/color-scheme|color-scheme <meta>}>
+ sets the [=page color scheme=].
+
+ Authors should generally set the [=page color scheme=],
+ rather than using the 'color-scheme' property,
+ so that the '@media/prefers-color-scheme' [=media feature=]
+ is consistent with the elements on the page.
+
+ The [=page color scheme=] is determined by finding the [=used color scheme=],
+ given the [=preferred color scheme=]
+ and the page's supported color schemes
+ (a [=color scheme support=]).
+
+ In embedded documents
+ (such as an <{iframe}> or an SVG <{img}>),
+ the embedding element's [=element color scheme=]
+ is used as the embedded document's [=preferred color scheme=]
+ (treated as a normal [=color scheme preference=]),
+ rather than the user's preference.
+ This allows embedded documents to match the negotiated color scheme
+ for the page or an element,
+ similar to other elements in the parent document.
+
+
+
+ A page that responds to user preferences for light or dark display
+ by using the ''@media/prefers-color-scheme'' media feature
+ to alter the colors it uses
+ can easily opt the browser-controlled UI
+ (scrollbars, inputs, etc)
+ to match
+ with a simple global declaration:
+
+
+
+
+
+ (Or, in languages that don't have a way to set the [=page color scheme=] directly,
+ a '':root { color-scheme: light dark;}'' rule.)
+
+ If a page limits itself to using only the <>s,
+ the 'color-scheme' declaration
+ will support the user's preferred color scheme
+ even without the author needing to use ''@media'' at all.
+
+
+
+ If a page cannot reasonably accommodate all color schemes,
+ such as for branding or theatrical reasons,
+ <{meta/name/color-scheme}> or 'color-scheme'
+ can still indicate which color schemes the page can support,
+ causing the UI to match.
+
+ If the page's color scheme is primarily light,
+ the following will indicate that explicitly:
+
+
+
+
+
+ While if the page is primarily dark,
+ indicating that explicitly will make the page look more coherent as well:
+
+
+
+
+
+ However, it is better to support both color schemes,
+ of course.
+
+
+
+
+Overriding the Page Color Scheme: the 'color-scheme' property {#color-scheme-prop}
-----------------------------------------------------------------
@@ -156,7 +256,7 @@ Opting Into a Preferred Color Scheme: the 'color-scheme' property {#color-scheme
Initial: normal
Applies to: all elements and text
Inherited: yes
- Computed Value: the keyword ''normal'', or an ordered list of specified color scheme keywords
+ Computed Value: the keyword ''normal'', or a [=color scheme support=]
Animation type: discrete
@@ -184,48 +284,34 @@ Opting Into a Preferred Color Scheme: the 'color-scheme' property {#color-scheme
rendering/dark-color-scheme/color-scheme-visited-link-initial.html
- While the prefers-color-scheme media feature
- allows an author to adapt the page’s colors to the user’s preferred color scheme,
- many parts of the page are not under the author's control
- (such as form controls, scrollbars, etc).
- The 'color-scheme' property allows an element to indicate
- which [=color schemes=] it is designed to be rendered with.
- These values are negotiated with the user's preferences,
- resulting in a used color scheme
- that affects things such as
- the default colors of form controls and scrollbars.
- (See [[#color-scheme-effect]].)
-
- Note: Because many pages were authored before color scheme support existed,
- user agents cannot automatically adapt the colors used in elements under their control,
- as it might cause unreadable color contrast with the surrounding page.
-
- Host languages can define the page's supported color schemes,
- a list of [=color schemes=] supported by default for all elements on that page.
-
- Note: [[HTML]] specifies a
- color-scheme
- <{meta}> tag which can be used to set the [=page's supported color schemes=].
-
+ While the [=page color scheme=] should generally be used
+ to control what [=color scheme=] a page uses,
+ occasionally there is need to override that [=color scheme=]
+ on a particular subtree.
+ The 'color-scheme' property allows this,
+ manually setting the [=element color scheme=]
+ for an element and its descendants.
Values are defined as follows:
: normal
::
- Indicates that the element supports the [=page's supported color schemes=],
- if they are set, or that it supports no [=color schemes=] at all otherwise.
+ The [=element color scheme=] is the same as the [=page color scheme=].
+ (This includes noting whether the [=color scheme=] was [=color scheme/defaulted=].)
: light
- ::
- Indicates that the element supports a [=light color scheme=].
-
: dark
::
- Indicates that the element supports a [=dark color scheme=].
+ Indicates that the element supports a [=light=] and/or [=dark=] color scheme,
+ as appropriate.
+ The element's [=color scheme support=] will include the keywords,
+ in the order they're specified.
: only
::
Forbids the user agent from [=overriding the color scheme=] for the element.
+ The element's [=color scheme support=] will have a flag
+ indicating sole support.
: <>
::
@@ -245,95 +331,11 @@ Opting Into a Preferred Color Scheme: the 'color-scheme' property {#color-scheme
are not valid <>s in this property.
- Note: [=Light=] and [=dark=] [=color schemes=]
- are not specific color palettes.
- For example,
- a stark black-on-white scheme and a sepia dark-on-tan scheme
- would both be considered [=light color schemes=].
- To ensure particular foreground or background colors,
- they need to be specified explicitly.
-
-
- To determine the used color scheme of an element:
-
- 1. If the user's [=preferred color scheme=],
- as indicated by the prefers-color-scheme media feature,
- is present among the listed [=color schemes=],
- and is supported by the user agent,
- that's the element's [=used color scheme=].
-
- 2. Otherwise,
- if the user has indicated an overriding preference for their chosen color scheme,
- and the ''only'' keyword is not present in 'color-scheme' for the element,
- the user agent must [=override the color scheme=]
- with the user's [=preferred color scheme=].
- See [[#color-scheme-override]].
-
- 3. Otherwise,
- if the user agent supports at least one of the listed [=color schemes=],
- the [=used color scheme=] is
- the first supported [=color scheme=] in the list.
-
- 4. Otherwise,
- the [=used color scheme=] is the browser default.
- (Same as ''color-scheme/normal''.)
-
-
- Note: User agents are not required
- to support any particular [=color scheme=],
- so only using a single keyword,
- such as ''color-scheme: dark'',
- to indicate a required [=color scheme=]
- is still not guaranteed to have any effect on the rendering of the element.
-
-
- A page that responds to user preferences for light or dark display
- by using the prefers-color-scheme media feature
- to alter the colors it uses
- can easily opt the browser-controlled UI
- (scrollbars, inputs, etc)
- to match
- with a simple global declaration:
-
-
- :root {
- color-scheme: light dark;
- }
-
-
- If a page limits itself to using only the <>s,
- the 'color-scheme' declaration, above,
- will support the user's preferred color scheme
- even without the author needing to use ''@media'' at all.
-
-
-
- If a page cannot reasonably accommodate all color schemes,
- such as for branding or theatrical reasons,
- 'color-scheme' can still indicate which color schemes the page can support,
- causing the UI to match.
-
- If the page's color scheme is primarily light,
- the following will indicate that explicitly:
-
-
- :root {
- color-scheme: light;
- }
-
-
- While if the page is primarily dark,
- indicating that explicitly will make the page look more coherent as well:
-
-
- :root {
- color-scheme: dark;
- }
-
-
- However, it is better to support both color schemes,
- of course.
-
+ If an element has any value other than ''color-scheme: normal'',
+ its [=element color scheme=] is determined by finding the [=used color scheme=],
+ given the user's [=preferred color scheme=]
+ and the element's [=color scheme support=]
+ specified by this property.
A page might be generally capable of handling multiple color schemes,
@@ -344,22 +346,21 @@ Opting Into a Preferred Color Scheme: the 'color-scheme' property {#color-scheme
showing off the light or dark theme specifically.
This can be indicated as:
-
- :root {
- color-scheme: light dark;
- }
-
- .light-theme-example {
- color-scheme: light;
- }
+
+
+
+
Only the subsections rooted at ''.light-theme-example'' or ''.dark-theme-example''
- will be opted into the ''light'' or ''dark'' themes specifically;
+ will be opted into the [=light=] or [=dark=] themes specifically;
the rest of the page will respect the user's preference.
@@ -368,33 +369,125 @@ Opting Into a Preferred Color Scheme: the 'color-scheme' property {#color-scheme
beyond what the first instance of the keyword provides.
+Resolving Color Schemes {#color-scheme-resolution}
+-----------------------
+
+ While it's important for a page to respect the user's preferred [=color scheme=],
+ it's also important to only use a [=color scheme=] the page author expects,
+ or else it is very easy to render a page unreadable
+ by causing the foreground and background elements to accidentally have minimal (or zero!) contrast.
+
+ For example, an author expecting the default light color scheme
+ might set the page background to a light cream
+ while leaving the text color unset,
+ expecting it to use the default black text color.
+ If the page unexpectedly opted into a user's preferred [=dark color scheme=],
+ however,
+ and adjusted the default text color to white,
+ that would make the text virtually unreadable.
+
+ To balance these competing concerns,
+ a user's [=color scheme preference=]
+ is compared against a page's [=color scheme support=]
+ to produce a used [=color scheme=].
+
+ A color scheme preference
+ is either no preference,
+ a [=color scheme=] preference ([=light=] or [=dark=]),
+ or an overriding [=color scheme=] preference.
+
+ A color scheme support
+ is null,
+ or an ordered list of one or more supported [=color schemes=],
+ along with a flag indicating whether or not it solely supports the indicated [=color schemes=].
+
+
+ To determine the used color scheme,
+ given a [=color scheme support=] |support|
+ and a [=color scheme preference=] |preference|:
+
+ 1. If |support| is null,
+ or none of the [=color schemes=] in |support|
+ are supported by the UA,
+ return the UA default [=color scheme=],
+ and annotate that this [=color scheme=] was [=color scheme/defaulted=].
+
+ 1. If |preference| is no preference,
+ return the first supported [=color scheme=] in |support|.
+
+ 1. If |preference|'s [=color scheme=] is in |support|
+ and supported by the UA,
+ return that [=color scheme=].
+
+ 1. If |support| is flagged as sole support,
+ return the first supported [=color scheme=] in |support|.
+
+ 1. If |preference| is an [=overriding preference=],
+ return |preference|'s [=color scheme=].
+ If this [=color scheme=] is used as an [=element color scheme=],
+ also [=override the color scheme=] on the element
+ to this [=color scheme=].
+
+ 1. Otherwise,
+ return the first supported [=color scheme=] in |support|.
+
+ Note: The basic logic here is that,
+ if the page hasn't opted into color schemes at all (null |supports|),
+ we go with the safe UA default that it was probably implicitly designed for.
+ If there is a usable |supports|,
+ and it matches |preference|,
+ we use the preference.
+ Otherwise |preference| and |supports| disagree,
+ and we go back and forth down the preference hierarchy to see who wins:
+ sole support in |support| wins,
+ then overriding preference in |preference| wins
+ (and we adjust the element's colors to make sure this actually works),
+ then |support| finally wins.
+
+
+ Note: User agents are not required
+ to support any particular [=color scheme=],
+ so only using a single keyword,
+ such as ''color-scheme: dark'',
+ to indicate a required [=color scheme=]
+ is still not guaranteed to have any effect on the rendering of the element.
+
+ Note: User agents might not actually support preference levels in a [=color scheme preferences=].
+ At the time of writing,
+ UAs generally only support an ordinary [=light=] or [=dark=] preference,
+ which considerably simplifies the above logic.
+
+
Effects of the Used Color Scheme {#color-scheme-effect}
--------------------------------
For all elements,
- the user agent must match the following to the [=used color scheme=]:
+ the user agent must match the following to the [=element color scheme=]:
* the default colors of scrollbars and other interaction UI
* the default colors of form controls and other "specially-rendered" elements
* the default colors of other browser-provided UI, such as "spellcheck" underlines
+ * the value of [=system colors=]
+ * the value of the ''light-dark()'' function
On the root element,
- the [=used color scheme=] additionally must affect
+ the [=element color scheme=] additionally must affect
the surface color of the [=canvas=],
and the viewport's scrollbars.
In order to preserve expected color contrasts,
in the case of embedded documents typically rendered over a transparent [=canvas=]
(such as provided via an HTML <{iframe}> element),
- if the [=used color scheme=] of the element
- and the [=used color scheme=] of the embedded document’s root element
+ if the [=element color scheme=] of the element
+ and the [=element color scheme=] of the embedded document’s root element
do not match,
then the UA must use an opaque [=canvas=] of the ''Canvas'' color
- appropriate to the embedded document’s [=used color scheme=]
+ appropriate to the embedded document’s root element's [=element color scheme=]
instead of a transparent canvas.
This rule does not apply to documents embedded
via elements intended for graphics
- (such as <{img}> elements embedding an SVG document).
+ (such as <{img}> elements embedding an SVG document);
+ their canvases remain the default transparent regardless.
Note: Aside from the small list of adjustments given above,
user agents generally do not further adjust a page
@@ -408,12 +501,11 @@ Effects of the Used Color Scheme {#color-scheme-effect}
Overriding the Color Scheme {#color-scheme-override}
---------------------------
-If the user has indicated an overriding preference for a particular color scheme,
+If the user has indicated an [=color scheme/overriding preference=] for a particular color scheme that the author does not explicitly support,
and the author has not disallowed this (by using the ''only'' keyword),
-the user agent may override the color scheme,
-forcing the [=used color scheme=] to the user's [=preferred color scheme=].
-If the element does not support that [=color scheme=],
-the user agent must also auto-adjust other colors into this chosen [=color scheme=],
+the user agent must override the color scheme:
+in addition to the effects described in [[#color-scheme-effect]],
+it must also auto-adjust other colors into this chosen [=color scheme=],
such as by inverting their brightness,
while preserving any color contrast necessary for readability of the page.
In this case, UA may also auto-adjust colors within replaced elements, background images, and other external resources as appropriate.
@@ -1193,6 +1285,15 @@ Privacy Considerations {#privacy}
for discussion on this topic.
+ Embedded documents (even cross-origin ones)
+ recieve their embedding element's [=element color scheme=]
+ as their [=preferred color scheme=],
+ which is technically a bit of cross-site communication.
+ This was not considered a significant problem by browser security reviewers,
+ and the user benefit of having pages and, particularly, SVG images
+ automatically adapt to the parent page's color scheme
+ was considered valuable enought to warrant it.
+
Security Considerations {#security}
===================================
diff --git a/css-color-hdr-1/Overview.bs b/css-color-hdr-1/Overview.bs
index 462a47b36b21..9ee820929175 100644
--- a/css-color-hdr-1/Overview.bs
+++ b/css-color-hdr-1/Overview.bs
@@ -529,7 +529,8 @@ Mixing Dynamic Range Limits: the ''dynamic-range-limit-mix()'' function {#dynami
<> | <> | <> | <> |
<> | <> | <> |
<> |
- <>
+ <> |
+ <>
ictcp() = ictcp([from <>]?
[<> | <> | none]
[<> | <> | none]
@@ -1894,7 +1895,11 @@ in a user stylesheet.
-
+
+
Added missing hdr-color() to the grammar of the color function
+
Added missing Jzazbz_to_XYZ to sample code
+ #9934
+
Removed mention of SMPTE-ST-2094-50 as justification for eps
(#12873,
#11788)
diff --git a/css-conditional-5/Overview.bs b/css-conditional-5/Overview.bs
index 10fd5bd0997d..f48574071950 100644
--- a/css-conditional-5/Overview.bs
+++ b/css-conditional-5/Overview.bs
@@ -31,12 +31,6 @@ WPT Display: open
@@ -118,44 +119,58 @@ Extensions to the ''@supports'' rule
<supports-feature> = <>
| <> | <>
| <> | <>
- | <>
+ | <> | <>
<supports-decl> = ( [ <> | <> ] )
<supports-font-tech-fn> = font-tech( <> )
<supports-font-format-fn> = font-format( <> )
<supports-at-rule-fn> = at-rule( <> )
<supports-named-feature-fn> = named-feature( <> )
+ <supports-env-fn> = env( <> )
- : <>
- ::
- The result is true if the UA
- supports the named condition.
- If the name is not recognized,
- the result is false.
-
- : <>
- ::
- The result is true if the UA
- supports the font tech
- provided as an argument to the function.
-
- : <>
- ::
- The result is true if the UA
- supports the font format
- provided as an argument to the function.
-
- : <>
- ::
- The result is true if the UA
- supports the at-rule
- provided as an argument to the function.
-
- : <>
- ::
- The result is true if the UA
- supports the named feature
- provided as an argument to the function.
+ <declaration> here matches anything that would be successfully parsed by [=consume a declaration=],
+ ignoring the context-validation check at the end of that algorithm.
+ Notably, this includes a trailing ''!important'',
+ which is valid but ignored for the purpose of ''@supports''.
+
+