@@ -3075,6 +3075,7 @@ To <dfn>await a navigation</dfn> given |navigable|, |request|, |wait condition|,
3075
3075
browsingContext.Locator = (
3076
3076
browsingContext.AccessibilityLocator /
3077
3077
browsingContext.CssLocator /
3078
+ browsingContext.ContextLocator /
3078
3079
browsingContext.InnerTextLocator /
3079
3080
browsingContext.XPathLocator
3080
3081
)
@@ -3092,6 +3093,13 @@ browsingContext.CssLocator = {
3092
3093
value: text
3093
3094
}
3094
3095
3096
+ browsingContext.ContextLocator = {
3097
+ type: "context",
3098
+ value: {
3099
+ context: browsingContext.BrowsingContext,
3100
+ }
3101
+ }
3102
+
3095
3103
browsingContext.InnerTextLocator = {
3096
3104
type: "innerText",
3097
3105
value: text,
@@ -3891,6 +3899,18 @@ To <dfn>locate nodes using CSS</dfn> with given |navigable|, |context nodes|,
3891
3899
3892
3900
</div>
3893
3901
3902
+ <div algorithm="locate the container element">
3903
+ To <dfn>locate the container element</dfn> given |navigable|:
3904
+
3905
+ 1. Let |returned nodes| be an empty [=/list=] .
3906
+
3907
+ 1. If |navigable|'s [=navigable/container=] is not null,
3908
+ append |navigable|'s [=navigable/container=] to |returned nodes|.
3909
+
3910
+ 1. Return |returned nodes|.
3911
+
3912
+ </div>
3913
+
3894
3914
<div algorithm="locate nodes using XPath">
3895
3915
3896
3916
To <dfn>locate nodes using XPath</dfn> with given |navigable|, |context nodes|,
@@ -4158,6 +4178,25 @@ The [=remote end steps=] with |session| and |command parameters| are:
4158
4178
1. Let |result nodes| be [=locate nodes using accessibility attributes=]
4159
4179
given |context nodes|, |selector|, and |maximum returned node count|.
4160
4180
4181
+ <dt> |type| is the string "<code> context</code> "
4182
+ <dd>
4183
+
4184
+ 1. If |start nodes parameter| is not null,
4185
+ return [=error=] with [=error code=] "<code> invalid argument</code> ".
4186
+
4187
+ 1. Let |selector| be |locator|["<code>value</code>"] .
4188
+
4189
+ 1. Let |context id| be |selector|["<code>context</code>"] .
4190
+
4191
+ 1. Let |child navigable| be the result of [=trying=] to [=get a navigable=] with |context id|.
4192
+
4193
+ 1. If |child navigable|'s [=navigable/parent=] is not |navigable|,
4194
+ return [=error=] with [=error code=] "<code> invalid argument</code> ".
4195
+
4196
+ 1. Let |result nodes| be [=locate the container element=] given |child navigable|.
4197
+
4198
+ 1. Assert: For each |node| in |result nodes|, |node|'s [=/node navigable=] is |navigable|.
4199
+
4161
4200
1. Assert: |maximum returned node count| is null or [=list/size=] of |result nodes| is less
4162
4201
than or equal to |maximum returned node count|.
4163
4202
0 commit comments