@@ -24,20 +24,15 @@ spec:css-color-4; type:property; text:color
2424spec:fill-stroke-3; type:property;
2525 text:fill
2626 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
3130</pre>
3231
3332<pre class=anchors>
3433url: https://html.spec.whatwg.org/multipage/semantics.html#meta-color-scheme;
3534 type: attr-value; for: meta/name; spec: html; text: color-scheme;
3635</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>
4136
4237<link rel="stylesheet" href="style.css" />
4338
@@ -492,12 +487,11 @@ Forced Color Palettes {#forced}
492487 ''prefers-color-scheme/light'' or ''prefers-color-scheme/dark''
493488 as the user’s preferred color scheme.
494489
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=] :
501495
502496 : "{{ForcedColorsModeAutomationTheme/light}} "
503497 :: Act as if the user has enabled <a>forced colors mode</a> with the
@@ -1096,20 +1090,17 @@ The 'color-adjust' Shorthand {#color-adjust}
10961090 inheritance.html
10971091</wpt>
10981092
1099- Automation {#color-adjust-automation }
1093+ Emulation {#color-adjust-emulation }
11001094===================================
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 .
11031097
1104- <dfn>Emulate Forced Colors Mode</dfn> {#emualte-forced-colors-mode}
1098+ <dfn export >Emulate Forced Colors Mode</dfn> {#emualte-forced-colors-mode}
11051099 --------------------------------------------
11061100
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}} ".
11131104
11141105 <xmp class="idl">
11151106 enum ForcedColorsModeAutomationTheme {
@@ -1119,42 +1110,34 @@ Automation {#color-adjust-automation}
11191110 };
11201111 </xmp>
11211112
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|:
11381128
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=] .
11411131
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.
11441133
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=] .
11471135
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.
11511137
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=] .
11531139
1154- 5. Signal to the browser that styles need to be recalculated.
11551140
1156- 6. Return [=success=] with data
1157- <a href="https://262.ecma-international.org/5.1/#sec-4.3.11">null</a> .
11581141
11591142
11601143Privacy Considerations {#privacy}
0 commit comments