Skip to content

Commit 90c3690

Browse files
authored
Merge branch 'trunk' into py-bidi-emulation
2 parents 0c46ee6 + a9348cf commit 90c3690

File tree

102 files changed

+2173
-4648
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+2173
-4648
lines changed

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- uses: actions/stale@v9
2020
with:
21-
stale-issue-message: 'This issue is stale because it has been open 280 days with no activity. Remove stale label or comment or this will be closed in 14 days.'
21+
stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 14 days.'
2222
close-issue-message: 'This issue was closed because it has been stalled for 14 days with no activity.'
2323
stale-issue-label: 'J-stale'
2424
stale-pr-label: 'J-stale'

.mailmap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Brandon Walderman <[email protected]> <[email protected]>
1616
1717
1818
19-
19+
Corey Goldberg <[email protected].com> <cgoldberg@gmail.com>
2020
2121
2222
Daniel P. Purkhús <[email protected]>

MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ bazel_dep(name = "rules_multitool", version = "1.3.0")
2424
bazel_dep(name = "rules_nodejs", version = "6.3.2")
2525
bazel_dep(name = "rules_oci", version = "1.8.0")
2626
bazel_dep(name = "rules_pkg", version = "1.0.1")
27-
bazel_dep(name = "rules_python", version = "1.1.0")
27+
bazel_dep(name = "rules_python", version = "1.5.0")
2828
bazel_dep(name = "rules_proto", version = "7.0.2")
2929
bazel_dep(name = "rules_ruby", version = "0.19.0")
3030

