selenium-webdriver 4.51.0 → 4.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES +15 -0
- data/Gemfile +14 -0
- data/README.md +20 -0
- data/bin/linux-arm64/selenium-manager +0 -0
- data/bin/linux-x86_64/selenium-manager +0 -0
- data/bin/macos/selenium-manager +0 -0
- data/bin/selenium-manager-THIRD-PARTY-NOTICES.txt +543 -226
- data/bin/selenium-manager.cdx.json +804 -722
- data/bin/windows/selenium-manager.exe +0 -0
- data/lib/selenium/webdriver/atoms/findElements.js +960 -250
- data/lib/selenium/webdriver/atoms/getAttribute.js +153 -127
- data/lib/selenium/webdriver/atoms/isDisplayed.js +433 -364
- data/lib/selenium/webdriver/atoms.rb +4 -1
- data/lib/selenium/webdriver/bidi/protocol/bluetooth.rb +6 -6
- data/lib/selenium/webdriver/bidi/protocol/browser.rb +21 -9
- data/lib/selenium/webdriver/bidi/protocol/browsing_context.rb +109 -39
- data/lib/selenium/webdriver/bidi/protocol/emulation.rb +89 -44
- data/lib/selenium/webdriver/bidi/protocol/input.rb +95 -31
- data/lib/selenium/webdriver/bidi/protocol/log.rb +4 -4
- data/lib/selenium/webdriver/bidi/protocol/moz_debugging.rb +12 -10
- data/lib/selenium/webdriver/bidi/protocol/moz_profiler.rb +4 -4
- data/lib/selenium/webdriver/bidi/protocol/network.rb +82 -39
- data/lib/selenium/webdriver/bidi/protocol/script.rb +38 -24
- data/lib/selenium/webdriver/bidi/protocol/session.rb +61 -8
- data/lib/selenium/webdriver/bidi/protocol/storage.rb +3 -3
- data/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb +3 -3
- data/lib/selenium/webdriver/bidi/protocol/web_extension.rb +17 -9
- data/lib/selenium/webdriver/bidi/serialization/record.rb +66 -24
- data/lib/selenium/webdriver/bidi/serialization.rb +2 -2
- data/lib/selenium/webdriver/bidi/support/bidi_generate.rb +228 -150
- data/lib/selenium/webdriver/common/client_config.rb +4 -1
- data/lib/selenium/webdriver/common/driver_finder.rb +5 -2
- data/lib/selenium/webdriver/common/websocket_connection.rb +51 -13
- data/lib/selenium/webdriver/remote/http/default.rb +17 -1
- data/lib/selenium/webdriver/version.rb +1 -1
- data/selenium-webdriver.gemspec +0 -12
- metadata +6 -163
|
@@ -1,388 +1,457 @@
|
|
|
1
1
|
(function () {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var __seleniumAtom = (() => {
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
16
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// javascript/atoms/typescript/is-displayed.ts
|
|
22
|
+
var is_displayed_exports = {};
|
|
23
|
+
__export(is_displayed_exports, {
|
|
24
|
+
default: () => shown_default
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// javascript/atoms/typescript/core/attribute.ts
|
|
28
|
+
var SPLIT_STYLE_ATTRIBUTE_ON_SEMICOLONS = new RegExp(
|
|
29
|
+
`[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\\([^()]*\\))*[^()]*$)`
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
// javascript/atoms/typescript/core/element.ts
|
|
33
|
+
var tagNameDescriptor = null;
|
|
34
|
+
function getTagNameDescriptor() {
|
|
35
|
+
if (tagNameDescriptor === null) {
|
|
36
|
+
tagNameDescriptor = Object.getOwnPropertyDescriptor(Element.prototype, "tagName");
|
|
24
37
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return current && current.nodeType === 1 ? current : null;
|
|
38
|
+
return tagNameDescriptor;
|
|
39
|
+
}
|
|
40
|
+
function toUpperCaseTag(tagName) {
|
|
41
|
+
return tagName ? tagName.toUpperCase() : void 0;
|
|
42
|
+
}
|
|
43
|
+
function isElement(node, tagName) {
|
|
44
|
+
if (!node || node.nodeType !== 1) {
|
|
45
|
+
return false;
|
|
34
46
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (!computed) {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
var value = computed.getPropertyValue(propertyName);
|
|
46
|
-
return value || null;
|
|
47
|
+
var asElement = node;
|
|
48
|
+
var descriptor = getTagNameDescriptor();
|
|
49
|
+
var rawTagName = descriptor && typeof descriptor.get === "function" ? descriptor.get.call(asElement) : asElement.tagName;
|
|
50
|
+
var upperTagName = typeof rawTagName === "string" ? rawTagName.toUpperCase() : "";
|
|
51
|
+
var normalizedTagName = toUpperCaseTag(tagName);
|
|
52
|
+
if (upperTagName === "FORM") {
|
|
53
|
+
return !normalizedTagName || normalizedTagName === "FORM";
|
|
47
54
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
return !!upperTagName && (!normalizedTagName || upperTagName === normalizedTagName);
|
|
56
|
+
}
|
|
57
|
+
function getParentElement(node) {
|
|
58
|
+
var current = node.parentNode;
|
|
59
|
+
while (current && current.nodeType !== Node.ELEMENT_NODE && current.nodeType !== Node.DOCUMENT_NODE && current.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) {
|
|
60
|
+
current = current.parentNode;
|
|
53
61
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
return current && current.nodeType === 1 ? current : null;
|
|
63
|
+
}
|
|
64
|
+
function getParentNodeInComposedDom(node) {
|
|
65
|
+
var parent = node.parentNode;
|
|
66
|
+
var slottable = node;
|
|
67
|
+
var parentWithShadow = parent;
|
|
68
|
+
if (parentWithShadow && parentWithShadow.shadowRoot && slottable.assignedSlot !== void 0) {
|
|
69
|
+
return slottable.assignedSlot ? slottable.assignedSlot.parentNode : null;
|
|
70
|
+
}
|
|
71
|
+
return parent;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// javascript/atoms/typescript/core/geometry.ts
|
|
75
|
+
function createRect(left, top, width, height) {
|
|
76
|
+
return {
|
|
77
|
+
left,
|
|
78
|
+
top,
|
|
79
|
+
right: left + width,
|
|
80
|
+
bottom: top + height,
|
|
81
|
+
width,
|
|
82
|
+
height
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function clamp(value, min, max) {
|
|
86
|
+
return Math.min(Math.max(value, min), max);
|
|
87
|
+
}
|
|
88
|
+
function getAreaRelativeRect(area) {
|
|
89
|
+
var shape = area.shape.toLowerCase();
|
|
90
|
+
var coords = area.coords.split(",").map(function(value) {
|
|
91
|
+
return Number(value.trim());
|
|
92
|
+
});
|
|
93
|
+
if (shape === "rect" && coords.length === 4) {
|
|
94
|
+
return createRect(coords[0], coords[1], coords[2] - coords[0], coords[3] - coords[1]);
|
|
95
|
+
}
|
|
96
|
+
if (shape === "circle" && coords.length === 3) {
|
|
97
|
+
return createRect(coords[0] - coords[2], coords[1] - coords[2], coords[2] * 2, coords[2] * 2);
|
|
98
|
+
}
|
|
99
|
+
if (shape === "poly" && coords.length > 2) {
|
|
100
|
+
var minX = coords[0];
|
|
101
|
+
var minY = coords[1];
|
|
102
|
+
var maxX = minX;
|
|
103
|
+
var maxY = minY;
|
|
104
|
+
for (var index = 2; index + 1 < coords.length; index += 2) {
|
|
105
|
+
minX = Math.min(minX, coords[index]);
|
|
106
|
+
maxX = Math.max(maxX, coords[index]);
|
|
107
|
+
minY = Math.min(minY, coords[index + 1]);
|
|
108
|
+
maxY = Math.max(maxY, coords[index + 1]);
|
|
109
|
+
}
|
|
110
|
+
return createRect(minX, minY, maxX - minX, maxY - minY);
|
|
111
|
+
}
|
|
112
|
+
return createRect(0, 0, 0, 0);
|
|
113
|
+
}
|
|
114
|
+
function findImageUsingMap(mapName, doc) {
|
|
115
|
+
return doc.querySelector('[usemap="#' + mapName.replace(/\\/g, "\\\\").replace(/"/g, '\\"') + '"]');
|
|
116
|
+
}
|
|
117
|
+
function maybeFindImageMap(elem, getRect = getClientRect) {
|
|
118
|
+
var isMap = isElement(elem, "MAP");
|
|
119
|
+
if (!isMap && !isElement(elem, "AREA")) {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
var map = isMap ? elem : isElement(elem.parentNode, "MAP") ? elem.parentNode : null;
|
|
123
|
+
var image = null;
|
|
124
|
+
var rect = createRect(0, 0, 0, 0);
|
|
125
|
+
if (isElement(map, "MAP") && map.name) {
|
|
126
|
+
image = findImageUsingMap(map.name, map.ownerDocument);
|
|
127
|
+
if (image) {
|
|
128
|
+
rect = getRect(image);
|
|
129
|
+
if (!isMap && isElement(elem, "AREA") && elem.shape.toLowerCase() !== "default") {
|
|
130
|
+
var relativeRect = getAreaRelativeRect(elem);
|
|
131
|
+
var relativeX = Math.min(Math.max(relativeRect.left, 0), rect.width);
|
|
132
|
+
var relativeY = Math.min(Math.max(relativeRect.top, 0), rect.height);
|
|
133
|
+
var width = Math.min(relativeRect.width, rect.width - relativeX);
|
|
134
|
+
var height = Math.min(relativeRect.height, rect.height - relativeY);
|
|
135
|
+
rect = createRect(relativeX + rect.left, relativeY + rect.top, width, height);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
62
138
|
}
|
|
63
|
-
|
|
139
|
+
return { image, rect };
|
|
140
|
+
}
|
|
141
|
+
function getClientRect(elem, getRect) {
|
|
142
|
+
var imageMap = maybeFindImageMap(elem, getRect || getClientRect);
|
|
143
|
+
if (imageMap) {
|
|
144
|
+
return imageMap.rect;
|
|
145
|
+
}
|
|
146
|
+
var elemTagName = typeof elem.tagName === "string" ? elem.tagName : "";
|
|
147
|
+
if (elemTagName.toUpperCase() === "HTML") {
|
|
148
|
+
var doc = elem.ownerDocument;
|
|
149
|
+
var sizeElem = doc.compatMode === "CSS1Compat" ? doc.documentElement : doc.body || doc.documentElement;
|
|
150
|
+
return createRect(0, 0, sizeElem.clientWidth, sizeElem.clientHeight);
|
|
151
|
+
}
|
|
152
|
+
try {
|
|
153
|
+
var nativeRect = elem.getBoundingClientRect();
|
|
154
|
+
return {
|
|
155
|
+
left: nativeRect.left,
|
|
156
|
+
top: nativeRect.top,
|
|
157
|
+
right: nativeRect.right,
|
|
158
|
+
bottom: nativeRect.bottom,
|
|
159
|
+
width: nativeRect.right - nativeRect.left,
|
|
160
|
+
height: nativeRect.bottom - nativeRect.top
|
|
161
|
+
};
|
|
162
|
+
} catch (_error) {
|
|
163
|
+
return createRect(0, 0, 0, 0);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function getClientRegion(elem, optRegion, getRect = getClientRect) {
|
|
167
|
+
var rect = getRect(elem);
|
|
168
|
+
if (!optRegion) {
|
|
169
|
+
return rect;
|
|
170
|
+
}
|
|
171
|
+
var region = "left" in optRegion ? optRegion : { left: optRegion.x, top: optRegion.y, width: 1, height: 1 };
|
|
172
|
+
var left = clamp(rect.left + region.left, rect.left, rect.right);
|
|
173
|
+
var top = clamp(rect.top + region.top, rect.top, rect.bottom);
|
|
174
|
+
var right = clamp(left + region.width, left, rect.right);
|
|
175
|
+
var bottom = clamp(top + region.height, top, rect.bottom);
|
|
176
|
+
return createRect(left, top, right - left, bottom - top);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// javascript/atoms/typescript/core/style.ts
|
|
180
|
+
function getEffectiveStyle(elem, propertyName) {
|
|
181
|
+
const win = elem.ownerDocument.defaultView;
|
|
182
|
+
const computed = win ? win.getComputedStyle(elem) : null;
|
|
183
|
+
if (!computed) {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
return computed.getPropertyValue(propertyName) || null;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// javascript/atoms/typescript/core/overflow.ts
|
|
190
|
+
function getOverflowState(elem, optRegion, getStyle = getEffectiveStyle, getRect = getClientRect) {
|
|
191
|
+
var region = getClientRegion(elem, optRegion, getRect);
|
|
192
|
+
var ownerDoc = elem.ownerDocument;
|
|
193
|
+
var htmlElem = ownerDoc.documentElement;
|
|
194
|
+
var bodyElem = ownerDoc.body;
|
|
195
|
+
var htmlOverflowStyle = getStyle(htmlElem, "overflow") || "visible";
|
|
196
|
+
var treatAsFixedPosition = false;
|
|
197
|
+
function canBeOverflowed(container2, position) {
|
|
198
|
+
if (container2 === htmlElem) {
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
var display = getStyle(container2, "display") || "";
|
|
202
|
+
if (display.indexOf("inline") === 0 || display === "contents") {
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
if (position === "absolute" && getStyle(container2, "position") === "static") {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
return true;
|
|
209
|
+
}
|
|
210
|
+
function getOverflowParent(current) {
|
|
211
|
+
var position = getStyle(current, "position");
|
|
212
|
+
if (position === "fixed") {
|
|
213
|
+
treatAsFixedPosition = true;
|
|
214
|
+
return current === htmlElem ? null : htmlElem;
|
|
215
|
+
}
|
|
216
|
+
var parent = getParentElement(current);
|
|
217
|
+
while (parent && !canBeOverflowed(parent, position)) {
|
|
218
|
+
parent = getParentElement(parent);
|
|
219
|
+
}
|
|
220
|
+
return parent;
|
|
221
|
+
}
|
|
222
|
+
function getOverflowStyles(current) {
|
|
223
|
+
var overflowElem = current;
|
|
224
|
+
if (htmlOverflowStyle === "visible") {
|
|
225
|
+
if (current === htmlElem && bodyElem) {
|
|
226
|
+
overflowElem = bodyElem;
|
|
227
|
+
} else if (current === bodyElem) {
|
|
228
|
+
return { x: "visible", y: "visible" };
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
var overflow = {
|
|
232
|
+
x: getStyle(overflowElem, "overflow-x") || "visible",
|
|
233
|
+
y: getStyle(overflowElem, "overflow-y") || "visible"
|
|
234
|
+
};
|
|
235
|
+
if (current === htmlElem) {
|
|
236
|
+
overflow.x = overflow.x === "visible" ? "auto" : overflow.x;
|
|
237
|
+
overflow.y = overflow.y === "visible" ? "auto" : overflow.y;
|
|
238
|
+
}
|
|
239
|
+
return overflow;
|
|
240
|
+
}
|
|
241
|
+
function getScroll(current) {
|
|
242
|
+
if (current === htmlElem) {
|
|
64
243
|
return {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
right: left + width,
|
|
68
|
-
bottom: top + height,
|
|
69
|
-
width: width,
|
|
70
|
-
height: height,
|
|
244
|
+
x: ownerDoc.defaultView ? ownerDoc.defaultView.pageXOffset : 0,
|
|
245
|
+
y: ownerDoc.defaultView ? ownerDoc.defaultView.pageYOffset : 0
|
|
71
246
|
};
|
|
247
|
+
}
|
|
248
|
+
return { x: current.scrollLeft, y: current.scrollTop };
|
|
72
249
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
if (cachedRect) {
|
|
76
|
-
return cachedRect;
|
|
77
|
-
}
|
|
78
|
-
var rect;
|
|
79
|
-
var imageMap = maybeFindImageMap(elem);
|
|
80
|
-
if (imageMap) {
|
|
81
|
-
rect = imageMap.rect;
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
var elemTagName = typeof elem.tagName === 'string' ? elem.tagName : '';
|
|
85
|
-
if (elemTagName.toUpperCase() === 'HTML') {
|
|
86
|
-
var doc = elem.ownerDocument;
|
|
87
|
-
var sizeElem = doc.compatMode === 'CSS1Compat' ? doc.documentElement : (doc.body || doc.documentElement);
|
|
88
|
-
rect = createRect(0, 0, sizeElem.clientWidth, sizeElem.clientHeight);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
try {
|
|
92
|
-
var nativeRect = elem.getBoundingClientRect();
|
|
93
|
-
rect = {
|
|
94
|
-
left: nativeRect.left,
|
|
95
|
-
top: nativeRect.top,
|
|
96
|
-
right: nativeRect.right,
|
|
97
|
-
bottom: nativeRect.bottom,
|
|
98
|
-
width: nativeRect.right - nativeRect.left,
|
|
99
|
-
height: nativeRect.bottom - nativeRect.top,
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
catch (_error) {
|
|
103
|
-
rect = createRect(0, 0, 0, 0);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
clientRectCache.set(elem, rect);
|
|
108
|
-
return rect;
|
|
250
|
+
function overflowStateOf(container2) {
|
|
251
|
+
return getOverflowState(container2, void 0, getStyle, getRect);
|
|
109
252
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
253
|
+
for (var container = getOverflowParent(elem); container; container = getOverflowParent(container)) {
|
|
254
|
+
var containerOverflow = getOverflowStyles(container);
|
|
255
|
+
if (containerOverflow.x === "visible" && containerOverflow.y === "visible") {
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
var containerRect = getRect(container);
|
|
259
|
+
if (containerRect.width === 0 || containerRect.height === 0) {
|
|
260
|
+
return "hidden";
|
|
261
|
+
}
|
|
262
|
+
var underflowsX = region.right < containerRect.left;
|
|
263
|
+
var underflowsY = region.bottom < containerRect.top;
|
|
264
|
+
if (underflowsX && containerOverflow.x === "hidden" || underflowsY && containerOverflow.y === "hidden") {
|
|
265
|
+
return "hidden";
|
|
266
|
+
}
|
|
267
|
+
if (underflowsX && containerOverflow.x !== "visible" || underflowsY && containerOverflow.y !== "visible") {
|
|
268
|
+
var containerScroll = getScroll(container);
|
|
269
|
+
var unscrollableX = region.right < containerRect.left - containerScroll.x;
|
|
270
|
+
var unscrollableY = region.bottom < containerRect.top - containerScroll.y;
|
|
271
|
+
if (unscrollableX && containerOverflow.x !== "visible" || unscrollableY && containerOverflow.y !== "visible") {
|
|
272
|
+
return "hidden";
|
|
273
|
+
}
|
|
274
|
+
return overflowStateOf(container) === "hidden" ? "hidden" : "scroll";
|
|
275
|
+
}
|
|
276
|
+
var overflowsX = region.left >= containerRect.left + containerRect.width;
|
|
277
|
+
var overflowsY = region.top >= containerRect.top + containerRect.height;
|
|
278
|
+
if (overflowsX && containerOverflow.x === "hidden" || overflowsY && containerOverflow.y === "hidden") {
|
|
279
|
+
return "hidden";
|
|
280
|
+
}
|
|
281
|
+
if (overflowsX && containerOverflow.x !== "visible" || overflowsY && containerOverflow.y !== "visible") {
|
|
282
|
+
if (treatAsFixedPosition) {
|
|
283
|
+
var docScroll = getScroll(container);
|
|
284
|
+
if (region.left >= htmlElem.scrollWidth - docScroll.x || region.right >= htmlElem.scrollHeight - docScroll.y) {
|
|
285
|
+
return "hidden";
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return overflowStateOf(container) === "hidden" ? "hidden" : "scroll";
|
|
289
|
+
}
|
|
135
290
|
}
|
|
136
|
-
|
|
137
|
-
|
|
291
|
+
return "none";
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// javascript/atoms/typescript/core/shown.ts
|
|
295
|
+
function isShownElement(elem, optIgnoreOpacity) {
|
|
296
|
+
var computedStyleCache = /* @__PURE__ */ new Map();
|
|
297
|
+
var clientRectCache = /* @__PURE__ */ new Map();
|
|
298
|
+
var displayedCache = /* @__PURE__ */ new Map();
|
|
299
|
+
function getEffectiveStyle2(elem2, propertyName) {
|
|
300
|
+
var computed = computedStyleCache.get(elem2);
|
|
301
|
+
if (computed === void 0) {
|
|
302
|
+
var win = elem2.ownerDocument.defaultView;
|
|
303
|
+
computed = win ? win.getComputedStyle(elem2) || null : null;
|
|
304
|
+
computedStyleCache.set(elem2, computed);
|
|
305
|
+
}
|
|
306
|
+
if (!computed) {
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
var value = computed.getPropertyValue(propertyName);
|
|
310
|
+
return value || null;
|
|
138
311
|
}
|
|
139
|
-
function
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
var map = isMap ? elem : isElement(elem.parentNode, 'MAP') ? elem.parentNode : null;
|
|
145
|
-
var image = null;
|
|
146
|
-
var rect = createRect(0, 0, 0, 0);
|
|
147
|
-
if (isElement(map, 'MAP') && map.name) {
|
|
148
|
-
image = findImageUsingMap(map.name, map.ownerDocument);
|
|
149
|
-
if (image) {
|
|
150
|
-
rect = getClientRect(image);
|
|
151
|
-
if (!isMap && isElement(elem, 'AREA') && elem.shape.toLowerCase() !== 'default') {
|
|
152
|
-
var relativeRect = getAreaRelativeRect(elem);
|
|
153
|
-
var relativeX = Math.min(Math.max(relativeRect.left, 0), rect.width);
|
|
154
|
-
var relativeY = Math.min(Math.max(relativeRect.top, 0), rect.height);
|
|
155
|
-
var width = Math.min(relativeRect.width, rect.width - relativeX);
|
|
156
|
-
var height = Math.min(relativeRect.height, rect.height - relativeY);
|
|
157
|
-
rect = createRect(relativeX + rect.left, relativeY + rect.top, width, height);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return { image: image, rect: rect };
|
|
312
|
+
function getOpacity(elem2) {
|
|
313
|
+
var opacityStyle = getEffectiveStyle2(elem2, "opacity");
|
|
314
|
+
var opacity = opacityStyle ? Number(opacityStyle) : 1;
|
|
315
|
+
var parent = getParentElement(elem2);
|
|
316
|
+
return parent ? opacity * getOpacity(parent) : opacity;
|
|
162
317
|
}
|
|
163
|
-
function
|
|
164
|
-
|
|
318
|
+
function getClientRect2(elem2) {
|
|
319
|
+
var cachedRect = clientRectCache.get(elem2);
|
|
320
|
+
if (cachedRect) {
|
|
321
|
+
return cachedRect;
|
|
322
|
+
}
|
|
323
|
+
var rect = getClientRect(elem2, getClientRect2);
|
|
324
|
+
clientRectCache.set(elem2, rect);
|
|
325
|
+
return rect;
|
|
165
326
|
}
|
|
166
|
-
function
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
327
|
+
function maybeFindImageMap2(elem2) {
|
|
328
|
+
return maybeFindImageMap(elem2, getClientRect2);
|
|
329
|
+
}
|
|
330
|
+
function getClientRegion2(elem2) {
|
|
331
|
+
return getClientRegion(elem2, void 0, getClientRect2);
|
|
332
|
+
}
|
|
333
|
+
function getOverflowState2(elem2) {
|
|
334
|
+
return getOverflowState(elem2, void 0, getEffectiveStyle2, getClientRect2);
|
|
335
|
+
}
|
|
336
|
+
function isShownInternal(elem2, ignoreOpacity, displayedFn) {
|
|
337
|
+
if (!isElement(elem2)) {
|
|
338
|
+
throw new Error("Argument to isShown must be of type Element");
|
|
339
|
+
}
|
|
340
|
+
if (isElement(elem2, "BODY")) {
|
|
341
|
+
return true;
|
|
342
|
+
}
|
|
343
|
+
if (isElement(elem2, "OPTION") || isElement(elem2, "OPTGROUP")) {
|
|
344
|
+
var select = elem2.closest("select");
|
|
345
|
+
return !!select && isShownInternal(select, true, displayedFn);
|
|
346
|
+
}
|
|
347
|
+
var imageMap = maybeFindImageMap2(elem2);
|
|
348
|
+
if (imageMap) {
|
|
349
|
+
return !!imageMap.image && imageMap.rect.width > 0 && imageMap.rect.height > 0 && isShownInternal(imageMap.image, ignoreOpacity, displayedFn);
|
|
350
|
+
}
|
|
351
|
+
if (isElement(elem2, "INPUT") && elem2.type.toLowerCase() === "hidden") {
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
if (isElement(elem2, "NOSCRIPT")) {
|
|
355
|
+
return false;
|
|
356
|
+
}
|
|
357
|
+
var visibility = getEffectiveStyle2(elem2, "visibility");
|
|
358
|
+
if (visibility === "collapse" || visibility === "hidden") {
|
|
359
|
+
return false;
|
|
360
|
+
}
|
|
361
|
+
if (!displayedFn(elem2)) {
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
if (!ignoreOpacity && getOpacity(elem2) === 0) {
|
|
365
|
+
return false;
|
|
366
|
+
}
|
|
367
|
+
function positiveSize(element) {
|
|
368
|
+
var rect = getClientRect2(element);
|
|
369
|
+
if (rect.height > 0 && rect.width > 0) {
|
|
370
|
+
return true;
|
|
371
|
+
}
|
|
372
|
+
if (isElement(element, "PATH") && (rect.height > 0 || rect.width > 0)) {
|
|
373
|
+
var strokeWidth = getEffectiveStyle2(element, "stroke-width");
|
|
374
|
+
return !!strokeWidth && parseInt(strokeWidth, 10) > 0;
|
|
375
|
+
}
|
|
376
|
+
var elementVisibility = getEffectiveStyle2(element, "visibility");
|
|
377
|
+
if (elementVisibility === "collapse" || elementVisibility === "hidden") {
|
|
378
|
+
return false;
|
|
379
|
+
}
|
|
380
|
+
if (!displayedFn(element)) {
|
|
381
|
+
return false;
|
|
382
|
+
}
|
|
383
|
+
if (getEffectiveStyle2(element, "overflow") === "hidden") {
|
|
384
|
+
return false;
|
|
385
|
+
}
|
|
386
|
+
for (var index = 0; index < element.childNodes.length; index += 1) {
|
|
387
|
+
var child = element.childNodes[index];
|
|
388
|
+
if (child.nodeType === Node.TEXT_NODE) {
|
|
389
|
+
var text = child.nodeValue || "";
|
|
390
|
+
if (/^[\s]*$/.test(text) && /[\n\r\t]/.test(text)) {
|
|
391
|
+
continue;
|
|
183
392
|
}
|
|
184
393
|
return true;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
var position = getEffectiveStyle(current, 'position');
|
|
188
|
-
if (position === 'fixed') {
|
|
189
|
-
treatAsFixedPosition = true;
|
|
190
|
-
return current === htmlElem ? null : htmlElem;
|
|
191
|
-
}
|
|
192
|
-
var parent = getParentElement(current);
|
|
193
|
-
while (parent && !canBeOverflowed(parent, position)) {
|
|
194
|
-
parent = getParentElement(parent);
|
|
195
|
-
}
|
|
196
|
-
return parent;
|
|
197
|
-
}
|
|
198
|
-
function getOverflowStyles(current) {
|
|
199
|
-
var overflowElem = current;
|
|
200
|
-
if (htmlOverflowStyle === 'visible') {
|
|
201
|
-
if (current === htmlElem && bodyElem) {
|
|
202
|
-
overflowElem = bodyElem;
|
|
203
|
-
}
|
|
204
|
-
else if (current === bodyElem) {
|
|
205
|
-
return { x: 'visible', y: 'visible' };
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
var overflow = {
|
|
209
|
-
x: getEffectiveStyle(overflowElem, 'overflow-x') || 'visible',
|
|
210
|
-
y: getEffectiveStyle(overflowElem, 'overflow-y') || 'visible',
|
|
211
|
-
};
|
|
212
|
-
if (current === htmlElem) {
|
|
213
|
-
overflow.x = overflow.x === 'visible' ? 'auto' : overflow.x;
|
|
214
|
-
overflow.y = overflow.y === 'visible' ? 'auto' : overflow.y;
|
|
215
|
-
}
|
|
216
|
-
return overflow;
|
|
217
|
-
}
|
|
218
|
-
function getScroll(current) {
|
|
219
|
-
if (current === htmlElem) {
|
|
220
|
-
return {
|
|
221
|
-
x: ownerDoc.defaultView ? ownerDoc.defaultView.pageXOffset : 0,
|
|
222
|
-
y: ownerDoc.defaultView ? ownerDoc.defaultView.pageYOffset : 0,
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
return { x: current.scrollLeft, y: current.scrollTop };
|
|
226
|
-
}
|
|
227
|
-
for (var container = getOverflowParent(elem); container; container = getOverflowParent(container)) {
|
|
228
|
-
var containerOverflow = getOverflowStyles(container);
|
|
229
|
-
if (containerOverflow.x === 'visible' && containerOverflow.y === 'visible') {
|
|
230
|
-
continue;
|
|
231
|
-
}
|
|
232
|
-
var containerRect = getClientRect(container);
|
|
233
|
-
if (containerRect.width === 0 || containerRect.height === 0) {
|
|
234
|
-
return 'hidden';
|
|
235
|
-
}
|
|
236
|
-
var underflowsX = region.right < containerRect.left;
|
|
237
|
-
var underflowsY = region.bottom < containerRect.top;
|
|
238
|
-
if ((underflowsX && containerOverflow.x === 'hidden') || (underflowsY && containerOverflow.y === 'hidden')) {
|
|
239
|
-
return 'hidden';
|
|
240
|
-
}
|
|
241
|
-
if ((underflowsX && containerOverflow.x !== 'visible') || (underflowsY && containerOverflow.y !== 'visible')) {
|
|
242
|
-
var containerScroll = getScroll(container);
|
|
243
|
-
var unscrollableX = region.right < containerRect.left - containerScroll.x;
|
|
244
|
-
var unscrollableY = region.bottom < containerRect.top - containerScroll.y;
|
|
245
|
-
if ((unscrollableX && containerOverflow.x !== 'visible') || (unscrollableY && containerOverflow.y !== 'visible')) {
|
|
246
|
-
return 'hidden';
|
|
247
|
-
}
|
|
248
|
-
var containerUnderflowState = getOverflowState(container);
|
|
249
|
-
return containerUnderflowState === 'hidden' ? 'hidden' : 'scroll';
|
|
250
|
-
}
|
|
251
|
-
var overflowsX = region.left >= containerRect.left + containerRect.width;
|
|
252
|
-
var overflowsY = region.top >= containerRect.top + containerRect.height;
|
|
253
|
-
if ((overflowsX && containerOverflow.x === 'hidden') || (overflowsY && containerOverflow.y === 'hidden')) {
|
|
254
|
-
return 'hidden';
|
|
255
|
-
}
|
|
256
|
-
if ((overflowsX && containerOverflow.x !== 'visible') || (overflowsY && containerOverflow.y !== 'visible')) {
|
|
257
|
-
if (treatAsFixedPosition) {
|
|
258
|
-
var docScroll = getScroll(container);
|
|
259
|
-
if (region.left >= htmlElem.scrollWidth - docScroll.x || region.right >= htmlElem.scrollHeight - docScroll.y) {
|
|
260
|
-
return 'hidden';
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
var containerOverflowState = getOverflowState(container);
|
|
264
|
-
return containerOverflowState === 'hidden' ? 'hidden' : 'scroll';
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
return 'none';
|
|
268
|
-
}
|
|
269
|
-
function isShownInternal(elem, ignoreOpacity, displayedFn) {
|
|
270
|
-
if (!isElement(elem)) {
|
|
271
|
-
throw new Error('Argument to isShown must be of type Element');
|
|
272
|
-
}
|
|
273
|
-
if (isElement(elem, 'BODY')) {
|
|
394
|
+
}
|
|
395
|
+
if (isElement(child) && positiveSize(child)) {
|
|
274
396
|
return true;
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
return false;
|
|
290
|
-
}
|
|
291
|
-
var visibility = getEffectiveStyle(elem, 'visibility');
|
|
292
|
-
if (visibility === 'collapse' || visibility === 'hidden') {
|
|
293
|
-
return false;
|
|
294
|
-
}
|
|
295
|
-
if (!displayedFn(elem)) {
|
|
296
|
-
return false;
|
|
297
|
-
}
|
|
298
|
-
if (!ignoreOpacity && getOpacity(elem) === 0) {
|
|
299
|
-
return false;
|
|
300
|
-
}
|
|
301
|
-
function positiveSize(element) {
|
|
302
|
-
var rect = getClientRect(element);
|
|
303
|
-
if (rect.height > 0 && rect.width > 0) {
|
|
304
|
-
return true;
|
|
305
|
-
}
|
|
306
|
-
if (isElement(element, 'PATH') && (rect.height > 0 || rect.width > 0)) {
|
|
307
|
-
var strokeWidth = getEffectiveStyle(element, 'stroke-width');
|
|
308
|
-
return !!strokeWidth && parseInt(strokeWidth, 10) > 0;
|
|
309
|
-
}
|
|
310
|
-
var elementVisibility = getEffectiveStyle(element, 'visibility');
|
|
311
|
-
if (elementVisibility === 'collapse' || elementVisibility === 'hidden') {
|
|
312
|
-
return false;
|
|
313
|
-
}
|
|
314
|
-
if (!displayedFn(element)) {
|
|
315
|
-
return false;
|
|
316
|
-
}
|
|
317
|
-
if (getEffectiveStyle(element, 'overflow') === 'hidden') {
|
|
318
|
-
return false;
|
|
319
|
-
}
|
|
320
|
-
for (var index = 0; index < element.childNodes.length; index += 1) {
|
|
321
|
-
var child = element.childNodes[index];
|
|
322
|
-
if (child.nodeType === Node.TEXT_NODE) {
|
|
323
|
-
var text = child.nodeValue || '';
|
|
324
|
-
if (/^[\s]*$/.test(text) && /[\n\r\t]/.test(text)) {
|
|
325
|
-
continue;
|
|
326
|
-
}
|
|
327
|
-
return true;
|
|
328
|
-
}
|
|
329
|
-
if (isElement(child) && positiveSize(child)) {
|
|
330
|
-
return true;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
return false;
|
|
334
|
-
}
|
|
335
|
-
if (!positiveSize(elem)) {
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return false;
|
|
400
|
+
}
|
|
401
|
+
if (!positiveSize(elem2)) {
|
|
402
|
+
return false;
|
|
403
|
+
}
|
|
404
|
+
function hiddenByOverflow(element) {
|
|
405
|
+
if (getOverflowState2(element) !== "hidden") {
|
|
406
|
+
return false;
|
|
407
|
+
}
|
|
408
|
+
for (var index = 0; index < element.childNodes.length; index += 1) {
|
|
409
|
+
var child = element.childNodes[index];
|
|
410
|
+
if (isElement(child) && !hiddenByOverflow(child) && positiveSize(child)) {
|
|
336
411
|
return false;
|
|
412
|
+
}
|
|
337
413
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}
|
|
342
|
-
for (var index = 0; index < element.childNodes.length; index += 1) {
|
|
343
|
-
var child = element.childNodes[index];
|
|
344
|
-
if (isElement(child) && !hiddenByOverflow(child) && positiveSize(child)) {
|
|
345
|
-
return false;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
return true;
|
|
349
|
-
}
|
|
350
|
-
return !hiddenByOverflow(elem);
|
|
414
|
+
return true;
|
|
415
|
+
}
|
|
416
|
+
return !hiddenByOverflow(elem2);
|
|
351
417
|
}
|
|
352
418
|
function displayed(node) {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
419
|
+
var cached = displayedCache.get(node);
|
|
420
|
+
if (cached !== void 0) {
|
|
421
|
+
return cached;
|
|
422
|
+
}
|
|
423
|
+
if (isElement(node)) {
|
|
424
|
+
var display = getEffectiveStyle2(node, "display");
|
|
425
|
+
var contentVisibility = getEffectiveStyle2(node, "content-visibility");
|
|
426
|
+
if (display === "none" || contentVisibility === "hidden") {
|
|
427
|
+
displayedCache.set(node, false);
|
|
428
|
+
return false;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
var parent = getParentNodeInComposedDom(node);
|
|
432
|
+
if (typeof ShadowRoot === "function" && parent instanceof ShadowRoot) {
|
|
433
|
+
if (parent.host.shadowRoot && parent.host.shadowRoot !== parent) {
|
|
434
|
+
displayedCache.set(node, false);
|
|
435
|
+
return false;
|
|
436
|
+
}
|
|
437
|
+
parent = parent.host;
|
|
438
|
+
}
|
|
439
|
+
if (parent && (parent.nodeType === Node.DOCUMENT_NODE || parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE)) {
|
|
440
|
+
displayedCache.set(node, true);
|
|
441
|
+
return true;
|
|
442
|
+
}
|
|
443
|
+
if (isElement(parent, "DETAILS") && !parent.open && !isElement(node, "SUMMARY")) {
|
|
444
|
+
displayedCache.set(node, false);
|
|
445
|
+
return false;
|
|
446
|
+
}
|
|
447
|
+
var result = !!parent && displayed(parent);
|
|
448
|
+
displayedCache.set(node, result);
|
|
449
|
+
return result;
|
|
384
450
|
}
|
|
385
451
|
return isShownInternal(elem, !!optIgnoreOpacity, displayed);
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
|
|
452
|
+
}
|
|
453
|
+
var shown_default = isShownElement;
|
|
454
|
+
return __toCommonJS(is_displayed_exports);
|
|
455
|
+
})();
|
|
456
|
+
return __seleniumAtom.default;
|
|
457
|
+
})()
|