diff --git a/.github/workflows/checkstyle.yml b/.github/workflows/checkstyle.yml
index 594e9878e8d..de6521deb8d 100644
--- a/.github/workflows/checkstyle.yml
+++ b/.github/workflows/checkstyle.yml
@@ -22,12 +22,12 @@ jobs:
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up JDK
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
+ uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
java-version: 21
distribution: 'temurin'
cache: maven
- - uses: reviewdog/action-setup@3f401fe1d58fe77e10d665ab713057375e39b887 # v0.20.1
+ - uses: reviewdog/action-setup@e04ffabe3898a0af8d0fb1af00c188831c4b5893 # v0.20.1
name: Set up reviewdog
with:
reviewdog_version: latest
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index e0c5c1693ce..cd6dabaf43e 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -24,12 +24,12 @@ jobs:
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up JDK ${{ matrix.Java }}
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
+ uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
java-version: ${{ matrix.Java }}
distribution: 'temurin'
cache: maven
- - uses: reviewdog/action-setup@3f401fe1d58fe77e10d665ab713057375e39b887 # v0.20.1
+ - uses: reviewdog/action-setup@e04ffabe3898a0af8d0fb1af00c188831c4b5893 # v0.20.1
name: Set up reviewdog
with:
reviewdog_version: latest
diff --git a/.github/workflows/pmd.yml b/.github/workflows/pmd.yml
index b5f1a3d3c9f..51bc4988d02 100644
--- a/.github/workflows/pmd.yml
+++ b/.github/workflows/pmd.yml
@@ -20,12 +20,12 @@ jobs:
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up JDK
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
+ uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
java-version: 21
distribution: 'temurin'
cache: maven
- - uses: reviewdog/action-setup@3f401fe1d58fe77e10d665ab713057375e39b887 # v0.20.1
+ - uses: reviewdog/action-setup@e04ffabe3898a0af8d0fb1af00c188831c4b5893 # v0.20.1
name: Set up reviewdog
with:
reviewdog_version: latest
diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml
index 562589dacba..3536fd3b400 100644
--- a/.github/workflows/scorecard.yml
+++ b/.github/workflows/scorecard.yml
@@ -37,7 +37,7 @@ jobs:
persist-credentials: false
- name: "Run analysis"
- uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
+ uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
with:
results_file: results.sarif
results_format: sarif
@@ -59,7 +59,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: SARIF file
path: results.sarif
diff --git a/README.md b/README.md
index 393e8eea5ae..aa727ffb546 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# 
-Version 4.7.0 / November 29, 2024
+Version 4.14.0 / July 30, 2025
:heart: [Sponsor](https://github.com/sponsors/rbri)
@@ -9,40 +9,48 @@ Version 4.7.0 / November 29, 2024
### Homepage
-[htmlunit.org][4]
+[htmlunit.org](https://www.htmlunit.org)
### News
-**[Developer Blog][15]**
+**[Developer Blog](https://htmlunit.github.io/htmlunit-blog/)**
+
+[HtmlUnit@mastodon](https://fosstodon.org/@HtmlUnit) | [HtmlUnit@bsky](https://bsky.app/profile/htmlunit.bsky.social) | [HtmlUnit@Twitter](https://twitter.com/HtmlUnit)
+
+
+## Table of Contents
+- [Overview](#overview)
+- [Get it!](#get-it)
+ - [Maven](#maven)
+ - [Gradle](#gradle)
+- [Getting Started](#getting-started)
+- [Features](#features)
+ - [Selenium Integration](#selenium-integration)
+ - [jsoup Bridge](#jsoup-bridge)
+ - [HtmlUnit satellite projects](#htmlunit-satellite-projects)
+ - [Built on HtmlUnit](#built-on-htmlunit)
+- [Vulnerabilities](#vulnerabilities)
+- [Sponsoring](#sponsoring)
+- [Contributing](#contributing)
+- [Last CI build](#last-ci-build)
+ - [Maven](#maven-1)
+ - [Gradle](#gradle-1)
+- [License](#license)
+- [Development](#development)
+- [Some insights](#some-insights)
-[HtmlUnit@mastodon][13] | [HtmlUnit@Twitter][3]
-
-[HtmlUnit Kanban Board][6]
-
-> **Check out HtmlUnit [satellite projects](https://github.com/orgs/HtmlUnit/repositories)**,
-such as:
-> * [HtmlUnit on android](https://github.com/HtmlUnit/htmlunit-android)
-> * [HtmlUnit for .Net](https://github.com/HtmlUnit/NHtmlUnit)
-> * or [our Rhino fork](https://github.com/HtmlUnit/htmlunit-rhino-fork) (the JS engine)
->
-> Note as well that you can use HtmlUnit with [Selenium](https://www.selenium.dev/) via
-> their [htmlunit-driver](https://github.com/SeleniumHQ/htmlunit-driver)!
-
-
-## Sponsoring
+## Overview
+HtmlUnit is a "GUI-less browser for Java programs". It models HTML documents and provides an API that allows you to invoke pages, fill out forms, click links, etc... just like you do in your "normal" browser.
-Constantly updating and maintaining the HtmlUnit code base already takes a lot of time.
+It has fairly good JavaScript support (which is constantly improving) and is able to work even with quite complex AJAX libraries, simulating Chrome, Firefox or Internet Explorer depending on the configuration used.
-I would like to make 2 major extensions in the next few months
-* [Add HTTP/2 support](https://github.com/HtmlUnit/htmlunit/issues/370)
-* [Replace the Rhino based JavaScript engine](https://github.com/HtmlUnit/htmlunit/issues/755)
+HtmlUnit is typically used for testing purposes or to retrieve information from web sites.
-For doing this I need your [sponsoring](https://github.com/sponsors/rbri).
## Get it!
-* [Download from GitHub][12]
-* [Download from Sourceforge][1]
+* [Download from GitHub](https://github.com/HtmlUnit/htmlunit/releases)
+* [Download from Sourceforge](https://sourceforge.net/projects/htmlunit/files/htmlunit/)
* [Release History](https://www.htmlunit.org/changes-report.html)
### Maven
@@ -53,7 +61,7 @@ Add to your `pom.xml`:
P getPage(final WebWindow webWindow, final WebRequest webReques
/**
* Convenient method to build a URL and load it into the current WebWindow as it would be done
* by {@link #getPage(WebWindow, WebRequest)}.
- * @param url the URL of the new content
+ * @param url the URL of the new content; in contrast to real browsers plain file url's are not supported.
+ * You have to use the 'file', 'data', 'blob', 'http' or 'https' protocol.
* @param the page type
* @return the new page
* @throws FailingHttpStatusCodeException if the server returns a failing status code AND the property
@@ -523,7 +532,8 @@ public P getPage(final String url) throws IOException, FailingH
/**
* Convenient method to load a URL into the current top WebWindow as it would be done
* by {@link #getPage(WebWindow, WebRequest)}.
- * @param url the URL of the new content
+ * @param url the URL of the new content; in contrast to real browsers plain file url's are not supported.
+ * You have to use the 'file', 'data', 'blob', 'http' or 'https' protocol.
* @param the page type
* @return the new page
* @throws FailingHttpStatusCodeException if the server returns a failing status code AND the property
@@ -534,7 +544,6 @@ public P getPage(final URL url) throws IOException, FailingHttp
final WebRequest request = new WebRequest(url, getBrowserVersion().getHtmlAcceptHeader(),
getBrowserVersion().getAcceptEncodingHeader());
request.setCharset(UTF_8);
-
return getPage(getCurrentWindow().getTopWindow(), request);
}
@@ -589,7 +598,7 @@ public Page loadWebResponseInto(final WebResponse webResponse, final WebWindow w
* @param webResponse the response that will be used to create the new page
* @param webWindow the window that the new page will be placed within
* @param forceAttachmentWithFilename if not {@code null}, handle this as an attachment with the specified name
- * or if an empty string ("") use the filename provided in the response
+ * or if an empty string ("") use the filename provided in the response
* @throws IOException if an IO error occurs
* @throws FailingHttpStatusCodeException if the server returns a failing status code AND the property
* {@link WebClientOptions#setThrowExceptionOnFailingStatusCode(boolean)} is set to true
@@ -1539,7 +1548,8 @@ private WebResponse makeWebResponseForJavaScriptUrl(final WebWindow webWindow, f
* @return the WebResponse
*/
public WebResponse loadWebResponse(final WebRequest webRequest) throws IOException {
- switch (webRequest.getUrl().getProtocol()) {
+ final String protocol = webRequest.getUrl().getProtocol();
+ switch (protocol) {
case UrlUtils.ABOUT:
return makeWebResponseForAboutUrl(webRequest);
@@ -1552,8 +1562,12 @@ public WebResponse loadWebResponse(final WebRequest webRequest) throws IOExcepti
case "blob":
return makeWebResponseForBlobUrl(webRequest);
- default:
+ case "http":
+ case "https":
return loadWebResponseFromWebConnection(webRequest, ALLOWED_REDIRECTIONS_SAME_URL);
+
+ default:
+ throw new IOException("Unsupported protocol '" + protocol + "'");
}
}
@@ -2080,7 +2094,7 @@ public void setClipboardHandler(final ClipboardHandler handler) {
/**
* Returns the current {@link PrintHandler}.
* @return the current {@link PrintHandler} or null if print
- * requests are ignored
+ * requests are ignored
*/
public PrintHandler getPrintHandler() {
return printHandler_;
@@ -2091,7 +2105,7 @@ public PrintHandler getPrintHandler() {
* (Printing Spec).
*
* @param handler the new {@link PrintHandler} or null if you like to
- * ignore print requests (default is null)
+ * ignore print requests (default is null)
*/
public void setPrintHandler(final PrintHandler handler) {
printHandler_ = handler;
@@ -2471,8 +2485,44 @@ public int waitForBackgroundJavaScript(final long timeoutMillis) {
* method returns; will be Experimental API: May be changed in next release
+ * and may not yet work perfectly! This method blocks until all background JavaScript tasks scheduled to start executing before
+ * If there is no background JavaScript task currently executing, and there is no background JavaScript
+ * task scheduled to start executing within the specified time, this method returns immediately -- even
+ * if there are tasks scheduled to be executed after Note that the total time spent executing a background JavaScript task is never known ahead of
+ * time, so this method makes no guarantees as to how long it will block. Use this method instead of {@link #waitForBackgroundJavaScript(long)} if you know roughly when
+ * your background JavaScript is supposed to start executing, but you're not necessarily sure how long
+ * it will take to execute. This property is transient (because KeyStore is not serializable)
*
* @param keyStore {@link KeyStore} to use
* @param keyStorePassword the keystore password
@@ -205,6 +209,7 @@ public void setSSLClientCertificateKeyStore(final KeyStore keyStore, final char[
* "sun.security.ssl.allowUnsafeRenegotiation" to true, as hinted in
*
* TLS Renegotiation Issue.
+ * This property is transient (because KeyStore is not serializable)
*
* @param keyStoreUrl the URL which locates the certificate {@link KeyStore}
* @param keyStorePassword the certificate {@link KeyStore} password
@@ -253,6 +258,8 @@ public void setSSLClientCertificateKeyStore(final InputStream keyStoreInputStrea
/**
* Gets the SSLClientCertificateStore.
+ * This property is transient (because KeyStore is not serializable)
+ *
* @return the KeyStore for use on SSL connections
*/
public KeyStore getSSLClientCertificateStore() {
@@ -541,8 +548,8 @@ public String getSSLInsecureProtocol() {
/**
* Sets the SSL server certificate trust store. All server certificates will be validated against
* this trust store.
- *
- * The needed parameters are used to construct a {@link java.security.KeyStore}.
+ * This property is transient (because KeyStore is not serializable)
+ * The needed parameters are used to construct a {@link java.security.KeyStore}.
*
* @param sslTrustStoreUrl the URL which locates the trust store
* @param sslTrustStorePassword the trust store password
@@ -564,6 +571,7 @@ void setSSLTrustStore(final KeyStore keyStore) {
/**
* Gets the SSL TrustStore.
+ * This property is transient (because KeyStore is not serializable)
* @return the SSL TrustStore for insecure SSL connections
*/
public KeyStore getSSLTrustStore() {
@@ -635,8 +643,8 @@ public int getHistoryPageCacheLimit() {
* entries in the history. For older entries only the url is saved; the page
* will be (re)retrieved on demand.
* @param historyPageCacheLimit maximum number of pages to cache in history
- * default is Integer.MAX_VALUE; negative values are having the same effect
- * as setting this to zero.
+ * default is Integer.MAX_VALUE; negative values are having the same effect
+ * as setting this to zero.
*/
public void setHistoryPageCacheLimit(final int historyPageCacheLimit) {
historyPageCacheLimit_ = historyPageCacheLimit;
@@ -720,6 +728,22 @@ public int getScreenHeight() {
return screenHeight_;
}
+ /**
+ * @return the Neko Html parser reader buffer size
+ */
+ public int getNekoReaderBufferSize() {
+ return nekoReaderBufferSize_;
+ }
+
+ /**
+ * Sets the Neko Html parser reader buffer size.
+ *
+ * @param nekoReaderBufferSize the new value
+ */
+ public void setNekoReaderBufferSize(final int nekoReaderBufferSize) {
+ nekoReaderBufferSize_ = nekoReaderBufferSize;
+ }
+
/**
* Enables/disables WebSocket support. By default, this property is enabled.
*
@@ -848,7 +872,10 @@ public void setGeolocation(final Geolocation geolocation) {
geolocation_ = geolocation;
}
- public static class Geolocation {
+ /**
+ * Support class for Geolocation.
+ */
+ public static class Geolocation implements Serializable {
private final double accuracy_;
private final double latitude_;
private final double longitude_;
diff --git a/src/main/java/org/htmlunit/WebConnection.java b/src/main/java/org/htmlunit/WebConnection.java
index 758d96744f6..956d3f41f93 100644
--- a/src/main/java/org/htmlunit/WebConnection.java
+++ b/src/main/java/org/htmlunit/WebConnection.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/WebConsole.java b/src/main/java/org/htmlunit/WebConsole.java
index 8d3de6d1b90..1656f3bf7bf 100644
--- a/src/main/java/org/htmlunit/WebConsole.java
+++ b/src/main/java/org/htmlunit/WebConsole.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/WebRequest.java b/src/main/java/org/htmlunit/WebRequest.java
index 2ef4fd3857b..137225f8c17 100644
--- a/src/main/java/org/htmlunit/WebRequest.java
+++ b/src/main/java/org/htmlunit/WebRequest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,8 +54,12 @@
* @author Lai Quang Duong
* @author Kristof Neirynck
*/
+@SuppressWarnings("PMD.TooManyFields")
public class WebRequest implements Serializable {
+ /**
+ * Enum to configure request creation.
+ */
public enum HttpHint {
/** Force to include the charset. */
IncludeCharsetInContentTypeHeader,
@@ -456,7 +460,7 @@ public String getRequestBody() {
* Other request types result in {@link RuntimeException}.
* Should not be used in combination with {@link #setRequestParameters(List) request parameters}.
* @param requestBody the body content to be submitted if this is a {@code POST}, {@code PUT}
- * or {@code PATCH} request
+ * or {@code PATCH} request
* @throws RuntimeException if the request parameters have already been set
* or this is not a {@code POST}, {@code PUT} or {@code PATCH} request.
*/
@@ -556,17 +560,6 @@ public void setRefererHeader(final URL url) {
}
}
- /**
- * Sets the referer HTTP header - only if the provided url is valid.
- * @param url the url for the referer HTTP header
- *
- * @deprecated as of version 4.5.0; use {@link #setRefererHeader(URL)} instead
- */
- @Deprecated
- public void setRefererlHeader(final URL url) {
- setRefererHeader(url);
- }
-
/**
* Sets the specified name/value pair in the additional HTTP headers.
* @param name the name of the additional HTTP header
@@ -655,6 +648,10 @@ public void setDefaultResponseContentCharset(final Charset defaultResponseConten
this.defaultResponseContentCharset_ = Objects.requireNonNull(defaultResponseContentCharset);
}
+ /**
+ * @param hint the hint to check for
+ * @return true if the hint is enabled
+ */
public boolean hasHint(final HttpHint hint) {
if (httpHints_ == null) {
return false;
@@ -662,6 +659,10 @@ public boolean hasHint(final HttpHint hint) {
return httpHints_.contains(hint);
}
+ /**
+ * Enables the hint.
+ * @param hint the hint to add
+ */
public void addHint(final HttpHint hint) {
if (httpHints_ == null) {
httpHints_ = EnumSet.noneOf(HttpHint.class);
diff --git a/src/main/java/org/htmlunit/WebResponse.java b/src/main/java/org/htmlunit/WebResponse.java
index c54359fd360..4661bde6bb1 100644
--- a/src/main/java/org/htmlunit/WebResponse.java
+++ b/src/main/java/org/htmlunit/WebResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -174,25 +174,6 @@ public Charset getHeaderContentCharset() {
return EncodingSniffer.extractEncodingFromContentType(contentType);
}
- /**
- * Returns the content charset specified explicitly in the header or in the content,
- * or {@code null} if none was specified.
- * @return the content charset specified explicitly in the header or in the content,
- * or {@code null} if none was specified
- *
- * @deprecated as of version 4.0.0; use {@link #getContentCharset()} instead
- */
- @Deprecated
- public Charset getContentCharsetOrNull() {
- try (InputStream is = getContentAsStream()) {
- return EncodingSniffer.sniffEncoding(getResponseHeaders(), is);
- }
- catch (final IOException e) {
- LOG.warn("Error trying to sniff encoding.", e);
- return null;
- }
- }
-
/**
* Returns the content charset for this response, even if no charset was specified explicitly.
*
@@ -257,9 +238,9 @@ public Charset getContentCharset() {
* For example, HTML meta-tag sniffing can be fooled by text that looks-like-a-meta-tag inside
* JavaScript code (false positive) or if the meta-tag is after the first 1024 bytes (false negative).
* @return {@code true} if the charset of the previous call to {@link #getContentCharset()} was
- * "tentative".
+ * "tentative".
* @see
- * https://html.spec.whatwg.org/multipage/parsing.html#concept-encoding-confidence
+ * https://html.spec.whatwg.org/multipage/parsing.html#concept-encoding-confidence
*/
public boolean wasContentCharsetTentative() {
return wasContentCharsetTentative_;
@@ -268,7 +249,7 @@ public boolean wasContentCharsetTentative() {
/**
* Returns the response content as a string, using the charset/encoding specified in the server response.
* @return the response content as a string, using the charset/encoding specified in the server response
- * or null if the content retrieval was failing
+ * or null if the content retrieval was failing
*/
public String getContentAsString() {
return getContentAsString(getContentCharset());
@@ -362,15 +343,6 @@ public void cleanUp() {
}
}
- /**
- * Mark this response for using UTF-8 as default charset.
- * @deprecated as of version 4.0.0; use {@link WebRequest#setDefaultResponseContentCharset(Charset)} instead
- */
- @Deprecated
- public void defaultCharsetUtf8() {
- getWebRequest().setDefaultResponseContentCharset(UTF_8);
- }
-
/**
* @return true if the 2xx
*/
diff --git a/src/main/java/org/htmlunit/WebResponseData.java b/src/main/java/org/htmlunit/WebResponseData.java
index bd9b11f9d5f..6f55e37a4ab 100644
--- a/src/main/java/org/htmlunit/WebResponseData.java
+++ b/src/main/java/org/htmlunit/WebResponseData.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -113,7 +113,7 @@ private InputStream getStream(final ByteOrderMark... bomHeaders) throws IOExcept
LOG.error("Reading gzip encodec content failed.", e);
stream.close();
stream = IOUtils.toInputStream(
- "\n"
+ "\n"
+ "document.XYZ
also looks at frames. */
- @BrowserFeature({CHROME, EDGE})
+ @BrowserFeature({CHROME, EDGE, FF})
HTMLDOCUMENT_GET_ALSO_FRAMES,
/** Removing the active element from the dom tree triggers the onblur event. */
@@ -156,10 +160,6 @@ public enum BrowserVersionFeatures {
@BrowserFeature({CHROME, EDGE})
HTMLIMAGE_HTMLUNKNOWNELEMENT,
- /** Clicking an image input submits the value as param if defined. */
- @BrowserFeature({CHROME, EDGE})
- HTMLIMAGE_NAME_VALUE_PARAMS,
-
/** HTMLInputElement image type is not supported. */
@BrowserFeature({CHROME, EDGE})
HTMLINPUT_TYPE_IMAGE_IGNORES_CUSTOM_VALIDITY,
@@ -172,6 +172,10 @@ public enum BrowserVersionFeatures {
@BrowserFeature({CHROME, EDGE})
HTMLINPUT_TYPE_WEEK_SUPPORTED,
+ /** For a stylesheet link report an error if the response type is not text/css. */
+ @BrowserFeature({FF, FF_ESR})
+ HTMLLINK_CHECK_RESPONSE_TYPE_FOR_STYLESHEET,
+
/** If the type is present for a link only use if type is text/css. */
@BrowserFeature({CHROME, EDGE})
HTMLLINK_CHECK_TYPE_FOR_STYLESHEET,
@@ -220,7 +224,8 @@ public enum BrowserVersionFeatures {
@BrowserFeature(FF_ESR)
JS_ANCHOR_PATHNAME_DETECT_WIN_DRIVES_URL,
- /** The anchor pathname detects url's starting with one letter as file url's
+ /**
+ * The anchor pathname detects url's starting with one letter as file url's
* and replaces them with the file protocol. */
@BrowserFeature({CHROME, EDGE})
JS_ANCHOR_PATHNAME_DETECT_WIN_DRIVES_URL_REPLACE,
@@ -265,6 +270,22 @@ public enum BrowserVersionFeatures {
@BrowserFeature(FF)
JS_CLIENTHEIGHT_RADIO_CHECKBOX_14,
+ /** ClientHeight for rb is 17. */
+ @BrowserFeature({FF, FF_ESR})
+ JS_CLIENTHEIGHT_RB_17,
+
+ /** ClientHeight for rt is 9. */
+ @BrowserFeature({FF, FF_ESR})
+ JS_CLIENTHEIGHT_RT_9,
+
+ /** ClientHeight for ruby is 17. */
+ @BrowserFeature({FF, FF_ESR})
+ JS_CLIENTHEIGHT_RUBY_17,
+
+ /** ClientWidth for text/password input is 154. */
+ @BrowserFeature(FF_ESR)
+ JS_CLIENTWIDTH_INPUT_TEXT_154,
+
/** ClientWidth for text/password input is 173. */
@BrowserFeature({CHROME, EDGE})
JS_CLIENTWIDTH_INPUT_TEXT_173,
@@ -290,7 +311,7 @@ public enum BrowserVersionFeatures {
JS_DOCUMENT_SELECTION_RANGE_COUNT,
/** Javascript {@code Error.captureStackTrace}. */
- @BrowserFeature({CHROME, EDGE})
+ @BrowserFeature({CHROME, EDGE, FF})
JS_ERROR_CAPTURE_STACK_TRACE,
/** Javascript {@code Error.stackTraceLimit}. */
@@ -305,19 +326,10 @@ public enum BrowserVersionFeatures {
@BrowserFeature({FF, FF_ESR})
JS_EVENT_KEYBOARD_CTOR_WHICH,
- /** do not trigger the onload event if the frame content
- * was not shown because of the csp. */
- @BrowserFeature(FF_ESR)
- JS_EVENT_LOAD_SUPPRESSED_BY_CONTENT_SECURIRY_POLICY,
-
/** form.dispatchEvent(e) submits the form if the event is of type 'submit'. */
@BrowserFeature({FF, FF_ESR})
JS_FORM_DISPATCHEVENT_SUBMITS,
- /** HTMLObject Validity isValid ignores custom error property. */
- @BrowserFeature({CHROME, EDGE})
- JS_HTML_OBJECT_VALIDITYSTATE_ISVALID_IGNORES_CUSTOM_ERROR,
-
/** Executes the {@code onload} handler, regardless of the whether the element was already attached to the page. */
@BrowserFeature({FF, FF_ESR})
JS_IFRAME_ALWAYS_EXECUTE_ONLOAD,
@@ -412,14 +424,14 @@ public enum BrowserVersionFeatures {
@BrowserFeature({FF, FF_ESR})
JS_STORAGE_PRESERVED_INCLUDED,
+ /** Indicates letterSpacing support percent values. */
+ @BrowserFeature(FF)
+ JS_STYLE_LETTER_SPACING_ACCEPTS_PERCENT,
+
/** Indicates wordSpacing support percent values. */
@BrowserFeature({FF, FF_ESR})
JS_STYLE_WORD_SPACING_ACCEPTS_PERCENT,
- /** Set span zo zero if provided value is invalid. */
- @BrowserFeature({CHROME, EDGE})
- JS_TABLE_SPAN_SET_ZERO_IF_INVALID,
-
/** window.getComputedStyle works with pseudo selectors without colon in front. */
@BrowserFeature({CHROME, EDGE})
JS_WINDOW_COMPUTED_STYLE_PSEUDO_ACCEPT_WITHOUT_COLON,
@@ -429,10 +441,10 @@ public enum BrowserVersionFeatures {
JS_WINDOW_INSTALL_TRIGGER_NULL,
/**
- * Difference of window.outer/inner height is 136.
+ * Difference of window.outer/inner height is 138.
*/
@BrowserFeature(EDGE)
- JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_136,
+ JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_138,
/**
* Difference of window.outer/inner height is 147.
@@ -443,9 +455,15 @@ public enum BrowserVersionFeatures {
/**
* Difference of window.outer/inner height is 91.
*/
- @BrowserFeature({FF, FF_ESR})
+ @BrowserFeature(FF_ESR)
JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_91,
+ /**
+ * Difference of window.outer/inner height is 93.
+ */
+ @BrowserFeature(FF)
+ JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_93,
+
/** Window.getSelection returns null, if the window is not visible. */
@BrowserFeature({FF, FF_ESR})
JS_WINDOW_SELECTION_NULL_IF_INVISIBLE,
diff --git a/src/main/java/org/htmlunit/Cache.java b/src/main/java/org/htmlunit/Cache.java
index b9ad5bf8a86..3b9e14523d0 100644
--- a/src/main/java/org/htmlunit/Cache.java
+++ b/src/main/java/org/htmlunit/Cache.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -169,7 +169,7 @@ else if (response.getResponseHeaderValue(HttpHeader.LAST_MODIFIED) != null) {
* @param request the request corresponding to the specified compiled script
* @param response the response corresponding to the specified compiled script
* @param toCache the object that is to be cached, if possible (may be for instance a compiled script or
- * simply a WebResponse)
+ * simply a WebResponse)
* @return whether the response was cached or not
*/
public boolean cacheIfPossible(final WebRequest request, final WebResponse response, final Object toCache) {
diff --git a/src/main/java/org/htmlunit/ClipboardHandler.java b/src/main/java/org/htmlunit/ClipboardHandler.java
index 5bb4ae0bacc..e00a2a57097 100644
--- a/src/main/java/org/htmlunit/ClipboardHandler.java
+++ b/src/main/java/org/htmlunit/ClipboardHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/CollectingAlertHandler.java b/src/main/java/org/htmlunit/CollectingAlertHandler.java
index e86c785ca5b..76ca4d2aae2 100644
--- a/src/main/java/org/htmlunit/CollectingAlertHandler.java
+++ b/src/main/java/org/htmlunit/CollectingAlertHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/ConfirmHandler.java b/src/main/java/org/htmlunit/ConfirmHandler.java
index 77c3727c58a..1502869f3e2 100644
--- a/src/main/java/org/htmlunit/ConfirmHandler.java
+++ b/src/main/java/org/htmlunit/ConfirmHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +21,9 @@
* are triggered when the JavaScript function window.confirm()
is invoked.
*
* @author Mike Bowler
+ * @author Ronald Brill
*/
+@FunctionalInterface
public interface ConfirmHandler extends Serializable {
/**
diff --git a/src/main/java/org/htmlunit/CookieManager.java b/src/main/java/org/htmlunit/CookieManager.java
index ce71e3ae66b..063e3c417da 100644
--- a/src/main/java/org/htmlunit/CookieManager.java
+++ b/src/main/java/org/htmlunit/CookieManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/DefaultCredentialsProvider.java b/src/main/java/org/htmlunit/DefaultCredentialsProvider.java
index 59012821abe..b9c3478866e 100644
--- a/src/main/java/org/htmlunit/DefaultCredentialsProvider.java
+++ b/src/main/java/org/htmlunit/DefaultCredentialsProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@ public class DefaultCredentialsProvider implements CredentialsProvider, Serializ
/** The {@code null} value represents any host. */
public static final String ANY_HOST = null;
- /**The {@code -1} value represents any port. */
+ /** The {@code -1} value represents any port. */
public static final int ANY_PORT = -1;
/** The {@code null} value represents any realm. */
diff --git a/src/main/java/org/htmlunit/DefaultCssErrorHandler.java b/src/main/java/org/htmlunit/DefaultCssErrorHandler.java
index 6cb7c625360..ecbc2bbc23b 100644
--- a/src/main/java/org/htmlunit/DefaultCssErrorHandler.java
+++ b/src/main/java/org/htmlunit/DefaultCssErrorHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/DefaultPageCreator.java b/src/main/java/org/htmlunit/DefaultPageCreator.java
index 1b0f996d933..85aff6db4ca 100644
--- a/src/main/java/org/htmlunit/DefaultPageCreator.java
+++ b/src/main/java/org/htmlunit/DefaultPageCreator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -297,7 +297,7 @@ protected HtmlPage createHtmlPage(final WebResponse webResponse, final WebWindow
final HtmlPage page = new HtmlPage(webResponse, webWindow);
webWindow.setEnclosedPage(page);
- HTML_PARSER.parse(webResponse, page, false, false);
+ HTML_PARSER.parse(webWindow.getWebClient(), webResponse, page, false, false);
return page;
}
@@ -313,7 +313,7 @@ protected XHtmlPage createXHtmlPage(final WebResponse webResponse, final WebWind
final XHtmlPage page = new XHtmlPage(webResponse, webWindow);
webWindow.setEnclosedPage(page);
- HTML_PARSER.parse(webResponse, page, true, false);
+ HTML_PARSER.parse(webWindow.getWebClient(), webResponse, page, true, false);
return page;
}
diff --git a/src/main/java/org/htmlunit/DialogWindow.java b/src/main/java/org/htmlunit/DialogWindow.java
index 571a691f723..12e5e0ac4a7 100644
--- a/src/main/java/org/htmlunit/DialogWindow.java
+++ b/src/main/java/org/htmlunit/DialogWindow.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/DownloadedContent.java b/src/main/java/org/htmlunit/DownloadedContent.java
index a3654cb8d20..29d6d2443dc 100644
--- a/src/main/java/org/htmlunit/DownloadedContent.java
+++ b/src/main/java/org/htmlunit/DownloadedContent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/ElementNotFoundException.java b/src/main/java/org/htmlunit/ElementNotFoundException.java
index 18341269852..3f178ad5159 100644
--- a/src/main/java/org/htmlunit/ElementNotFoundException.java
+++ b/src/main/java/org/htmlunit/ElementNotFoundException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/FailingHttpStatusCodeException.java b/src/main/java/org/htmlunit/FailingHttpStatusCodeException.java
index 1ccc2ff1089..98b652d6803 100644
--- a/src/main/java/org/htmlunit/FailingHttpStatusCodeException.java
+++ b/src/main/java/org/htmlunit/FailingHttpStatusCodeException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/FormEncodingType.java b/src/main/java/org/htmlunit/FormEncodingType.java
index d395c57c560..1033fef81f5 100644
--- a/src/main/java/org/htmlunit/FormEncodingType.java
+++ b/src/main/java/org/htmlunit/FormEncodingType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/FrameContentHandler.java b/src/main/java/org/htmlunit/FrameContentHandler.java
index 0bde91b58de..90917500cba 100644
--- a/src/main/java/org/htmlunit/FrameContentHandler.java
+++ b/src/main/java/org/htmlunit/FrameContentHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
*
* @author Ronald Brill
*/
+@FunctionalInterface
public interface FrameContentHandler {
/**
diff --git a/src/main/java/org/htmlunit/History.java b/src/main/java/org/htmlunit/History.java
index 6122e714716..15ac7a25907 100644
--- a/src/main/java/org/htmlunit/History.java
+++ b/src/main/java/org/htmlunit/History.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/HttpHeader.java b/src/main/java/org/htmlunit/HttpHeader.java
index d61c962bf34..b71be6f696c 100644
--- a/src/main/java/org/htmlunit/HttpHeader.java
+++ b/src/main/java/org/htmlunit/HttpHeader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/HttpMethod.java b/src/main/java/org/htmlunit/HttpMethod.java
index a77391a2234..36002469782 100644
--- a/src/main/java/org/htmlunit/HttpMethod.java
+++ b/src/main/java/org/htmlunit/HttpMethod.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/HttpWebConnection.java b/src/main/java/org/htmlunit/HttpWebConnection.java
index 7f266d0ebb2..a5304245782 100644
--- a/src/main/java/org/htmlunit/HttpWebConnection.java
+++ b/src/main/java/org/htmlunit/HttpWebConnection.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -426,7 +426,8 @@ private static Charset getCharset(final Charset charset, final ListNodeIterator
over the subtree rooted at the
* specified node.
* @param root The node which will be iterated together with its
- * children. The NodeIterator
is initially positioned
- * just before this node. The whatToShow
flags and the
- * filter, if any, are not considered when setting this position. The
- * root must not be null
.
+ * children. The NodeIterator
is initially positioned
+ * just before this node. The whatToShow
flags and the
+ * filter, if any, are not considered when setting this position. The
+ * root must not be null
.
* @param whatToShow This flag specifies which node types may appear in
- * the logical view of the tree presented by the
- * NodeIterator
. See the description of
- * NodeFilter
for the set of possible SHOW_
- * values.These flags can be combined using OR
.
+ * the logical view of the tree presented by the
+ * NodeIterator
. See the description of
+ * NodeFilter
for the set of possible SHOW_
+ * values.These flags can be combined using OR
.
* @param filter The NodeFilter
to be used with this
- * NodeIterator
, or null
to indicate no
- * filter.
+ * NodeIterator
, or null
to indicate no
+ * filter.
* @param entityReferenceExpansion The value of this flag determines
- * whether entity reference nodes are expanded.
+ * whether entity reference nodes are expanded.
* @return The newly created NodeIterator
.
* @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the specified root
is
- * null
.
+ * NOT_SUPPORTED_ERR: Raised if the specified root
is null
.
*/
public DomNodeIterator createNodeIterator(final Node root, final int whatToShow, final NodeFilter filter,
final boolean entityReferenceExpansion) throws DOMException {
diff --git a/src/main/java/org/htmlunit/SilentCssErrorHandler.java b/src/main/java/org/htmlunit/SilentCssErrorHandler.java
index 88d44bf8f9d..c7022d09a81 100644
--- a/src/main/java/org/htmlunit/SilentCssErrorHandler.java
+++ b/src/main/java/org/htmlunit/SilentCssErrorHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/SilentIncorrectnessListener.java b/src/main/java/org/htmlunit/SilentIncorrectnessListener.java
index fe95df873b2..e8e1dfa1995 100644
--- a/src/main/java/org/htmlunit/SilentIncorrectnessListener.java
+++ b/src/main/java/org/htmlunit/SilentIncorrectnessListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/StatusHandler.java b/src/main/java/org/htmlunit/StatusHandler.java
index f1a7a07c8d4..2ea5ff8be5b 100644
--- a/src/main/java/org/htmlunit/StatusHandler.java
+++ b/src/main/java/org/htmlunit/StatusHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/StorageHolder.java b/src/main/java/org/htmlunit/StorageHolder.java
index 73e4e970334..19b917817a7 100644
--- a/src/main/java/org/htmlunit/StorageHolder.java
+++ b/src/main/java/org/htmlunit/StorageHolder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/StringWebResponse.java b/src/main/java/org/htmlunit/StringWebResponse.java
index 5ac6e4e6464..0f1d0fbd791 100644
--- a/src/main/java/org/htmlunit/StringWebResponse.java
+++ b/src/main/java/org/htmlunit/StringWebResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/TextPage.java b/src/main/java/org/htmlunit/TextPage.java
index fe21deaf77f..1c30e4c721d 100644
--- a/src/main/java/org/htmlunit/TextPage.java
+++ b/src/main/java/org/htmlunit/TextPage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/ThreadedRefreshHandler.java b/src/main/java/org/htmlunit/ThreadedRefreshHandler.java
index b2925a38d2a..756f11401e8 100644
--- a/src/main/java/org/htmlunit/ThreadedRefreshHandler.java
+++ b/src/main/java/org/htmlunit/ThreadedRefreshHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/TopLevelWindow.java b/src/main/java/org/htmlunit/TopLevelWindow.java
index 99bf5c5dfa4..178006f2c30 100644
--- a/src/main/java/org/htmlunit/TopLevelWindow.java
+++ b/src/main/java/org/htmlunit/TopLevelWindow.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -115,7 +115,7 @@ public void close() {
*
* Closes this window.
* @param ignoreOnbeforeunloadAccepted if true the result of triggering the OnbeforeunloadAccepted event
- * will be ignored
+ * will be ignored
*/
public void close(final boolean ignoreOnbeforeunloadAccepted) {
final Page page = getEnclosedPage();
diff --git a/src/main/java/org/htmlunit/UnexpectedPage.java b/src/main/java/org/htmlunit/UnexpectedPage.java
index 2040e4afaf0..faa027e247d 100644
--- a/src/main/java/org/htmlunit/UnexpectedPage.java
+++ b/src/main/java/org/htmlunit/UnexpectedPage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/Version.java b/src/main/java/org/htmlunit/Version.java
index d737e259004..dcb6d452021 100644
--- a/src/main/java/org/htmlunit/Version.java
+++ b/src/main/java/org/htmlunit/Version.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -79,6 +79,6 @@ public static String getProductVersion() {
* @return the copyright notice
*/
public static String getCopyright() {
- return "Copyright (c) 2002-2024 Gargoyle Software Inc. All rights reserved.";
+ return "Copyright (c) 2002-2025 Gargoyle Software Inc. All rights reserved.";
}
}
diff --git a/src/main/java/org/htmlunit/WaitingRefreshHandler.java b/src/main/java/org/htmlunit/WaitingRefreshHandler.java
index 91186fce65b..1d26563b47d 100644
--- a/src/main/java/org/htmlunit/WaitingRefreshHandler.java
+++ b/src/main/java/org/htmlunit/WaitingRefreshHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/WebAssert.java b/src/main/java/org/htmlunit/WebAssert.java
index ceaa25d46fd..612e444cc46 100644
--- a/src/main/java/org/htmlunit/WebAssert.java
+++ b/src/main/java/org/htmlunit/WebAssert.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/WebClient.java b/src/main/java/org/htmlunit/WebClient.java
index 08f92818e53..0baa51a91b9 100644
--- a/src/main/java/org/htmlunit/WebClient.java
+++ b/src/main/java/org/htmlunit/WebClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -99,6 +99,10 @@
import org.htmlunit.util.MimeType;
import org.htmlunit.util.NameValuePair;
import org.htmlunit.util.UrlUtils;
+import org.htmlunit.websocket.JettyWebSocketAdapter.JettyWebSocketAdapterFactory;
+import org.htmlunit.websocket.WebSocketAdapter;
+import org.htmlunit.websocket.WebSocketAdapterFactory;
+import org.htmlunit.websocket.WebSocketListener;
import org.htmlunit.webstart.WebStartHandler;
/**
@@ -147,6 +151,7 @@
* @author René Schwietzke
* @author Sven Strickroth
*/
+@SuppressWarnings("PMD.TooManyFields")
public class WebClient implements Serializable, AutoCloseable {
/** Logging support. */
@@ -191,6 +196,7 @@ public class WebClient implements Serializable, AutoCloseable {
private transient WebConnection webConnection_;
private CredentialsProvider credentialsProvider_ = new DefaultCredentialsProvider();
private CookieManager cookieManager_ = new CookieManager();
+ private WebSocketAdapterFactory webSocketAdapterFactory_;
private transient AbstractJavaScriptEngine> scriptEngine_;
private transient List0
if there are no jobs left to execute
*/
public int waitForBackgroundJavaScriptStartingBefore(final long delayMillis) {
+ return waitForBackgroundJavaScriptStartingBefore(delayMillis, -1);
+ }
+
+ /**
+ * (now + delayMillis)
have finished executing. Background JavaScript tasks are JavaScript
+ * tasks scheduled for execution via window.setTimeout
, window.setInterval
or
+ * asynchronous XMLHttpRequest
.(now + delayMillis)
.0
if there are no jobs left to execute
+ */
+ public int waitForBackgroundJavaScriptStartingBefore(final long delayMillis, final long timeoutMillis) {
int count = 0;
- final long endTime = System.currentTimeMillis() + delayMillis;
+ long now = System.currentTimeMillis();
+ final long endTime = now + delayMillis;
+ long endTimeout = now + timeoutMillis;
+ if (timeoutMillis < 0 || timeoutMillis < delayMillis) {
+ endTimeout = -1;
+ }
+
for (Iterator
*
* @return a CSS3Parser that will return to an internal pool for reuse if closed using the
- * try-with-resource concept
+ * try-with-resource concept
*/
public PooledCSS3Parser getCSS3Parser() {
return this.css3ParserPool_.get();
@@ -2919,7 +2990,7 @@ static class CSS3ParserPool {
* Our pool. We only hold data when it is available. In addition, synchronization against
* this deque is cheap.
*/
- private ConcurrentLinkedDequeContent Encoding Error
\n"
@@ -136,7 +136,7 @@ private InputStream getStream(final ByteOrderMark... bomHeaders) throws IOExcept
LOG.error("Reading Brotli encodec content failed.", e);
stream.close();
stream = IOUtils.toInputStream(
- "\n"
+ "\n"
+ "Content Encoding Error
\n"
diff --git a/src/main/java/org/htmlunit/WebResponseFromCache.java b/src/main/java/org/htmlunit/WebResponseFromCache.java
index 1354fbaf09f..287d62fe213 100644
--- a/src/main/java/org/htmlunit/WebResponseFromCache.java
+++ b/src/main/java/org/htmlunit/WebResponseFromCache.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/WebWindow.java b/src/main/java/org/htmlunit/WebWindow.java
index b6b44ecb0b0..09612fd7ce4 100644
--- a/src/main/java/org/htmlunit/WebWindow.java
+++ b/src/main/java/org/htmlunit/WebWindow.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -71,7 +71,7 @@ public interface WebWindow extends Serializable {
* is a top level window, then return this window.
*
* @return the top level window that contains this window or this
- * window if there is no parent.
+ * window if there is no parent.
*/
WebWindow getTopWindow();
@@ -187,15 +187,15 @@ public interface WebWindow extends Serializable {
Screen getScreen();
/**
- * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
- *
+ * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ *
* Returns computed style of the element. Computed style represents the final computed values
* of all CSS properties for the element. This method's return value is of the same type as
* that of element.style
, but the value returned by this method is read-only.
*
* @param element the element
* @param pseudoElement a string specifying the pseudo-element to match (may be {@code null});
- * e.g. ':before'
+ * e.g. ':before'
* @return the computed style
*/
ComputedCssStyleDeclaration getComputedStyle(DomElement element, String pseudoElement);
diff --git a/src/main/java/org/htmlunit/WebWindowAdapter.java b/src/main/java/org/htmlunit/WebWindowAdapter.java
index c6f71d85dba..e23da1d128d 100644
--- a/src/main/java/org/htmlunit/WebWindowAdapter.java
+++ b/src/main/java/org/htmlunit/WebWindowAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/WebWindowEvent.java b/src/main/java/org/htmlunit/WebWindowEvent.java
index b1e440081a5..bbe17d7b1dc 100644
--- a/src/main/java/org/htmlunit/WebWindowEvent.java
+++ b/src/main/java/org/htmlunit/WebWindowEvent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -169,7 +169,9 @@ public String toString() {
return builder.toString();
}
- /** @return the event type */
+ /**
+ * @return the event type
+ */
public int getEventType() {
return type_;
}
diff --git a/src/main/java/org/htmlunit/WebWindowImpl.java b/src/main/java/org/htmlunit/WebWindowImpl.java
index 9d3f4fcb536..0fa11202ca0 100644
--- a/src/main/java/org/htmlunit/WebWindowImpl.java
+++ b/src/main/java/org/htmlunit/WebWindowImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,9 +15,10 @@
package org.htmlunit;
import static org.htmlunit.BrowserVersionFeatures.JS_WINDOW_COMPUTED_STYLE_PSEUDO_ACCEPT_WITHOUT_COLON;
-import static org.htmlunit.BrowserVersionFeatures.JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_136;
+import static org.htmlunit.BrowserVersionFeatures.JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_138;
import static org.htmlunit.BrowserVersionFeatures.JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_147;
import static org.htmlunit.BrowserVersionFeatures.JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_91;
+import static org.htmlunit.BrowserVersionFeatures.JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_93;
import java.io.IOException;
import java.io.ObjectInputStream;
@@ -88,8 +89,12 @@ public WebWindowImpl(final WebClient webClient) {
outerHeight_ = innerHeight_ + 91;
outerWidth_ = innerWidth_ + 12;
}
- else if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_136)) {
- outerHeight_ = innerHeight_ + 136;
+ else if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_93)) {
+ outerHeight_ = innerHeight_ + 93;
+ outerWidth_ = innerWidth_ + 16;
+ }
+ else if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_138)) {
+ outerHeight_ = innerHeight_ + 138;
outerWidth_ = innerWidth_ + 24;
}
else if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_147)) {
diff --git a/src/main/java/org/htmlunit/WebWindowListener.java b/src/main/java/org/htmlunit/WebWindowListener.java
index 9c2752ef638..e111fc50c70 100644
--- a/src/main/java/org/htmlunit/WebWindowListener.java
+++ b/src/main/java/org/htmlunit/WebWindowListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,10 @@
* process. This implies, the initial window is already open at the time you attach this listener.
* Therefore you will receive no open event for this.
*
+ * Caution: Frames and also iFrames are handled as separate windows. Therefore the listener is also + * called for each and every containing (i)Frame when e.g. closing a {@link TopLevelWindow}. + *
* * @author Mike Bowler * @author Ronald Brill @@ -37,7 +41,7 @@ public interface WebWindowListener { * This usually takes place AFTER the event was processed * * @param event the event (the oldPage and newPage properties will be {@code null} - * because the event is generated after the window is opened but before the content is loaded) + * because the event is generated after the window is opened but before the content is loaded) */ void webWindowOpened(WebWindowEvent event); diff --git a/src/main/java/org/htmlunit/WebWindowNotFoundException.java b/src/main/java/org/htmlunit/WebWindowNotFoundException.java index 8c40836c47e..a0624ad929e 100644 --- a/src/main/java/org/htmlunit/WebWindowNotFoundException.java +++ b/src/main/java/org/htmlunit/WebWindowNotFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/attachment/Attachment.java b/src/main/java/org/htmlunit/attachment/Attachment.java index 2aeab16c191..3c2c0682897 100644 --- a/src/main/java/org/htmlunit/attachment/Attachment.java +++ b/src/main/java/org/htmlunit/attachment/Attachment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/attachment/AttachmentHandler.java b/src/main/java/org/htmlunit/attachment/AttachmentHandler.java index 6835646fcce..fa0e5138fe4 100644 --- a/src/main/java/org/htmlunit/attachment/AttachmentHandler.java +++ b/src/main/java/org/htmlunit/attachment/AttachmentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/attachment/CollectingAttachmentHandler.java b/src/main/java/org/htmlunit/attachment/CollectingAttachmentHandler.java index 8d63e7f30e1..3bd87518d39 100644 --- a/src/main/java/org/htmlunit/attachment/CollectingAttachmentHandler.java +++ b/src/main/java/org/htmlunit/attachment/CollectingAttachmentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/attachment/DownloadingAttachmentHandler.java b/src/main/java/org/htmlunit/attachment/DownloadingAttachmentHandler.java index 80ab43ffd5f..92d80ffe9ec 100644 --- a/src/main/java/org/htmlunit/attachment/DownloadingAttachmentHandler.java +++ b/src/main/java/org/htmlunit/attachment/DownloadingAttachmentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/attachment/package-info.java b/src/main/java/org/htmlunit/attachment/package-info.java index a17bceabe77..a487aac832e 100644 --- a/src/main/java/org/htmlunit/attachment/package-info.java +++ b/src/main/java/org/htmlunit/attachment/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/css/AbstractCssStyleDeclaration.java b/src/main/java/org/htmlunit/css/AbstractCssStyleDeclaration.java index 893ed286ca2..c0baff12da7 100644 --- a/src/main/java/org/htmlunit/css/AbstractCssStyleDeclaration.java +++ b/src/main/java/org/htmlunit/css/AbstractCssStyleDeclaration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -137,7 +137,7 @@ public String getStyleAttribute(final Definition definition1, final Definition d return element1.getValue(); } if (element1 != null) { - if (element1.compareTo(element2) > 0) { + if (StyleElement.compareToByImportanceAndSpecificity(element1, element2) > 0) { return element1.getValue(); } } @@ -437,6 +437,14 @@ public String getBackgroundRepeat() { return value; } + /** + * Gets the {@code blockSize} style attribute. + * @return the style attribute + */ + public String getBlockSize() { + return getStyleAttribute(Definition.BLOCK_SIZE, true); + } + /** * Gets the {@code borderBottomColor} style attribute. * @return the style attribute diff --git a/src/main/java/org/htmlunit/css/BrowserConfiguration.java b/src/main/java/org/htmlunit/css/BrowserConfiguration.java index a360971c379..2aa740da734 100644 --- a/src/main/java/org/htmlunit/css/BrowserConfiguration.java +++ b/src/main/java/org/htmlunit/css/BrowserConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/css/ComputedCssStyleDeclaration.java b/src/main/java/org/htmlunit/css/ComputedCssStyleDeclaration.java index 9ee4b96f342..702b704a269 100644 --- a/src/main/java/org/htmlunit/css/ComputedCssStyleDeclaration.java +++ b/src/main/java/org/htmlunit/css/ComputedCssStyleDeclaration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,10 @@ import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTHEIGHT_INPUT_18; import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTHEIGHT_RADIO_CHECKBOX_10; import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTHEIGHT_RADIO_CHECKBOX_14; +import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTHEIGHT_RB_17; +import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTHEIGHT_RT_9; +import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTHEIGHT_RUBY_17; +import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTWIDTH_INPUT_TEXT_154; import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTWIDTH_INPUT_TEXT_173; import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTWIDTH_RADIO_CHECKBOX_10; import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTWIDTH_RADIO_CHECKBOX_14; @@ -43,6 +47,7 @@ import org.htmlunit.BrowserVersion; import org.htmlunit.BrowserVersionFeatures; import org.htmlunit.Page; +import org.htmlunit.SgmlPage; import org.htmlunit.WebWindow; import org.htmlunit.css.CssPixelValueConverter.CssValue; import org.htmlunit.css.StyleAttributes.Definition; @@ -86,6 +91,12 @@ import org.htmlunit.html.HtmlFileInput; import org.htmlunit.html.HtmlFooter; import org.htmlunit.html.HtmlHeader; +import org.htmlunit.html.HtmlHeading1; +import org.htmlunit.html.HtmlHeading2; +import org.htmlunit.html.HtmlHeading3; +import org.htmlunit.html.HtmlHeading4; +import org.htmlunit.html.HtmlHeading5; +import org.htmlunit.html.HtmlHeading6; import org.htmlunit.html.HtmlHiddenInput; import org.htmlunit.html.HtmlImage; import org.htmlunit.html.HtmlInlineFrame; @@ -103,6 +114,7 @@ import org.htmlunit.html.HtmlNoLayer; import org.htmlunit.html.HtmlNoScript; import org.htmlunit.html.HtmlOutput; +import org.htmlunit.html.HtmlPage; import org.htmlunit.html.HtmlPasswordInput; import org.htmlunit.html.HtmlPlainText; import org.htmlunit.html.HtmlRadioButtonInput; @@ -135,7 +147,6 @@ import org.htmlunit.html.HtmlUnknownElement; import org.htmlunit.html.HtmlVariable; import org.htmlunit.html.HtmlWordBreak; -import org.htmlunit.javascript.host.html.HTMLElement; import org.htmlunit.platform.Platform; /** @@ -201,7 +212,7 @@ public class ComputedCssStyleDeclaration extends AbstractCssStyleDeclaration { * The computed, cached height of the element to which this computed style belongs (no padding, borders, etc.), * not taking child elements into account. */ - private Integer height2_; + private Integer emptyHeight_; /** The computed, cached horizontal padding (left + right) of the element to which this computed style belongs. */ private Integer paddingHorizontal_; @@ -234,7 +245,7 @@ public class ComputedCssStyleDeclaration extends AbstractCssStyleDeclaration { public ComputedCssStyleDeclaration(final ElementCssStyleDeclaration styleDeclaration) { super(); elementStyleDeclaration_ = styleDeclaration; - getDomElement().setDefaults(this); + elementStyleDeclaration_.getDomElement().setDefaults(this); } /** @@ -499,7 +510,7 @@ public Mapnode
.
- *
- * @param indent white space to indent child nodes
- * @param printWriter writer where child nodes are written
+ * {@inheritDoc}
*/
@Override
- protected void printXml(final String indent, final PrintWriter printWriter) {
+ protected boolean printXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) {
printWriter.print(indent);
printWriter.print("");
- printChildrenAsXml(indent, printWriter);
+ return printChildrenAsXml(indent, true, printWriter);
}
/**
diff --git a/src/main/java/org/htmlunit/html/DomDocumentFragment.java b/src/main/java/org/htmlunit/html/DomDocumentFragment.java
index 382f82f019c..0a52964b75f 100644
--- a/src/main/java/org/htmlunit/html/DomDocumentFragment.java
+++ b/src/main/java/org/htmlunit/html/DomDocumentFragment.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/DomDocumentType.java b/src/main/java/org/htmlunit/html/DomDocumentType.java
index 18d34769d70..638ac0c4c89 100644
--- a/src/main/java/org/htmlunit/html/DomDocumentType.java
+++ b/src/main/java/org/htmlunit/html/DomDocumentType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/DomElement.java b/src/main/java/org/htmlunit/html/DomElement.java
index 16cedb8ebca..e2356510d30 100644
--- a/src/main/java/org/htmlunit/html/DomElement.java
+++ b/src/main/java/org/htmlunit/html/DomElement.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
@@ -110,6 +111,13 @@ public class DomElement extends DomNamespaceNode implements Element {
private String styleString_;
private LinkedHashMapnode
.
- *
- * @param indent white space to indent child nodes
- * @param printWriter writer where child nodes are written
+ * {@inheritDoc}
*/
@Override
- protected void printXml(final String indent, final PrintWriter printWriter) {
+ protected boolean printXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) {
final boolean hasChildren = getFirstChild() != null;
- printWriter.print(indent + "<");
- printOpeningTagContentAsXml(printWriter);
- if (hasChildren || isEmptyXmlTagExpanded()) {
- printWriter.print(">\r\n");
- printChildrenAsXml(indent, printWriter);
+ if (tagBefore) {
+ printWriter.print("\r\n");
printWriter.print(indent);
+ }
+
+ printWriter.print('<');
+ printOpeningTagContentAsXml(printWriter);
+
+ if (hasChildren) {
+ printWriter.print(">");
+ final boolean tag = printChildrenAsXml(indent, true, printWriter);
+ if (tag) {
+ printWriter.print("\r\n");
+ printWriter.print(indent);
+ }
printWriter.print("");
printWriter.print(getTagName());
- printWriter.print(">\r\n");
+ printWriter.print(">");
+ }
+ else if (isEmptyXmlTagExpanded()) {
+ printWriter.print(">");
+ printWriter.print(getTagName());
+ printWriter.print(">");
}
else {
- printWriter.print("/>\r\n");
+ printWriter.print("/>");
}
+
+ return true;
}
/**
@@ -469,7 +490,7 @@ public final Attr removeAttributeNode(final Attr attribute) {
* @param namespaceURI the URI that identifies an XML namespace
* @param localName the name within the namespace
* @return true if an attribute with the given name is specified on this element or has a
- * default value, false otherwise.
+ * default value, false otherwise.
*/
@Override
public final boolean hasAttributeNS(final String namespaceURI, final String localName) {
@@ -604,7 +625,7 @@ public void writeStyleToElement(final Map P click(final Event event,
* @param ctrlKey {@code true} if CTRL is pressed
*
* @return true if doClickFireEvent method has to be called later on (to signal,
- * that the value was changed)
+ * that the value was changed)
* @throws IOException if an IO error occurs
*/
protected boolean doClickStateUpdate(final boolean shiftKey, final boolean ctrlKey) throws IOException {
@@ -1184,11 +1216,9 @@ protected boolean doClickStateUpdate(final boolean shiftKey, final boolean ctrlK
}
/**
- * @see #doClickStateUpdate(boolean, boolean)
- * Usually the click is propagated to the parent. Overwrite if you
- * like to disable this.
- *
+ * Usually the click is propagated to the parent. Overwrite if you like to disable this.
* @return true or false
+ * @see #doClickStateUpdate(boolean, boolean)
*/
protected boolean propagateClickStateUpdateToParent() {
return true;
diff --git a/src/main/java/org/htmlunit/html/DomNamespaceNode.java b/src/main/java/org/htmlunit/html/DomNamespaceNode.java
index ebc04fb2fdc..5370245b195 100644
--- a/src/main/java/org/htmlunit/html/DomNamespaceNode.java
+++ b/src/main/java/org/htmlunit/html/DomNamespaceNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/DomNode.java b/src/main/java/org/htmlunit/html/DomNode.java
index 7cd051f2081..21db7e8fd08 100644
--- a/src/main/java/org/htmlunit/html/DomNode.java
+++ b/src/main/java/org/htmlunit/html/DomNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,7 +48,6 @@
import org.htmlunit.html.serializer.HtmlSerializerVisibleText;
import org.htmlunit.html.xpath.XPathHelper;
import org.htmlunit.javascript.HtmlUnitScriptable;
-import org.htmlunit.javascript.JavaScriptEngine;
import org.htmlunit.javascript.host.event.Event;
import org.htmlunit.xpath.xml.utils.PrefixResolver;
import org.w3c.dom.DOMException;
@@ -208,7 +207,7 @@ public int getStartColumnNumber() {
/**
* Returns the line number in the source page where the DOM node ends.
* @return 0 if no information on the line number is available (for instance for nodes dynamically added),
- * -1 if the end tag has not yet been parsed (during page loading)
+ * -1 if the end tag has not yet been parsed (during page loading)
*/
public int getEndLineNumber() {
return endLineNumber_;
@@ -217,7 +216,7 @@ public int getEndLineNumber() {
/**
* Returns the column number in the source page where the DOM node ends.
* @return 0 if no information on the line number is available (for instance for nodes dynamically added),
- * -1 if the end tag has not yet been parsed (during page loading)
+ * -1 if the end tag has not yet been parsed (during page loading)
*/
public int getEndColumnNumber() {
return endColumnNumber_;
@@ -790,12 +789,14 @@ public String asXml() {
final StringWriter stringWriter = new StringWriter();
try (PrintWriter printWriter = new PrintWriter(stringWriter)) {
+ boolean tag = false;
if (charsetName != null && this instanceof HtmlHtml) {
printWriter.print("\r\n");
+ printWriter.print("\"?>");
+ tag = true;
}
- printXml("", printWriter);
+ printXml("", tag, printWriter);
return stringWriter.toString();
}
}
@@ -804,27 +805,35 @@ public String asXml() {
* Recursively writes the XML data for the node tree starting at
*
- * The following elements support the
+ * The following elements support the Please note: Although this method is public, it is not intended for
* general execution of JavaScript. Users of HtmlUnit should interact with the pages
* as a user would by clicking on buttons or links and having the JavaScript event
- * handlers execute as needed..
+ * handlers execute as needed.
* the page type
* @return the page contained in the current window as returned
- * by {@link org.htmlunit.WebClient#getCurrentWindow()}
+ * by {@link org.htmlunit.WebClient#getCurrentWindow()}
*/
public P setSelectedAttribute(final String optionValue, final boolean isSelected) {
return setSelectedAttribute(optionValue, isSelected, true);
@@ -292,7 +294,7 @@ public P setSelectedAttribute(final String optionValue, final b
* @param invokeOnFocus whether to set focus or not.
* @param the page type
* @return the page contained in the current window as returned
- * by {@link org.htmlunit.WebClient#getCurrentWindow()}
+ * by {@link org.htmlunit.WebClient#getCurrentWindow()}
*/
@SuppressWarnings("unchecked")
public P setSelectedAttribute(final String optionValue,
@@ -319,7 +321,7 @@ public P setSelectedAttribute(final String optionValue,
* @param selectedOption the value of the option that is to change
* @param the page type
* @return the page contained in the current window as returned
- * by {@link org.htmlunit.WebClient#getCurrentWindow()}
+ * by {@link org.htmlunit.WebClient#getCurrentWindow()}
*/
public P setSelectedAttribute(final HtmlOption selectedOption, final boolean isSelected) {
return setSelectedAttribute(selectedOption, isSelected, true, true, false, true);
@@ -341,7 +343,7 @@ public P setSelectedAttribute(final HtmlOption selectedOption,
* @param isClick is mouse clicked
* @param the page type
* @return the page contained in the current window as returned
- * by {@link org.htmlunit.WebClient#getCurrentWindow()}
+ * by {@link org.htmlunit.WebClient#getCurrentWindow()}
*/
@SuppressWarnings("unchecked")
public P setSelectedAttribute(final HtmlOption selectedOption, final boolean isSelected,
diff --git a/src/main/java/org/htmlunit/html/HtmlSelectableTextInput.java b/src/main/java/org/htmlunit/html/HtmlSelectableTextInput.java
index f6aeb79ac85..411df97eef4 100644
--- a/src/main/java/org/htmlunit/html/HtmlSelectableTextInput.java
+++ b/src/main/java/org/htmlunit/html/HtmlSelectableTextInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlSlot.java b/src/main/java/org/htmlunit/html/HtmlSlot.java
index f2e59524748..0ebc751d2fe 100644
--- a/src/main/java/org/htmlunit/html/HtmlSlot.java
+++ b/src/main/java/org/htmlunit/html/HtmlSlot.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlSmall.java b/src/main/java/org/htmlunit/html/HtmlSmall.java
index d7b8bb502e3..a8e2f616292 100644
--- a/src/main/java/org/htmlunit/html/HtmlSmall.java
+++ b/src/main/java/org/htmlunit/html/HtmlSmall.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlSource.java b/src/main/java/org/htmlunit/html/HtmlSource.java
index 00ca3280eee..e554dc406f6 100644
--- a/src/main/java/org/htmlunit/html/HtmlSource.java
+++ b/src/main/java/org/htmlunit/html/HtmlSource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlSpan.java b/src/main/java/org/htmlunit/html/HtmlSpan.java
index f31e6496839..abf2243c018 100644
--- a/src/main/java/org/htmlunit/html/HtmlSpan.java
+++ b/src/main/java/org/htmlunit/html/HtmlSpan.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlStrike.java b/src/main/java/org/htmlunit/html/HtmlStrike.java
index 3c71ce763d0..6e1156424a2 100644
--- a/src/main/java/org/htmlunit/html/HtmlStrike.java
+++ b/src/main/java/org/htmlunit/html/HtmlStrike.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlStrong.java b/src/main/java/org/htmlunit/html/HtmlStrong.java
index a4de4d07819..7266e15bb6d 100644
--- a/src/main/java/org/htmlunit/html/HtmlStrong.java
+++ b/src/main/java/org/htmlunit/html/HtmlStrong.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlStyle.java b/src/main/java/org/htmlunit/html/HtmlStyle.java
index 3bd74f6bf04..d450ea6babc 100644
--- a/src/main/java/org/htmlunit/html/HtmlStyle.java
+++ b/src/main/java/org/htmlunit/html/HtmlStyle.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlSubmitInput.java b/src/main/java/org/htmlunit/html/HtmlSubmitInput.java
index 052fd7f0786..3c1067d3788 100644
--- a/src/main/java/org/htmlunit/html/HtmlSubmitInput.java
+++ b/src/main/java/org/htmlunit/html/HtmlSubmitInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlSubscript.java b/src/main/java/org/htmlunit/html/HtmlSubscript.java
index d88c3f4eee9..bbaf6601bc5 100644
--- a/src/main/java/org/htmlunit/html/HtmlSubscript.java
+++ b/src/main/java/org/htmlunit/html/HtmlSubscript.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlSummary.java b/src/main/java/org/htmlunit/html/HtmlSummary.java
index 82209589bf3..3bcda51ecf1 100644
--- a/src/main/java/org/htmlunit/html/HtmlSummary.java
+++ b/src/main/java/org/htmlunit/html/HtmlSummary.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlSuperscript.java b/src/main/java/org/htmlunit/html/HtmlSuperscript.java
index da860d55d68..99887803649 100644
--- a/src/main/java/org/htmlunit/html/HtmlSuperscript.java
+++ b/src/main/java/org/htmlunit/html/HtmlSuperscript.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlSvg.java b/src/main/java/org/htmlunit/html/HtmlSvg.java
index 75fa768d2d8..2d2708dff95 100644
--- a/src/main/java/org/htmlunit/html/HtmlSvg.java
+++ b/src/main/java/org/htmlunit/html/HtmlSvg.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlTable.java b/src/main/java/org/htmlunit/html/HtmlTable.java
index fef6feba237..9d62e33c804 100644
--- a/src/main/java/org/htmlunit/html/HtmlTable.java
+++ b/src/main/java/org/htmlunit/html/HtmlTable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -91,9 +91,11 @@ public final HtmlTableCell getCellAt(final int rowIndex, final int columnIndex)
return cell;
}
}
- if (cell.getRowSpan() > 1 || cell.getColumnSpan() > 1) {
- for (int i = 0; i < cell.getRowSpan(); i++) {
- for (int j = 0; j < cell.getColumnSpan(); j++) {
+ final int rowSpan = cell.getRowSpan();
+ final int columnSpan = cell.getColumnSpan();
+ if (rowSpan > 1 || columnSpan > 1) {
+ for (int i = 0; i < rowSpan; i++) {
+ for (int j = 0; j < columnSpan; j++) {
occupied.add(new Position(row + i, col + j));
}
}
@@ -235,7 +237,7 @@ public List Cookie Domain Test Cookie Domain Test Cookie Domain Test hello world hello worldnode
.
*
* @param indent white space to indent child nodes
+ * @param tagBefore true if the last thing printed was a tag
* @param printWriter writer where child nodes are written
+ * @return true if the last thing printed was a tag
*/
- protected void printXml(final String indent, final PrintWriter printWriter) {
- printWriter.print(indent);
+ protected boolean printXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) {
+ if (tagBefore) {
+ printWriter.print("\r\n");
+ printWriter.print(indent);
+ }
printWriter.print(this);
- printWriter.print("\r\n");
- printChildrenAsXml(indent, printWriter);
+ return printChildrenAsXml(indent, false, printWriter);
}
/**
* Recursively writes the XML data for the node tree starting at node
.
*
* @param indent white space to indent child nodes
+ * @param tagBefore true if the last thing printed was a tag
* @param printWriter writer where child nodes are written
+ * @return true if the last thing printed was a tag
*/
- protected void printChildrenAsXml(final String indent, final PrintWriter printWriter) {
+ protected boolean printChildrenAsXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) {
DomNode child = getFirstChild();
+ boolean tag = tagBefore;
while (child != null) {
- child.printXml(indent + " ", printWriter);
+ tag = child.printXml(indent + " ", tag, printWriter);
child = child.getNextSibling();
}
+ return tag;
}
/**
@@ -908,11 +917,11 @@ public node
.
- *
- * @param indent white space to indent child nodes
- * @param printWriter writer where child nodes are written
+ * {@inheritDoc}
*/
@Override
- protected void printXml(final String indent, final PrintWriter printWriter) {
+ protected boolean printXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) {
String data = getData();
+ boolean tag = tagBefore;
if (org.apache.commons.lang3.StringUtils.isNotBlank(data)) {
- printWriter.print(indent);
if (!(getParentNode() instanceof HtmlStyle) || !data.startsWith("")) {
data = StringUtils.escapeXmlChars(data);
}
printWriter.print(data);
- printWriter.print("\r\n");
+ tag = false;
}
- printChildrenAsXml(indent, printWriter);
+ return printChildrenAsXml(indent, tag, printWriter);
}
/**
diff --git a/src/main/java/org/htmlunit/html/ElementFactory.java b/src/main/java/org/htmlunit/html/ElementFactory.java
index 303bdd3f79c..e6ba4ce68ff 100644
--- a/src/main/java/org/htmlunit/html/ElementFactory.java
+++ b/src/main/java/org/htmlunit/html/ElementFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/ElementFromPointHandler.java b/src/main/java/org/htmlunit/html/ElementFromPointHandler.java
index 154db0a2099..02e055c4d09 100644
--- a/src/main/java/org/htmlunit/html/ElementFromPointHandler.java
+++ b/src/main/java/org/htmlunit/html/ElementFromPointHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/FormFieldWithNameHistory.java b/src/main/java/org/htmlunit/html/FormFieldWithNameHistory.java
index 2bb60e27daf..fccd64a38e3 100644
--- a/src/main/java/org/htmlunit/html/FormFieldWithNameHistory.java
+++ b/src/main/java/org/htmlunit/html/FormFieldWithNameHistory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/FrameWindow.java b/src/main/java/org/htmlunit/html/FrameWindow.java
index e67f96fdcc7..2427f9aee7e 100644
--- a/src/main/java/org/htmlunit/html/FrameWindow.java
+++ b/src/main/java/org/htmlunit/html/FrameWindow.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/Html.java b/src/main/java/org/htmlunit/html/Html.java
index 1cd5264a182..d12ed2e2454 100644
--- a/src/main/java/org/htmlunit/html/Html.java
+++ b/src/main/java/org/htmlunit/html/Html.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,9 @@
*/
public final class Html {
+ /** The html5 doctype. */
+ public static final String DOCTYPE_HTML = "";
+
/** XHTML namespace. */
public static final String XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
diff --git a/src/main/java/org/htmlunit/html/HtmlAbbreviated.java b/src/main/java/org/htmlunit/html/HtmlAbbreviated.java
index cd39db4e339..da78125251e 100644
--- a/src/main/java/org/htmlunit/html/HtmlAbbreviated.java
+++ b/src/main/java/org/htmlunit/html/HtmlAbbreviated.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlAcronym.java b/src/main/java/org/htmlunit/html/HtmlAcronym.java
index 7f2d21b377e..52ee3ad1554 100644
--- a/src/main/java/org/htmlunit/html/HtmlAcronym.java
+++ b/src/main/java/org/htmlunit/html/HtmlAcronym.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlAddress.java b/src/main/java/org/htmlunit/html/HtmlAddress.java
index 4c5fba1f928..f8c760e46d4 100644
--- a/src/main/java/org/htmlunit/html/HtmlAddress.java
+++ b/src/main/java/org/htmlunit/html/HtmlAddress.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlAnchor.java b/src/main/java/org/htmlunit/html/HtmlAnchor.java
index 056887de0cd..ba42f1b9857 100644
--- a/src/main/java/org/htmlunit/html/HtmlAnchor.java
+++ b/src/main/java/org/htmlunit/html/HtmlAnchor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -195,7 +195,7 @@ protected void doClickStateUpdate(final boolean shiftKey, final boolean ctrlKey,
target = page.getResolvedTarget(getTargetAttribute());
}
page.getWebClient().download(page.getEnclosingWindow(), target, webRequest,
- true, false, (ATTRIBUTE_NOT_DEFINED != downloadAttribute) ? downloadAttribute : null, "Link click");
+ true, (ATTRIBUTE_NOT_DEFINED != downloadAttribute) ? downloadAttribute : null, "Link click");
}
private boolean relContainsNoreferrer() {
diff --git a/src/main/java/org/htmlunit/html/HtmlArea.java b/src/main/java/org/htmlunit/html/HtmlArea.java
index 103f523d069..129b22d02d2 100644
--- a/src/main/java/org/htmlunit/html/HtmlArea.java
+++ b/src/main/java/org/htmlunit/html/HtmlArea.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlArticle.java b/src/main/java/org/htmlunit/html/HtmlArticle.java
index 4cf20fbb923..41634809154 100644
--- a/src/main/java/org/htmlunit/html/HtmlArticle.java
+++ b/src/main/java/org/htmlunit/html/HtmlArticle.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlAside.java b/src/main/java/org/htmlunit/html/HtmlAside.java
index caa7a641cd6..6940cd01dd6 100644
--- a/src/main/java/org/htmlunit/html/HtmlAside.java
+++ b/src/main/java/org/htmlunit/html/HtmlAside.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlAttributeChangeEvent.java b/src/main/java/org/htmlunit/html/HtmlAttributeChangeEvent.java
index 32ae7b62c56..ccbcb896d53 100644
--- a/src/main/java/org/htmlunit/html/HtmlAttributeChangeEvent.java
+++ b/src/main/java/org/htmlunit/html/HtmlAttributeChangeEvent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlAttributeChangeListener.java b/src/main/java/org/htmlunit/html/HtmlAttributeChangeListener.java
index 23c9603de49..fd5adf4b638 100644
--- a/src/main/java/org/htmlunit/html/HtmlAttributeChangeListener.java
+++ b/src/main/java/org/htmlunit/html/HtmlAttributeChangeListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlAudio.java b/src/main/java/org/htmlunit/html/HtmlAudio.java
index 18cb378beca..289e66b4434 100644
--- a/src/main/java/org/htmlunit/html/HtmlAudio.java
+++ b/src/main/java/org/htmlunit/html/HtmlAudio.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlBackgroundSound.java b/src/main/java/org/htmlunit/html/HtmlBackgroundSound.java
index c39b14e9983..460633e86bf 100644
--- a/src/main/java/org/htmlunit/html/HtmlBackgroundSound.java
+++ b/src/main/java/org/htmlunit/html/HtmlBackgroundSound.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlBase.java b/src/main/java/org/htmlunit/html/HtmlBase.java
index d5d61df1409..3056fae6771 100644
--- a/src/main/java/org/htmlunit/html/HtmlBase.java
+++ b/src/main/java/org/htmlunit/html/HtmlBase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlBaseFont.java b/src/main/java/org/htmlunit/html/HtmlBaseFont.java
index b0e66fd9158..77224e41f08 100644
--- a/src/main/java/org/htmlunit/html/HtmlBaseFont.java
+++ b/src/main/java/org/htmlunit/html/HtmlBaseFont.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlBidirectionalIsolation.java b/src/main/java/org/htmlunit/html/HtmlBidirectionalIsolation.java
index c9b8ca11716..9b5c4d68eea 100644
--- a/src/main/java/org/htmlunit/html/HtmlBidirectionalIsolation.java
+++ b/src/main/java/org/htmlunit/html/HtmlBidirectionalIsolation.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlBidirectionalOverride.java b/src/main/java/org/htmlunit/html/HtmlBidirectionalOverride.java
index d10392fc5f7..7442adc95eb 100644
--- a/src/main/java/org/htmlunit/html/HtmlBidirectionalOverride.java
+++ b/src/main/java/org/htmlunit/html/HtmlBidirectionalOverride.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlBig.java b/src/main/java/org/htmlunit/html/HtmlBig.java
index 14275f70c17..0775020322b 100644
--- a/src/main/java/org/htmlunit/html/HtmlBig.java
+++ b/src/main/java/org/htmlunit/html/HtmlBig.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlBlockQuote.java b/src/main/java/org/htmlunit/html/HtmlBlockQuote.java
index cc46acedc6b..a68b95825c1 100644
--- a/src/main/java/org/htmlunit/html/HtmlBlockQuote.java
+++ b/src/main/java/org/htmlunit/html/HtmlBlockQuote.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlBody.java b/src/main/java/org/htmlunit/html/HtmlBody.java
index 7599394a57e..762e03530ee 100644
--- a/src/main/java/org/htmlunit/html/HtmlBody.java
+++ b/src/main/java/org/htmlunit/html/HtmlBody.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlBold.java b/src/main/java/org/htmlunit/html/HtmlBold.java
index 1fc36341217..2aceb9a1471 100644
--- a/src/main/java/org/htmlunit/html/HtmlBold.java
+++ b/src/main/java/org/htmlunit/html/HtmlBold.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlBreak.java b/src/main/java/org/htmlunit/html/HtmlBreak.java
index 890c3bc2591..95faabb88c1 100644
--- a/src/main/java/org/htmlunit/html/HtmlBreak.java
+++ b/src/main/java/org/htmlunit/html/HtmlBreak.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlButton.java b/src/main/java/org/htmlunit/html/HtmlButton.java
index 8acce57fe2f..0b060974104 100644
--- a/src/main/java/org/htmlunit/html/HtmlButton.java
+++ b/src/main/java/org/htmlunit/html/HtmlButton.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlButtonInput.java b/src/main/java/org/htmlunit/html/HtmlButtonInput.java
index daf6e7dc54c..401aaed4964 100644
--- a/src/main/java/org/htmlunit/html/HtmlButtonInput.java
+++ b/src/main/java/org/htmlunit/html/HtmlButtonInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlCanvas.java b/src/main/java/org/htmlunit/html/HtmlCanvas.java
index 7c7b53a7b31..7ec012d4702 100644
--- a/src/main/java/org/htmlunit/html/HtmlCanvas.java
+++ b/src/main/java/org/htmlunit/html/HtmlCanvas.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlCaption.java b/src/main/java/org/htmlunit/html/HtmlCaption.java
index 2d1e5a4f391..5d24f5eb7c7 100644
--- a/src/main/java/org/htmlunit/html/HtmlCaption.java
+++ b/src/main/java/org/htmlunit/html/HtmlCaption.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlCenter.java b/src/main/java/org/htmlunit/html/HtmlCenter.java
index 7dc3ee22ae9..e7493cb46ee 100644
--- a/src/main/java/org/htmlunit/html/HtmlCenter.java
+++ b/src/main/java/org/htmlunit/html/HtmlCenter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlCheckBoxInput.java b/src/main/java/org/htmlunit/html/HtmlCheckBoxInput.java
index a0ad891fe45..2309c933e94 100644
--- a/src/main/java/org/htmlunit/html/HtmlCheckBoxInput.java
+++ b/src/main/java/org/htmlunit/html/HtmlCheckBoxInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlCitation.java b/src/main/java/org/htmlunit/html/HtmlCitation.java
index f4017caba11..ed8bc0b5710 100644
--- a/src/main/java/org/htmlunit/html/HtmlCitation.java
+++ b/src/main/java/org/htmlunit/html/HtmlCitation.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlCode.java b/src/main/java/org/htmlunit/html/HtmlCode.java
index 69b45eeb58e..762245c0698 100644
--- a/src/main/java/org/htmlunit/html/HtmlCode.java
+++ b/src/main/java/org/htmlunit/html/HtmlCode.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlColorInput.java b/src/main/java/org/htmlunit/html/HtmlColorInput.java
index 4f45c319a8c..1184303ea32 100644
--- a/src/main/java/org/htmlunit/html/HtmlColorInput.java
+++ b/src/main/java/org/htmlunit/html/HtmlColorInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlData.java b/src/main/java/org/htmlunit/html/HtmlData.java
index e00312a03e0..c6dd99fff5f 100644
--- a/src/main/java/org/htmlunit/html/HtmlData.java
+++ b/src/main/java/org/htmlunit/html/HtmlData.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlDataList.java b/src/main/java/org/htmlunit/html/HtmlDataList.java
index cbed89585d2..b6b40bc49ac 100644
--- a/src/main/java/org/htmlunit/html/HtmlDataList.java
+++ b/src/main/java/org/htmlunit/html/HtmlDataList.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlDateInput.java b/src/main/java/org/htmlunit/html/HtmlDateInput.java
index 8e4acc1a0c9..e7bac09c29b 100644
--- a/src/main/java/org/htmlunit/html/HtmlDateInput.java
+++ b/src/main/java/org/htmlunit/html/HtmlDateInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlDateTimeLocalInput.java b/src/main/java/org/htmlunit/html/HtmlDateTimeLocalInput.java
index 4855ce8ce8a..6924a61c506 100644
--- a/src/main/java/org/htmlunit/html/HtmlDateTimeLocalInput.java
+++ b/src/main/java/org/htmlunit/html/HtmlDateTimeLocalInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlDefinition.java b/src/main/java/org/htmlunit/html/HtmlDefinition.java
index e76775d0ede..025922ec14f 100644
--- a/src/main/java/org/htmlunit/html/HtmlDefinition.java
+++ b/src/main/java/org/htmlunit/html/HtmlDefinition.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlDefinitionDescription.java b/src/main/java/org/htmlunit/html/HtmlDefinitionDescription.java
index 9d3c9342a57..12fbd63545d 100644
--- a/src/main/java/org/htmlunit/html/HtmlDefinitionDescription.java
+++ b/src/main/java/org/htmlunit/html/HtmlDefinitionDescription.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlDefinitionList.java b/src/main/java/org/htmlunit/html/HtmlDefinitionList.java
index 10266abde0a..2d24cfa6039 100644
--- a/src/main/java/org/htmlunit/html/HtmlDefinitionList.java
+++ b/src/main/java/org/htmlunit/html/HtmlDefinitionList.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlDefinitionTerm.java b/src/main/java/org/htmlunit/html/HtmlDefinitionTerm.java
index 206284e1146..64511c1c4d7 100644
--- a/src/main/java/org/htmlunit/html/HtmlDefinitionTerm.java
+++ b/src/main/java/org/htmlunit/html/HtmlDefinitionTerm.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlDeletedText.java b/src/main/java/org/htmlunit/html/HtmlDeletedText.java
index e58e8feb394..9cc465b4c15 100644
--- a/src/main/java/org/htmlunit/html/HtmlDeletedText.java
+++ b/src/main/java/org/htmlunit/html/HtmlDeletedText.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlDetails.java b/src/main/java/org/htmlunit/html/HtmlDetails.java
index 2da7d55735e..d624a4282d3 100644
--- a/src/main/java/org/htmlunit/html/HtmlDetails.java
+++ b/src/main/java/org/htmlunit/html/HtmlDetails.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlDialog.java b/src/main/java/org/htmlunit/html/HtmlDialog.java
index 22fce114683..3f9ef9a63b1 100644
--- a/src/main/java/org/htmlunit/html/HtmlDialog.java
+++ b/src/main/java/org/htmlunit/html/HtmlDialog.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlDirectory.java b/src/main/java/org/htmlunit/html/HtmlDirectory.java
index 63a65c8cdb2..f65d92fc925 100644
--- a/src/main/java/org/htmlunit/html/HtmlDirectory.java
+++ b/src/main/java/org/htmlunit/html/HtmlDirectory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlDivision.java b/src/main/java/org/htmlunit/html/HtmlDivision.java
index ff4390a3838..716fbe2fb8a 100644
--- a/src/main/java/org/htmlunit/html/HtmlDivision.java
+++ b/src/main/java/org/htmlunit/html/HtmlDivision.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlDomTreeWalker.java b/src/main/java/org/htmlunit/html/HtmlDomTreeWalker.java
index 766c98a9ec8..0f6a9a7625e 100644
--- a/src/main/java/org/htmlunit/html/HtmlDomTreeWalker.java
+++ b/src/main/java/org/htmlunit/html/HtmlDomTreeWalker.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,6 +14,8 @@
*/
package org.htmlunit.html;
+import java.io.Serializable;
+
import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
import org.w3c.dom.traversal.NodeFilter;
@@ -24,13 +26,13 @@
* therefore we have this impl as backend.
*
* @see
- * DOM-Level-2-Traversal-Range
+ * DOM-Level-2-Traversal-Range
* @author Mike Dirolf
* @author Frank Danek
* @author Ahmed Ashour
* @author Ronald Brill
*/
-public class HtmlDomTreeWalker {
+public class HtmlDomTreeWalker implements Serializable {
private final DomNode root_;
private DomNode currentNode_;
diff --git a/src/main/java/org/htmlunit/html/HtmlElement.java b/src/main/java/org/htmlunit/html/HtmlElement.java
index db4f3011fe6..8038fc5efd2 100644
--- a/src/main/java/org/htmlunit/html/HtmlElement.java
+++ b/src/main/java/org/htmlunit/html/HtmlElement.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,9 @@
import static org.htmlunit.BrowserVersionFeatures.HTMLELEMENT_REMOVE_ACTIVE_TRIGGERS_BLUR_EVENT;
import static org.htmlunit.BrowserVersionFeatures.KEYBOARD_EVENT_SPECIAL_KEYPRESS;
+import static org.htmlunit.css.CssStyleSheet.ABSOLUTE;
+import static org.htmlunit.css.CssStyleSheet.FIXED;
+import static org.htmlunit.css.CssStyleSheet.STATIC;
import java.io.IOException;
import java.util.ArrayList;
@@ -31,6 +34,8 @@
import org.htmlunit.SgmlPage;
import org.htmlunit.WebAssert;
import org.htmlunit.WebClient;
+import org.htmlunit.WebWindow;
+import org.htmlunit.css.ComputedCssStyleDeclaration;
import org.htmlunit.html.impl.SelectableTextInput;
import org.htmlunit.javascript.HtmlUnitScriptable;
import org.htmlunit.javascript.host.dom.Document;
@@ -162,7 +167,7 @@ public String value() {
* @param qualifiedName the qualified name of the element type to instantiate
* @param page the page that contains this element
* @param attributes a map ready initialized with the attributes for this element, or
- * {@code null}. The map will be stored as is, not copied.
+ * {@code null}. The map will be stored as is, not copied.
*/
protected HtmlElement(final String qualifiedName, final SgmlPage page,
final Map
+ *
+ * @param returnNullIfFixed if position is 'fixed' return null
+ * @return the offset parent {@link HtmlElement}
+ */
+ public HtmlElement getOffsetParentInternal(final boolean returnNullIfFixed) {
+ if (getParentNode() == null) {
+ return null;
+ }
+
+ final WebWindow webWindow = getPage().getEnclosingWindow();
+ final ComputedCssStyleDeclaration style = webWindow.getComputedStyle(this, null);
+ final String position = style.getPositionWithInheritance();
+
+ if (returnNullIfFixed && FIXED.equals(position)) {
+ return null;
+ }
+
+ final boolean staticPos = STATIC.equals(position);
+
+ DomNode currentElement = this;
+ while (currentElement != null) {
+
+ final DomNode parentNode = currentElement.getParentNode();
+ if (parentNode instanceof HtmlBody
+ || (staticPos && parentNode instanceof HtmlTableDataCell)
+ || (staticPos && parentNode instanceof HtmlTable)) {
+ return (HtmlElement) parentNode;
+ }
+
+ if (parentNode instanceof HtmlElement) {
+ final ComputedCssStyleDeclaration parentStyle =
+ webWindow.getComputedStyle((HtmlElement) parentNode, null);
+ final String parentPosition = parentStyle.getPositionWithInheritance();
+ if (!STATIC.equals(parentPosition)) {
+ return (HtmlElement) parentNode;
+ }
+ }
+
+ currentElement = currentElement.getParentNode();
+ }
+
+ return null;
+ }
+
+ /**
+ * @return this element's top offset, which is the calculated left position of this
+ * element relative to the offsetParent
.
+ */
+ public int getOffsetTop() {
+ if (this instanceof HtmlBody) {
+ return 0;
+ }
+
+ int top = 0;
+
+ // Add the offset for this node.
+ final WebWindow webWindow = getPage().getEnclosingWindow();
+ ComputedCssStyleDeclaration style = webWindow.getComputedStyle(this, null);
+ top += style.getTop(true, false, false);
+
+ // If this node is absolutely positioned, we're done.
+ final String position = style.getPositionWithInheritance();
+ if (ABSOLUTE.equals(position) || FIXED.equals(position)) {
+ return top;
+ }
+
+ final HtmlElement offsetParent = getOffsetParentInternal(false);
+
+ // Add the offset for the ancestor nodes.
+ DomNode parentNode = getParentNode();
+ while (parentNode != null && parentNode != offsetParent) {
+ if (parentNode instanceof HtmlElement) {
+ style = webWindow.getComputedStyle((HtmlElement) parentNode, null);
+ top += style.getTop(false, true, true);
+ }
+ parentNode = parentNode.getParentNode();
+ }
+
+ if (offsetParent != null) {
+ style = webWindow.getComputedStyle(this, null);
+ final boolean thisElementHasTopMargin = style.getMarginTopValue() != 0;
+
+ style = webWindow.getComputedStyle(offsetParent, null);
+ if (!thisElementHasTopMargin) {
+ top += style.getMarginTopValue();
+ }
+ top += style.getPaddingTopValue();
+ }
+
+ return top;
+ }
+
+ /**
+ * @return this element's left offset, which is the calculated left position of this
+ * element relative to the offsetParent
.
+ */
+ public int getOffsetLeft() {
+ if (this instanceof HtmlBody) {
+ return 0;
+ }
+
+ int left = 0;
+
+ // Add the offset for this node.
+ final WebWindow webWindow = getPage().getEnclosingWindow();
+ ComputedCssStyleDeclaration style = webWindow.getComputedStyle(this, null);
+ left += style.getLeft(true, false, false);
+
+ // If this node is absolutely positioned, we're done.
+ final String position = style.getPositionWithInheritance();
+ if (ABSOLUTE.equals(position) || FIXED.equals(position)) {
+ return left;
+ }
+
+ final HtmlElement offsetParent = getOffsetParentInternal(false);
+
+ DomNode parentNode = getParentNode();
+ while (parentNode != null && parentNode != offsetParent) {
+ if (parentNode instanceof HtmlElement) {
+ style = webWindow.getComputedStyle((HtmlElement) parentNode, null);
+ left += style.getLeft(true, true, true);
+ }
+ parentNode = parentNode.getParentNode();
+ }
+
+ if (offsetParent != null) {
+ style = webWindow.getComputedStyle(offsetParent, null);
+ left += style.getMarginLeftValue();
+ left += style.getPaddingLeftValue();
+ }
+
+ return left;
+ }
+
+ /**
+ * Returns this element's X position.
+ * @return this element's X position
+ */
+ public int getPosX() {
+ int cumulativeOffset = 0;
+ final WebWindow webWindow = getPage().getEnclosingWindow();
+
+ HtmlElement element = this;
+ while (element != null) {
+ cumulativeOffset += element.getOffsetLeft();
+ if (element != this) {
+ final ComputedCssStyleDeclaration style =
+ webWindow.getComputedStyle(element, null);
+ cumulativeOffset += style.getBorderLeftValue();
+ }
+ element = element.getOffsetParentInternal(false);
+ }
+
+ return cumulativeOffset;
+ }
+
+ /**
+ * Returns this element's Y position.
+ * @return this element's Y position
+ */
+ public int getPosY() {
+ int cumulativeOffset = 0;
+ final WebWindow webWindow = getPage().getEnclosingWindow();
+
+ HtmlElement element = this;
+ while (element != null) {
+ cumulativeOffset += element.getOffsetTop();
+ if (element != this) {
+ final ComputedCssStyleDeclaration style =
+ webWindow.getComputedStyle(element, null);
+ cumulativeOffset += style.getBorderTopValue();
+ }
+ element = element.getOffsetParentInternal(false);
+ }
+
+ return cumulativeOffset;
+ }
+
/**
* {@inheritDoc}
*/
diff --git a/src/main/java/org/htmlunit/html/HtmlEmailInput.java b/src/main/java/org/htmlunit/html/HtmlEmailInput.java
index 8b923b7b920..fb391a50ad0 100644
--- a/src/main/java/org/htmlunit/html/HtmlEmailInput.java
+++ b/src/main/java/org/htmlunit/html/HtmlEmailInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlEmbed.java b/src/main/java/org/htmlunit/html/HtmlEmbed.java
index 8f169a736f6..266f942cd50 100644
--- a/src/main/java/org/htmlunit/html/HtmlEmbed.java
+++ b/src/main/java/org/htmlunit/html/HtmlEmbed.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlEmphasis.java b/src/main/java/org/htmlunit/html/HtmlEmphasis.java
index a3d3f495daa..a0ebfd2175b 100644
--- a/src/main/java/org/htmlunit/html/HtmlEmphasis.java
+++ b/src/main/java/org/htmlunit/html/HtmlEmphasis.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlExample.java b/src/main/java/org/htmlunit/html/HtmlExample.java
index 553a3edf2dd..40207710fed 100644
--- a/src/main/java/org/htmlunit/html/HtmlExample.java
+++ b/src/main/java/org/htmlunit/html/HtmlExample.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlFieldSet.java b/src/main/java/org/htmlunit/html/HtmlFieldSet.java
index 25fb285fd16..bfe0cc3fdee 100644
--- a/src/main/java/org/htmlunit/html/HtmlFieldSet.java
+++ b/src/main/java/org/htmlunit/html/HtmlFieldSet.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlFigure.java b/src/main/java/org/htmlunit/html/HtmlFigure.java
index a45ee383e79..e2aa3446d08 100644
--- a/src/main/java/org/htmlunit/html/HtmlFigure.java
+++ b/src/main/java/org/htmlunit/html/HtmlFigure.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlFigureCaption.java b/src/main/java/org/htmlunit/html/HtmlFigureCaption.java
index 9577c7868a7..8e0485fb7bc 100644
--- a/src/main/java/org/htmlunit/html/HtmlFigureCaption.java
+++ b/src/main/java/org/htmlunit/html/HtmlFigureCaption.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlFileInput.java b/src/main/java/org/htmlunit/html/HtmlFileInput.java
index cb53def554a..5f95299fd61 100644
--- a/src/main/java/org/htmlunit/html/HtmlFileInput.java
+++ b/src/main/java/org/htmlunit/html/HtmlFileInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -137,7 +137,7 @@ public void setContentType(final String contentType) {
/**
* Gets the content type that should be sent together with the uploaded file.
* @return the content type, or {@code null} if this has not been explicitly set
- * and should be guessed from file content
+ * and should be guessed from file content
*/
public String getContentType() {
return contentType_;
diff --git a/src/main/java/org/htmlunit/html/HtmlFont.java b/src/main/java/org/htmlunit/html/HtmlFont.java
index 4b2852afcda..cd9df518051 100644
--- a/src/main/java/org/htmlunit/html/HtmlFont.java
+++ b/src/main/java/org/htmlunit/html/HtmlFont.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlFooter.java b/src/main/java/org/htmlunit/html/HtmlFooter.java
index dc9382b9469..f9236d3b898 100644
--- a/src/main/java/org/htmlunit/html/HtmlFooter.java
+++ b/src/main/java/org/htmlunit/html/HtmlFooter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlForm.java b/src/main/java/org/htmlunit/html/HtmlForm.java
index 9ad6cafa176..dd7797388f3 100644
--- a/src/main/java/org/htmlunit/html/HtmlForm.java
+++ b/src/main/java/org/htmlunit/html/HtmlForm.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -191,7 +191,7 @@ && getAttributeDirect(ATTRIBUTE_NOVALIDATE) != ATTRIBUTE_NOT_DEFINED) {
final WebWindow webWindow = htmlPage.getEnclosingWindow();
// Calling form.submit() twice forces double download.
- webClient.download(webWindow, target, request, false, false, null, "JS form.submit()");
+ webClient.download(webWindow, target, request, false, null, "JS form.submit()");
}
/**
@@ -541,36 +541,18 @@ private tabindex
attribute: A, AREA, BUTTON,
- * INPUT, OBJECT, SELECT, and TEXTAREA.tabindex
attribute:
+ * A, AREA, BUTTON, INPUT, OBJECT, SELECT, and TEXTAREA.
*
* @return all the tabbable elements in proper tab order
*/
@@ -908,7 +907,7 @@ public List
*
* @return a list of all styles from this page (<style> and <link rel=stylesheet>).
- * This returns an empty list if css support is disabled in the web client options.
+ * This returns an empty list if css support is disabled in the web client options.
*/
public Listnode
.
- *
- * @param indent white space to indent child nodes
- * @param printWriter writer where child nodes are written
+ * {@inheritDoc}
*/
@Override
- protected void printXml(final String indent, final PrintWriter printWriter) {
+ protected boolean printXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) {
printWriter.print(indent + "<");
printOpeningTagContentAsXml(printWriter);
printWriter.print(">");
- printWriter.print(StringEscapeUtils.escapeXml10(getText()));
+ printWriter.print(org.htmlunit.util.StringUtils.escapeXml(getText()));
printWriter.print("");
+ return true;
}
/**
diff --git a/src/main/java/org/htmlunit/html/HtmlTextInput.java b/src/main/java/org/htmlunit/html/HtmlTextInput.java
index 736ad273312..a50abdd9571 100644
--- a/src/main/java/org/htmlunit/html/HtmlTextInput.java
+++ b/src/main/java/org/htmlunit/html/HtmlTextInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlTime.java b/src/main/java/org/htmlunit/html/HtmlTime.java
index 9c814439dd8..65d0d378974 100644
--- a/src/main/java/org/htmlunit/html/HtmlTime.java
+++ b/src/main/java/org/htmlunit/html/HtmlTime.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlTimeInput.java b/src/main/java/org/htmlunit/html/HtmlTimeInput.java
index 2b2e33695b8..74f38e37021 100644
--- a/src/main/java/org/htmlunit/html/HtmlTimeInput.java
+++ b/src/main/java/org/htmlunit/html/HtmlTimeInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlTitle.java b/src/main/java/org/htmlunit/html/HtmlTitle.java
index c49e6fc0089..fc04a5c0b83 100644
--- a/src/main/java/org/htmlunit/html/HtmlTitle.java
+++ b/src/main/java/org/htmlunit/html/HtmlTitle.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlTrack.java b/src/main/java/org/htmlunit/html/HtmlTrack.java
index be74d4e73bc..1cd0542f69b 100644
--- a/src/main/java/org/htmlunit/html/HtmlTrack.java
+++ b/src/main/java/org/htmlunit/html/HtmlTrack.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlUnderlined.java b/src/main/java/org/htmlunit/html/HtmlUnderlined.java
index fccdc68f4de..7d480355c53 100644
--- a/src/main/java/org/htmlunit/html/HtmlUnderlined.java
+++ b/src/main/java/org/htmlunit/html/HtmlUnderlined.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlUnknownElement.java b/src/main/java/org/htmlunit/html/HtmlUnknownElement.java
index 57c628e6998..0cd1dd74ead 100644
--- a/src/main/java/org/htmlunit/html/HtmlUnknownElement.java
+++ b/src/main/java/org/htmlunit/html/HtmlUnknownElement.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/htmlunit/html/HtmlUnorderedList.java b/src/main/java/org/htmlunit/html/HtmlUnorderedList.java
index a1b4ac3344a..e12a0904b37 100644
--- a/src/main/java/org/htmlunit/html/HtmlUnorderedList.java
+++ b/src/main/java/org/htmlunit/html/HtmlUnorderedList.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,7 +50,7 @@ public class HtmlUnorderedList extends HtmlElement {
* documentation for details on the use of this attribute.
*
* @return the value of the attribute {@code type}
- * or an empty string if that attribute isn't defined.
+ * or an empty string if that attribute isn't defined.
*/
public final String getTypeAttribute() {
return getAttributeDirect(TYPE_ATTRIBUTE);
@@ -62,7 +62,7 @@ public final String getTypeAttribute() {
* documentation for details on the use of this attribute.
*
* @return the value of the attribute {@code compact}
- * or an empty string if that attribute isn't defined.
+ * or an empty string if that attribute isn't defined.
*/
public final String getCompactAttribute() {
return getAttributeDirect("compact");
diff --git a/src/main/java/org/htmlunit/html/HtmlUrlInput.java b/src/main/java/org/htmlunit/html/HtmlUrlInput.java
index c2c9ae192f5..a94157b7e26 100644
--- a/src/main/java/org/htmlunit/html/HtmlUrlInput.java
+++ b/src/main/java/org/htmlunit/html/HtmlUrlInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,18 +38,8 @@ public class HtmlUrlInput extends HtmlSelectableTextInput implements LabelableEl
*/
HtmlUrlInput(final String qualifiedName, final SgmlPage page,
final Mapalert(document.cookie)
. */
- public static final String HTML_ALERT_COOKIE
- = HtmlPageTest.STANDARDS_MODE_PREFIX_
+ public static final String HTML_ALERT_COOKIE = DOCTYPE_HTML
+ "\n"
+ "\n"
@@ -303,7 +299,7 @@ public void setCookieExpired() throws Exception {
@Test
@Alerts({"cookies: first=1", "cookies: "})
public void setCookieTimeout() throws Exception {
- final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_
+ final String html = DOCTYPE_HTML
+ "\n"
+ "\n"
- + "";
-
- final URL firstUrl = new URL("http://host1.htmlunit.org:" + PORT + "/");
- getMockWebConnection().setResponse(firstUrl, html);
- loadPage2(html, firstUrl);
-
- loadPage2(HTML_ALERT_COOKIE, firstUrl);
- verifyTitle2(getWebDriver(), getExpectedAlerts());
- }
}
diff --git a/src/test/java/org/htmlunit/DefaultCredentialsProvider2Test.java b/src/test/java/org/htmlunit/DefaultCredentialsProvider2Test.java
index d3a8ff56164..83fd1192933 100644
--- a/src/test/java/org/htmlunit/DefaultCredentialsProvider2Test.java
+++ b/src/test/java/org/htmlunit/DefaultCredentialsProvider2Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
*/
package org.htmlunit;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
import java.io.StringWriter;
import java.net.URL;
@@ -27,10 +27,8 @@
import org.apache.logging.log4j.core.config.Configurator;
import org.apache.logging.log4j.core.layout.PatternLayout;
import org.htmlunit.html.HtmlPage;
-import org.htmlunit.junit.BrowserRunner;
-import org.htmlunit.junit.BrowserRunner.Alerts;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.htmlunit.junit.annotation.Alerts;
+import org.junit.jupiter.api.Test;
/**
* Tests for {@link DefaultCredentialsProvider}.
@@ -38,7 +36,6 @@
* @author Ahmed Ashour
* @author Ronald Brill
*/
-@RunWith(BrowserRunner.class)
public class DefaultCredentialsProvider2Test extends WebServerTestCase {
/**
@@ -135,7 +132,7 @@ public void basicAuthentication_singleAuthenticaiton() throws Exception {
@Test
@Alerts("SecRet")
public void basicAuthenticationUserFromUrl() throws Exception {
- final String html = "";
+ final String html = DOCTYPE_HTML + "";
getMockWebConnection().setDefaultResponse(html);
getWebClient().getCredentialsProvider().clear();
@@ -184,7 +181,7 @@ public void basicAuthenticationUserFromUrl() throws Exception {
@Test
@Alerts("SecRet")
public void basicAuthenticationUserFromUrlUsedForNextSteps() throws Exception {
- final String html = "";
+ final String html = DOCTYPE_HTML + "";
getMockWebConnection().setDefaultResponse(html);
getWebClient().getCredentialsProvider().clear();
@@ -248,7 +245,7 @@ public void basicAuthenticationUserFromUrlUsedForNextSteps() throws Exception {
@Test
@Alerts("SecRet")
public void basicAuthenticationUserFromUrlOverwrite() throws Exception {
- final String html = "";
+ final String html = DOCTYPE_HTML + "";
getMockWebConnection().setDefaultResponse(html);
getWebClient().getCredentialsProvider().clear();
@@ -307,7 +304,7 @@ public void basicAuthenticationUserFromUrlOverwrite() throws Exception {
@Test
@Alerts("SecRet")
public void basicAuthenticationUserFromUrlOverwriteDefaultCredentials() throws Exception {
- final String html = "";
+ final String html = DOCTYPE_HTML + "";
getMockWebConnection().setDefaultResponse(html);
getWebClient().getCredentialsProvider().clear();
@@ -333,7 +330,7 @@ public void basicAuthenticationUserFromUrlOverwriteDefaultCredentials() throws E
@Test
@Alerts("SecRet")
public void basicAuthenticationUserFromUrlOverwriteWrongDefaultCredentials() throws Exception {
- final String html = "";
+ final String html = DOCTYPE_HTML + "";
getMockWebConnection().setDefaultResponse(html);
getWebClient().getCredentialsProvider().clear();
@@ -372,7 +369,8 @@ public void basicAuthenticationUserFromUrlOverwriteWrongDefaultCredentials() thr
@Test
@Alerts("Hello World")
public void basicAuthenticationXHR() throws Exception {
- final String html = "";
+ String html = DOCTYPE_HTML
+ + "";
html = "HTTP/1.1 200 OK\r\n"
+ "Content-Length: " + (html.length()) + "\r\n"
+ "Content-Type: text/html\r\n"
@@ -1142,7 +1146,8 @@ public void locationSetHref() throws Exception {
"Sec-Fetch-User: ?1",
"Priority: u=0, i"})
public void locationSetSearch() throws Exception {
- String html = "";
+ String html = DOCTYPE_HTML
+ + "";
html = "HTTP/1.1 200 OK\r\n"
+ "Content-Length: " + (html.length()) + "\r\n"
+ "Content-Type: text/html\r\n"
@@ -1293,7 +1298,8 @@ public void locationSetSearch() throws Exception {
"Sec-Fetch-User: ?1", /* wrong */
"Priority: u=0, i"})
public void loadJavascript() throws Exception {
- String html = " ";
+ String html = DOCTYPE_HTML
+ + " ";
html = "HTTP/1.1 200 OK\r\n"
+ "Content-Length: " + (html.length()) + "\r\n"
+ "Content-Type: text/html\r\n"
@@ -1443,12 +1449,13 @@ public void loadJavascript() throws Exception {
"Sec-Fetch-Site: same-origin",
"Sec-Fetch-User: ?1", /* wrong */
"Priority: u=0, i"})
- // this fails on our CI but i have no idea why
+ // this fails on our CI but I have no idea why
// seems like the request for downloading the script never reaches the
// PrimitiveWebServer
- @NotYetImplemented(value = {}, os = OS.Linux)
+ @DisabledOnOs(OS.LINUX)
public void loadJavascriptCharset() throws Exception {
- String html = ""
+ String html = DOCTYPE_HTML
+ + ""
+ ""
+ ""
+ "";
@@ -1479,6 +1486,18 @@ public void loadJavascriptCharset() throws Exception {
expectedHeaders[i] = expectedHeaders[i].replaceAll("§§ACCEPT§§",
getBrowserVersion().getScriptAcceptHeader());
}
+
+ // let's try some wait on our CI server
+ final long endTime = System.currentTimeMillis() + Duration.ofSeconds(4).toMillis();
+ while (primitiveWebServer.getRequests().size() < 1
+ && System.currentTimeMillis() < endTime) {
+ Thread.sleep(100);
+ }
+
+ if (primitiveWebServer.getRequests().size() < 2) {
+ Assertions.fail("Still no request / request count:" + primitiveWebServer.getRequests().size());
+ }
+
final String request = primitiveWebServer.getRequests().get(1);
final String[] headers = request.split("\\r\\n");
assertEquals(Arrays.asList(expectedHeaders).toString(), Arrays.asList(headers).toString());
diff --git a/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLTest.java b/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLTest.java
index cc622a7edbd..8bf5d259e23 100644
--- a/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLTest.java
+++ b/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ * Copyright (c) 2002-2025 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,10 +23,9 @@
import org.eclipse.jetty.server.SslConnectionFactory;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.util.ssl.SslContextFactory.Server;
-import org.htmlunit.junit.BrowserRunner;
import org.htmlunit.util.WebConnectionWrapper;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
/**
* Tests for insecure SSL.
@@ -34,16 +33,16 @@
* @author Ahmed Ashour
* @author Ronald Brill
*/
-@RunWith(BrowserRunner.class)
public class HttpWebConnectionInsecureSSLTest extends WebServerTestCase {
/**
* @throws Exception if an error occurs
*/
- @Test(expected = SSLHandshakeException.class)
+ @Test
public void normal() throws Exception {
final URL https = new URL("https://localhost:" + PORT2 + "/");
- loadPage("