3131
# Until `rules_jvm_external` 6.8 ships
3232
git_override(
3333
module_name = "rules_jvm_external",
34-
commit = "29c451d2a62aa2451f5810c005ecac925b4772b6",
34+
commit = "aca619b117c1fe306ffdd20c5f47cc4dbd5effed",
3535
patch_strip = 1,
3636
patches = ["//java:rules_jvm_external_javadoc.patch"],
3737
remote = "https://github.com/bazel-contrib/rules_jvm_external.git",

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ you can configure it use Bazel artifacts:
266266
1. Open `rb/` as a main project directory.
267267
2. Run `bundle exec rake update` as necessary to create up-to-date artifacts. If this does not work, run `./go rb:update` from the `selenium` (parent) directory.
268268
3. In <kbd>Settings / Languages & Frameworks / Ruby SDK and Gems</kbd> add new <kbd>Interpreter</kbd> pointing to `../bazel-selenium/external/rules_ruby_dist/dist/bin/ruby`.
269-
4. You should now be able to run and debug any spec. It uses Chrome by default, but you can alter it using environment variables secified in [Ruby Testing](#ruby-2) section below.
269+
4. You should now be able to run and debug any spec. It uses Chrome by default, but you can alter it using environment variables specified in [Ruby Testing](#ruby-2) section below.
270270

271271
### Rust
272272

common/repositories.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ js_library(
5050

5151
http_archive(
5252
name = "linux_beta_firefox",
53-
url = "https://ftp.mozilla.org/pub/firefox/releases/141.0b4/linux-x86_64/en-US/firefox-141.0b4.tar.xz",
54-
sha256 = "04e66e3e8a7512d2f45b69fe9385c6820182e7b8addfaac218ee10a108a08e6b",
53+
url = "https://ftp.mozilla.org/pub/firefox/releases/141.0b6/linux-x86_64/en-US/firefox-141.0b6.tar.xz",
54+
sha256 = "24ee93812f5943a940c6fe9231726a2c6dce10e1767204d5127d8cdafdf257b5",
5555
build_file_content = """
5656
load("@aspect_rules_js//js:defs.bzl", "js_library")
5757
package(default_visibility = ["//visibility:public"])
@@ -72,8 +72,8 @@ js_library(
7272

7373
dmg_archive(
7474
name = "mac_beta_firefox",
75-
url = "https://ftp.mozilla.org/pub/firefox/releases/141.0b4/mac/en-US/Firefox%20141.0b4.dmg",
76-
sha256 = "edcd3074f81a3e318aa672db0ec48f2c57c9eebbe9275e22fd64a42c9eb8d29b",
75+
url = "https://ftp.mozilla.org/pub/firefox/releases/141.0b6/mac/en-US/Firefox%20141.0b6.dmg",
76+
sha256 = "26ff8ba6534ee8c15a7b55fc4a38bde1e72c515c878b0abbe87b4dd8993f81db",
7777
build_file_content = """
7878
load("@aspect_rules_js//js:defs.bzl", "js_library")
7979
package(default_visibility = ["//visibility:public"])

java/spotbugs-excludes.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,6 @@
6363
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
6464
</Match>
6565

66-
<Match>
67-
<Class name="org.openqa.selenium.firefox.Executable"/>
68-
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
69-
</Match>
70-
71-
<Match>
72-
<Class name="org.openqa.selenium.firefox.FirefoxBinary"/>
73-
<Bug pattern="DMI_HARDCODED_ABSOLUTE_FILENAME,NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
74-
</Match>
75-
7666
<Match>
7767
<Class name="org.openqa.selenium.firefox.FirefoxDriver"/>
7868
<Bug pattern="NP_BOOLEAN_RETURN_NULL,UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD"/>

java/src/org/openqa/selenium/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ java_export(
1313
srcs = glob([
1414
"*.java",
1515
"federatedcredentialmanagement/*.java",
16-
"html5/*.java",
1716
"internal/*.java",
1817
"interactions/**/*.java",
1918
"logging/**/*.java",

java/src/org/openqa/selenium/By.java

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import java.util.Map;
2424
import java.util.Objects;
2525
import java.util.regex.Pattern;
26+
import org.jspecify.annotations.NullMarked;
27+
import org.jspecify.annotations.Nullable;
2628
import org.openqa.selenium.internal.Require;
2729

2830
/**
@@ -40,6 +42,7 @@
4042
* }
4143
* </code></pre>
4244
*/
45+
@NullMarked
4346
public abstract class By {
4447
/**
4548
* @param id The value of the "id" attribute to search for.
@@ -158,7 +161,7 @@ protected JavascriptExecutor getJavascriptExecutor(SearchContext context) {
158161
}
159162

160163
@Override
161-
public boolean equals(Object o) {
164+
public boolean equals(@Nullable Object o) {
162165
if (!(o instanceof By)) {
163166
return false;
164167
}
@@ -296,6 +299,7 @@ public String toString() {
296299

297300
public static class ByClassName extends PreW3CLocator {
298301

302+
private static final Pattern AT_LEAST_ONE_WHITESPACE = Pattern.compile(".*\\s.*");
299303
private final String className;
300304

301305
public ByClassName(String className) {
@@ -305,7 +309,7 @@ public ByClassName(String className) {
305309
.nonNull("Cannot find elements when the class name expression is null."),
306310
".%s");
307311

308-
if (className.matches(".*\\s.*")) {
312+
if (AT_LEAST_ONE_WHITESPACE.matcher(className).matches()) {
309313
throw new InvalidSelectorException("Compound class names not permitted");
310314
}
311315

@@ -341,9 +345,9 @@ public interface Remotable {
341345

342346
class Parameters {
343347
private final String using;
344-
private final Object value;
348+
private final @Nullable Object value;
345349

346-
public Parameters(String using, Object value) {
350+
public Parameters(String using, @Nullable Object value) {
347351
this.using = Require.nonNull("Search mechanism", using);
348352
// There may be subclasses where the value is optional. Allow for this.
349353
this.value = value;
@@ -353,7 +357,7 @@ public String using() {
353357
return using;
354358
}
355359

356-
public Object value() {
360+
public @Nullable Object value() {
357361
return value;
358362
}
359363

@@ -363,7 +367,7 @@ public String toString() {
363367
}
364368

365369
@Override
366-
public boolean equals(Object o) {
370+
public boolean equals(@Nullable Object o) {
367371
if (!(o instanceof Parameters)) {
368372
return false;
369373
}
@@ -376,8 +380,8 @@ public int hashCode() {
376380
return Objects.hash(using, value);
377381
}
378382

379-
private Map<String, Object> toJson() {
380-
Map<String, Object> params = new HashMap<>();
383+
private Map<String, @Nullable Object> toJson() {
384+
Map<String, @Nullable Object> params = new HashMap<>();
381385
params.put("using", using);
382386
params.put("value", value);
383387
return Collections.unmodifiableMap(params);
@@ -409,7 +413,7 @@ public final Parameters getRemoteParameters() {
409413
return params;
410414
}
411415

412-
protected final Map<String, Object> toJson() {
416+
protected final Map<String, @Nullable Object> toJson() {
413417
return getRemoteParameters().toJson();
414418
}
415419
}
@@ -440,7 +444,7 @@ public final Parameters getRemoteParameters() {
440444
return remoteParams;
441445
}
442446

443-
protected final Map<String, Object> toJson() {
447+
protected final Map<String, @Nullable Object> toJson() {
444448
return fallback.toJson();
445449
}
446450

java/src/org/openqa/selenium/Capabilities.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,18 @@
2424
import java.util.Optional;
2525
import java.util.Set;
2626
import java.util.stream.Stream;
27+
import org.jspecify.annotations.NullMarked;
28+
import org.jspecify.annotations.Nullable;
2729

2830
/** Describes a series of key/value pairs that encapsulate aspects of a browser. */
31+
@NullMarked
2932
public interface Capabilities extends Serializable {
3033

3134
default String getBrowserName() {
3235
return String.valueOf(Optional.ofNullable(getCapability("browserName")).orElse(""));
3336
}
3437

35-
default Platform getPlatformName() {
38+
default @Nullable Platform getPlatformName() {
3639
return Stream.of("platformName")
3740
.map(this::getCapability)
3841
.filter(Objects::nonNull)
@@ -67,7 +70,7 @@ default String getBrowserVersion() {
6770
* @return The value, or null if not set.
6871
* @see org.openqa.selenium.remote.CapabilityType
6972
*/
70-
Object getCapability(String capabilityName);
73+
@Nullable Object getCapability(String capabilityName);
7174

7275
/**
7376
* @param capabilityName The capability to check.

java/src/org/openqa/selenium/HasCapabilities.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717

1818
package org.openqa.selenium;
1919

20+
import org.jspecify.annotations.NullMarked;
21+
2022
/**
2123
* Used by classes to indicate that they can describe the {@link org.openqa.selenium.Capabilities}
2224
* they possess. This can be used for run-time detection of features.
2325
*/
26+
@NullMarked
2427
public interface HasCapabilities {
2528
/**
2629
* @return The capabilities of the current driver.

0 commit comments

Comments
 (0)