@@ -24,20 +24,15 @@ spec:css-color-4; type:property; text:color
24
24
spec:fill-stroke-3; type:property;
25
25
text:fill
26
26
text:stroke
27
- spec: webdriver; urlPrefix: https://w3c.github.io/webdriver/#; type: dfn;
28
- text: error; url: dfn-error
29
- text: getting a property; url: dfn-getting-properties
30
- text: remote end steps; url: dfn-remote-end-steps
27
+ spec: html; urlPrefix: https://html.spec.whatwg.org/multipage/; type: dfn;
28
+ text: navigable; for:Window; url: nav-history-apis.html#window-navigable
29
+ text: top-level traversable; for:/; url: document-sequences.html#top-level-traversable
31
30
</pre>
32
31
33
32
<pre class=anchors>
34
33
url: https://html.spec.whatwg.org/multipage/semantics.html#meta-color-scheme;
35
34
type: attr-value; for: meta/name; spec: html; text: color-scheme;
36
35
</pre>
37
- <pre class=anchors>
38
- url: https://262.ecma-international.org/5.1/#sec-4.3.11; type: dfn;
39
- spec: ecmascript; text: null;
40
- </pre>
41
36
42
37
<link rel="stylesheet" href="style.css" />
43
38
@@ -492,12 +487,11 @@ Forced Color Palettes {#forced}
492
487
''prefers-color-scheme/light'' or ''prefers-color-scheme/dark''
493
488
as the user’s preferred color scheme.
494
489
495
- If the [=current forced colors mode automation theme=] is not
496
- "{{ForcedColorsModeAutomationTheme/none}} ", the user agent should first verify that
497
- it is in an automation context (see [[WebDriver#security|WebDriver's Security
498
- considerations]]). The user agent should then bypass the above operating system
499
- color themes, and instead do the following based on the value of the
500
- [=current forced colors mode automation theme=] :
490
+ If [=get emulated forced colors theme data=]
491
+ is not "{{ForcedColorsModeAutomationTheme/none}} ",
492
+ the user agent should bypass the above operating system color themes,
493
+ and instead do the following based on the resulting value of
494
+ [=emulated forced colors theme data=] :
501
495
502
496
: "{{ForcedColorsModeAutomationTheme/light}} "
503
497
:: Act as if the user has enabled <a>forced colors mode</a> with the
@@ -1096,20 +1090,17 @@ The 'color-adjust' Shorthand {#color-adjust}
1096
1090
inheritance.html
1097
1091
</wpt>
1098
1092
1099
- Automation {#color-adjust-automation }
1093
+ Emulation {#color-adjust-emulation }
1100
1094
===================================
1101
- For the purposes of user agent automation and website testing, this document
1102
- defines the below [[WebDriver]] [=extension commands=] .
1095
+ For the purposes of user agent automation and application testing, this document
1096
+ defines the below emulations .
1103
1097
1104
- <dfn>Emulate Forced Colors Mode</dfn> {#emualte-forced-colors-mode}
1098
+ <dfn export >Emulate Forced Colors Mode</dfn> {#emualte-forced-colors-mode}
1105
1099
--------------------------------------------
1106
1100
1107
- The [=Emulate Forced Colors Mode=] [=extension command=] simulates
1108
- [=Forced Colors Mode=] for the purposes of testing.
1109
-
1110
- The <dfn>current forced colors mode automation theme</dfn> tracks what
1111
- {{ForcedColorsModeAutomationTheme}} is currently active. It defaults to
1112
- "{{ForcedColorsModeAutomationTheme/none}} ".
1101
+ Each [=top-level traversable=] has an associated
1102
+ <dfn>emulated forced colors theme data</dfn> , which is data representing
1103
+ {{ForcedColorsModeAutomationTheme}} , initially "{{ForcedColorsModeAutomationTheme/none}} ".
1113
1104
1114
1105
<xmp class="idl">
1115
1106
enum ForcedColorsModeAutomationTheme {
@@ -1119,42 +1110,34 @@ Automation {#color-adjust-automation}
1119
1110
};
1120
1111
</xmp>
1121
1112
1122
- <figure id="table-setForcedColorsModeAutomationTheme" class="table">
1123
- <table class="data">
1124
- <thead>
1125
- <tr>
1126
- <th> HTTP Method</th>
1127
- <th> URI Template</th>
1128
- </tr>
1129
- </thead>
1130
- <tbody>
1131
- <tr>
1132
- <td> POST</td>
1133
- <td> /session/<em> {session id}</em> /emulate/forced-colors-mode/<em> {theme}</em></td>
1134
- </tr>
1135
- </tbody>
1136
- </table>
1137
- </figure>
1113
+ To <dfn export>set emulated forced colors theme data</dfn> , given
1114
+ [=navigable=] |navigable| and an |emulatedThemeData|:
1115
+
1116
+ 1. Assert |emulatedThemeData| is {{ForcedColorsModeAutomationTheme}} .
1117
+
1118
+ 2. Let |traversable| be |navigable|’s [=navigable/top-level traversable=] .
1119
+
1120
+ 3. If |traversable| is not null:
1121
+ 1. Set |traversable|'s associated [=emulated forced colors theme data=] to
1122
+ |emulatedThemeData|.
1123
+
1124
+ 2. UAs must consider this a change that requires style recalculation.
1125
+
1126
+ To <dfn>get emulated forced colors theme data</dfn> , given {{ForcedColorsModeAutomationTheme}}
1127
+ |theme|:
1138
1128
1139
- The [=remote end steps=] , given <em> session </em> , <em> URL
1140
- variables </em> and <em> parameters </em> are:
1129
+ 1. Let |navigable| be |theme| 's [=relevant global object=]' s
1130
+ [=associated Document=] 's [=node navigable=] .
1141
1131
1142
- 1. If <em> parameters</em> is not a JSON [=Object=] , return a WebDriver [=error=]
1143
- with WebDriver [=error code=] [=invalid argument=] .
1132
+ 2. If |navigable| is null, return null.
1144
1133
1145
- 2. Let <em> theme</em> be the result of [=getting a property=] named
1146
- <code> "theme"</code> from <em> parameters</em> .
1134
+ 3. Let |traversable| be |navigable|’s [=navigable/top-level traversable=] .
1147
1135
1148
- 3. If <em> theme</em> is {{globalThis/undefined}} or is not a member of
1149
- {{ForcedColorsModeAutomationTheme}} , return a WebDriver [=error=] with
1150
- WebDriver [=error code=] [=invalid argument=] .
1136
+ 4. If |traversable| is null, return null.
1151
1137
1152
- 4. Set the [=current forced colors mode automation theme=] to <em> theme </em> .
1138
+ 5. Return |traversable|'s associated [=emulated forced colors theme data=] .
1153
1139
1154
- 5. Signal to the browser that styles need to be recalculated.
1155
1140
1156
- 6. Return [=success=] with data
1157
- <a href="https://262.ecma-international.org/5.1/#sec-4.3.11">null</a> .
1158
1141
1159
1142
1160
1143
Privacy Considerations {#privacy}
0 commit comments