diff --git a/.github/workflows/checkstyle.yml b/.github/workflows/checkstyle.yml index 594e9878e8d..61afd4de5a2 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@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 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..50c0767f714 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@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 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..8e2105e7af5 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@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 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..b61ad1fcc8b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ![HtmlUnit Logo](https://github.com/HtmlUnit/htmlunit/blob/master/src/site/resources/images/htmlunit.png) -Version 4.7.0 / November 29, 2024 +Version 4.12.0 / May 17, 2025 :heart: [Sponsor](https://github.com/sponsors/rbri) @@ -13,11 +13,9 @@ Version 4.7.0 / November 29, 2024 ### News -**[Developer Blog][15]** +**[Developer Blog](https://htmlunit.github.io/htmlunit-blog/)** -[HtmlUnit@mastodon][13] | [HtmlUnit@Twitter][3] - -[HtmlUnit Kanban Board][6] +[HtmlUnit@mastodon](https://fosstodon.org/@HtmlUnit) | [HtmlUnit@bsky](https://bsky.app/profile/htmlunit.bsky.social) | [HtmlUnit@Twitter](https://twitter.com/HtmlUnit) > **Check out HtmlUnit [satellite projects](https://github.com/orgs/HtmlUnit/repositories)**, such as: @@ -53,7 +51,7 @@ Add to your `pom.xml`: org.htmlunit htmlunit - 4.7.0 + 4.12.0 ``` @@ -62,7 +60,7 @@ Add to your `pom.xml`: Add to your `build.gradle`: ```groovy -implementation group: 'org.htmlunit', name: 'htmlunit', version: '4.7.0' +implementation group: 'org.htmlunit', name: 'htmlunit', version: '4.12.0' ``` ## Vulnerabilities @@ -93,18 +91,56 @@ HtmlUnit is typically used for testing purposes or to retrieve information from * Support for basic and NTLM authentication * Excellent JavaScript support +HtmlUnit is used as the underlying "browser" by different Open Source tools like + * [WebDriver](https://github.com/SeleniumHQ/selenium) + * [Arquillian Drone](https://arquillian.org/arquillian-extension-drone) + * [Serenity BDD](https://serenity-bdd.info) + * [XLT](https://www.xceptance.com/en/products/xlt/) + * [FluentLenium](https://github.com/FluentLenium/FluentLenium) + * [WETATOR](https://www.wetator.org/) + * [Selenium Foundation](https://github.com/sbabcoc/Selenium-Foundation) + * [Spring Testing](https://docs.spring.io/spring/docs/current/spring-framework-reference/testing.html#spring-mvc-test-server-htmlunit) + * [Selenide](https://selenide.org/) + * [JWebUnit](https://jwebunit.github.io/jwebunit/) + * [JSFUnit](http://www.jboss.org/jsfunit/) + * ... + +HtmlUnit is used by many projects for automated web testing + * [jenkins-test-harness](https://github.com/jenkinsci/jenkins-test-harness) + * [Apache Shiro](https://shiro.apache.org/) + * [Apache Struts](https://struts.apache.org/) + * [Quarkus](https://quarkus.io/) + * [Togglz](https://www.togglz.org/) + * [Dataverse](https://dataverse.org/) + * [Janssen Project](https://github.com/JanssenProject/jans) + * [Apache TomEE](https://github.com/apache/tomee) + * [Apache Maven Surefire](https://maven.apache.org/surefire/) + * [JSCover](http://tntim96.github.io/JSCover/) + * [Apache Jackrabbit](https://jackrabbit.apache.org/jcr/index.html) + * [Apache MyFaces](https://myfaces.apache.org/) + * [JakartaEE TCK](https://github.com/jakartaee/platform-tck) + * [Jakarta Security](https://github.com/jakartaee/security) + * [OpenXava](https://github.com/openxava/openxava) + * [Cargo](https://github.com/codehaus-cargo/cargo) + * [piranha cloud](https://github.com/piranhacloud/piranha) + * ... + ## Getting Started You can start here: * [Getting Started][7] +* [Introduction to HtmlUnit - Baeldung](https://www.baeldung.com/htmlunit) * [The Java Web Scraping Handbook][8] A nice tutorial about webscraping with a lot of background information and details about HtmlUnit. * [Web Scraping][9] Examples how to implement web scraping using HtmlUnit, Selenium or jaunt and compares them. * [The Complete Guide to Web Scraping with Java][10] A small straightforward guide to web scraping with Java. * [How to test Jakarta Faces with HtmlUnit and Arquillian][11] * [WebScraping.AI HtmlUnit FAQ][13]: + ## Contributing Pull Requests and all other Community Contributions are essential for open source software. Every contribution - from bug reports to feature requests, typos to full new features - are greatly appreciated. +Please try to keep your pull requests small (don't bundle unrelated changes) and try to include test cases. + ## Last CI build The latest builds are available from our [Jenkins CI build server][2] @@ -136,7 +172,7 @@ Add the snapshot repository and dependency to your `pom.xml`: org.htmlunit htmlunit - 4.8.0-SNAPSHOT + 4.13.0-SNAPSHOT @@ -155,7 +191,7 @@ repositories { } // ... dependencies { - implementation group: 'org.htmlunit', name: 'htmlunit', version: '4.8.0-SNAPSHOT' + implementation group: 'org.htmlunit', name: 'htmlunit', version: '4.12.0-SNAPSHOT' // ... } ``` @@ -187,10 +223,6 @@ check dependencies for known security problems mvn dependency-check:check ``` -### Contributing - -I welcome contributions, especially in the form of pull requests. -Please try to keep your pull requests small (don't bundle unrelated changes) and try to include test cases. ## Some insights [HtmlUnit at openhub][5] @@ -201,16 +233,12 @@ Please try to keep your pull requests small (don't bundle unrelated changes) and [1]: https://sourceforge.net/projects/htmlunit/files/htmlunit/4.1.0/ "HtmlUnit on sourceforge" [2]: https://jenkins.wetator.org/view/HtmlUnit/ "HtmlUnit CI" -[3]: https://twitter.com/HtmlUnit "https://twitter.com/HtmlUnit" [4]: https://www.htmlunit.org "https://www.htmlunit.org" [5]: https://www.openhub.net/p/HtmlUnit "https://www.openhub.net/p/HtmlUnit" -[6]: https://github.com/HtmlUnit/htmlunit/projects/1 "https://github.com/HtmlUnit/htmlunit/projects/1" [7]: https://www.htmlunit.org/gettingStarted.html [8]: https://www.scrapingbee.com/java-webscraping-book/ [9]: https://www.innoq.com/en/blog/webscraping/ [10]: https://www.webscrapingapi.com/java-web-scraping/ [11]: http://www.mastertheboss.com/java-ee/jsf/how-to-test-jakarta-faces-with-htmlunit-and-arquillian [12]: https://github.com/HtmlUnit/htmlunit/releases -[13]: https://fosstodon.org/@HtmlUnit -[14]: https://webscraping.ai/faq/htmlunit -[15]: https://htmlunit.github.io/htmlunit-blog/ +[13]: https://webscraping.ai/faq/htmlunit \ No newline at end of file diff --git a/checkstyle.xml b/checkstyle.xml index 801f430d970..b6e52d0a9b1 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -24,7 +24,7 @@ - + @@ -122,6 +122,10 @@ + + + + @@ -130,7 +134,7 @@ - + @@ -138,6 +142,16 @@ + + + + + + + + + + @@ -250,7 +264,6 @@ - \ No newline at end of file diff --git a/checkstyle_suppressions.xml b/checkstyle_suppressions.xml index c095435aad1..d5a3ce0ce1b 100644 --- a/checkstyle_suppressions.xml +++ b/checkstyle_suppressions.xml @@ -39,7 +39,7 @@ - + diff --git a/pom.xml b/pom.xml index 3735a0c0ea8..7f6ef3e52bc 100644 --- a/pom.xml +++ b/pom.xml @@ -3,18 +3,20 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 + org.htmlunit htmlunit - 4.7.0 + 4.12.0 + jar + HtmlUnit + + A headless browser intended for use in testing web-based applications. + Gargoyle Software Inc. http://www.GargoyleSoftware.com/ - jar - - A headless browser intended for use in testing web-based applications. - https://www.htmlunit.org @@ -25,29 +27,40 @@ 8 8 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 + 4.12.0 + 4.12.0 + 4.12.0 + 4.12.0 + 4.12.0 + 4.12.0 4.5.14 + 3.17.0 + 2.19.0 + 1.3.5 + 0.1.2 - 4.27.0 - 4.27.0 - selenium-devtools-v131 - - 9.4.56.v20240826 - 2.24.2 - 2.0.16 + + 4.32.0 + 4.32.0 + selenium-devtools-v136 - - 10.20.1 - 4.8.6 - 7.7.0 + 4.13.2 - 1.3.0 + 9.4.57.v20241219 + 4.0.66 + 2.24.3 + 2.0.17 + 1.13.1 + 1.5 + 4.4.0 + 1.5.5 + + + 10.23.1 + 4.9.3 + 7.13.0 + 1.4.1 10.0.4 @@ -56,7 +69,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.13.0 + 3.14.0 org.apache.maven.plugins @@ -78,7 +91,7 @@ com.github.spotbugs spotbugs-maven-plugin - 4.8.6.6 + 4.9.3.0 com.github.spotbugs @@ -190,19 +203,19 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 org.apache.maven.plugins maven-javadoc-plugin - 3.11.1 + 3.11.2 true protected - html,missing,reference,syntax + html,reference,syntax true true - netscape:netscape.*:org.htmlunit.platform.util + org.htmlunit.platform.util @@ -269,7 +282,7 @@ org.apache.felix maven-bundle-plugin - 6.0.0 + 5.1.9 true @@ -280,11 +293,10 @@ - @@ -309,7 +320,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -339,7 +350,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -370,7 +381,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -398,7 +409,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -426,7 +437,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -456,7 +467,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -485,7 +496,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -514,7 +525,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -543,7 +554,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -571,7 +582,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -599,7 +610,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -627,7 +638,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -656,7 +667,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -678,14 +689,14 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.11.1 + 3.11.2 true protected - html,missing,reference,syntax + html,reference,syntax true true - netscape:netscape.*:org.htmlunit.platform.util + org.htmlunit.platform.util @@ -698,7 +709,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.8.0 + 3.9.0 org.apache.maven.plugins @@ -1196,6 +1207,9 @@ Markus Winter + + Christoph Burgmer + @@ -1204,10 +1218,6 @@ httpmime ${httpcomponents.version} - - commons-codec - commons-codec - commons-logging commons-logging @@ -1255,43 +1265,22 @@ org.apache.commons commons-lang3 - 3.17.0 - - - org.apache.commons - commons-text - 1.12.0 - - - org.apache.commons - commons-lang3 - - + ${commons-lang3.version} commons-io commons-io - 2.18.0 + ${commons-io.version} commons-logging commons-logging - 1.3.4 - - - commons-net - commons-net - 3.11.1 - - - commons-codec - commons-codec - 1.17.1 + ${commons-logging.version} org.brotli dec - 0.1.2 + ${brotli.version} @@ -1367,7 +1356,7 @@ org.apache.xmlgraphics batik-transcoder - 1.18 + 1.19 test @@ -1381,10 +1370,23 @@ + + org.apache.commons + commons-text + ${commons-text.version} + test + + + org.apache.commons + commons-lang3 + + + + commons-fileupload commons-fileupload - 1.5 + ${commons-fileupload.version} test @@ -1400,13 +1402,13 @@ com.github.romankh3 image-comparison - 4.4.0 + ${image-comparison.version} test org.jfree jfreechart - 1.5.5 + ${jfreechart.version} test @@ -1425,7 +1427,7 @@ com.caucho quercus - 4.0.66 + ${quercus.version} test diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 6260cda210e..713c4750ceb 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -7,6 +7,506 @@ + + + WebClient option NekoReaderBufferSize added. You can use this to increase the buffer size used by + the Neko Html parser to optimize parsing performance. + + + HTMLParser parseFragment(DomNode, String), parse(WebResponse, HtmlPage, boolean, boolean), and + parseFragment(DomNode, DomNode, String, boolean) are deprecated. + + + neko: HTMLScanner always requires a document handler; the null check is moved to the setter + and all the others are removed. + + + neko: avoid HTML1011 error for self closing tags. + + + neko: ignore whitespace before the closing > when parsing special tags. + + + neko: remove two superfluous conversions from the code. + + + core-js: NativeArray impl is now lambda based. + + + core-js: improved date string parser; support optional ms digits, + skip ms digits, extended year support is not available in es6 + + + core-js: detailed message added to IndexOutOfBoundsExceptions + + + core-js: add double null check pattern when initializing cache values. + + + DomTokenList.forEach() now takes care of the current state of the list + (e.g. the forEach function might add/remove elements to the list itself). + + + NodeList.forEach() now takes care of the current state of the list + (e.g. the forEach function might add/remove elements to the list itself). + + + AlertHandler, ConfirmHandler, FrameContentHandler, CharacterDataChangeListener, and IncorrectnessListener + marked as @FunctionalInterface. + + + Upgrade Apache commons-io to 2.19.0. + + + Element.scrollIntoView() now triggers scroll events on all parents. + + + For FF scroll events are of type UIEvent. + + + Scroll events are not bubbling and not cancelable. + + + core-js: Function.prototype[Symbol.hasInstance] fixed. + + + core-js: regression in hex and unicode hex parsing or regexp fixed + + + CSS blockSize support improved. + + + core-js: Complete reimplementation of 'String.prototype.search', 'String.prototype.replace', + 'String.prototype.replaceAll', and 'String.prototype.split'. The new impl is much closer to the spec. + + + core-js: Fix a character class parsing regression for regexp. + + + core-js: Fix handling of \x and \u in regexp. + + + FF137: SVGDiscardElement added. + + + Chrome/Edge 135, FF137: Setter validation for length style properties adjusted. + + + Chrome/Edge 135: Style properties 'interactivity', 'overflowBlock', 'overflowInline', and 'scrollMarkerGroup' added. + + + FF137: Adjust clientHeight for some ruby related tags. + + + Chrome/Edge 135, FF137: Improved namespace handling when sending an html document via XMLHttpRequest. + + + Chrome/Edge 135: Improved <br> handling in options tags. + + + Chrome/Edge 135, FF137: Fixed font sizes for smaller/larger css prooerty value. + + + FF137: Set span for table cells to zero if provided value is invalid. + + + core-js: Some fixes for strict handling. + + + core-js: Several code improvements for the RegExp implementation. + + + WebClient.setWebSocketAdapter(WebSocketAdapterFactory) added. This should + help to use a different WebSocket implementation. + + + WebSocketAdapter splitted into WebSocketAdapter and WebSocketListener. + New interface WebSocketAdapterFactory introduced. This should help to + make it simpler to use a different WebSocket implementation. + + + core-js: Named capture groups in RegularExpressions now supported. + + + Deprecated method CssStyleSheet.validateSelectors(SelectorList, int, DomNode) removed. + + + Deprecated method HtmlForm.getElements() removed. + + + Deprecated method WebRequest.setRefererlHeader(URL) removed. + + + + + + + NumberFormatException when calculating the clientHeight/offsetHeight. + + + + + + + Event 'onload' is trigger by FF ESR also if the frame content was not shown because of csp. + + + Initial support for font sizes 'xx-small', 'x-small', 'small', 'medium', 'large', + 'x-large', 'xx-large', 'xxx-large', 'smaller', and 'larger'. + + + core-js: Refactor NativeString based on lambdas and stop using IdScriptableObject. + + + The style cache has to handle all parents of added or deleted nodes. + + + Class HiddenFunctionObject removed, this was a leftover from the IE age. + + + core-js: Arguments.callee is always the same function in strict mode. + + + core-js: Arguments.caller is not available in real browsers. + + + core-js: An issue where capture groups in quantified expressions (min = 2) were not cleared between iterations fixed. + For example, in /(?:(\2)(\d)){2}/, during the second iteration, \2 incorrectly retained the first iteration's value instead of being reset. + + + Switched back from our RegExp translation into java regular expressions to use the core Rhino stuff. Rhino mades significant + progress in this arae. This simplifies out impl and supports more features in the future. + + + core-js: RegExp lookbehind implemented. + + + core-js: NativeObject converted from IdScriptableObject to lambda constructor + + + core-js: problem with 'super' and nested lambdas + + + core-js: RegExp.prototype[Symbol.match] and String.prototype.match. + + + core-js: Implement Symbol.match. + + + core-js: String.prototype.match. As per the spec, it is simply supposed to invoke the Symbol.match of the regexp. + + + core-js: Fix the behaviour of Regexp sticky flag. + + + Deprecated methods removed from EncodingSniffer, HttpClientConverter, WebResponse, and WebResponseWrapper. + + + cssparser: improved support for var initial values. + + + Apache commons-codec is no longer a runtime dependency. + + + atob() has to remove all whitespace from the provided string. + + + atob() must always fail on invalid input. + + + The script async attribute is ignored if the src attribute is absent. + + + Many more checkstyle jdoc rules enabled and all violations fixed. + + + HtmlImage onerror event is triggerd for 204 responses. + + + Some minor code improvements found by spotbugs. + + + Some more event initialization fixes. + + + Fix various event initialization when working with WebSocket's. + + + + + + + core-js: NativeGlobal now based on lambda functions. + + + Avoid using XPath for implementing form submit on enter key pressed. + + + Implement Document.getElementById() without using XPath. + + + NPE in org.htmlunit.javascript.JavaScriptEngine.asJavaScriptException(). + + + Upgrade commons-logging to 1.3.5. + + + StyleElement implements no longer the Comparable interface. For our special needs we now using the + static method compareToByImportanceAndSpecificity(StyleElement, StyleElement). + + + core-js: load more classes lazily. + + + HtmlUrlInput value trimming fixed. + + + Replace the deprecated WebElement.getAttribute(String) with getDomAttribute(String) and getDomProperty(String) + at many places in the test suite. + + + Use StandardCharsets.UTF_8 instead of Charsets.UTF_8 for the sample code. + + + HtmlTextArea - several fixes to throw the correct error. + + + AudioContext/OfflineAudioContext - several fixes to throw the correct error. + + + 'Illegal constructor' is a type error. + + + Firefox ESR accept header no longer contains 'image/avif,image/webp,image/png,image/svg+xml'. + + + core-js: BigInt, Boolean and Number converted to use lambdas. + + + core-js: Function hoisting inside blocks is now a core Rhino feature, our own hack is gone. + + + core-js: Map and Set converted to use lambdas. + + + core-js: lambda-based classes serializable are serializable. + + + core-js: bunch of changes to make the SlotMap handling faster. + + + CSSStyleSheet - several fixes to throw the correct error. + + + XPath.evaluate() throws a TypeError. + + + Document - several fixes to throw the correct error. + + + XMLHttpRequest - several fixes to throw the correct error. + + + Geolocation.ctor() throws a TypeError. + + + TreeWalker.ctor() throws a TypeError. + + + MutationObserver.observe() throws a TypeError. + + + DOMParser.parseFromString() throws a TypeError. + + + Window.postMessage() throws a SyntaxError. + + + Window.atob()/btoa() throws an InvalidCharacterError. + + + DomNode.appendChild() throws a HierarchyRequstError. + + + AbstractRange.ctor() throws a TypeError. + + + DOMTokenList - several fixes to throw the correct error. + + + CSSGroupingRule - several fixes to throw the correct error. + + + HTMLInputElement value/selectionStart/selectionEnd properties throws the correct error (InvalidStateError). + + + SVGMatrix.rotateFromVector()/inverse() throws the correct error (InvalidAccessError/InvalidStateError). + + + Crypto.getRandomValues() throws a QuotaExceededError. + + + CanvasRenderingContext2D.measureText() throws a TypeError. + + + HTMLTableElement/HTMLTableRowElement - several fixes to throw the correct error. + + + Element.querySelectorAll()/querySelector() throws a SyntaxError. + + + HTMLOptionsCollection.add() throws a NotFoundError. + + + Accessing a HTMLDocument without a js peer throws a TypeError. + + + Document.createElementNS() throws a TypeError. + + + Document.createElementNS() throws a TypeError. + + + Selection.getRangeAt() throws an IndexSizeError. + + + Node.replaceChild()/removeChild()/insertBefore() several fixes to throw the correct error. + + + HTMLDocument.appendChild() throws HierarchyRequstError. + + + Document.createElement() throws InvalidCharacterError. + + + ImageData.ctor() various fixes to throw the correct error in different situations. + + + CharacterData.deleteData() throws an IndexSizeError. + + + Document.querySelectorAll() throws a SyntaxError if the selector is invalid. + + + Document.createEvent() creates the correct exception when the event type is not supported. + + + DOMException name property was missing. + + + Handling of the error code when construction DOMException is fixed. + + + Document.evaluate() now throws a SyntaxError instead of an InternalError. + + + Upgrade commons-codec to 1.18.0. + + + WebClientOptions sslClientCertificateStore is transient. + + + + + + + WebClientOptions SSLTrustStore is transient. + + + WebClientOptions.Geolocation is serializable now + + + HtmlDomTreeWalker is serializable now + + + core-js: junit-vintage-engine was NOT marked as 'test' dependency, therefore we had junit + as part of our depenencies/lib/diestribution (regression from 4.8.0) + + + BigInt support added. + + + core-js: Symbol.hasInstance for Function.prototype implemented. + + + core-js: Context#emptyArgs is deprecated. + + + + + + + cssparser: support plain color definitions with var/calc. + + + cssparser: 'and' is a valid class name. + + + cssparser: support relative color definitions. + + + websocket-client: jetty updated to 9.4.57.v20241219. + + + core-js: add an empty slot map (singleton) for cases where no slots exist; this should reduce the memory needed a bit + + + core-js: methods cannot be used as constructor fixed + + + Upgrade commons-codec to 1.17.2. + + + Apache commons-net is no longer a runtime dependency. + + + Apache commons-text is no longer a runtime dependency. + + + core-js: Extract function calling out of the interpreter loop for performance. + + + Avoid ConcurrentModificationExceptions in frame processing. + + + core-js: handle stack frames in the correct order. + + + cssparser: support hwb(), lab(), lch(), oklab(), and oklch() color definitions. + + + cssparser: add support for 'none' in modern color definitions. + + + core-js: fix border checks for typedarray set-method (see https://github.com/HtmlUnit/htmlunit-core-js/issues/27) + + + core-js: Allow symbol keys in getter/setter in object literal syntax like 'var o = { get [aSymbol]: value }'. + + + core-js: Support for generator methods in object literals like 'o = {*g() {...}}' added. + + + core-js: Implement the super operator - which can actually be used outside of classes and will do something that intuitively is "refer to the prototype". + + + core-js: Fix tokenEnd and cursor for string, template, xml literals and multiline comments when using multibyte characters. + + + FAQ updated with some info about page history. + + + DomElement#getStaticElementsByTagName() has to check for prefix. + + + Upgrade Apache commons-text to 1.13.0. + + + core-js: Some improvments for the interpreter by generating smaller interpreter bytecode. + + + + core-js: String.prototype.matchAll, Symbol.matchAll, and RegExp.prototype[Symbol.matchAll] added. diff --git a/src/jenkins/huge-tests-m-o b/src/jenkins/huge-tests-m-o index cdd22ad9987..4b04403eeb3 100644 --- a/src/jenkins/huge-tests-m-o +++ b/src/jenkins/huge-tests-m-o @@ -4,7 +4,7 @@ pipeline { lock resource: 'htmlunit-test-ports' disableConcurrentBuilds() timestamps() - timeout(time: 15, unit: 'MINUTES') + timeout(time: 35, unit: 'MINUTES') } tools { jdk 'openjdk-11+28' diff --git a/src/main/java/org/htmlunit/AbstractPage.java b/src/main/java/org/htmlunit/AbstractPage.java index 1ddf2d29272..940d8c67a5c 100644 --- a/src/main/java/org/htmlunit/AbstractPage.java +++ b/src/main/java/org/htmlunit/AbstractPage.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/AjaxController.java b/src/main/java/org/htmlunit/AjaxController.java index f845bbef786..bd8cb6674c6 100644 --- a/src/main/java/org/htmlunit/AjaxController.java +++ b/src/main/java/org/htmlunit/AjaxController.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/AlertHandler.java b/src/main/java/org/htmlunit/AlertHandler.java index 41b4508b5c6..d8b768a0f6c 100644 --- a/src/main/java/org/htmlunit/AlertHandler.java +++ b/src/main/java/org/htmlunit/AlertHandler.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 Mike Bowler * @author Ronald Brill */ +@FunctionalInterface public interface AlertHandler extends Serializable { /** diff --git a/src/main/java/org/htmlunit/BrowserVersion.java b/src/main/java/org/htmlunit/BrowserVersion.java index 2912be38195..68afc603429 100644 --- a/src/main/java/org/htmlunit/BrowserVersion.java +++ b/src/main/java/org/htmlunit/BrowserVersion.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. @@ -26,7 +26,7 @@ import java.util.TimeZone; import org.apache.commons.io.FilenameUtils; -import org.htmlunit.javascript.configuration.AbstractJavaScriptConfiguration; +import org.htmlunit.css.CssPixelValueConverter; import org.htmlunit.javascript.configuration.BrowserFeature; import org.htmlunit.javascript.configuration.SupportedBrowser; import org.htmlunit.util.MimeType; @@ -61,31 +61,11 @@ * @author Frank Danek * @author Ronald Brill */ -@SuppressWarnings("PMD.AvoidDuplicateLiterals") +@SuppressWarnings({"PMD.AvoidDuplicateLiterals", "PMD.TooManyFields"}) public final class BrowserVersion implements Serializable { - /** - * Application name the Netscape navigator series of browsers. - */ - private static final String NETSCAPE = "Netscape"; - - /** - * United States English language identifier. - */ - private static final String LANGUAGE_ENGLISH_US = "en-US"; - - /** - * United States. - */ - private static final String TIMEZONE_NEW_YORK = "America/New_York"; - - /** - * The WIN32 platform. - */ - private static final String PLATFORM_WIN32 = "Win32"; - /** Latest Firefox. */ - public static final BrowserVersion FIREFOX = new BrowserVersion(133, "FF"); + public static final BrowserVersion FIREFOX = new BrowserVersion(137, "FF"); private static final int FIREFOX_ESR_NUMERIC = 128; @@ -93,10 +73,10 @@ public final class BrowserVersion implements Serializable { public static final BrowserVersion FIREFOX_ESR = new BrowserVersion(FIREFOX_ESR_NUMERIC, "FF-ESR"); /** Latest Edge. */ - public static final BrowserVersion EDGE = new BrowserVersion(131, "Edge"); + public static final BrowserVersion EDGE = new BrowserVersion(135, "Edge"); /** Latest Chrome. */ - public static final BrowserVersion CHROME = new BrowserVersion(131, "Chrome"); + public static final BrowserVersion CHROME = new BrowserVersion(135, "Chrome"); /** * Array with all supported browsers. @@ -117,6 +97,7 @@ public final class BrowserVersion implements Serializable { + FIREFOX_ESR.getBrowserVersionNumeric() + ".0) Gecko/20100101 Firefox/" + FIREFOX_ESR.getBrowserVersionNumeric() + ".0"; FIREFOX_ESR.buildId_ = "20181001000000"; + FIREFOX_ESR.vendor_ = ""; FIREFOX_ESR.productSub_ = "20100101"; FIREFOX_ESR.headerNamesOrdered_ = new String[] { HttpHeader.HOST, @@ -133,7 +114,7 @@ public final class BrowserVersion implements Serializable { HttpHeader.SEC_FETCH_SITE, HttpHeader.SEC_FETCH_USER, HttpHeader.PRIORITY}; - FIREFOX_ESR.htmlAcceptHeader_ = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8"; + FIREFOX_ESR.htmlAcceptHeader_ = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; FIREFOX_ESR.acceptLanguageHeader_ = "en-US,en;q=0.5"; FIREFOX_ESR.xmlHttpRequestAcceptHeader_ = "*/*"; FIREFOX_ESR.imgAcceptHeader_ = "image/avif,image/webp,image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5"; @@ -152,6 +133,7 @@ public final class BrowserVersion implements Serializable { + FIREFOX.getBrowserVersionNumeric() + ".0) Gecko/20100101 Firefox/" + FIREFOX.getBrowserVersionNumeric() + ".0"; FIREFOX.buildId_ = "20181001000000"; + FIREFOX.vendor_ = ""; FIREFOX.productSub_ = "20100101"; FIREFOX.headerNamesOrdered_ = new String[] { HttpHeader.HOST, @@ -188,7 +170,6 @@ public final class BrowserVersion implements Serializable { CHROME.userAgent_ = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/" + CHROME.getBrowserVersionNumeric() + ".0.0.0 Safari/537.36"; - CHROME.applicationCodeName_ = "Mozilla"; CHROME.vendor_ = "Google Inc."; CHROME.productSub_ = "20030107"; CHROME.headerNamesOrdered_ = new String[] { @@ -215,9 +196,23 @@ public final class BrowserVersion implements Serializable { CHROME.imgAcceptHeader_ = "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"; CHROME.cssAcceptHeader_ = "text/css,*/*;q=0.1"; CHROME.scriptAcceptHeader_ = "*/*"; + + /* + if (CHROME.getBrowserVersionNumeric() % 2 == 0) { + CHROME.secClientHintUserAgentHeader_ = "\"Chromium\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\", \"Not:A-Brand\";v=\"24\", \"Google Chrome\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\""; + } + else { + CHROME.secClientHintUserAgentHeader_ = "\"Not(A:Brand\";v=\"99\", \"Google Chrome\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\", \"Chromium\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\""; + } + */ CHROME.secClientHintUserAgentHeader_ = "\"Google Chrome\";v=\"" - + CHROME.getBrowserVersionNumeric() + "\", \"Chromium\";v=\"" - + CHROME.getBrowserVersionNumeric() + "\", \"Not_A Brand\";v=\"24\""; + + CHROME.getBrowserVersionNumeric() + "\", \"Not-A.Brand\";v=\"8\", \"Chromium\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\""; + CHROME.fontHeights_ = new int[] { 0, 1, 2, 4, 5, 5, 6, 8, 9, 10, 11, 12, 15, 16, 16, 17, 18, 20, 21, 22, 23, 25, 26, 26, 27, 28, 30, 31, 32, 33, 34, 36, 37, 37, 38, 40, 42, 43, 44, 45, 47, 48, 48, 49, 51, 52, 53, 54, 55, 57, @@ -234,7 +229,6 @@ public final class BrowserVersion implements Serializable { + EDGE.getBrowserVersionNumeric() + ".0.0.0 Safari/537.36 Edg/" + EDGE.getBrowserVersionNumeric() + ".0.0.0"; - EDGE.applicationCodeName_ = "Mozilla"; EDGE.vendor_ = "Google Inc."; EDGE.productSub_ = "20030107"; EDGE.headerNamesOrdered_ = new String[] { @@ -261,9 +255,23 @@ public final class BrowserVersion implements Serializable { EDGE.imgAcceptHeader_ = "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"; EDGE.cssAcceptHeader_ = "text/css,*/*;q=0.1"; EDGE.scriptAcceptHeader_ = "*/*"; + + /* + if (EDGE.getBrowserVersionNumeric() % 2 == 0) { + EDGE.secClientHintUserAgentHeader_ = "\"Chromium\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\", \"Not:A-Brand\";v=\"24\", \"Microsoft Edge\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\""; + } + else { + EDGE.secClientHintUserAgentHeader_ = "\"Not(A:Brand\";v=\"99\", \"Microsoft Edge\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\", \"Chromium\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\""; + } + */ EDGE.secClientHintUserAgentHeader_ = "\"Microsoft Edge\";v=\"" - + EDGE.getBrowserVersionNumeric() + "\", \"Chromium\";v=\"" - + EDGE.getBrowserVersionNumeric() + "\", \"Not_A Brand\";v=\"24\""; + + EDGE.getBrowserVersionNumeric() + "\", \"Not-A.Brand\";v=\"8\", \"Chromium\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\""; + EDGE.fontHeights_ = new int[] { 0, 1, 2, 4, 5, 5, 6, 8, 9, 10, 11, 12, 15, 16, 16, 17, 18, 20, 21, 22, 23, 25, 26, 26, 27, 28, 30, 31, 32, 33, 34, 36, 37, 37, 38, 40, 42, 43, 44, 45, 47, 48, 48, 49, 51, 52, 53, 54, 55, 57, @@ -371,7 +379,7 @@ public final class BrowserVersion implements Serializable { FIREFOX.registerUploadMimeType("mp3", "audio/mpeg"); FIREFOX.registerUploadMimeType("ogv", "video/ogg"); FIREFOX.registerUploadMimeType("ogm", "video/ogg"); - FIREFOX.registerUploadMimeType("ogg", "video/ogg"); + FIREFOX.registerUploadMimeType("ogg", "application/ogg"); FIREFOX.registerUploadMimeType("oga", "audio/ogg"); FIREFOX.registerUploadMimeType("opus", "audio/ogg"); FIREFOX.registerUploadMimeType("webm", "video/webm"); @@ -387,17 +395,17 @@ public final class BrowserVersion implements Serializable { private final int browserVersionNumeric_; private final String nickname_; - private String applicationCodeName_ = "Mozilla"; - private String applicationMinorVersion_ = "0"; + private String applicationCodeName_; + private String applicationMinorVersion_; private String applicationName_; private String applicationVersion_; private String buildId_; private String productSub_; - private String vendor_ = ""; - private Locale browserLocale_ = Locale.forLanguageTag(LANGUAGE_ENGLISH_US); - private boolean onLine_ = true; - private String platform_ = PLATFORM_WIN32; - private TimeZone systemTimezone_ = TimeZone.getTimeZone(TIMEZONE_NEW_YORK); + private String vendor_; + private Locale browserLocale_; + private boolean onLine_; + private String platform_; + private TimeZone systemTimezone_; private String userAgent_; private final Set features_; private String acceptEncodingHeader_; @@ -423,7 +431,15 @@ public final class BrowserVersion implements Serializable { browserVersionNumeric_ = browserVersionNumeric; nickname_ = nickname; - applicationName_ = NETSCAPE; + applicationCodeName_ = "Mozilla"; + applicationMinorVersion_ = "0"; + applicationName_ = "Netscape"; + onLine_ = true; + platform_ = "Win32"; + + browserLocale_ = Locale.forLanguageTag("en-US"); + systemTimezone_ = TimeZone.getTimeZone("America/New_York"); + acceptEncodingHeader_ = "gzip, deflate, br"; htmlAcceptHeader_ = "*/*"; imgAcceptHeader_ = "*/*"; @@ -468,7 +484,7 @@ else if (isFirefox()) { final BrowserFeature browserFeature = field.getAnnotation(BrowserFeature.class); if (browserFeature != null) { for (final SupportedBrowser browser : browserFeature.value()) { - if (AbstractJavaScriptConfiguration.isCompatible(expectedBrowser, browser)) { + if (expectedBrowser == browser) { features_.add(features); } } @@ -598,7 +614,7 @@ public String getVendor() { /** * Returns the browser locale. - * Default value is {@link #LANGUAGE_ENGLISH_US} if not explicitly configured. + * Default value is ENGLISH_US if not explicitly configured. * @return the system locale */ public Locale getBrowserLocale() { @@ -607,7 +623,7 @@ public Locale getBrowserLocale() { /** * Returns the browser application language, for example "en-us". - * Default value is {@link #LANGUAGE_ENGLISH_US} if not explicitly configured. + * Default value is ENGLISH_US if not explicitly configured. * @return the browser application language * @see MSDN documentation */ @@ -627,7 +643,7 @@ public boolean isOnLine() { /** * Returns the platform on which the application is running, for example "Win32". - * Default value is {@link #PLATFORM_WIN32} if not explicitly configured. + * Default value is 'Win32' if not explicitly configured. * @return the platform on which the application is running * @see MSDN documentation */ @@ -797,13 +813,47 @@ public String getUploadMimeType(final File file) { * @return the corresponding height */ public int getFontHeight(final String fontSize) { - if (fontHeights_ == null) { + if (fontHeights_ == null || fontSize.isEmpty()) { return 18; } - final int fontSizeInt = Integer.parseInt(fontSize.substring(0, fontSize.length() - 2)); + + if ("xx-small".equalsIgnoreCase(fontSize)) { + return fontHeights_[9]; + } + if ("x-small".equalsIgnoreCase(fontSize)) { + return fontHeights_[10]; + } + if ("small".equalsIgnoreCase(fontSize)) { + return fontHeights_[13]; + } + if ("medium".equalsIgnoreCase(fontSize)) { + return fontHeights_[16]; + } + if ("large".equalsIgnoreCase(fontSize)) { + return fontHeights_[18]; + } + if ("x-large".equalsIgnoreCase(fontSize)) { + return fontHeights_[24]; + } + if ("xx-large".equalsIgnoreCase(fontSize)) { + return fontHeights_[32]; + } + if ("xxx-large".equalsIgnoreCase(fontSize)) { + return fontHeights_[48]; + } + + if ("smaller".equalsIgnoreCase(fontSize)) { + return fontHeights_[13]; + } + if ("larger".equalsIgnoreCase(fontSize)) { + return fontHeights_[19]; + } + + final int fontSizeInt = CssPixelValueConverter.pixelValue(fontSize); if (fontSizeInt < fontHeights_.length) { return fontHeights_[fontSizeInt]; } + return (int) (fontSizeInt * 1.2); } @@ -1020,7 +1070,7 @@ public BrowserVersionBuilder setScriptAcceptHeader(final String scriptAcceptHead /** * @param xmlHttpRequestAcceptHeader the {@code Accept} header to be used when - * performing XMLHttpRequests + * performing XMLHttpRequests * @return this for fluent use */ public BrowserVersionBuilder setXmlHttpRequestAcceptHeader(final String xmlHttpRequestAcceptHeader) { diff --git a/src/main/java/org/htmlunit/BrowserVersionFeatures.java b/src/main/java/org/htmlunit/BrowserVersionFeatures.java index 6253793c5c7..3a68914a218 100644 --- a/src/main/java/org/htmlunit/BrowserVersionFeatures.java +++ b/src/main/java/org/htmlunit/BrowserVersionFeatures.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. @@ -90,6 +90,10 @@ public enum BrowserVersionFeatures { @BrowserFeature({FF, FF_ESR}) EVENT_ONPOPSTATE_DOCUMENT_CREATE_NOT_SUPPORTED, + /** Scroll events are of type 'UIEvent'. */ + @BrowserFeature({FF, FF_ESR}) + EVENT_SCROLL_UIEVENT, + /** Supports event type 'TextEvent'. */ @BrowserFeature({FF, FF_ESR}) EVENT_TYPE_MUTATIONEVENT, @@ -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, @@ -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..7a15b14943e 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 List 127) { return charset; } diff --git a/src/main/java/org/htmlunit/ImmediateRefreshHandler.java b/src/main/java/org/htmlunit/ImmediateRefreshHandler.java index 9aa782d7d51..de10d5746cd 100644 --- a/src/main/java/org/htmlunit/ImmediateRefreshHandler.java +++ b/src/main/java/org/htmlunit/ImmediateRefreshHandler.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/IncorrectnessListener.java b/src/main/java/org/htmlunit/IncorrectnessListener.java index c7d539e5872..be471515020 100644 --- a/src/main/java/org/htmlunit/IncorrectnessListener.java +++ b/src/main/java/org/htmlunit/IncorrectnessListener.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. @@ -20,7 +20,9 @@ * that HtmlUnit can handle but that denote a badly written application. * * @author Marc Guillemot + * @author Ronald Brill */ +@FunctionalInterface public interface IncorrectnessListener { /** diff --git a/src/main/java/org/htmlunit/IncorrectnessListenerImpl.java b/src/main/java/org/htmlunit/IncorrectnessListenerImpl.java index ddf3bf0ab3d..b966c7c19e0 100644 --- a/src/main/java/org/htmlunit/IncorrectnessListenerImpl.java +++ b/src/main/java/org/htmlunit/IncorrectnessListenerImpl.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/MockWebConnection.java b/src/main/java/org/htmlunit/MockWebConnection.java index 52e5c4c6bdf..4e28befb684 100644 --- a/src/main/java/org/htmlunit/MockWebConnection.java +++ b/src/main/java/org/htmlunit/MockWebConnection.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. @@ -386,7 +386,7 @@ public void setResponse(final URL url, final String content, final String conten * @param title the title of the page */ public void setResponseAsGenericHtml(final URL url, final String title) { - final String content = "" + title + ""; + final String content = "" + title + ""; setResponse(url, content); } diff --git a/src/main/java/org/htmlunit/NiceRefreshHandler.java b/src/main/java/org/htmlunit/NiceRefreshHandler.java index 58d61966d4e..0a369a13082 100644 --- a/src/main/java/org/htmlunit/NiceRefreshHandler.java +++ b/src/main/java/org/htmlunit/NiceRefreshHandler.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/NicelyResynchronizingAjaxController.java b/src/main/java/org/htmlunit/NicelyResynchronizingAjaxController.java index 90e3b2b3e07..99305812765 100644 --- a/src/main/java/org/htmlunit/NicelyResynchronizingAjaxController.java +++ b/src/main/java/org/htmlunit/NicelyResynchronizingAjaxController.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/NotYetImplementedException.java b/src/main/java/org/htmlunit/NotYetImplementedException.java index e837e64928f..daeac7bdd2a 100644 --- a/src/main/java/org/htmlunit/NotYetImplementedException.java +++ b/src/main/java/org/htmlunit/NotYetImplementedException.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/ObjectInstantiationException.java b/src/main/java/org/htmlunit/ObjectInstantiationException.java index 25a22cb349d..4645bcfeafb 100644 --- a/src/main/java/org/htmlunit/ObjectInstantiationException.java +++ b/src/main/java/org/htmlunit/ObjectInstantiationException.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/OnbeforeunloadHandler.java b/src/main/java/org/htmlunit/OnbeforeunloadHandler.java index 401828f4fc8..232da80ac69 100644 --- a/src/main/java/org/htmlunit/OnbeforeunloadHandler.java +++ b/src/main/java/org/htmlunit/OnbeforeunloadHandler.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/Page.java b/src/main/java/org/htmlunit/Page.java index 57f40739fe2..e721620594d 100644 --- a/src/main/java/org/htmlunit/Page.java +++ b/src/main/java/org/htmlunit/Page.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/PageCreator.java b/src/main/java/org/htmlunit/PageCreator.java index 0d134e25403..d774a5fb750 100644 --- a/src/main/java/org/htmlunit/PageCreator.java +++ b/src/main/java/org/htmlunit/PageCreator.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/PrintHandler.java b/src/main/java/org/htmlunit/PrintHandler.java index cf7ebfad005..1cf16eff3da 100644 --- a/src/main/java/org/htmlunit/PrintHandler.java +++ b/src/main/java/org/htmlunit/PrintHandler.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/PromptHandler.java b/src/main/java/org/htmlunit/PromptHandler.java index 5947e7baf0e..484aa3cc45b 100644 --- a/src/main/java/org/htmlunit/PromptHandler.java +++ b/src/main/java/org/htmlunit/PromptHandler.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/ProxyConfig.java b/src/main/java/org/htmlunit/ProxyConfig.java index c4433cddb54..5b3aca2dbf9 100644 --- a/src/main/java/org/htmlunit/ProxyConfig.java +++ b/src/main/java/org/htmlunit/ProxyConfig.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. @@ -156,7 +156,7 @@ public void removeHostsFromProxyBypass(final String pattern) { * configured proxy. * @param hostname the name of the host to check * @return {@code true} if the host with the specified hostname should be accessed bypassing the - * configured proxy, {@code false} otherwise. + * configured proxy, {@code false} otherwise. */ protected boolean shouldBypassProxy(final String hostname) { boolean bypass = false; diff --git a/src/main/java/org/htmlunit/RefreshHandler.java b/src/main/java/org/htmlunit/RefreshHandler.java index b05f15addb1..aec83a4600b 100644 --- a/src/main/java/org/htmlunit/RefreshHandler.java +++ b/src/main/java/org/htmlunit/RefreshHandler.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/Screen.java b/src/main/java/org/htmlunit/Screen.java index 7c9f382d46f..739c5131858 100644 --- a/src/main/java/org/htmlunit/Screen.java +++ b/src/main/java/org/htmlunit/Screen.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/ScriptException.java b/src/main/java/org/htmlunit/ScriptException.java index c8687e62bda..275b3248f57 100644 --- a/src/main/java/org/htmlunit/ScriptException.java +++ b/src/main/java/org/htmlunit/ScriptException.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. @@ -52,8 +52,8 @@ public class ScriptException extends RuntimeException { * @param page the page in which the script causing this exception was executed * @param throwable the exception that was thrown from the script engine * @param scriptSourceCode the code that was being executed when this exception - * was thrown. This may be null if the exception was not caused by execution - * of JavaScript. + * was thrown. This may be null if the exception was not caused by execution + * of JavaScript. */ public ScriptException(final HtmlPage page, final Throwable throwable, final String scriptSourceCode) { @@ -192,7 +192,7 @@ public String getScriptSourceCode() { * thrown. * * @return the line of source or an empty string if the exception was not thrown - * due to the execution of a script. + * due to the execution of a script. */ public String getFailingLine() { final int lineNumber = getFailingLineNumber(); @@ -218,7 +218,7 @@ public String getFailingLine() { * Returns the line number of the source that was executing at the time of the exception. * * @return the line number or -1 if the exception was not thrown due to the - * execution of a script. + * execution of a script. */ public int getFailingLineNumber() { if (getCause() instanceof RhinoException) { @@ -233,7 +233,7 @@ public int getFailingLineNumber() { * Returns the column number of the source that was executing at the time of the exception. * * @return the column number or -1 if the exception was not thrown due to the - * execution of a script. + * execution of a script. */ public int getFailingColumnNumber() { if (getCause() instanceof RhinoException) { diff --git a/src/main/java/org/htmlunit/ScriptPreProcessor.java b/src/main/java/org/htmlunit/ScriptPreProcessor.java index c8eb14602fd..b5c0ede9770 100644 --- a/src/main/java/org/htmlunit/ScriptPreProcessor.java +++ b/src/main/java/org/htmlunit/ScriptPreProcessor.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/ScriptResult.java b/src/main/java/org/htmlunit/ScriptResult.java index 554c8103672..c30b5630433 100644 --- a/src/main/java/org/htmlunit/ScriptResult.java +++ b/src/main/java/org/htmlunit/ScriptResult.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/SgmlPage.java b/src/main/java/org/htmlunit/SgmlPage.java index 6b643e27f63..33250378c75 100644 --- a/src/main/java/org/htmlunit/SgmlPage.java +++ b/src/main/java/org/htmlunit/SgmlPage.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. @@ -347,24 +347,23 @@ public Comment createComment(final String data) { * Create a new NodeIterator 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..c17eedc9094 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 List loadQueue_; private final Map requestHeaders_ = Collections.synchronizedMap(new HashMap<>(89)); @@ -332,6 +338,8 @@ public WebClient(final BrowserVersion browserVersion, final boolean javaScriptEn } loadQueue_ = new ArrayList<>(); + webSocketAdapterFactory_ = new JettyWebSocketAdapterFactory(); + // The window must be constructed AFTER the script engine. currentWindowTracker_ = new CurrentWindowTracker(this, true); currentWindow_ = new TopLevelWindow("", this); @@ -507,7 +515,8 @@

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; @@ -2540,6 +2554,7 @@ private void readObject(final ObjectInputStream in) throws IOException, ClassNot scriptEngine_ = new JavaScriptEngine(this); jobManagers_ = Collections.synchronizedList(new ArrayList<>()); loadQueue_ = new ArrayList<>(); + css3ParserPool_ = new CSS3ParserPool(); } private static class LoadJob { @@ -2589,13 +2604,12 @@ public boolean isOutdated() { * @param target the name of the target window * @param request the request to perform * @param checkHash if true check for hashChenage - * @param forceLoad if true always load the request even if there is already the same in the queue * @param forceAttachmentWithFilename if not {@code null} the AttachmentHandler isAttachment() method is not called, - * the response has to be handled as attachment in any case + * the response has to be handled as attachment in any case * @param description information about the origin of the request. Useful for debugging. */ public void download(final WebWindow requestingWindow, final String target, - final WebRequest request, final boolean checkHash, final boolean forceLoad, + final WebRequest request, final boolean checkHash, final String forceAttachmentWithFilename, final String description) { final WebWindow targetWindow = resolveWindow(requestingWindow, target); @@ -2632,9 +2646,7 @@ public void download(final WebWindow requestingWindow, final String target, final WebRequest otherRequest = otherLoadJob.request_; final URL otherUrl = otherRequest.getUrl(); - // TODO: investigate but it seems that IE considers query string too but not FF - if (!forceLoad - && url.getPath().equals(otherUrl.getPath()) // fail fast + if (url.getPath().equals(otherUrl.getPath()) // fail fast && url.toString().equals(otherUrl.toString()) && request.getRequestParameters().equals(otherRequest.getRequestParameters()) && Objects.equals(request.getRequestBody(), otherRequest.getRequestBody())) { @@ -2863,7 +2875,7 @@ public HtmlPage loadHtmlCodeIntoCurrentWindow(final String htmlCode) throws IOEx final HtmlPage page = new HtmlPage(webResponse, webWindow); webWindow.setEnclosedPage(page); - htmlParser.parse(webResponse, page, false, false); + htmlParser.parse(this, webResponse, page, false, false); return page; } @@ -2884,15 +2896,34 @@ public XHtmlPage loadXHtmlCodeIntoCurrentWindow(final String xhtmlCode) throws I final XHtmlPage page = new XHtmlPage(webResponse, webWindow); webWindow.setEnclosedPage(page); - htmlParser.parse(webResponse, page, true, false); + htmlParser.parse(this, webResponse, page, true, false); return page; } + /** + * Creates a new {@link WebSocketAdapter}. + * + * @param webSocketListener the {@link WebSocketListener} + * @return a new {@link WebSocketAdapter} + */ + public WebSocketAdapter buildWebSocketAdapter(final WebSocketListener webSocketListener) { + return webSocketAdapterFactory_.buildWebSocketAdapter(this, webSocketListener); + } + + /** + * Defines a new factory method to create a new WebSocketAdapter. + * + * @param factory a {@link WebSocketAdapterFactory} + */ + public void setWebSocketAdapter(final WebSocketAdapterFactory factory) { + webSocketAdapterFactory_ = factory; + } + /** * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
* * @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 +2950,7 @@ static class CSS3ParserPool { * Our pool. We only hold data when it is available. In addition, synchronization against * this deque is cheap. */ - private ConcurrentLinkedDeque parsers_ = new ConcurrentLinkedDeque<>(); + private final ConcurrentLinkedDeque parsers_ = new ConcurrentLinkedDeque<>(); /** * Fetch a new or recycled CSS3parser. Make sure you use the try-with-resource concept diff --git a/src/main/java/org/htmlunit/WebClientOptions.java b/src/main/java/org/htmlunit/WebClientOptions.java index 030d13981f1..2e672d3ff81 100644 --- a/src/main/java/org/htmlunit/WebClientOptions.java +++ b/src/main/java/org/htmlunit/WebClientOptions.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. @@ -37,6 +37,7 @@ * @author Madis Pärn * @author Ronald Brill */ +@SuppressWarnings("PMD.TooManyFields") public class WebClientOptions implements Serializable { /** 1920. */ @@ -53,9 +54,9 @@ public class WebClientOptions implements Serializable { private boolean isRedirectEnabled_ = true; private File tempFileDirectory_; - private KeyStore sslClientCertificateStore_; + private transient KeyStore sslClientCertificateStore_; private char[] sslClientCertificatePassword_; - private KeyStore sslTrustStore_; + private transient KeyStore sslTrustStore_; private String[] sslClientProtocols_; private String[] sslClientCipherSuites_; @@ -82,6 +83,8 @@ public class WebClientOptions implements Serializable { private boolean geolocationEnabled_; private Geolocation geolocation_; + private int nekoReaderBufferSize_ = -1; + private boolean webSocketEnabled_ = true; private int webSocketMaxTextMessageSize_ = -1; private int webSocketMaxTextMessageBufferSize_ = -1; @@ -188,6 +191,7 @@ public boolean isRedirectEnabled() { * In some cases the impl seems to pick old certificates from the {@link KeyStore}. To avoid * that, wrap your {@link KeyStore} inside your own {@link KeyStore} impl and filter out outdated * certificates. + *

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,23 @@ 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 +873,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" + "Problem loading page\n" + "\n" + "

Content 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" + "Problem loading page\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 Map getStyleMap() { /** * @return the {@link DomElement} the backing {@link ElementCssStyleDeclaration} - * is associated with + * is associated with */ public DomElement getDomElement() { return elementStyleDeclaration_.getDomElement(); @@ -518,6 +529,10 @@ public String getBackgroundAttachment() { */ @Override public String getBackgroundColor() { + if (!getDomElement().isAttachedToPage()) { + return EMPTY_FINAL; + } + final String value = super.getBackgroundColor(); if (StringUtils.isEmpty(value)) { return Definition.BACKGROUND_COLOR.getDefaultComputedValue(getBrowserVersion()); @@ -550,6 +565,38 @@ public String getBackgroundRepeat() { return defaultIfEmpty(super.getBackgroundRepeat(), Definition.BACKGROUND_REPEAT); } + /** + * {@inheritDoc} + */ + @Override + public String getBlockSize() { + if (NONE.equals(getDisplay())) { + return defaultIfEmpty(super.getBlockSize(), Definition.BLOCK_SIZE); + } + + final DomElement domElem = getDomElement(); + if (!domElem.isAttachedToPage()) { + return defaultIfEmpty(super.getBlockSize(), Definition.BLOCK_SIZE); + } + + return CssPixelValueConverter.pixelString(domElem, new CssPixelValueConverter.CssValue(0, 0) { + @Override + public String get(final ComputedCssStyleDeclaration style) { + final String value = style.getStyleAttribute(Definition.HEIGHT, true); + if (StringUtils.isEmpty(value)) { + final String content = domElem.getVisibleText(); + // do this only for small content + // at least for empty div's this is more correct + if (null == content) { + return getDefaultValue() + "px"; + } + return getEmptyHeight(domElem) + "px"; + } + return value; + } + }); + } + /** * {@inheritDoc} */ @@ -724,11 +771,7 @@ public String getFontFamily() { */ @Override public String getFontSize() { - String value = getStyleAttribute(Definition.FONT_SIZE, true); - if (!value.isEmpty()) { - value = CssPixelValueConverter.pixelValue(value) + "px"; - } - return value; + return getStyleAttribute(Definition.FONT_SIZE, true); } /** @@ -752,16 +795,20 @@ public String getHeight() { if (!elem.isAttachedToPage()) { return ""; } - final int windowHeight = elem.getPage().getEnclosingWindow().getInnerHeight(); - return CssPixelValueConverter - .pixelString(elem, new CssPixelValueConverter.CssValue(0, windowHeight) { - @Override - public String get(final ComputedCssStyleDeclaration style) { - // TODO don't reach out to the js peer - final String offsetHeight = ((HTMLElement) elem.getScriptableObject()).getOffsetHeight() + "px"; - return defaultIfEmpty(style.getStyleAttribute(Definition.HEIGHT, true), offsetHeight, AUTO); - } - }); + + final ComputedCssStyleDeclaration style = elem.getPage().getEnclosingWindow().getComputedStyle(elem, null); + final String styleValue = style.getStyleAttribute(Definition.HEIGHT, true); + + if (styleValue == null || styleValue.isEmpty() || AUTO.equals(styleValue) || styleValue.endsWith("%")) { + final String calculatedHeight = style.getCalculatedHeight(false, false) + "px"; + return calculatedHeight; + } + + if (styleValue.endsWith("px")) { + return styleValue; + } + + return CssPixelValueConverter.pixelValue(styleValue) + "px"; } /** @@ -769,16 +816,24 @@ public String get(final ComputedCssStyleDeclaration style) { */ @Override public String getLeft() { + if (NONE.equals(getDisplay())) { + return AUTO; + } + + final DomElement elem = getDomElement(); + if (!elem.isAttachedToPage()) { + return ""; + } + final String superLeft = super.getLeft(); if (!superLeft.endsWith("%")) { return defaultIfEmpty(superLeft, AUTO, null); } - final DomElement element = getDomElement(); - return CssPixelValueConverter.pixelString(element, new CssPixelValueConverter.CssValue(0, 0) { + return CssPixelValueConverter.pixelString(elem, new CssPixelValueConverter.CssValue(0, 0) { @Override public String get(final ComputedCssStyleDeclaration style) { - if (style.getDomElement() == element) { + if (style.getDomElement() == elem) { return style.getStyleAttribute(Definition.LEFT, true); } return style.getStyleAttribute(Definition.WIDTH, true); @@ -973,19 +1028,24 @@ public String getTextIndent() { */ @Override public String getTop() { - final DomElement element = getDomElement(); - if (!element.isAttachedToPage()) { + if (NONE.equals(getDisplay())) { + return AUTO; + } + + final DomElement elem = getDomElement(); + if (!elem.isAttachedToPage()) { return ""; } + final String superTop = super.getTop(); if (!superTop.endsWith("%")) { return defaultIfEmpty(superTop, Definition.TOP); } - return CssPixelValueConverter.pixelString(element, new CssPixelValueConverter.CssValue(0, 0) { + return CssPixelValueConverter.pixelString(elem, new CssPixelValueConverter.CssValue(0, 0) { @Override public String get(final ComputedCssStyleDeclaration style) { - if (style.getDomElement() == element) { + if (style.getDomElement() == elem) { return style.getStyleAttribute(Definition.TOP, true); } return style.getStyleAttribute(Definition.HEIGHT, true); @@ -1156,6 +1216,10 @@ public String getWordSpacing() { */ @Override public String getZIndex() { + if (!getDomElement().isAttachedToPage()) { + return EMPTY_FINAL; + } + final String response = super.getZIndex(); if (response.isEmpty()) { return AUTO; @@ -1220,7 +1284,7 @@ else if ((ABSOLUTE.equals(p) || FIXED.equals(p)) && !AUTO.equals(r)) { parentWidth = getDomElement().getPage().getEnclosingWindow().getInnerWidth(); } else if (parent instanceof Page) { - parentWidth = (((Page) parent).getEnclosingWindow()).getInnerWidth(); + parentWidth = ((Page) parent).getEnclosingWindow().getInnerWidth(); } else { final ComputedCssStyleDeclaration parentStyle = @@ -1415,12 +1479,12 @@ public int getCalculatedHeight(final boolean includeBorder, final boolean includ if (!element.isAttachedToPage()) { return 0; } - int height = getCalculatedHeight(); + int height = getCalculatedHeight(element); if (!"border-box".equals(getStyleAttribute(Definition.BOX_SIZING, true))) { if (includeBorder) { height += getBorderVertical(); } - else if (isScrollable(true, true) && !(element instanceof HtmlBody)) { + else if (isScrollable(element, true, true) && !(element instanceof HtmlBody)) { height -= 17; } @@ -1435,14 +1499,12 @@ else if (isScrollable(true, true) && !(element instanceof HtmlBody)) { * Returns the element's calculated height, taking both relevant CSS and the element's children into account. * @return the element's calculated height, taking both relevant CSS and the element's children into account */ - private int getCalculatedHeight() { + private int getCalculatedHeight(final DomElement element) { final Integer cachedHeight = getCachedHeight(); if (cachedHeight != null) { return cachedHeight.intValue(); } - final DomElement element = getDomElement(); - if (element instanceof HtmlImage) { return updateCachedHeight(((HtmlImage) element).getHeightOrDefault()); } @@ -1456,7 +1518,7 @@ private int getCalculatedHeight() { } } - return updateCachedHeight(getEmptyHeight()); + return updateCachedHeight(getEmptyHeight(element)); } /** @@ -1476,7 +1538,7 @@ public int getCalculatedWidth(final boolean includeBorder, final boolean include if (includeBorder) { width += getBorderHorizontal(); } - else if (isScrollable(false, true) && !(element instanceof HtmlBody)) { + else if (isScrollable(element, false, true) && !(element instanceof HtmlBody)) { width -= 17; } @@ -1555,7 +1617,10 @@ else if (element instanceof HtmlTextInput || element instanceof HtmlPasswordInpu if (browserVersion.hasFeature(JS_CLIENTWIDTH_INPUT_TEXT_173)) { return 173; } - width = 154; // FF + if (browserVersion.hasFeature(JS_CLIENTWIDTH_INPUT_TEXT_154)) { + return 154; + } + width = 161; // FF } else if (element instanceof HtmlRadioButtonInput || element instanceof HtmlCheckBoxInput) { final BrowserVersion browserVersion = getDomElement().getPage().getWebClient().getBrowserVersion(); @@ -1624,7 +1689,8 @@ else if (child instanceof DomText) { final DomNode parent = child.getParentNode(); if (parent instanceof HtmlElement) { final ComputedCssStyleDeclaration style = webWindow.getComputedStyle((DomElement) parent, null); - final int height = browserVersion.getFontHeight(style.getFontSize()); + final int height = browserVersion.getFontHeight( + style.getStyleAttribute(Definition.FONT_SIZE, true)); width += child.getVisibleText().length() * (int) (height / 1.8f); } else { @@ -1636,33 +1702,34 @@ else if (child instanceof DomText) { } /** - * Returns the element's calculated height taking relevant CSS into account, but not the element's child - * elements. - * * @return the element's calculated height taking relevant CSS into account, but not the element's child * elements */ - private int getEmptyHeight() { - final Integer cachedHeight2 = getCachedHeight2(); - if (cachedHeight2 != null) { - return cachedHeight2.intValue(); + private int getEmptyHeight(final DomElement element) { + final Integer cachedEmptyHeight = getCachedEmptyHeight(); + if (cachedEmptyHeight != null) { + return cachedEmptyHeight.intValue(); } - final DomElement element = getDomElement(); if (!element.mayBeDisplayed()) { - return updateCachedHeight2(0); + return updateCachedEmptyHeight(0); } final String display = getDisplay(); if (NONE.equals(display)) { - return updateCachedHeight2(0); + return updateCachedEmptyHeight(0); } - final WebWindow webWindow = element.getPage().getEnclosingWindow(); + final SgmlPage page = element.getPage(); + final WebWindow webWindow = page.getEnclosingWindow(); final int windowHeight = webWindow.getInnerHeight(); if (element instanceof HtmlBody) { - return updateCachedHeight2(windowHeight); + if (page instanceof HtmlPage && ((HtmlPage) page).isQuirksMode()) { + return updateCachedEmptyHeight(windowHeight); + } + + return updateCachedEmptyHeight(0); } final boolean isInline = INLINE.equals(display) && !(element instanceof HtmlInlineFrame); @@ -1702,10 +1769,7 @@ private int getEmptyHeight() { || element instanceof HtmlNoLayer || element instanceof HtmlNoScript || element instanceof HtmlPlainText - || element instanceof HtmlRuby - || element instanceof HtmlRb || element instanceof HtmlRp - || element instanceof HtmlRt || element instanceof HtmlRtc || element instanceof HtmlS || element instanceof HtmlSample @@ -1773,11 +1837,105 @@ else if (element instanceof HtmlInlineFrame) { defaultHeight = 0; } } + else if (element instanceof HtmlRb) { + final BrowserVersion browser = webWindow.getWebClient().getBrowserVersion(); + if (browser.hasFeature(JS_CLIENTHEIGHT_RB_17)) { + defaultHeight = 17; + } + else { + defaultHeight = 0; + } + } + else if (element instanceof HtmlRt) { + final BrowserVersion browser = webWindow.getWebClient().getBrowserVersion(); + if (browser.hasFeature(JS_CLIENTHEIGHT_RT_9)) { + defaultHeight = 9; + } + else { + defaultHeight = 0; + } + } + else if (element instanceof HtmlRuby) { + final BrowserVersion browser = webWindow.getWebClient().getBrowserVersion(); + if (browser.hasFeature(JS_CLIENTHEIGHT_RUBY_17)) { + defaultHeight = 17; + } + else { + defaultHeight = 0; + } + } else { - final String fontSize = getFontSize(); + final String fontSize; + + boolean isHeading = false; + if (element instanceof HtmlHeading1) { + isHeading = true; + final String value = getStyleAttribute(Definition.FONT_SIZE, false); + if (value.isEmpty()) { + fontSize = "32px"; + } + else { + fontSize = getStyleAttribute(Definition.FONT_SIZE, true); + } + } + else if (element instanceof HtmlHeading2) { + isHeading = true; + final String value = getStyleAttribute(Definition.FONT_SIZE, false); + if (value.isEmpty()) { + fontSize = "24px"; + } + else { + fontSize = getStyleAttribute(Definition.FONT_SIZE, true); + } + } + else if (element instanceof HtmlHeading3) { + isHeading = true; + final String value = getStyleAttribute(Definition.FONT_SIZE, false); + if (value.isEmpty()) { + fontSize = "19px"; + } + else { + fontSize = getStyleAttribute(Definition.FONT_SIZE, true); + } + } + else if (element instanceof HtmlHeading4) { + isHeading = true; + final String value = getStyleAttribute(Definition.FONT_SIZE, false); + if (value.isEmpty()) { + fontSize = "16px"; + } + else { + fontSize = getStyleAttribute(Definition.FONT_SIZE, true); + } + } + else if (element instanceof HtmlHeading5) { + isHeading = true; + final String value = getStyleAttribute(Definition.FONT_SIZE, false); + if (value.isEmpty()) { + fontSize = "13px"; + } + else { + fontSize = getStyleAttribute(Definition.FONT_SIZE, true); + } + } + else if (element instanceof HtmlHeading6) { + isHeading = true; + final String value = getStyleAttribute(Definition.FONT_SIZE, false); + if (value.isEmpty()) { + fontSize = "11px"; + } + else { + fontSize = getStyleAttribute(Definition.FONT_SIZE, true); + } + } + else { + fontSize = getStyleAttribute(Definition.FONT_SIZE, true); + } + defaultHeight = webWindow.getWebClient().getBrowserVersion().getFontHeight(fontSize); - if (element instanceof HtmlDivision + if (isHeading + || element instanceof HtmlDivision || element instanceof HtmlSpan) { String width = getStyleAttribute(Definition.WIDTH, false); @@ -1811,6 +1969,13 @@ else if (element instanceof HtmlInlineFrame) { defaultHeight *= StringUtils.countMatches(content, '\n') + 1; } } + + final String styleHeight = getStyleAttribute(Definition.HEIGHT, true); + if (styleHeight.endsWith("%")) { + if (page instanceof HtmlPage && !((HtmlPage) page).isQuirksMode()) { + return defaultHeight; + } + } } } @@ -1835,7 +2000,7 @@ else if (element instanceof HtmlInlineFrame) { height = defaultHeight; } - return updateCachedHeight2(height); + return updateCachedEmptyHeight(height); } /** @@ -1905,15 +2070,14 @@ else if (ABSOLUTE.equals(position) || FIXED.equals(position)) { * @return {@code true} if the element is scrollable along the specified axis */ public boolean isScrollable(final boolean horizontal) { - return isScrollable(horizontal, false); + return isScrollable(getDomElement(), horizontal, false); } /** * @param ignoreSize whether to consider the content/calculated width/height */ - private boolean isScrollable(final boolean horizontal, final boolean ignoreSize) { + private boolean isScrollable(final DomElement element, final boolean horizontal, final boolean ignoreSize) { final boolean scrollable; - final DomElement element = getDomElement(); String overflow; if (horizontal) { @@ -1939,7 +2103,7 @@ private boolean isScrollable(final boolean horizontal, final boolean ignoreSize) } scrollable = (element instanceof HtmlBody || SCROLL.equals(overflow) || AUTO.equals(overflow)) - && (ignoreSize || getContentHeight() > getEmptyHeight()); + && (ignoreSize || getContentHeight() > getEmptyHeight(element)); } return scrollable; } @@ -2086,20 +2250,20 @@ public int updateCachedHeight(final int height) { /** * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. - * @return the cached height2 + * @return the cached emptyHeight */ - public Integer getCachedHeight2() { - return height2_; + public Integer getCachedEmptyHeight() { + return emptyHeight_; } /** * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. - * @param height the new value - * @return the param height2 + * @param emptyHeight the new value + * @return the param emptyHeight */ - public int updateCachedHeight2(final int height) { - height2_ = Integer.valueOf(height); - return height; + public int updateCachedEmptyHeight(final int emptyHeight) { + emptyHeight_ = Integer.valueOf(emptyHeight); + return emptyHeight; } /** diff --git a/src/main/java/org/htmlunit/css/CssColors.java b/src/main/java/org/htmlunit/css/CssColors.java index e24c57652a5..1e5ae5094c6 100644 --- a/src/main/java/org/htmlunit/css/CssColors.java +++ b/src/main/java/org/htmlunit/css/CssColors.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,9 +14,9 @@ */ package org.htmlunit.css; -import java.util.HashMap; import java.util.Locale; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; /** * Helper to work with colors. @@ -25,7 +25,7 @@ */ public final class CssColors { - private static final Map CSS_COLORS = new HashMap<>(); + private static final Map CSS_COLORS = new ConcurrentHashMap<>(); static { CSS_COLORS.put("aqua", "rgb(0, 255, 255)"); @@ -63,7 +63,7 @@ public static boolean isColorKeyword(final String token) { * Gets the RGB equivalent of a CSS color if the provided color is recognized. * @param color the color * @return the provided color if this is not a recognized color keyword, the RGB value - * in the form "rgb(x, y, z)" otherwise + * in the form "rgb(x, y, z)" otherwise */ public static String toRGBColor(final String color) { final String rgbValue = CSS_COLORS.get(color.toLowerCase(Locale.ROOT)); diff --git a/src/main/java/org/htmlunit/css/CssMediaList.java b/src/main/java/org/htmlunit/css/CssMediaList.java index 8a8e1bdbde3..88ff7a8d6e9 100644 --- a/src/main/java/org/htmlunit/css/CssMediaList.java +++ b/src/main/java/org/htmlunit/css/CssMediaList.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/CssPixelValueConverter.java b/src/main/java/org/htmlunit/css/CssPixelValueConverter.java index 1d101ac8b72..688ad4d23ff 100644 --- a/src/main/java/org/htmlunit/css/CssPixelValueConverter.java +++ b/src/main/java/org/htmlunit/css/CssPixelValueConverter.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/CssStyleSheet.java b/src/main/java/org/htmlunit/css/CssStyleSheet.java index 93a0924455b..9afb0bc3feb 100644 --- a/src/main/java/org/htmlunit/css/CssStyleSheet.java +++ b/src/main/java/org/htmlunit/css/CssStyleSheet.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. @@ -1044,25 +1044,6 @@ private static String toString(final InputSource source) { } } - /** - * Validates the list of selectors. - * @param selectorList the selectors - * @param documentMode see {@link Document#getDocumentMode()} - * @param domNode the dom node the query should work on - * @throws CSSException if a selector is invalid - * - * @deprecated as of version 4.5.0; use {@link #validateSelectors(SelectorList, DomNode)} instead - */ - @Deprecated - public static void validateSelectors(final SelectorList selectorList, final int documentMode, - final DomNode domNode) throws CSSException { - for (final Selector selector : selectorList) { - if (!isValidSelector(selector, domNode)) { - throw new CSSException("Invalid selector: " + selector, null); - } - } - } - /** * Validates the list of selectors. * @param selectorList the selectors @@ -1224,7 +1205,8 @@ public static boolean isActive(final MediaListImpl mediaList, final WebWindow we return true; } - for (int i = 0; i < mediaList.getLength(); i++) { + final int length = mediaList.getLength(); + for (int i = 0; i < length; i++) { final MediaQuery mediaQuery = mediaList.mediaQuery(i); boolean isActive = isActive(mediaQuery, webWindow); if (mediaQuery.isNot()) { diff --git a/src/main/java/org/htmlunit/css/ElementCssStyleDeclaration.java b/src/main/java/org/htmlunit/css/ElementCssStyleDeclaration.java index 609fa4857eb..f98bab0d4b1 100644 --- a/src/main/java/org/htmlunit/css/ElementCssStyleDeclaration.java +++ b/src/main/java/org/htmlunit/css/ElementCssStyleDeclaration.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. @@ -188,6 +188,9 @@ public Map getStyleMap() { return domElement_.getStyleMap(); } + /** + * @return the {@link DomElement} associated with this + */ public DomElement getDomElement() { return domElement_; } diff --git a/src/main/java/org/htmlunit/css/StyleAttributes.java b/src/main/java/org/htmlunit/css/StyleAttributes.java index 17f4c11e482..a41f839323e 100644 --- a/src/main/java/org/htmlunit/css/StyleAttributes.java +++ b/src/main/java/org/htmlunit/css/StyleAttributes.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. @@ -32,9 +32,9 @@ import java.io.Serializable; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.htmlunit.BrowserVersion; @@ -48,7 +48,7 @@ */ @SuppressWarnings("PMD.AvoidDuplicateLiterals") public final class StyleAttributes implements Serializable { - private static final Map STYLES = new HashMap<>(); + private static final Map STYLES = new ConcurrentHashMap<>(); static { for (final Definition definition : Definition.values()) { @@ -338,10 +338,10 @@ public enum Definition { BASELINE_SOURCE_("baseline-source", "baseline-source", ff("auto")), /** The style property {@code blockSize}. */ - BLOCK_SIZE("blockSize", "block-size", chromeAndEdge("324px"), ff("328px")), + BLOCK_SIZE("blockSize", "block-size", chromeAndEdgeAndFirefox("auto")), /** The style property {@code block-size}. */ - BLOCK_SIZE_("block-size", "block-size", ff("328px")), + BLOCK_SIZE_("block-size", "block-size", ff("auto")), /** The style property {@code border}. */ BORDER("border", "border", chromeAndEdge("0px none rgb(0, 0, 0)"), ff("0px rgb(0, 0, 0)")), @@ -695,10 +695,10 @@ public enum Definition { BORDER_RIGHT_WIDTH_("border-right-width", "border-right-width", ff("0px")), /** The style property {@code borderSpacing}. */ - BORDER_SPACING("borderSpacing", "border-spacing", chromeAndEdge("0px 0px"), ff("0px 0px")), + BORDER_SPACING("borderSpacing", "border-spacing", chromeAndEdge("0px 0px"), ffEsr("0px 0px"), ffLatest("0px")), /** The style property {@code border-spacing}. */ - BORDER_SPACING_("border-spacing", "border-spacing", ff("0px 0px")), + BORDER_SPACING_("border-spacing", "border-spacing", ffEsr("0px 0px"), ffLatest("0px")), /** The style property {@code borderStartEndRadius}. */ BORDER_START_END_RADIUS("borderStartEndRadius", "border-start-end-radius", chromeAndEdge("0px"), ff("0px")), @@ -1426,7 +1426,10 @@ public enum Definition { HYPHENATE_CHARACTER_("hyphenate-character", "hyphenate-character", ff("auto")), /** The style property {@code hyphenateLimitChars}. */ - HYPHENATE_LIMIT_CHAR("hyphenateLimitChars", "hyphenate-limit-char", chromeAndEdgeAuto()), + HYPHENATE_LIMIT_CHAR("hyphenateLimitChars", "hyphenate-limit-chars", chromeAndEdgeAuto(), ffLatest("auto")), + + /** The style property {@code hyphenate-limit-chars}. */ + HYPHENATE_LIMIT_CHAR_("hyphenate-limit-chars", "hyphenate-limit-chars", ffLatest("auto")), /** The style property {@code hyphens}. */ HYPHENS("hyphens", "hyphens", ff("manual"), chromeAndEdge("manual")), @@ -1461,10 +1464,10 @@ public enum Definition { INITIAL_VALUE("initialValue", "initial-value", chromeAndEdgeEmpty()), /** The style property {@code inlineSize}. */ - INLINE_SIZE("inlineSize", "inline-size", ff("1244px"), chrome("1240px"), edge("1232px")), + INLINE_SIZE("inlineSize", "inline-size", ffEsr("1244px"), ffLatest("1240px"), chrome("1240px"), edge("1232px")), /** The style property {@code inline-size}. */ - INLINE_SIZE_("inline-size", "inline-size", ff("1244px")), + INLINE_SIZE_("inline-size", "inline-size", ffEsr("1244px"), ffLatest("1240px")), /** The style property {@code inset}. */ INSET("inset", "inset", chromeAndEdgeAuto(), ff("auto")), @@ -1505,6 +1508,9 @@ public enum Definition { /** The style property {@code inset-inline-start}. */ INSET_INLINE_START_("inset-inline-start", "inset-inline-start", ff("auto")), + /** The style property {@code interactivity}. */ + INTERACTIVITY("interactivity", "interpolate-size", chromeAndEdge("auto")), + /** The style property {@code interpolateSize}. */ INTERPOLATE_SIZE("interpolateSize", "interpolate-size", chromeAndEdge("numeric-only")), @@ -2084,10 +2090,10 @@ public enum Definition { MOZ_PERSPECTIVE__("-moz-perspective", "-moz-perspective", ffLatest("none")), /** The style property {@code MozPerspectiveOrigin}. */ - MOZ_PERSPECTIVE_ORIGIN("MozPerspectiveOrigin", "-moz-perspective-origin", ffLatest("622px 164px")), + MOZ_PERSPECTIVE_ORIGIN("MozPerspectiveOrigin", "-moz-perspective-origin", ffLatest("620px 9px")), /** The style property {@code -moz-perspective-origin}. */ - MOZ_PERSPECTIVE_ORIGIN__("-moz-perspective-origin", "-moz-perspective-origin", ffLatest("622px 164px")), + MOZ_PERSPECTIVE_ORIGIN__("-moz-perspective-origin", "-moz-perspective-origin", ffLatest("620px 9px")), /** The style property {@code MozTabSize}. */ MOZ_TAB_SIZE("MozTabSize", "-moz-tab-size", ff("8")), @@ -2118,10 +2124,12 @@ public enum Definition { MOZ_TRANSFORM__("-moz-transform", "-moz-transform", ffNone()), /** The style property {@code MozTransformOrigin}. */ - MOZ_TRANSFORM_ORIGIN("MozTransformOrigin", "-moz-transform-origin", ff("622px 164px")), + MOZ_TRANSFORM_ORIGIN("MozTransformOrigin", "-moz-transform-origin", + ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code -moz-transform-origin}. */ - MOZ_TRANSFORM_ORIGIN__("-moz-transform-origin", "-moz-transform-origin", ff("622px 164px")), + MOZ_TRANSFORM_ORIGIN__("-moz-transform-origin", "-moz-transform-origin", + ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code MozTransformStyle}. */ MOZ_TRANSFORM_STYLE("MozTransformStyle", "-moz-transform-style", ffLatest("flat")), @@ -2130,10 +2138,10 @@ public enum Definition { MOZ_TRANSFORM_STYLE__("-moz-transform-style", "-moz-transform-style", ffLatest("flat")), /** The style property {@code MozUserInput}. */ - MOZ_USER_INPUT("MozUserInput", "-moz-user-input", ff("auto")), + MOZ_USER_INPUT("MozUserInput", "-moz-user-input", ffEsr("auto")), /** The style property {@code -moz-user-input}. */ - MOZ_USER_INPUT__("-moz-user-input", "-moz-user-input", ff("auto")), + MOZ_USER_INPUT__("-moz-user-input", "-moz-user-input", ffEsr("auto")), /** The style property {@code MozUserModify}. */ MOZ_USER_MODIFY("MozUserModify", "-moz-user-modify", ffEsr("read-only")), @@ -2255,7 +2263,7 @@ public enum Definition { OVERFLOW_ANCHOR_("overflow-anchor", "overflow-anchor", ff("auto")), /** The style property {@code overflowBlock}. */ - OVERFLOW_BLOCK("overflowBlock", "overflow-block", ff("visible")), + OVERFLOW_BLOCK("overflowBlock", "overflow-block", chromeAndEdgeAndFirefox("visible")), /** The style property {@code overflow-block}. */ OVERFLOW_BLOCK_("overflow-block", "overflow-block", ff("visible")), @@ -2267,7 +2275,7 @@ public enum Definition { OVERFLOW_CLIP_MARGIN_("overflow-clip-margin", "overflow-clip-margin", ff("0px")), /** The style property {@code overflowInline}. */ - OVERFLOW_INLINE("overflowInline", "overflow-inline", ff("visible")), + OVERFLOW_INLINE("overflowInline", "overflow-inline", chromeAndEdgeAndFirefox("visible")), /** The style property {@code overflow-inline}. */ OVERFLOW_INLINE_("overflow-inline", "overflow-inline", ff("visible")), @@ -2431,10 +2439,11 @@ public enum Definition { /** The style property {@code perspectiveOrigin}. */ PERSPECTIVE_ORIGIN("perspectiveOrigin", "perspective-origin", - ff("622px 164px"), chrome("620px 162px"), edge("616px 162px")), + ffEsr("622px 9px"), ffLatest("620px 9px"), chrome("620px 9px"), edge("616px 9px")), /** The style property {@code perspective-origin}. */ - PERSPECTIVE_ORIGIN_("perspective-origin", "perspective-origin", ff("622px 164px")), + PERSPECTIVE_ORIGIN_("perspective-origin", "perspective-origin", + ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code placeContent}. */ PLACE_CONTENT("placeContent", "place-content", chromeAndEdgeNormal(), ffNormal()), @@ -2542,6 +2551,9 @@ public enum Definition { /** The style property {@code scroll-behavior}. */ SCROLL_BEHAVIOR_("scroll-behavior", "scroll-behavior", ff("auto")), + /** The style property {@code scrollInitialTarget}. */ + SCROLL_INITIAL_TARGET("scrollInitialTarget", "scroll-initial-target", chromeAndEdgeNone()), + /** The style property {@code scrollMargin}. */ SCROLL_MARGIN("scrollMargin", "scroll-margin", chromeAndEdge("0px"), ff("0px")), @@ -2614,6 +2626,9 @@ public enum Definition { /** The style property {@code scroll-margin-top}. */ SCROLL_MARGIN_TOP_("scroll-margin-top", "scroll-margin-top", ff("0px")), + /** The style property {@code scrollMarkerGroup}. */ + SCROLL_MARKER_GROUP("scrollMarkerGroup", "scroll-marker-group", chromeAndEdgeNone()), + /** The style property {@code scrollPadding}. */ SCROLL_PADDING("scrollPadding", "scroll-padding", chromeAndEdgeAuto(), ff("auto")), @@ -2869,6 +2884,15 @@ public enum Definition { /** The style property {@code text-anchor}. */ TEXT_ANCHOR_("text-anchor", "text-anchor", ff("start")), + /** The style property {@code textBox}. */ + TEXT_BOX("textBox", "text-box", chromeAndEdgeNormal()), + + /** The style property {@code textBoxEdge}. */ + TEXT_BOX_EDGE("textBoxEdge", "text-box-edge", chromeAndEdgeAuto()), + + /** The style property {@code textBoxTrim}. */ + TEXT_BOX_TRIM("textBoxTrim", "text-box-trim", chromeAndEdgeNone()), + /** The style property {@code textCombineUpright}. */ TEXT_COMBINE_UPRIGHT("textCombineUpright", "text-combine-upright", chromeAndEdgeNone(), ffNone()), @@ -3048,10 +3072,10 @@ public enum Definition { /** The style property {@code transformOrigin}. */ TRANSFORM_ORIGIN("transformOrigin", "transform-origin", - ff("622px 164px"), chrome("620px 162px"), edge("616px 162px")), + ffEsr("622px 9px"), ffLatest("620px 9px"), chrome("620px 9px"), edge("616px 9px")), /** The style property {@code transform-origin}. */ - TRANSFORM_ORIGIN_("transform-origin", "transform-origin", ff("622px 164px")), + TRANSFORM_ORIGIN_("transform-origin", "transform-origin", ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code transformStyle}. */ TRANSFORM_STYLE("transformStyle", "transform-style", ff("flat"), chromeAndEdge("flat")), @@ -3692,7 +3716,7 @@ public enum Definition { WEBKIT_LOCALE("webkitLocale", "webkit-locale", chromeAndEdgeAuto()), /** The style property {@code webkitLogicalHeight}. */ - WEBKIT_LOGICAL_HEIGHT("webkitLogicalHeight", "webkit-logical-height", chromeAndEdge("324px")), + WEBKIT_LOGICAL_HEIGHT("webkitLogicalHeight", "webkit-logical-height", chromeAndEdge("18px")), /** The style property {@code webkitLogicalWidth}. */ WEBKIT_LOGICAL_WIDTH("webkitLogicalWidth", "webkit-logical-width", chrome("1240px"), edge("1232px")), @@ -3865,15 +3889,15 @@ public enum Definition { /** The style property {@code webkitPerspectiveOrigin}. */ WEBKIT_PERSPECTIVE_ORIGIN("webkitPerspectiveOrigin", "webkit-perspective-origin", - ff("622px 164px"), chrome("620px 162px"), edge("616px 162px")), + ffEsr("622px 9px"), ffLatest("620px 9px"), chrome("620px 9px"), edge("616px 9px")), /** The style property {@code WebkitPerspectiveOrigin}. */ WEBKIT_PERSPECTIVE_ORIGIN_("WebkitPerspectiveOrigin", "webkit-perspective-origin", - ff("622px 164px")), + ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code -webkit-perspective-origin}. */ WEBKIT_PERSPECTIVE_ORIGIN__("-webkit-perspective-origin", "webkit-perspective-origin", - ff("622px 164px")), + ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code webkitPerspectiveOriginX}. */ WEBKIT_PERSPECTIVE_ORIGIN_X("webkitPerspectiveOriginX", "webkit-perspective-origin-x", chromeAndEdgeEmpty()), @@ -3999,15 +4023,15 @@ public enum Definition { /** The style property {@code webkitTransformOrigin}. */ WEBKIT_TRANSFORM_ORIGIN("webkitTransformOrigin", "webkit-transform-origin", - ff("622px 164px"), chrome("620px 162px"), edge("616px 162px")), + ffEsr("622px 9px"), ffLatest("620px 9px"), chrome("620px 9px"), edge("616px 9px")), /** The style property {@code WebkitTransformOrigin}. */ WEBKIT_TRANSFORM_ORIGIN_("WebkitTransformOrigin", "webkit-transform-origin", - ff("622px 164px")), + ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code -webkit-transform-origin}. */ WEBKIT_TRANSFORM_ORIGIN__("-webkit-transform-origin", "webkit-transform-origin", - ff("622px 164px")), + ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code webkitTransformOriginX}. */ WEBKIT_TRANSFORM_ORIGIN_X("webkitTransformOriginX", "webkit-transform-origin-x", chromeAndEdgeEmpty()), diff --git a/src/main/java/org/htmlunit/css/StyleElement.java b/src/main/java/org/htmlunit/css/StyleElement.java index 954b9810a82..2e4f2a2714e 100644 --- a/src/main/java/org/htmlunit/css/StyleElement.java +++ b/src/main/java/org/htmlunit/css/StyleElement.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. @@ -35,7 +35,7 @@ * @author Ronald Brill * @author Frank Danek */ -public class StyleElement implements Comparable, Serializable { +public class StyleElement implements Serializable { /** CSS important property constant. */ public static final String PRIORITY_IMPORTANT = "important"; @@ -133,28 +133,41 @@ public String toString() { } /** - * {@inheritDoc} + * This takes only the importance, the specificity and the index into account. + * The name and value properties are ignored. + * + * @param first the {@link StyleElement} to compare + * @param second the {@link StyleElement} to compare with + * @return a negative integer, zero, or a positive integer as this object + * is less than, equal to, or greater than the specified object. */ - @Override - public int compareTo(final StyleElement e) { - if (e == null) { + public static int compareToByImportanceAndSpecificity(final StyleElement first, final StyleElement second) { + if (first == null) { + return second == null ? 0 : -1; + } + + if (second == null) { return 1; } - if (isImportant()) { - if (!e.isImportant()) { + if (first == second) { + return 0; + } + + if (first.isImportant()) { + if (!second.isImportant()) { return 1; } } else { - if (e.isImportant()) { + if (second.isImportant()) { return -1; } } - final int comp = getSpecificity().compareTo(e.getSpecificity()); + final int comp = first.getSpecificity().compareTo(second.getSpecificity()); if (comp == 0) { - return Long.compare(getIndex(), e.getIndex()); + return Long.compare(first.getIndex(), second.getIndex()); } return comp; } diff --git a/src/main/java/org/htmlunit/css/WrappedCssStyleDeclaration.java b/src/main/java/org/htmlunit/css/WrappedCssStyleDeclaration.java index 8fd8eacdc74..6654f6acab9 100644 --- a/src/main/java/org/htmlunit/css/WrappedCssStyleDeclaration.java +++ b/src/main/java/org/htmlunit/css/WrappedCssStyleDeclaration.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/package-info.java b/src/main/java/org/htmlunit/css/package-info.java index 4b6c583bfd1..0d5400bc9e4 100644 --- a/src/main/java/org/htmlunit/css/package-info.java +++ b/src/main/java/org/htmlunit/css/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/html/AbstractDomNodeList.java b/src/main/java/org/htmlunit/html/AbstractDomNodeList.java index 72c354e9a12..c5a1434f11b 100644 --- a/src/main/java/org/htmlunit/html/AbstractDomNodeList.java +++ b/src/main/java/org/htmlunit/html/AbstractDomNodeList.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/BaseFrameElement.java b/src/main/java/org/htmlunit/html/BaseFrameElement.java index b1ed2a0f326..7d1ffd0aa31 100644 --- a/src/main/java/org/htmlunit/html/BaseFrameElement.java +++ b/src/main/java/org/htmlunit/html/BaseFrameElement.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/CharacterDataChangeEvent.java b/src/main/java/org/htmlunit/html/CharacterDataChangeEvent.java index b87d090fab6..ad975321c44 100644 --- a/src/main/java/org/htmlunit/html/CharacterDataChangeEvent.java +++ b/src/main/java/org/htmlunit/html/CharacterDataChangeEvent.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/CharacterDataChangeListener.java b/src/main/java/org/htmlunit/html/CharacterDataChangeListener.java index a81b44dc1dd..d37c4ce833f 100644 --- a/src/main/java/org/htmlunit/html/CharacterDataChangeListener.java +++ b/src/main/java/org/htmlunit/html/CharacterDataChangeListener.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. @@ -20,8 +20,10 @@ * Implementations of this interface receive notifications of changes to the Character Data. * * @author Ahmed Ashour + * @author Ronald Brill * @see CharacterDataChangeEvent */ +@FunctionalInterface public interface CharacterDataChangeListener extends Serializable { /** diff --git a/src/main/java/org/htmlunit/html/DefaultElementFactory.java b/src/main/java/org/htmlunit/html/DefaultElementFactory.java index 236d0cb112a..7e76ed5eb57 100644 --- a/src/main/java/org/htmlunit/html/DefaultElementFactory.java +++ b/src/main/java/org/htmlunit/html/DefaultElementFactory.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/DisabledElement.java b/src/main/java/org/htmlunit/html/DisabledElement.java index 1719d45eb93..abf6d54971d 100644 --- a/src/main/java/org/htmlunit/html/DisabledElement.java +++ b/src/main/java/org/htmlunit/html/DisabledElement.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/DoTypeProcessor.java b/src/main/java/org/htmlunit/html/DoTypeProcessor.java index 41bc133a75c..c32c36b3222 100644 --- a/src/main/java/org/htmlunit/html/DoTypeProcessor.java +++ b/src/main/java/org/htmlunit/html/DoTypeProcessor.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. @@ -68,7 +68,7 @@ class DoTypeProcessor implements Serializable { SPECIAL_KEYS_MAP_.put(DOM_VK_SUBTRACT, '-'); for (int i = DOM_VK_NUMPAD0; i <= DOM_VK_NUMPAD9; i++) { - SPECIAL_KEYS_MAP_.put(i, (char) ('0' + (i - DOM_VK_NUMPAD0))); + SPECIAL_KEYS_MAP_.put(i, (char) ('0' + i - DOM_VK_NUMPAD0)); } } diff --git a/src/main/java/org/htmlunit/html/DomAttr.java b/src/main/java/org/htmlunit/html/DomAttr.java index b4a3d6c78f4..19affc2d36d 100644 --- a/src/main/java/org/htmlunit/html/DomAttr.java +++ b/src/main/java/org/htmlunit/html/DomAttr.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. @@ -108,7 +108,13 @@ public void setNodeValue(final String value) { */ @Override public void setValue(final String value) { - value_ = value; + if (value != null + && value.isEmpty()) { + value_ = DomElement.ATTRIBUTE_VALUE_EMPTY; + } + else { + value_ = value; + } specified_ = true; } diff --git a/src/main/java/org/htmlunit/html/DomCDataSection.java b/src/main/java/org/htmlunit/html/DomCDataSection.java index eac1f7f6875..71df9b4b757 100644 --- a/src/main/java/org/htmlunit/html/DomCDataSection.java +++ b/src/main/java/org/htmlunit/html/DomCDataSection.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/DomChangeEvent.java b/src/main/java/org/htmlunit/html/DomChangeEvent.java index 25a12b2e99b..b595ea3d4ae 100644 --- a/src/main/java/org/htmlunit/html/DomChangeEvent.java +++ b/src/main/java/org/htmlunit/html/DomChangeEvent.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/DomChangeListener.java b/src/main/java/org/htmlunit/html/DomChangeListener.java index 352a075e8e8..56522bed5d9 100644 --- a/src/main/java/org/htmlunit/html/DomChangeListener.java +++ b/src/main/java/org/htmlunit/html/DomChangeListener.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/DomCharacterData.java b/src/main/java/org/htmlunit/html/DomCharacterData.java index 635af0a0e8a..79e316a31fd 100644 --- a/src/main/java/org/htmlunit/html/DomCharacterData.java +++ b/src/main/java/org/htmlunit/html/DomCharacterData.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. @@ -105,9 +105,9 @@ public void appendData(final String newData) { /** * Deletes characters from character data. * @param offset the position of the first character to be deleted (can't be - * less than zero) + * less than zero) * @param count the number of characters to be deleted, if less than zero - * leaves the first offset chars + * leaves the first offset chars */ @Override public void deleteData(final int offset, final int count) { diff --git a/src/main/java/org/htmlunit/html/DomComment.java b/src/main/java/org/htmlunit/html/DomComment.java index a77e117abaa..29fc8ba90cd 100644 --- a/src/main/java/org/htmlunit/html/DomComment.java +++ b/src/main/java/org/htmlunit/html/DomComment.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/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..1081a5c767f 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 LinkedHashMap styleMap_; + private static final Comparator STYLE_ELEMENT_COMPARATOR = new Comparator() { + @Override + public int compare(final StyleElement first, final StyleElement second) { + return StyleElement.compareToByImportanceAndSpecificity(first, second); + } + }; + /** * Whether the Mouse is currently over this element or not. */ @@ -122,7 +130,7 @@ public class DomElement extends DomNamespaceNode implements Element { * @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. */ public DomElement(final String namespaceURI, final String qualifiedName, final SgmlPage page, final Map attributes) { @@ -187,7 +195,7 @@ public final boolean hasAttributes() { * * @param attributeName the name of the attribute * @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 boolean hasAttribute(final String attributeName) { @@ -469,7 +477,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 +612,7 @@ public void writeStyleToElement(final Map styleMap) { final StringBuilder builder = new StringBuilder(); final List styleElements = new ArrayList<>(styleMap.values()); - Collections.sort(styleElements); + Collections.sort(styleElements, STYLE_ELEMENT_COMPARATOR); for (final StyleElement e : styleElements) { if (builder.length() != 0) { builder.append(' '); @@ -663,7 +671,10 @@ public List getStaticElementsByTagName(final String t for (final Iterator iterator = this.new DescendantHtmlElementsIterator(); iterator.hasNext();) { final HtmlElement elem = iterator.next(); if (elem.getLocalName().equalsIgnoreCase(tagName)) { - res.add((E) elem); + final String prefix = elem.getPrefix(); + if (prefix == null || prefix.isEmpty()) { + res.add((E) elem); + } } } return res; @@ -787,10 +798,12 @@ public DomElement getLastElementChild() { * Returns the current number of element nodes that are children of this element. * @return the current number of element nodes that are children of this element. */ - @SuppressWarnings("PMD.UnusedLocalVariable") public int getChildElementCount() { int counter = 0; - for (final DomElement elem : getChildElements()) { + + final Iterator iterator = getChildElements().iterator(); + while (iterator.hasNext()) { + iterator.next(); counter++; } return counter; @@ -809,7 +822,8 @@ public final Iterable getChildElements() { private static class ChildElementsIterable implements Iterable { private final Iterator iterator_; - /** Constructor. + /** + * Constructor. * @param domNode the parent */ protected ChildElementsIterable(final DomNode domNode) { @@ -829,7 +843,8 @@ protected static class ChildElementsIterator implements Iterator { private DomElement nextElement_; - /** Constructor. + /** + * Constructor. * @param domNode the parent */ protected ChildElementsIterator(final DomNode domNode) { @@ -844,13 +859,17 @@ protected ChildElementsIterator(final DomNode domNode) { } } - /** @return is there a next one ? */ + /** + * @return is there a next one ? + */ @Override public boolean hasNext() { return nextElement_ != null; } - /** @return the next one */ + /** + * @return the next one + */ @Override public DomElement next() { if (nextElement_ != null) { @@ -1166,7 +1185,7 @@ public

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 +1203,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..bf6b80f8724 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_; @@ -908,11 +907,11 @@ public T getScriptableObject() { @Override public DomNode appendChild(final Node node) { if (node == this) { - throw JavaScriptEngine.throwAsScriptRuntimeEx(new Exception("Can not add not to itself " + this)); + throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Can not add not to itself " + this); } final DomNode domNode = (DomNode) node; if (domNode.isAncestorOf(this)) { - throw JavaScriptEngine.throwAsScriptRuntimeEx(new Exception("Can not add (grand)parent to itself " + this)); + throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Can not add (grand)parent to itself " + this); } if (domNode instanceof DomDocumentFragment) { @@ -1121,7 +1120,8 @@ public void removeAllChildren() { * @throws SAXException in case of error */ public void parseHtmlSnippet(final String source) throws SAXException, IOException { - getPage().getWebClient().getPageCreator().getHtmlParser().parseFragment(this, source); + final WebClient webClient = getPage().getWebClient(); + webClient.getPageCreator().getHtmlParser().parseFragment(webClient, this, this, source, false); } /** @@ -1174,7 +1174,7 @@ else if (previousSibling_ != null && previousSibling_.nextSibling_ == this) { private void fireRemoval(final DomNode exParent) { final SgmlPage page = getPage(); - if (page != null && page instanceof HtmlPage) { + if (page instanceof HtmlPage) { // some actions executed on removal need an intact parent relationship (e.g. for the // DocumentPositionComparator) so we have to restore it temporarily parent_ = exParent; @@ -1245,11 +1245,11 @@ public void quietlyRemoveAndMoveChildrenTo(final DomNode destination) { * * @param newChild the new child node that is being inserted below this node * @throws DOMException HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does - * not allow children of the type of the newChild node, or if the node to insert is one of - * this node's ancestors or this node itself, or if this node is of type Document and the - * DOM application attempts to insert a second DocumentType or Element node. - * WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the - * one that created this node. + * not allow children of the type of the newChild node, or if the node to insert is one of + * this node's ancestors or this node itself, or if this node is of type Document and the + * DOM application attempts to insert a second DocumentType or Element node. + * WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the + * one that created this node. */ protected void checkChildHierarchy(final Node newChild) throws DOMException { Node parentNode = this; @@ -1392,7 +1392,7 @@ public final Iterable getDomElementDescendants() { * @param the type of nodes over which to iterate * * @deprecated as of version 4.7.0; use {@link DescendantDomNodesIterator}, - * {@link DescendantDomElementsIterator}, or {@link DescendantHtmlElementsIterator} instead. + * {@link DescendantDomElementsIterator}, or {@link DescendantHtmlElementsIterator} instead. */ @Deprecated protected class DescendantElementsIterator implements Iterator { @@ -1435,7 +1435,9 @@ public void remove() { current.remove(); } - /** @return the next node, if there is one */ + /** + * @return the next node, if there is one + */ @SuppressWarnings("unchecked") public T nextNode() { currentNode_ = nextNode_; @@ -1538,7 +1540,9 @@ public void remove() { current.remove(); } - /** @return the next node, if there is one */ + /** + * @return the next node, if there is one + */ @SuppressWarnings("unchecked") public DomNode nextNode() { currentNode_ = nextNode_; @@ -1639,7 +1643,9 @@ public void remove() { current.remove(); } - /** @return the next node, if there is one */ + /** + * @return the next node, if there is one + */ @SuppressWarnings("unchecked") public DomElement nextNode() { currentNode_ = nextNode_; @@ -1740,7 +1746,9 @@ public void remove() { current.remove(); } - /** @return the next node, if there is one */ + /** + * @return the next node, if there is one + */ @SuppressWarnings("unchecked") public HtmlElement nextNode() { currentNode_ = nextNode_; @@ -2228,7 +2236,7 @@ public boolean handles(final Event event) { * Returns the previous sibling element node of this element. * null if this element has no element sibling nodes that come before this one in the document tree. * @return the previous sibling element node of this element. - * null if this element has no element sibling nodes that come before this one in the document tree + * null if this element has no element sibling nodes that come before this one in the document tree */ public DomElement getPreviousElementSibling() { DomNode node = getPreviousSibling(); @@ -2242,7 +2250,7 @@ public DomElement getPreviousElementSibling() { * Returns the next sibling element node of this element. * null if this element has no element sibling nodes that come after this one in the document tree. * @return the next sibling element node of this element. - * null if this element has no element sibling nodes that come after this one in the document tree + * null if this element has no element sibling nodes that come after this one in the document tree */ public DomElement getNextElementSibling() { DomNode node = getNextSibling(); @@ -2289,9 +2297,6 @@ public DomElement closest(final String selectorString) { * An unmodifiable empty {@link NamedNodeMap} implementation. */ private static final class ReadOnlyEmptyNamedNodeMapImpl implements NamedNodeMap, Serializable { - private ReadOnlyEmptyNamedNodeMapImpl() { - super(); - } /** * {@inheritDoc} diff --git a/src/main/java/org/htmlunit/html/DomNodeIterator.java b/src/main/java/org/htmlunit/html/DomNodeIterator.java index 1f8169719c5..2bedfb345c0 100644 --- a/src/main/java/org/htmlunit/html/DomNodeIterator.java +++ b/src/main/java/org/htmlunit/html/DomNodeIterator.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,7 +38,7 @@ public class DomNodeIterator implements NodeIterator { * * @param root The root node at which to begin the {@link NodeIterator}'s traversal * @param whatToShow an optional int representing a bitmask created by combining - * the constant properties of {@link NodeFilter} + * the constant properties of {@link NodeFilter} * @param expandEntityReferences If false, the contents of * EntityReference nodes are not present in the logical view. * @param filter an object implementing the {@link NodeFilter} interface @@ -143,15 +143,7 @@ private DomNode traverse(final boolean next) { } else { if (beforeNode) { - final DomNode left = getSibling(node, true); - if (left == null) { - final Node parent = node.getParentNode(); - if (parent == null) { - node = null; - } - } - - DomNode follow = left; + DomNode follow = getSibling(node, true); if (follow != null) { while (follow.hasChildNodes()) { final DomNode toFollow = getChild(follow, false); diff --git a/src/main/java/org/htmlunit/html/DomNodeList.java b/src/main/java/org/htmlunit/html/DomNodeList.java index 2c00592413c..3080c25e5ec 100644 --- a/src/main/java/org/htmlunit/html/DomNodeList.java +++ b/src/main/java/org/htmlunit/html/DomNodeList.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/DomProcessingInstruction.java b/src/main/java/org/htmlunit/html/DomProcessingInstruction.java index 26d3c01f574..b3a5af3d030 100644 --- a/src/main/java/org/htmlunit/html/DomProcessingInstruction.java +++ b/src/main/java/org/htmlunit/html/DomProcessingInstruction.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/DomText.java b/src/main/java/org/htmlunit/html/DomText.java index 9db0277f5dc..aa3da9da5e4 100644 --- a/src/main/java/org/htmlunit/html/DomText.java +++ b/src/main/java/org/htmlunit/html/DomText.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/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..68034b78210 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 attributes) { @@ -176,7 +181,7 @@ protected HtmlElement(final String qualifiedName, final SgmlPage page, * @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 namespaceURI, final String qualifiedName, final SgmlPage page, final Map attributes) { @@ -191,17 +196,17 @@ protected void setAttributeNS(final String namespaceURI, final String qualifiedN final String attributeValue, final boolean notifyAttributeChangeListeners, final boolean notifyMutationObservers) { + final HtmlPage htmlPage = getHtmlPageOrNull(); + // TODO: Clean up; this is a hack for HtmlElement living within an XmlPage. - if (null == getHtmlPageOrNull()) { + if (null == htmlPage) { super.setAttributeNS(namespaceURI, qualifiedName, attributeValue, notifyAttributeChangeListeners, notifyMutationObservers); return; } final String oldAttributeValue = getAttribute(qualifiedName); - final HtmlPage htmlPage = (HtmlPage) getPage(); final boolean mappedElement = isAttachedToPage() - && htmlPage != null && (DomElement.NAME_ATTRIBUTE.equals(qualifiedName) || DomElement.ID_ATTRIBUTE.equals(qualifiedName)); if (mappedElement) { // cast is save here because isMappedElement checks for HtmlPage @@ -287,12 +292,19 @@ private void fireAttributeChangeImpl(final HtmlAttributeChangeEvent event, */ @Override public Attr setAttributeNode(final Attr attribute) { + final HtmlPage htmlPage = getHtmlPageOrNull(); + + // TODO: Clean up; this is a hack for HtmlElement living within an XmlPage. + if (null == htmlPage) { + return super.setAttributeNode(attribute); + } + final String qualifiedName = attribute.getName(); final String oldAttributeValue = getAttribute(qualifiedName); - final HtmlPage htmlPage = (HtmlPage) getPage(); + final boolean mappedElement = isAttachedToPage() - && htmlPage != null - && (DomElement.NAME_ATTRIBUTE.equals(qualifiedName) || DomElement.ID_ATTRIBUTE.equals(qualifiedName)); + && (DomElement.NAME_ATTRIBUTE.equals(qualifiedName) + || DomElement.ID_ATTRIBUTE.equals(qualifiedName)); if (mappedElement) { htmlPage.removeMappedElement(this, false, false); } @@ -325,23 +337,28 @@ public void removeAttribute(final String attributeName) { } final HtmlPage htmlPage = getHtmlPageOrNull(); - final boolean mapped = htmlPage != null - && (DomElement.NAME_ATTRIBUTE.equals(attributeName) || DomElement.ID_ATTRIBUTE.equals(attributeName)); + + // TODO: Clean up; this is a hack for HtmlElement living within an XmlPage. + if (null == htmlPage) { + super.removeAttribute(attributeName); + return; + } + + final boolean mapped = DomElement.NAME_ATTRIBUTE.equals(attributeName) + || DomElement.ID_ATTRIBUTE.equals(attributeName); if (mapped) { htmlPage.removeMappedElement(this, false, false); } super.removeAttribute(attributeName); - if (htmlPage != null) { - if (mapped) { - htmlPage.addMappedElement(this, false); - } - - final HtmlAttributeChangeEvent event = new HtmlAttributeChangeEvent(this, attributeName, value); - fireHtmlAttributeRemoved(event); - htmlPage.fireHtmlAttributeRemoved(event); + if (mapped) { + htmlPage.addMappedElement(this, false); } + + final HtmlAttributeChangeEvent event = new HtmlAttributeChangeEvent(this, attributeName, value); + fireHtmlAttributeRemoved(event); + htmlPage.fireHtmlAttributeRemoved(event); } /** @@ -605,10 +622,12 @@ private Page type(final char c, final boolean lastType) final HtmlForm form = getEnclosingForm(); if (form != null && c == '\n' && isSubmittableByEnter()) { - final HtmlSubmitInput submit = form.getFirstByXPath(".//input[@type='submit']"); - if (submit != null) { - return submit.click(); + for (final DomElement descendant : form.getDomElementDescendants()) { + if (descendant instanceof HtmlSubmitInput) { + return descendant.click(); + } } + form.submit((SubmittableElement) this); webClient.getJavaScriptEngine().processPostponedActions(); } @@ -660,7 +679,8 @@ public Page type(final Keyboard keyboard) throws IOException { } } - for (int i = 0; i < keys.size(); i++) { + final int size = keys.size(); + for (int i = 0; i < size; i++) { final Object[] entry = keys.get(i); if (entry.length == 1) { type((char) entry[0], i == keys.size() - 1); @@ -1275,7 +1295,7 @@ public DisplayStyle getDefaultStyleDisplay() { * Helper for src retrieval and normalization. * * @return the value of the attribute {@code src} with all line breaks removed - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ protected final String getSrcAttributeNormalized() { // at the moment StringUtils.replaceChars returns the org string @@ -1421,6 +1441,186 @@ public void setRequired(final boolean required) { } } + /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * + * @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 List getFormElementsByAttribute( final String attributeName, final String attributeValue) { - final List list = new ArrayList<>(); - final String lowerCaseTagName = elementName.toLowerCase(Locale.ROOT); - - for (final HtmlElement element : getElements()) { - if (element.getTagName().equals(lowerCaseTagName)) { - final String attValue = element.getAttribute(attributeName); - if (attValue.equals(attributeValue)) { - list.add((E) element); - } - } - } - return list; - } - - /** - * @return returns a list of all form controls contained in the <form> element or referenced by formId - * but ignoring elements that are contained in a nested form - * @deprecated as of version 4.4.0; use {@link #getFormElements()}, {@link #getElementsJS()} instead - */ - @Deprecated - public List getElements() { - return getElements(htmlElement -> SUBMITTABLE_TAG_NAMES.contains(htmlElement.getTagName())); + return (List) getElements(htmlElement -> + htmlElement.getTagName().equals(elementName) + && htmlElement.getAttribute(attributeName).equals(attributeValue)); } /** * @return A List containing all form controls in the form. - * The form controls in the returned collection are in the same order - * in which they appear in the form by following a preorder, - * depth-first traversal of the tree. This is called tree order. Only the following elements are returned: - * button, fieldset, input, object, output, select, textarea. + * The form controls in the returned collection are in the same order + * in which they appear in the form by following a preorder, + * depth-first traversal of the tree. This is called tree order. + * Only the following elements are returned: + * button, fieldset, input, object, output, select, textarea. */ public List getFormElements() { return getElements(htmlElement -> { @@ -590,12 +572,13 @@ public List getFormElements() { * see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/elements * * @return A List containing all non-image controls in the form. - * The form controls in the returned collection are in the same order - * in which they appear in the form by following a preorder, - * depth-first traversal of the tree. This is called tree order. Only the following elements are returned: - * button, fieldset, - * input (with the exception that any whose type is "image" are omitted for historical reasons), - * object, output, select, textarea. + * The form controls in the returned collection are in the same order + * in which they appear in the form by following a preorder, + * depth-first traversal of the tree. This is called tree order. + * Only the following elements are returned: + * button, fieldset, + * input (with the exception that any whose type is "image" are omitted for historical reasons), + * object, output, select, textarea. */ public List getElementsJS() { return getElements(htmlElement -> { diff --git a/src/main/java/org/htmlunit/html/HtmlFrame.java b/src/main/java/org/htmlunit/html/HtmlFrame.java index a5701f5f7e0..1759bc89df9 100644 --- a/src/main/java/org/htmlunit/html/HtmlFrame.java +++ b/src/main/java/org/htmlunit/html/HtmlFrame.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/HtmlFrameSet.java b/src/main/java/org/htmlunit/html/HtmlFrameSet.java index dc6cc5c868a..72373a95208 100644 --- a/src/main/java/org/htmlunit/html/HtmlFrameSet.java +++ b/src/main/java/org/htmlunit/html/HtmlFrameSet.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/HtmlHead.java b/src/main/java/org/htmlunit/html/HtmlHead.java index 5f47a1d0d8a..1644ec3a378 100644 --- a/src/main/java/org/htmlunit/html/HtmlHead.java +++ b/src/main/java/org/htmlunit/html/HtmlHead.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/HtmlHeader.java b/src/main/java/org/htmlunit/html/HtmlHeader.java index f172f2dd246..f28bddfa71d 100644 --- a/src/main/java/org/htmlunit/html/HtmlHeader.java +++ b/src/main/java/org/htmlunit/html/HtmlHeader.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/HtmlHeading1.java b/src/main/java/org/htmlunit/html/HtmlHeading1.java index 15ca56c501c..e5eeefb519a 100644 --- a/src/main/java/org/htmlunit/html/HtmlHeading1.java +++ b/src/main/java/org/htmlunit/html/HtmlHeading1.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/HtmlHeading2.java b/src/main/java/org/htmlunit/html/HtmlHeading2.java index 657bf0c6f2f..e3524b607f6 100644 --- a/src/main/java/org/htmlunit/html/HtmlHeading2.java +++ b/src/main/java/org/htmlunit/html/HtmlHeading2.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/HtmlHeading3.java b/src/main/java/org/htmlunit/html/HtmlHeading3.java index 20d41808dbf..fdcf4f0ab16 100644 --- a/src/main/java/org/htmlunit/html/HtmlHeading3.java +++ b/src/main/java/org/htmlunit/html/HtmlHeading3.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/HtmlHeading4.java b/src/main/java/org/htmlunit/html/HtmlHeading4.java index e28c9f7ad38..9755347b3fb 100644 --- a/src/main/java/org/htmlunit/html/HtmlHeading4.java +++ b/src/main/java/org/htmlunit/html/HtmlHeading4.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/HtmlHeading5.java b/src/main/java/org/htmlunit/html/HtmlHeading5.java index bb931137d00..14d26988ca8 100644 --- a/src/main/java/org/htmlunit/html/HtmlHeading5.java +++ b/src/main/java/org/htmlunit/html/HtmlHeading5.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/HtmlHeading6.java b/src/main/java/org/htmlunit/html/HtmlHeading6.java index fe87a181fc8..bf585172957 100644 --- a/src/main/java/org/htmlunit/html/HtmlHeading6.java +++ b/src/main/java/org/htmlunit/html/HtmlHeading6.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/HtmlHiddenInput.java b/src/main/java/org/htmlunit/html/HtmlHiddenInput.java index 823545fea96..ed3cc0e36c7 100644 --- a/src/main/java/org/htmlunit/html/HtmlHiddenInput.java +++ b/src/main/java/org/htmlunit/html/HtmlHiddenInput.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/HtmlHorizontalRule.java b/src/main/java/org/htmlunit/html/HtmlHorizontalRule.java index 53955050627..2495a7cd555 100644 --- a/src/main/java/org/htmlunit/html/HtmlHorizontalRule.java +++ b/src/main/java/org/htmlunit/html/HtmlHorizontalRule.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/HtmlHtml.java b/src/main/java/org/htmlunit/html/HtmlHtml.java index f07f67f6b0a..56a9f6cb416 100644 --- a/src/main/java/org/htmlunit/html/HtmlHtml.java +++ b/src/main/java/org/htmlunit/html/HtmlHtml.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/HtmlImage.java b/src/main/java/org/htmlunit/html/HtmlImage.java index d7443adedb9..ec90e4aa4f4 100644 --- a/src/main/java/org/htmlunit/html/HtmlImage.java +++ b/src/main/java/org/htmlunit/html/HtmlImage.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. @@ -41,12 +41,12 @@ import org.htmlunit.WebClient; import org.htmlunit.WebRequest; import org.htmlunit.WebResponse; +import org.htmlunit.http.HttpStatus; import org.htmlunit.javascript.AbstractJavaScriptEngine; import org.htmlunit.javascript.PostponedAction; import org.htmlunit.javascript.host.dom.Document; import org.htmlunit.javascript.host.event.Event; import org.htmlunit.javascript.host.event.MouseEvent; -import org.htmlunit.javascript.host.html.HTMLElement; import org.htmlunit.platform.Platform; import org.htmlunit.platform.geom.IntDimension2D; import org.htmlunit.platform.image.ImageData; @@ -278,7 +278,9 @@ public void doOnLoad() { downloadImageIfNeeded(); // if the download was a success if (imageWebResponse_.isSuccess()) { - loadSuccessful = true; // Trigger the onload handler + if (imageWebResponse_.getStatusCode() != HttpStatus.NO_CONTENT_204) { + loadSuccessful = true; // Trigger the onload handler + } } } catch (final IOException e) { @@ -873,12 +875,11 @@ public String getLocalName() { public ScriptResult fireEvent(final Event event) { if (event instanceof MouseEvent) { final MouseEvent mouseEvent = (MouseEvent) event; - final HTMLElement scriptableObject = getScriptableObject(); if (lastClickX_ >= 0) { - mouseEvent.setClientX(scriptableObject.getPosX() + lastClickX_); + mouseEvent.setClientX(getPosX() + lastClickX_); } if (lastClickY_ >= 0) { - mouseEvent.setClientY(scriptableObject.getPosX() + lastClickY_); + mouseEvent.setClientY(getPosX() + lastClickY_); } } diff --git a/src/main/java/org/htmlunit/html/HtmlImageInput.java b/src/main/java/org/htmlunit/html/HtmlImageInput.java index e834e04fe1c..f97701232f7 100644 --- a/src/main/java/org/htmlunit/html/HtmlImageInput.java +++ b/src/main/java/org/htmlunit/html/HtmlImageInput.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/HtmlInlineFrame.java b/src/main/java/org/htmlunit/html/HtmlInlineFrame.java index f51fd949fe1..d700d07815f 100644 --- a/src/main/java/org/htmlunit/html/HtmlInlineFrame.java +++ b/src/main/java/org/htmlunit/html/HtmlInlineFrame.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/HtmlInlineQuotation.java b/src/main/java/org/htmlunit/html/HtmlInlineQuotation.java index a36ccc92715..3197d7a7df9 100644 --- a/src/main/java/org/htmlunit/html/HtmlInlineQuotation.java +++ b/src/main/java/org/htmlunit/html/HtmlInlineQuotation.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. @@ -51,7 +51,7 @@ public class HtmlInlineQuotation extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code cite} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCiteAttribute() { return getAttributeDirect("cite"); diff --git a/src/main/java/org/htmlunit/html/HtmlInput.java b/src/main/java/org/htmlunit/html/HtmlInput.java index eb992273e2f..5cabcfdb7fc 100644 --- a/src/main/java/org/htmlunit/html/HtmlInput.java +++ b/src/main/java/org/htmlunit/html/HtmlInput.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,7 +25,6 @@ import java.util.HashSet; import java.util.Locale; import java.util.Map; -import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -36,11 +35,13 @@ import org.htmlunit.ScriptResult; import org.htmlunit.SgmlPage; import org.htmlunit.WebClient; +import org.htmlunit.corejs.javascript.Context; +import org.htmlunit.corejs.javascript.regexp.RegExpEngineAccess; import org.htmlunit.javascript.AbstractJavaScriptEngine; +import org.htmlunit.javascript.HtmlUnitContextFactory; import org.htmlunit.javascript.host.event.Event; import org.htmlunit.javascript.host.event.MouseEvent; import org.htmlunit.javascript.host.html.HTMLInputElement; -import org.htmlunit.javascript.regexp.RegExpJsToJavaConverter; import org.htmlunit.util.NameValuePair; import org.xml.sax.helpers.AttributesImpl; @@ -222,7 +223,7 @@ public final boolean isDisabled() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code readonly} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getReadOnlyAttribute() { return getAttributeDirect("readonly"); @@ -234,7 +235,7 @@ public final String getReadOnlyAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code size} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getSizeAttribute() { return getAttributeDirect("size"); @@ -246,7 +247,7 @@ public final String getSizeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code maxlength} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getMaxLengthAttribute() { return getAttribute("maxLength"); @@ -276,7 +277,7 @@ protected int getMaxLength() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code minlength} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getMinLengthAttribute() { return getAttribute("minLength"); @@ -306,7 +307,7 @@ protected int getMinLength() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code src} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public String getSrcAttribute() { return getSrcAttributeNormalized(); @@ -352,7 +353,7 @@ public void setSrcAttribute(final String src) { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code alt} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAltAttribute() { return getAttributeDirect("alt"); @@ -364,7 +365,7 @@ public final String getAltAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code usemap} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getUseMapAttribute() { return getAttributeDirect("usemap"); @@ -376,7 +377,7 @@ public final String getUseMapAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code tabindex} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getTabIndexAttribute() { return getAttributeDirect("tabindex"); @@ -388,7 +389,7 @@ public final String getTabIndexAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code accesskey} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAccessKeyAttribute() { return getAttributeDirect("accesskey"); @@ -400,7 +401,7 @@ public final String getAccessKeyAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code onfocus} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getOnFocusAttribute() { return getAttributeDirect("onfocus"); @@ -412,7 +413,7 @@ public final String getOnFocusAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code onblur} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getOnBlurAttribute() { return getAttributeDirect("onblur"); @@ -424,7 +425,7 @@ public final String getOnBlurAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code onselect} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getOnSelectAttribute() { return getAttributeDirect("onselect"); @@ -436,7 +437,7 @@ public final String getOnSelectAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code onchange} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getOnChangeAttribute() { return getAttributeDirect("onchange"); @@ -448,7 +449,7 @@ public final String getOnChangeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code accept} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAcceptAttribute() { return getAttribute(HttpHeader.ACCEPT_LC); @@ -460,7 +461,7 @@ public final String getAcceptAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -1011,10 +1012,12 @@ private boolean isPatternValid() { return true; } - final RegExpJsToJavaConverter converter = new RegExpJsToJavaConverter(); - final String javaPattern = converter.convert(pattern); - try { - return Pattern.matches(javaPattern, value); + try (Context cx = HtmlUnitContextFactory.getGlobal().enterContext()) { + RegExpEngineAccess.compile(cx, pattern, ""); + final RegExpEngineAccess.CompiledRegExp compiled + = RegExpEngineAccess.compile(cx, "^(?:" + pattern + ")$", ""); + + return RegExpEngineAccess.matches(cx, value, compiled); } catch (final Exception ignored) { // ignore if regex invalid diff --git a/src/main/java/org/htmlunit/html/HtmlInsertedText.java b/src/main/java/org/htmlunit/html/HtmlInsertedText.java index 6b92860479f..3f65a4d2e3e 100644 --- a/src/main/java/org/htmlunit/html/HtmlInsertedText.java +++ b/src/main/java/org/htmlunit/html/HtmlInsertedText.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. @@ -51,7 +51,7 @@ public class HtmlInsertedText extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code cite} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCiteAttribute() { return getAttributeDirect("cite"); @@ -63,7 +63,7 @@ public final String getCiteAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code datetime} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getDateTimeAttribute() { return getAttributeDirect("datetime"); diff --git a/src/main/java/org/htmlunit/html/HtmlItalic.java b/src/main/java/org/htmlunit/html/HtmlItalic.java index e1be355e17f..f26eda91658 100644 --- a/src/main/java/org/htmlunit/html/HtmlItalic.java +++ b/src/main/java/org/htmlunit/html/HtmlItalic.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/HtmlKeyboard.java b/src/main/java/org/htmlunit/html/HtmlKeyboard.java index 9d5cd89d9fc..f8cc10c8fa7 100644 --- a/src/main/java/org/htmlunit/html/HtmlKeyboard.java +++ b/src/main/java/org/htmlunit/html/HtmlKeyboard.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/HtmlLabel.java b/src/main/java/org/htmlunit/html/HtmlLabel.java index 407ab8c38d7..7ab63990ef7 100644 --- a/src/main/java/org/htmlunit/html/HtmlLabel.java +++ b/src/main/java/org/htmlunit/html/HtmlLabel.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. @@ -56,7 +56,7 @@ public class HtmlLabel extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code for} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getForAttribute() { return getAttributeDirect("for"); @@ -68,7 +68,7 @@ public final String getForAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code accesskey} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAccessKeyAttribute() { return getAttributeDirect("accesskey"); @@ -80,7 +80,7 @@ public final String getAccessKeyAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code onfocus} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getOnFocusAttribute() { return getAttributeDirect("onfocus"); @@ -92,7 +92,7 @@ public final String getOnFocusAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code onblur} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getOnBlurAttribute() { return getAttributeDirect("onblur"); diff --git a/src/main/java/org/htmlunit/html/HtmlLayer.java b/src/main/java/org/htmlunit/html/HtmlLayer.java index 41686da7229..4dc10388c39 100644 --- a/src/main/java/org/htmlunit/html/HtmlLayer.java +++ b/src/main/java/org/htmlunit/html/HtmlLayer.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/HtmlLegend.java b/src/main/java/org/htmlunit/html/HtmlLegend.java index ba70d7340d1..4eaa2c826ff 100644 --- a/src/main/java/org/htmlunit/html/HtmlLegend.java +++ b/src/main/java/org/htmlunit/html/HtmlLegend.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. @@ -51,7 +51,7 @@ public class HtmlLegend extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code accesskey} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAccessKeyAttribute() { return getAttributeDirect("accesskey"); @@ -63,7 +63,7 @@ public final String getAccessKeyAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); diff --git a/src/main/java/org/htmlunit/html/HtmlLink.java b/src/main/java/org/htmlunit/html/HtmlLink.java index 745e1eea767..0011d0671c4 100644 --- a/src/main/java/org/htmlunit/html/HtmlLink.java +++ b/src/main/java/org/htmlunit/html/HtmlLink.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. @@ -78,7 +78,7 @@ public class HtmlLink extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charset} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharsetAttribute() { return getAttributeDirect("charset"); @@ -90,7 +90,7 @@ public final String getCharsetAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code href} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHrefAttribute() { return getAttributeDirect("href"); @@ -102,7 +102,7 @@ public final String getHrefAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code hreflang} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHrefLangAttribute() { return getAttributeDirect("hreflang"); @@ -114,7 +114,7 @@ public final String getHrefLangAttribute() { * 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); @@ -126,7 +126,7 @@ public final String getTypeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code rel} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getRelAttribute() { return getAttributeDirect("rel"); @@ -138,7 +138,7 @@ public final String getRelAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code rev} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getRevAttribute() { return getAttributeDirect("rev"); @@ -150,7 +150,7 @@ public final String getRevAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code media} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getMediaAttribute() { return getAttributeDirect("media"); @@ -162,7 +162,7 @@ public final String getMediaAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code target} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getTargetAttribute() { return getAttributeDirect("target"); @@ -175,7 +175,7 @@ public final String getTargetAttribute() { * * @param downloadIfNeeded indicates if a request should be performed this hasn't been done previously * @return {@code null} if no download should be performed and when this wasn't already done; the response - * received when performing a request for the content referenced by this tag otherwise + * received when performing a request for the content referenced by this tag otherwise * @throws IOException if an error occurs while downloading the content */ public WebResponse getWebResponse(final boolean downloadIfNeeded) throws IOException { @@ -191,7 +191,7 @@ public WebResponse getWebResponse(final boolean downloadIfNeeded) throws IOExcep * @param downloadIfNeeded indicates if a request should be performed this hasn't been done previously * @param request the request; if null getWebRequest() is called to create one * @return {@code null} if no download should be performed and when this wasn't already done; the response - * received when performing a request for the content referenced by this tag otherwise + * received when performing a request for the content referenced by this tag otherwise * @throws IOException if an error occurs while downloading the content */ public WebResponse getWebResponse(final boolean downloadIfNeeded, WebRequest request) throws IOException { diff --git a/src/main/java/org/htmlunit/html/HtmlListItem.java b/src/main/java/org/htmlunit/html/HtmlListItem.java index bb643fff7e1..05ce4b5f967 100644 --- a/src/main/java/org/htmlunit/html/HtmlListItem.java +++ b/src/main/java/org/htmlunit/html/HtmlListItem.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 HtmlListItem 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 value} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValueAttribute() { return getAttributeDirect(VALUE_ATTRIBUTE); diff --git a/src/main/java/org/htmlunit/html/HtmlListing.java b/src/main/java/org/htmlunit/html/HtmlListing.java index 309d376ac2a..e8f6e4b093f 100644 --- a/src/main/java/org/htmlunit/html/HtmlListing.java +++ b/src/main/java/org/htmlunit/html/HtmlListing.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/HtmlMain.java b/src/main/java/org/htmlunit/html/HtmlMain.java index de756f3ddca..3e9c53cf715 100644 --- a/src/main/java/org/htmlunit/html/HtmlMain.java +++ b/src/main/java/org/htmlunit/html/HtmlMain.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/HtmlMap.java b/src/main/java/org/htmlunit/html/HtmlMap.java index 2ea525afe4f..bb248b3b4ef 100644 --- a/src/main/java/org/htmlunit/html/HtmlMap.java +++ b/src/main/java/org/htmlunit/html/HtmlMap.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. @@ -52,7 +52,7 @@ public class HtmlMap extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code name} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getNameAttribute() { return getAttributeDirect(NAME_ATTRIBUTE); diff --git a/src/main/java/org/htmlunit/html/HtmlMark.java b/src/main/java/org/htmlunit/html/HtmlMark.java index 4d76d35840b..6a4d86c25e9 100644 --- a/src/main/java/org/htmlunit/html/HtmlMark.java +++ b/src/main/java/org/htmlunit/html/HtmlMark.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/HtmlMarquee.java b/src/main/java/org/htmlunit/html/HtmlMarquee.java index 0ec18376bed..8a4204f0043 100644 --- a/src/main/java/org/htmlunit/html/HtmlMarquee.java +++ b/src/main/java/org/htmlunit/html/HtmlMarquee.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/HtmlMedia.java b/src/main/java/org/htmlunit/html/HtmlMedia.java index 030e83ece17..3adf013ca07 100644 --- a/src/main/java/org/htmlunit/html/HtmlMedia.java +++ b/src/main/java/org/htmlunit/html/HtmlMedia.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/HtmlMenu.java b/src/main/java/org/htmlunit/html/HtmlMenu.java index 1775ddfb677..4a920511bb6 100644 --- a/src/main/java/org/htmlunit/html/HtmlMenu.java +++ b/src/main/java/org/htmlunit/html/HtmlMenu.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 HtmlMenu extends HtmlElement { * 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/HtmlMeta.java b/src/main/java/org/htmlunit/html/HtmlMeta.java index b03c7401dfb..cb73a6ce15b 100644 --- a/src/main/java/org/htmlunit/html/HtmlMeta.java +++ b/src/main/java/org/htmlunit/html/HtmlMeta.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. @@ -68,7 +68,7 @@ public boolean mayBeDisplayed() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code http-equiv} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHttpEquivAttribute() { return getAttribute("http-equiv"); @@ -80,7 +80,7 @@ public final String getHttpEquivAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code name} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getNameAttribute() { return getAttributeDirect(NAME_ATTRIBUTE); @@ -92,7 +92,7 @@ public final String getNameAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code content} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getContentAttribute() { return getAttributeDirect("content"); @@ -104,7 +104,7 @@ public final String getContentAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code scheme} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getSchemeAttribute() { return getAttributeDirect("scheme"); diff --git a/src/main/java/org/htmlunit/html/HtmlMeter.java b/src/main/java/org/htmlunit/html/HtmlMeter.java index 6cbd436cd2c..7976e61b480 100644 --- a/src/main/java/org/htmlunit/html/HtmlMeter.java +++ b/src/main/java/org/htmlunit/html/HtmlMeter.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/HtmlMonthInput.java b/src/main/java/org/htmlunit/html/HtmlMonthInput.java index 5959a2c914e..ba5c9c11809 100644 --- a/src/main/java/org/htmlunit/html/HtmlMonthInput.java +++ b/src/main/java/org/htmlunit/html/HtmlMonthInput.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/HtmlNav.java b/src/main/java/org/htmlunit/html/HtmlNav.java index fb9800bc90f..063ec78ab88 100644 --- a/src/main/java/org/htmlunit/html/HtmlNav.java +++ b/src/main/java/org/htmlunit/html/HtmlNav.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/HtmlNoBreak.java b/src/main/java/org/htmlunit/html/HtmlNoBreak.java index cef7209e71c..041de331a48 100644 --- a/src/main/java/org/htmlunit/html/HtmlNoBreak.java +++ b/src/main/java/org/htmlunit/html/HtmlNoBreak.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/HtmlNoEmbed.java b/src/main/java/org/htmlunit/html/HtmlNoEmbed.java index 829e30a4b22..180ae26c769 100644 --- a/src/main/java/org/htmlunit/html/HtmlNoEmbed.java +++ b/src/main/java/org/htmlunit/html/HtmlNoEmbed.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/HtmlNoFrames.java b/src/main/java/org/htmlunit/html/HtmlNoFrames.java index 29107d7d51e..928fe6b59f2 100644 --- a/src/main/java/org/htmlunit/html/HtmlNoFrames.java +++ b/src/main/java/org/htmlunit/html/HtmlNoFrames.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/HtmlNoLayer.java b/src/main/java/org/htmlunit/html/HtmlNoLayer.java index 6fde254a22c..a59c4223b2f 100644 --- a/src/main/java/org/htmlunit/html/HtmlNoLayer.java +++ b/src/main/java/org/htmlunit/html/HtmlNoLayer.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/HtmlNoScript.java b/src/main/java/org/htmlunit/html/HtmlNoScript.java index 84e44880254..87cc03590e7 100644 --- a/src/main/java/org/htmlunit/html/HtmlNoScript.java +++ b/src/main/java/org/htmlunit/html/HtmlNoScript.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/HtmlNumberInput.java b/src/main/java/org/htmlunit/html/HtmlNumberInput.java index 40a65c08724..4292478ac0d 100644 --- a/src/main/java/org/htmlunit/html/HtmlNumberInput.java +++ b/src/main/java/org/htmlunit/html/HtmlNumberInput.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/HtmlObject.java b/src/main/java/org/htmlunit/html/HtmlObject.java index db6654b4786..e1464ff9003 100644 --- a/src/main/java/org/htmlunit/html/HtmlObject.java +++ b/src/main/java/org/htmlunit/html/HtmlObject.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,8 +14,6 @@ */ package org.htmlunit.html; -import static org.htmlunit.BrowserVersionFeatures.JS_HTML_OBJECT_VALIDITYSTATE_ISVALID_IGNORES_CUSTOM_ERROR; - import java.util.Map; import org.apache.commons.lang3.StringUtils; @@ -62,7 +60,7 @@ public class HtmlObject extends HtmlElement implements ValidatableElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code declare} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getDeclareAttribute() { return getAttributeDirect("declare"); @@ -74,7 +72,7 @@ public final String getDeclareAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code classid} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getClassIdAttribute() { return getAttributeDirect("classid"); @@ -86,7 +84,7 @@ public final String getClassIdAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute "codebase" - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCodebaseAttribute() { return getAttributeDirect("codebase"); @@ -98,7 +96,7 @@ public final String getCodebaseAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code data} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getDataAttribute() { return getAttributeDirect("data"); @@ -110,7 +108,7 @@ public final String getDataAttribute() { * 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); @@ -122,7 +120,7 @@ public final String getTypeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute "codetype" - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCodeTypeAttribute() { return getAttributeDirect("codetype"); @@ -134,7 +132,7 @@ public final String getCodeTypeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code archive} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getArchiveAttribute() { return getAttributeDirect("archive"); @@ -146,7 +144,7 @@ public final String getArchiveAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code standby} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getStandbyAttribute() { return getAttributeDirect("standby"); @@ -158,7 +156,7 @@ public final String getStandbyAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code height} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHeightAttribute() { return getAttributeDirect("height"); @@ -170,7 +168,7 @@ public final String getHeightAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code width} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getWidthAttribute() { return getAttributeDirect("width"); @@ -182,7 +180,7 @@ public final String getWidthAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code usemap} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getUseMapAttribute() { return getAttributeDirect("usemap"); @@ -194,7 +192,7 @@ public final String getUseMapAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code name} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getNameAttribute() { return getAttributeDirect(NAME_ATTRIBUTE); @@ -206,7 +204,7 @@ public final String getNameAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code tabindex} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getTabIndexAttribute() { return getAttributeDirect("tabindex"); @@ -218,7 +216,7 @@ public final String getTabIndexAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -230,7 +228,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code border} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getBorderAttribute() { return getAttributeDirect("border"); @@ -242,7 +240,7 @@ public final String getBorderAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code hspace} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHspaceAttribute() { return getAttributeDirect("hspace"); @@ -254,7 +252,7 @@ public final String getHspaceAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code vspace} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getVspaceAttribute() { return getAttributeDirect("vspace"); @@ -314,10 +312,6 @@ public void setCustomValidity(final String message) { @Override public boolean isCustomErrorValidityState() { - if (hasFeature(JS_HTML_OBJECT_VALIDITYSTATE_ISVALID_IGNORES_CUSTOM_ERROR)) { - return false; - } - return !StringUtils.isEmpty(customValidity_); } diff --git a/src/main/java/org/htmlunit/html/HtmlOption.java b/src/main/java/org/htmlunit/html/HtmlOption.java index ac406c0838f..c0dda178ab6 100644 --- a/src/main/java/org/htmlunit/html/HtmlOption.java +++ b/src/main/java/org/htmlunit/html/HtmlOption.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. @@ -151,7 +151,7 @@ public void reset() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code selected} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getSelectedAttribute() { return getAttributeDirect("selected"); @@ -224,7 +224,7 @@ public final void setLabelAttribute(final String newLabel) { * HTML 4.01 * documentation for details on the use of this attribute. * @see - * initial value if value attribute is not set + * initial value if value attribute is not set * @return the value of the attribute {@code value} */ public final String getValueAttribute() { diff --git a/src/main/java/org/htmlunit/html/HtmlOptionGroup.java b/src/main/java/org/htmlunit/html/HtmlOptionGroup.java index 8a7a9e841f4..a37dd3ba01c 100644 --- a/src/main/java/org/htmlunit/html/HtmlOptionGroup.java +++ b/src/main/java/org/htmlunit/html/HtmlOptionGroup.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/HtmlOrderedList.java b/src/main/java/org/htmlunit/html/HtmlOrderedList.java index 13525fc357f..25e20d1c087 100644 --- a/src/main/java/org/htmlunit/html/HtmlOrderedList.java +++ b/src/main/java/org/htmlunit/html/HtmlOrderedList.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 HtmlOrderedList 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"); @@ -74,7 +74,7 @@ public final String getCompactAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code start} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getStartAttribute() { return getAttributeDirect("start"); diff --git a/src/main/java/org/htmlunit/html/HtmlOutput.java b/src/main/java/org/htmlunit/html/HtmlOutput.java index 5b9e37e4f09..b2d12b10e70 100644 --- a/src/main/java/org/htmlunit/html/HtmlOutput.java +++ b/src/main/java/org/htmlunit/html/HtmlOutput.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/HtmlPage.java b/src/main/java/org/htmlunit/html/HtmlPage.java index 0fad9a9cf1e..a3a8547a386 100644 --- a/src/main/java/org/htmlunit/html/HtmlPage.java +++ b/src/main/java/org/htmlunit/html/HtmlPage.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,7 +15,6 @@ package org.htmlunit.html; import static org.htmlunit.BrowserVersionFeatures.EVENT_FOCUS_ON_LOAD; -import static org.htmlunit.BrowserVersionFeatures.JS_EVENT_LOAD_SUPPRESSED_BY_CONTENT_SECURIRY_POLICY; import static org.htmlunit.html.DomElement.ATTRIBUTE_NOT_DEFINED; import java.io.File; @@ -67,7 +66,6 @@ import org.htmlunit.corejs.javascript.Scriptable; import org.htmlunit.css.ComputedCssStyleDeclaration; import org.htmlunit.css.CssStyleSheet; -import org.htmlunit.html.FrameWindow.PageDenied; import org.htmlunit.html.impl.SimpleRange; import org.htmlunit.html.parser.HTMLParserDOMBuilder; import org.htmlunit.http.HttpStatus; @@ -141,6 +139,7 @@ * @author Lai Quang Duong * @author Sven Strickroth */ +@SuppressWarnings("PMD.TooManyFields") public class HtmlPage extends SgmlPage { private static final Log LOG = LogFactory.getLog(HtmlPage.class); @@ -232,8 +231,8 @@ public boolean hasCaseSensitiveTagNames() { * Initialize this page. * @throws IOException if an IO problem occurs * @throws FailingHttpStatusCodeException if the server returns a failing status code AND the property - * {@link org.htmlunit.WebClientOptions#setThrowExceptionOnFailingStatusCode(boolean)} is set - * to true. + * {@link org.htmlunit.WebClientOptions#setThrowExceptionOnFailingStatusCode(boolean)} is set + * to true. */ @Override public void initialize() throws IOException, FailingHttpStatusCodeException { @@ -295,7 +294,7 @@ public void initialize() throws IOException, FailingHttpStatusCodeException { executeEventHandlersIfNeeded(Event.TYPE_LOAD); } - for (final BaseFrameElement frameElement : frameElements_) { + for (final BaseFrameElement frameElement : new ArrayList<>(frameElements_)) { if (frameElement instanceof HtmlFrame) { final Page page = frameElement.getEnclosedWindow().getEnclosedPage(); if (page != null && page.isHtmlPage()) { @@ -785,8 +784,8 @@ public List getTabbableElementIds() { * Additionally, the value of tabindex must be within 0 and 32767. Any * values outside this range will be ignored.

* - * The following elements support the tabindex attribute: A, AREA, BUTTON, - * INPUT, OBJECT, SELECT, and TEXTAREA.

+ * The following elements support the 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 getHtmlElementsByAccessKey(final char accessKey) { * (see {@link org.htmlunit.WebClient#isJavaScriptEnabled()}.

* @param sourceCode the JavaScript code to execute * @return a ScriptResult which will contain both the current page (which may be different than - * the previous page) and a JavaScript result object + * the previous page) and a JavaScript result object */ public ScriptResult executeJavaScript(final String sourceCode) { return executeJavaScript(sourceCode, "injected script", 1); @@ -925,14 +924,14 @@ public ScriptResult executeJavaScript(final String sourceCode) { *

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. *

* * @param sourceCode the JavaScript code to execute * @param sourceName the name for this chunk of code (will be displayed in error messages) * @param startLine the line at which the script source starts * @return a ScriptResult which will contain both the current page (which may be different than - * the previous page and a JavaScript result object. + * the previous page and a JavaScript result object. */ public ScriptResult executeJavaScript(String sourceCode, final String sourceName, final int startLine) { if (!getWebClient().isJavaScriptEnabled()) { @@ -1288,12 +1287,6 @@ else if (Event.TYPE_READY_STATE_CHANGE.equals(eventType)) { event = new BeforeUnloadEvent(frame, eventType); } else { - // ff does not trigger the onload event in this case - if (PageDenied.BY_CONTENT_SECURIRY_POLICY == fw.getPageDenied() - && hasFeature(JS_EVENT_LOAD_SUPPRESSED_BY_CONTENT_SECURIRY_POLICY)) { - return true; - } - event = new Event(frame, eventType); } // This fires the "load" event for the element which, like all non-window @@ -1531,7 +1524,7 @@ public FrameWindow getFrameByName(final String name) throws ElementNotFoundExcep * * @param accessKey the key that will be pressed * @return the element that has the focus after pressing this access key or null if no element - * has the focus. + * has the focus. * @throws IOException if an IO error occurs during the processing of this access key (this * would only happen if the access key triggered a button which in turn caused a page load) */ @@ -1896,7 +1889,7 @@ private void calculateBase() { * {@link WebClientOptions#setThrowExceptionOnFailingStatusCode(boolean)} is set to {@code true} */ void loadFrames() throws FailingHttpStatusCodeException { - for (final BaseFrameElement frameElement : frameElements_) { + for (final BaseFrameElement frameElement : new ArrayList<>(frameElements_)) { // test if the frame should really be loaded: // if a script has already changed its content, it should be skipped // use == and not equals(...) to identify initial content (versus URL set to "about:blank") @@ -2649,7 +2642,7 @@ public void putStyleIntoCache(final DomElement element, final String normalizedP * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
* * @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 List getStyleSheets() { final List styles = new ArrayList<>(); @@ -2783,7 +2776,8 @@ private void nodeChanged(final DomNode changedNode, final String attribName) { } // Apparently it wasn't a stylesheet that changed; be semi-smart about what we evict and when. - final boolean clearParents = ATTRIBUTES_AFFECTING_PARENT.contains(attribName); + // null means that a node was added/removed; we always have to take care of this for the parents + final boolean clearParents = attribName == null || ATTRIBUTES_AFFECTING_PARENT.contains(attribName); if (computedStylesCache_ != null) { computedStylesCache_.nodeChanged(changedNode, clearParents); } @@ -2881,7 +2875,7 @@ private void readObject(final ObjectInputStream in) throws IOException, ClassNot } private static final class MappedElementIndexEntry implements Serializable { - private ArrayList elements_; + private final ArrayList elements_; private boolean sorted_; MappedElementIndexEntry() { diff --git a/src/main/java/org/htmlunit/html/HtmlParagraph.java b/src/main/java/org/htmlunit/html/HtmlParagraph.java index f013ec46e68..c8e4cd21f4b 100644 --- a/src/main/java/org/htmlunit/html/HtmlParagraph.java +++ b/src/main/java/org/htmlunit/html/HtmlParagraph.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. @@ -51,7 +51,7 @@ public class HtmlParagraph extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); diff --git a/src/main/java/org/htmlunit/html/HtmlParameter.java b/src/main/java/org/htmlunit/html/HtmlParameter.java index ba4a07cd453..c44aedaa1c3 100644 --- a/src/main/java/org/htmlunit/html/HtmlParameter.java +++ b/src/main/java/org/htmlunit/html/HtmlParameter.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 HtmlParameter extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code id} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getIdAttribute() { return getAttributeDirect(ID_ATTRIBUTE); @@ -62,7 +62,7 @@ public final String getIdAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code name} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getNameAttribute() { return getAttributeDirect(NAME_ATTRIBUTE); @@ -74,7 +74,7 @@ public final String getNameAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code value} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValueAttribute() { return getAttributeDirect(VALUE_ATTRIBUTE); @@ -86,7 +86,7 @@ public final String getValueAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code valuetype} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValueTypeAttribute() { return getAttributeDirect("valuetype"); @@ -98,7 +98,7 @@ public final String getValueTypeAttribute() { * 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); diff --git a/src/main/java/org/htmlunit/html/HtmlPasswordInput.java b/src/main/java/org/htmlunit/html/HtmlPasswordInput.java index d395d8ed4db..4e07ac633b3 100644 --- a/src/main/java/org/htmlunit/html/HtmlPasswordInput.java +++ b/src/main/java/org/htmlunit/html/HtmlPasswordInput.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/HtmlPicture.java b/src/main/java/org/htmlunit/html/HtmlPicture.java index 8858222c183..46b0b81ad48 100644 --- a/src/main/java/org/htmlunit/html/HtmlPicture.java +++ b/src/main/java/org/htmlunit/html/HtmlPicture.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/HtmlPlainText.java b/src/main/java/org/htmlunit/html/HtmlPlainText.java index 52b7d84c5e8..00e53fe4b2d 100644 --- a/src/main/java/org/htmlunit/html/HtmlPlainText.java +++ b/src/main/java/org/htmlunit/html/HtmlPlainText.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/HtmlPreformattedText.java b/src/main/java/org/htmlunit/html/HtmlPreformattedText.java index 04727e5b3d0..265711cdbc2 100644 --- a/src/main/java/org/htmlunit/html/HtmlPreformattedText.java +++ b/src/main/java/org/htmlunit/html/HtmlPreformattedText.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 HtmlPreformattedText extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code width} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getWidthAttribute() { return getAttributeDirect("width"); diff --git a/src/main/java/org/htmlunit/html/HtmlProgress.java b/src/main/java/org/htmlunit/html/HtmlProgress.java index b88c8d7e0b3..3a8f288954a 100644 --- a/src/main/java/org/htmlunit/html/HtmlProgress.java +++ b/src/main/java/org/htmlunit/html/HtmlProgress.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/HtmlRadioButtonInput.java b/src/main/java/org/htmlunit/html/HtmlRadioButtonInput.java index 675f6d520af..d0eeb72b17d 100644 --- a/src/main/java/org/htmlunit/html/HtmlRadioButtonInput.java +++ b/src/main/java/org/htmlunit/html/HtmlRadioButtonInput.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. @@ -96,7 +96,7 @@ void setCheckedInternal(final boolean isChecked) { * * @param isChecked true if this element is to be selected * @return the page that occupies this window after setting checked status - * It may be the same window or it may be a freshly loaded one. + * It may be the same window or it may be a freshly loaded one. */ @Override public Page setChecked(final boolean isChecked) { diff --git a/src/main/java/org/htmlunit/html/HtmlRangeInput.java b/src/main/java/org/htmlunit/html/HtmlRangeInput.java index cf3ef870c39..015a41e9072 100644 --- a/src/main/java/org/htmlunit/html/HtmlRangeInput.java +++ b/src/main/java/org/htmlunit/html/HtmlRangeInput.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/HtmlRb.java b/src/main/java/org/htmlunit/html/HtmlRb.java index 0af0e72da41..beef3a1dc2d 100644 --- a/src/main/java/org/htmlunit/html/HtmlRb.java +++ b/src/main/java/org/htmlunit/html/HtmlRb.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/HtmlResetInput.java b/src/main/java/org/htmlunit/html/HtmlResetInput.java index 62efd60400f..d7623a39f0c 100644 --- a/src/main/java/org/htmlunit/html/HtmlResetInput.java +++ b/src/main/java/org/htmlunit/html/HtmlResetInput.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/HtmlRp.java b/src/main/java/org/htmlunit/html/HtmlRp.java index 84999fa3d67..1cca0de3803 100644 --- a/src/main/java/org/htmlunit/html/HtmlRp.java +++ b/src/main/java/org/htmlunit/html/HtmlRp.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/HtmlRt.java b/src/main/java/org/htmlunit/html/HtmlRt.java index 0cca5bb1849..e0166bc3f97 100644 --- a/src/main/java/org/htmlunit/html/HtmlRt.java +++ b/src/main/java/org/htmlunit/html/HtmlRt.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/HtmlRtc.java b/src/main/java/org/htmlunit/html/HtmlRtc.java index d6ea798cad7..d2db0cb48b7 100644 --- a/src/main/java/org/htmlunit/html/HtmlRtc.java +++ b/src/main/java/org/htmlunit/html/HtmlRtc.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/HtmlRuby.java b/src/main/java/org/htmlunit/html/HtmlRuby.java index fde8ec95a39..a04cf48ce6a 100644 --- a/src/main/java/org/htmlunit/html/HtmlRuby.java +++ b/src/main/java/org/htmlunit/html/HtmlRuby.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/HtmlS.java b/src/main/java/org/htmlunit/html/HtmlS.java index e10704f066f..cfab3e2963b 100644 --- a/src/main/java/org/htmlunit/html/HtmlS.java +++ b/src/main/java/org/htmlunit/html/HtmlS.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/HtmlSample.java b/src/main/java/org/htmlunit/html/HtmlSample.java index c25bd0dc5e1..34b5df1747f 100644 --- a/src/main/java/org/htmlunit/html/HtmlSample.java +++ b/src/main/java/org/htmlunit/html/HtmlSample.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/HtmlScript.java b/src/main/java/org/htmlunit/html/HtmlScript.java index a96070ad3c8..4a5fdc5c32d 100644 --- a/src/main/java/org/htmlunit/html/HtmlScript.java +++ b/src/main/java/org/htmlunit/html/HtmlScript.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. @@ -72,7 +72,7 @@ public class HtmlScript extends HtmlElement implements ScriptElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charset} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharsetAttribute() { return getAttributeDirect("charset"); @@ -92,7 +92,7 @@ public final String getScriptCharset() { * 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); @@ -104,7 +104,7 @@ public final String getTypeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code language} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getLanguageAttribute() { return getAttributeDirect("language"); @@ -116,7 +116,7 @@ public final String getLanguageAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code src} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getSrcAttribute() { return getSrcAttributeNormalized(); @@ -152,7 +152,7 @@ public final String getHtmlForAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code defer} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getDeferAttribute() { return getAttributeDirect("defer"); diff --git a/src/main/java/org/htmlunit/html/HtmlSearchInput.java b/src/main/java/org/htmlunit/html/HtmlSearchInput.java index fedb500378b..0d5d2bdc02a 100644 --- a/src/main/java/org/htmlunit/html/HtmlSearchInput.java +++ b/src/main/java/org/htmlunit/html/HtmlSearchInput.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/HtmlSection.java b/src/main/java/org/htmlunit/html/HtmlSection.java index 209bade2631..5f8b011b382 100644 --- a/src/main/java/org/htmlunit/html/HtmlSection.java +++ b/src/main/java/org/htmlunit/html/HtmlSection.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/HtmlSelect.java b/src/main/java/org/htmlunit/html/HtmlSelect.java index 43106915cb4..5c3b99a774c 100644 --- a/src/main/java/org/htmlunit/html/HtmlSelect.java +++ b/src/main/java/org/htmlunit/html/HtmlSelect.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. @@ -201,7 +201,8 @@ public void setOptionSize(final int newLength) { */ public void removeOption(final int index) { final ChildElementsIterator iterator = new ChildElementsIterator(this); - for (int i = 0; iterator.hasNext();) { + int i = 0; + while (iterator.hasNext()) { final DomElement element = iterator.next(); if (element instanceof HtmlOption) { if (i == index) { @@ -221,7 +222,8 @@ public void removeOption(final int index) { */ public void replaceOption(final int index, final HtmlOption newOption) { final ChildElementsIterator iterator = new ChildElementsIterator(this); - for (int i = 0; iterator.hasNext();) { + int i = 0; + while (iterator.hasNext()) { final DomElement element = iterator.next(); if (element instanceof HtmlOption) { if (i == index) { @@ -273,7 +275,7 @@ public DomNode appendChild(final Node node) { * @param optionValue 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 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 getBodies() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code summary} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getSummaryAttribute() { return getAttributeDirect("summary"); @@ -247,7 +249,7 @@ public final String getSummaryAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code width} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getWidthAttribute() { return getAttributeDirect("width"); @@ -259,7 +261,7 @@ public final String getWidthAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code border} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getBorderAttribute() { return getAttributeDirect("border"); @@ -271,7 +273,7 @@ public final String getBorderAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code frame} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getFrameAttribute() { return getAttributeDirect("frame"); @@ -283,7 +285,7 @@ public final String getFrameAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code rules} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getRulesAttribute() { return getAttributeDirect("rules"); @@ -295,7 +297,7 @@ public final String getRulesAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code cellspacing} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCellSpacingAttribute() { return getAttributeDirect("cellspacing"); @@ -307,7 +309,7 @@ public final String getCellSpacingAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code cellpadding} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCellPaddingAttribute() { return getAttributeDirect("cellpadding"); @@ -319,7 +321,7 @@ public final String getCellPaddingAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -331,7 +333,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code bgcolor} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getBgcolorAttribute() { return getAttributeDirect("bgcolor"); diff --git a/src/main/java/org/htmlunit/html/HtmlTableBody.java b/src/main/java/org/htmlunit/html/HtmlTableBody.java index c7487ed2010..6febca3b576 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableBody.java +++ b/src/main/java/org/htmlunit/html/HtmlTableBody.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/HtmlTableCell.java b/src/main/java/org/htmlunit/html/HtmlTableCell.java index 9dfc11abd39..591a495729e 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableCell.java +++ b/src/main/java/org/htmlunit/html/HtmlTableCell.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,8 +14,6 @@ */ package org.htmlunit.html; -import static org.htmlunit.BrowserVersionFeatures.JS_TABLE_SPAN_SET_ZERO_IF_INVALID; - import java.util.Map; import org.apache.commons.lang3.StringUtils; @@ -80,18 +78,11 @@ public int getRowSpan() { } try { final int span = (int) Double.parseDouble(spanString); - if (getPage().getWebClient().getBrowserVersion().hasFeature(JS_TABLE_SPAN_SET_ZERO_IF_INVALID)) { - if (span < 0) { - return 1; - } - if (span < 1) { - return 0; - } + if (span < 0) { + return 1; } - else { - if (span < 1) { - return 1; - } + if (span < 1) { + return 0; } if (span > 65_534) { diff --git a/src/main/java/org/htmlunit/html/HtmlTableColumn.java b/src/main/java/org/htmlunit/html/HtmlTableColumn.java index 2aa6d78f733..41b63761952 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableColumn.java +++ b/src/main/java/org/htmlunit/html/HtmlTableColumn.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. @@ -51,7 +51,7 @@ public class HtmlTableColumn extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code span} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getSpanAttribute() { return getAttributeDirect("span"); @@ -63,7 +63,7 @@ public final String getSpanAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code width} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getWidthAttribute() { return getAttributeDirect("width"); @@ -75,7 +75,7 @@ public final String getWidthAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -87,7 +87,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code char} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharAttribute() { return getAttributeDirect("char"); @@ -99,7 +99,7 @@ public final String getCharAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charoff} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharoffAttribute() { return getAttributeDirect("charoff"); @@ -111,7 +111,7 @@ public final String getCharoffAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code valign} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValignAttribute() { return getAttributeDirect("valign"); diff --git a/src/main/java/org/htmlunit/html/HtmlTableColumnGroup.java b/src/main/java/org/htmlunit/html/HtmlTableColumnGroup.java index 32f221f9800..ac92ea5e2f6 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableColumnGroup.java +++ b/src/main/java/org/htmlunit/html/HtmlTableColumnGroup.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. @@ -51,7 +51,7 @@ public class HtmlTableColumnGroup extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code span} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getSpanAttribute() { return getAttributeDirect("span"); @@ -63,7 +63,7 @@ public final String getSpanAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code width} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getWidthAttribute() { return getAttributeDirect("width"); @@ -75,7 +75,7 @@ public final String getWidthAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -87,7 +87,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code char} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharAttribute() { return getAttributeDirect("char"); @@ -99,7 +99,7 @@ public final String getCharAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charoff} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharoffAttribute() { return getAttributeDirect("charoff"); @@ -111,7 +111,7 @@ public final String getCharoffAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code valign} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValignAttribute() { return getAttributeDirect("valign"); diff --git a/src/main/java/org/htmlunit/html/HtmlTableDataCell.java b/src/main/java/org/htmlunit/html/HtmlTableDataCell.java index e3eeb446c3f..65693e08c7f 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableDataCell.java +++ b/src/main/java/org/htmlunit/html/HtmlTableDataCell.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 HtmlTableDataCell extends HtmlTableCell { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code abbr} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAbbrAttribute() { return getAttributeDirect("abbr"); @@ -62,7 +62,7 @@ public final String getAbbrAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code axis} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAxisAttribute() { return getAttributeDirect("axis"); @@ -74,7 +74,7 @@ public final String getAxisAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code headers} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHeadersAttribute() { return getAttributeDirect("headers"); @@ -86,7 +86,7 @@ public final String getHeadersAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code scope} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getScopeAttribute() { return getAttributeDirect("scope"); @@ -98,7 +98,7 @@ public final String getScopeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code rowspan} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getRowSpanAttribute() { return getAttributeDirect("rowspan"); @@ -110,7 +110,7 @@ public final String getRowSpanAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code colspan} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getColumnSpanAttribute() { return getAttributeDirect("colspan"); @@ -122,7 +122,7 @@ public final String getColumnSpanAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -134,7 +134,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code char} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharAttribute() { return getAttributeDirect("char"); @@ -146,7 +146,7 @@ public final String getCharAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charoff} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharoffAttribute() { return getAttributeDirect("charoff"); @@ -158,7 +158,7 @@ public final String getCharoffAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code valign} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValignAttribute() { return getAttributeDirect("valign"); @@ -170,7 +170,7 @@ public final String getValignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code nowrap} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getNoWrapAttribute() { return getAttributeDirect("nowrap"); @@ -182,7 +182,7 @@ public final String getNoWrapAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code bgcolor} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getBgcolorAttribute() { return getAttributeDirect("bgcolor"); @@ -194,7 +194,7 @@ public final String getBgcolorAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code width} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getWidthAttribute() { return getAttributeDirect("width"); @@ -206,7 +206,7 @@ public final String getWidthAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code height} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHeightAttribute() { return getAttributeDirect("height"); diff --git a/src/main/java/org/htmlunit/html/HtmlTableFooter.java b/src/main/java/org/htmlunit/html/HtmlTableFooter.java index 87a89d4916a..38141b21ab9 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableFooter.java +++ b/src/main/java/org/htmlunit/html/HtmlTableFooter.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/HtmlTableHeader.java b/src/main/java/org/htmlunit/html/HtmlTableHeader.java index 4fcc4929da6..f53cdad68b3 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableHeader.java +++ b/src/main/java/org/htmlunit/html/HtmlTableHeader.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/HtmlTableHeaderCell.java b/src/main/java/org/htmlunit/html/HtmlTableHeaderCell.java index 490d9aff7c5..40514eb6bc4 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableHeaderCell.java +++ b/src/main/java/org/htmlunit/html/HtmlTableHeaderCell.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 HtmlTableHeaderCell extends HtmlTableCell { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code abbr} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAbbrAttribute() { return getAttributeDirect("abbr"); @@ -62,7 +62,7 @@ public final String getAbbrAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code axis} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAxisAttribute() { return getAttributeDirect("axis"); @@ -74,7 +74,7 @@ public final String getAxisAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code headers} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHeadersAttribute() { return getAttributeDirect("headers"); @@ -86,7 +86,7 @@ public final String getHeadersAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code scope} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getScopeAttribute() { return getAttributeDirect("scope"); @@ -98,7 +98,7 @@ public final String getScopeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code rowspan} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getRowSpanAttribute() { return getAttributeDirect("rowspan"); @@ -110,7 +110,7 @@ public final String getRowSpanAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code colspan} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getColumnSpanAttribute() { return getAttributeDirect("colspan"); @@ -122,7 +122,7 @@ public final String getColumnSpanAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -134,7 +134,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code char} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharAttribute() { return getAttributeDirect("char"); @@ -146,7 +146,7 @@ public final String getCharAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charoff} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharoffAttribute() { return getAttributeDirect("charoff"); @@ -158,7 +158,7 @@ public final String getCharoffAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code valign} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValignAttribute() { return getAttributeDirect("valign"); @@ -170,7 +170,7 @@ public final String getValignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code nowrap} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getNoWrapAttribute() { return getAttributeDirect("nowrap"); @@ -182,7 +182,7 @@ public final String getNoWrapAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code bgcolor} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getBgcolorAttribute() { return getAttributeDirect("bgcolor"); @@ -194,7 +194,7 @@ public final String getBgcolorAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code width} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getWidthAttribute() { return getAttributeDirect("width"); @@ -206,7 +206,7 @@ public final String getWidthAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code height} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHeightAttribute() { return getAttributeDirect("height"); diff --git a/src/main/java/org/htmlunit/html/HtmlTableRow.java b/src/main/java/org/htmlunit/html/HtmlTableRow.java index baaf17ec163..0afdd5f95a9 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableRow.java +++ b/src/main/java/org/htmlunit/html/HtmlTableRow.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,7 +91,7 @@ public HtmlTableCell getCell(final int index) throws IndexOutOfBoundsException { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -103,7 +103,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code char} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharAttribute() { return getAttributeDirect("char"); @@ -115,7 +115,7 @@ public final String getCharAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charoff} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharoffAttribute() { return getAttributeDirect("charoff"); @@ -127,7 +127,7 @@ public final String getCharoffAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code valign} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValignAttribute() { return getAttributeDirect("valign"); @@ -147,7 +147,7 @@ public HtmlTable getEnclosingTable() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code bgcolor} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getBgcolorAttribute() { return getAttributeDirect("bgcolor"); @@ -166,7 +166,9 @@ public CellIterator() { setNextCell(getFirstChild()); } - /** @return whether there is another cell available */ + /** + * @return whether there is another cell available + */ @Override public boolean hasNext() { return nextCell_ != null; diff --git a/src/main/java/org/htmlunit/html/HtmlTelInput.java b/src/main/java/org/htmlunit/html/HtmlTelInput.java index 6e593928e37..f8068a6c9df 100644 --- a/src/main/java/org/htmlunit/html/HtmlTelInput.java +++ b/src/main/java/org/htmlunit/html/HtmlTelInput.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/HtmlTeletype.java b/src/main/java/org/htmlunit/html/HtmlTeletype.java index 6898074a910..67520a8d239 100644 --- a/src/main/java/org/htmlunit/html/HtmlTeletype.java +++ b/src/main/java/org/htmlunit/html/HtmlTeletype.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/HtmlTemplate.java b/src/main/java/org/htmlunit/html/HtmlTemplate.java index 20258ab9783..e1cb57afcde 100644 --- a/src/main/java/org/htmlunit/html/HtmlTemplate.java +++ b/src/main/java/org/htmlunit/html/HtmlTemplate.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/HtmlTextArea.java b/src/main/java/org/htmlunit/html/HtmlTextArea.java index 961b7b08e4d..8358d359b9f 100644 --- a/src/main/java/org/htmlunit/html/HtmlTextArea.java +++ b/src/main/java/org/htmlunit/html/HtmlTextArea.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,6 @@ import java.util.Map; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.text.StringEscapeUtils; import org.htmlunit.SgmlPage; import org.htmlunit.html.impl.SelectableTextInput; import org.htmlunit.html.impl.SelectableTextSelectionDelegate; @@ -436,7 +435,7 @@ protected void printXml(final String indent, final PrintWriter printWriter) { printOpeningTagContentAsXml(printWriter); printWriter.print(">"); - printWriter.print(StringEscapeUtils.escapeXml10(getText())); + printWriter.print(org.htmlunit.util.StringUtils.escapeXml(getText())); printWriter.print(""); } 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 Map attributes) { - super(qualifiedName, page, trimValueAttribute(page, attributes)); - } - - private static Map trimValueAttribute(final SgmlPage page, final Map attributes) { - for (final Map.Entry entry : attributes.entrySet()) { - if (VALUE_ATTRIBUTE.equalsIgnoreCase(entry.getKey())) { - entry.getValue().setValue(entry.getValue().getValue().trim()); - break; - } - } - - return attributes; + super(qualifiedName, page, attributes); + setRawValue(getValue().trim()); } /** diff --git a/src/main/java/org/htmlunit/html/HtmlVariable.java b/src/main/java/org/htmlunit/html/HtmlVariable.java index 7e277086443..456f4c5daa1 100644 --- a/src/main/java/org/htmlunit/html/HtmlVariable.java +++ b/src/main/java/org/htmlunit/html/HtmlVariable.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/HtmlVideo.java b/src/main/java/org/htmlunit/html/HtmlVideo.java index c64baad80c9..88dfdedd489 100644 --- a/src/main/java/org/htmlunit/html/HtmlVideo.java +++ b/src/main/java/org/htmlunit/html/HtmlVideo.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/HtmlWeekInput.java b/src/main/java/org/htmlunit/html/HtmlWeekInput.java index afa4a4370eb..c94a7423dea 100644 --- a/src/main/java/org/htmlunit/html/HtmlWeekInput.java +++ b/src/main/java/org/htmlunit/html/HtmlWeekInput.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/HtmlWordBreak.java b/src/main/java/org/htmlunit/html/HtmlWordBreak.java index 7244bc185dc..90c2c7d071e 100644 --- a/src/main/java/org/htmlunit/html/HtmlWordBreak.java +++ b/src/main/java/org/htmlunit/html/HtmlWordBreak.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/Keyboard.java b/src/main/java/org/htmlunit/html/Keyboard.java index e16f6ba0578..fb935a3e7c6 100644 --- a/src/main/java/org/htmlunit/html/Keyboard.java +++ b/src/main/java/org/htmlunit/html/Keyboard.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/LabelableElement.java b/src/main/java/org/htmlunit/html/LabelableElement.java index d9f5ae80603..ab098808674 100644 --- a/src/main/java/org/htmlunit/html/LabelableElement.java +++ b/src/main/java/org/htmlunit/html/LabelableElement.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/ScriptElement.java b/src/main/java/org/htmlunit/html/ScriptElement.java index a955817a64c..1a96e2bea1d 100644 --- a/src/main/java/org/htmlunit/html/ScriptElement.java +++ b/src/main/java/org/htmlunit/html/ScriptElement.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/ScriptElementSupport.java b/src/main/java/org/htmlunit/html/ScriptElementSupport.java index b48f630f1b2..796c53d1a94 100644 --- a/src/main/java/org/htmlunit/html/ScriptElementSupport.java +++ b/src/main/java/org/htmlunit/html/ScriptElementSupport.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 @@ import org.apache.commons.logging.LogFactory; import org.htmlunit.FailingHttpStatusCodeException; import org.htmlunit.SgmlPage; +import org.htmlunit.WebClient; import org.htmlunit.WebWindow; import org.htmlunit.html.HtmlPage.JavaScriptLoadResult; import org.htmlunit.javascript.AbstractJavaScriptEngine; @@ -62,7 +63,7 @@ private ScriptElementSupport() { * Support method that is called from the (html or svg) script and the link tag. * * @param script the ScriptElement to work for - * @param postponed whether to use {@link org.htmlunit.javascript.PostponedAction} or no + * @param postponed whether to use {@link org.htmlunit.javascript.PostponedAction} or not */ public static void onAllChildrenAddedToPage(final ScriptElement script, final boolean postponed) { final DomElement element = (DomElement) script; @@ -73,7 +74,9 @@ public static void onAllChildrenAddedToPage(final ScriptElement script, final bo LOG.debug("Script node added: " + element.asXml()); } - if (!element.getPage().getWebClient().isJavaScriptEngineEnabled()) { + final SgmlPage page = element.getPage(); + final WebClient webClient = page.getWebClient(); + if (!webClient.isJavaScriptEngineEnabled()) { LOG.debug("Script found but not executed because javascript engine is disabled"); return; } @@ -84,7 +87,7 @@ public static void onAllChildrenAddedToPage(final ScriptElement script, final bo return; } - final WebWindow webWindow = element.getPage().getEnclosingWindow(); + final WebWindow webWindow = page.getEnclosingWindow(); if (webWindow != null) { final StringBuilder description = new StringBuilder() .append("Execution of ") @@ -94,7 +97,7 @@ public static void onAllChildrenAddedToPage(final ScriptElement script, final bo description.append(" (").append(srcAttrib).append(')'); } - final PostponedAction action = new PostponedAction(element.getPage(), description.toString()) { + final PostponedAction action = new PostponedAction(page, description.toString()) { @Override public void execute() { // see HTMLDocument.setExecutingDynamicExternalPosponed(boolean) @@ -103,7 +106,7 @@ public void execute() { if (window != null) { jsDoc = (HTMLDocument) window.getDocument(); jsDoc.setExecutingDynamicExternalPosponed(element.getStartLineNumber() == -1 - && ATTRIBUTE_NOT_DEFINED != srcAttrib); + && !hasNoSrcAttrib); } try { executeScriptIfNeeded(script, false, false); @@ -116,23 +119,17 @@ public void execute() { } }; - final AbstractJavaScriptEngine engine = element.getPage().getWebClient().getJavaScriptEngine(); - if (engine != null - && element.hasAttribute("async") && !engine.isScriptRunning()) { - final HtmlPage owningPage = element.getHtmlPageOrNull(); - owningPage.addAfterLoadAction(action); + final AbstractJavaScriptEngine engine = webClient.getJavaScriptEngine(); + if (element.hasAttribute("async") && !hasNoSrcAttrib) { + engine.addPostponedAction(action); } - else if (engine != null - && (element.hasAttribute("async") - || postponed && StringUtils.isBlank(element.getTextContent()))) { + else if (postponed && !hasNoSrcAttrib) { engine.addPostponedAction(action); } else { try { action.execute(); - if (engine != null) { - engine.processPostponedActions(); - } + engine.processPostponedActions(); } catch (final RuntimeException e) { throw e; @@ -308,6 +305,10 @@ public static boolean isJavaScript(String typeAttribute, final String languageAt private static void executeEvent(final DomElement element, final String type) { final EventTarget eventTarget = element.getScriptableObject(); final Event event = new Event(element, type); + + event.setParentScope(eventTarget); + event.setPrototype(eventTarget.getPrototype(event.getClass())); + eventTarget.executeEventLocally(event); } diff --git a/src/main/java/org/htmlunit/html/SiblingDomNodeList.java b/src/main/java/org/htmlunit/html/SiblingDomNodeList.java index 009de12080e..b864693af43 100644 --- a/src/main/java/org/htmlunit/html/SiblingDomNodeList.java +++ b/src/main/java/org/htmlunit/html/SiblingDomNodeList.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/StaticDomNodeList.java b/src/main/java/org/htmlunit/html/StaticDomNodeList.java index a0305646333..8a1305c0e6b 100644 --- a/src/main/java/org/htmlunit/html/StaticDomNodeList.java +++ b/src/main/java/org/htmlunit/html/StaticDomNodeList.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/SubmittableElement.java b/src/main/java/org/htmlunit/html/SubmittableElement.java index a8c8a3006e0..b913146e4f9 100644 --- a/src/main/java/org/htmlunit/html/SubmittableElement.java +++ b/src/main/java/org/htmlunit/html/SubmittableElement.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/TableRowGroup.java b/src/main/java/org/htmlunit/html/TableRowGroup.java index f885b0cfafb..c1befc12605 100644 --- a/src/main/java/org/htmlunit/html/TableRowGroup.java +++ b/src/main/java/org/htmlunit/html/TableRowGroup.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. @@ -68,7 +68,7 @@ public final List getRows() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -80,7 +80,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code char} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharAttribute() { return getAttributeDirect("char"); @@ -92,7 +92,7 @@ public final String getCharAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charoff} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharoffAttribute() { return getAttributeDirect("charoff"); @@ -104,7 +104,7 @@ public final String getCharoffAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code valign} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValignAttribute() { return getAttributeDirect("valign"); diff --git a/src/main/java/org/htmlunit/html/UnknownElementFactory.java b/src/main/java/org/htmlunit/html/UnknownElementFactory.java index f5e640f9aaa..4ecff7bab49 100644 --- a/src/main/java/org/htmlunit/html/UnknownElementFactory.java +++ b/src/main/java/org/htmlunit/html/UnknownElementFactory.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/ValidatableElement.java b/src/main/java/org/htmlunit/html/ValidatableElement.java index 654aa459727..0b441b20e32 100644 --- a/src/main/java/org/htmlunit/html/ValidatableElement.java +++ b/src/main/java/org/htmlunit/html/ValidatableElement.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. @@ -37,7 +37,7 @@ public interface ValidatableElement { /** * @return a boolean value boolean value that is true if the user - * has provided input that the browser is unable to convert. + * has provided input that the browser is unable to convert. */ default boolean hasBadInputValidityState() { return false; @@ -45,14 +45,14 @@ default boolean hasBadInputValidityState() { /** * @return a boolean value indicating whether the element's custom validity message - * has been set to a non-empty string by calling the element's setCustomValidity() method. + * has been set to a non-empty string by calling the element's setCustomValidity() method. */ boolean isCustomErrorValidityState(); /** * @return true if the value does not match the specified pattern, - * and false if it does match. - * If true, the element matches the :invalid CSS pseudo-class + * and false if it does match. + * If true, the element matches the :invalid CSS pseudo-class */ default boolean hasPatternMismatchValidityState() { return false; @@ -60,9 +60,9 @@ default boolean hasPatternMismatchValidityState() { /** * @return true if the value does not fit the rules determined by the step attribute - * (that is, it's not evenly divisible by the step value), - * or false if it does fit the step rule. - * If true, the element matches the :invalid and :out-of-range CSS pseudo-classes. + * (that is, it's not evenly divisible by the step value), + * or false if it does fit the step rule. + * If true, the element matches the :invalid and :out-of-range CSS pseudo-classes. */ default boolean isStepMismatchValidityState() { return false; @@ -70,8 +70,8 @@ default boolean isStepMismatchValidityState() { /** * @return true if the value is longer than the maximum length specified - * by the maxlength attribute, or false if it is shorter than or equal to the maximum. - * If true, the element matches the :invalid CSS pseudo-class + * by the maxlength attribute, or false if it is shorter than or equal to the maximum. + * If true, the element matches the :invalid CSS pseudo-class */ default boolean isTooLongValidityState() { return false; @@ -79,8 +79,8 @@ default boolean isTooLongValidityState() { /** * @return true if the value is shorter than the minimum length specified - * by the minlength attribute, or false if it is greater than or equal to the minimum. - * If true, the element matches the :invalid CSS pseudo-class + * by the minlength attribute, or false if it is greater than or equal to the minimum. + * If true, the element matches the :invalid CSS pseudo-class */ default boolean isTooShortValidityState() { return false; @@ -88,8 +88,8 @@ default boolean isTooShortValidityState() { /** * @return true if the value is not in the required syntax (when type is email or url), - * or false if the syntax is correct. - * If true, the element matches the :invalid CSS pseudo-class. + * or false if the syntax is correct. + * If true, the element matches the :invalid CSS pseudo-class. */ default boolean hasTypeMismatchValidityState() { return false; @@ -97,8 +97,8 @@ default boolean hasTypeMismatchValidityState() { /** * @return true if the value is greater than the maximum specified by the max attribute, - * or false if it is less than or equal to the maximum. - * If true, the element matches the :invalid and :out-of-range CSS pseudo-classes. + * or false if it is less than or equal to the maximum. + * If true, the element matches the :invalid and :out-of-range CSS pseudo-classes. */ default boolean hasRangeOverflowValidityState() { return false; @@ -106,8 +106,8 @@ default boolean hasRangeOverflowValidityState() { /** * @return true if the value is less than the minimum specified by the min attribute, - * or false if it is greater than or equal to the minimum. - * If true, the element matches the :invalid and :out-of-range CSS pseudo-classes. + * or false if it is greater than or equal to the minimum. + * If true, the element matches the :invalid and :out-of-range CSS pseudo-classes. */ default boolean hasRangeUnderflowValidityState() { return false; @@ -115,14 +115,14 @@ default boolean hasRangeUnderflowValidityState() { /** * @return true if the element meets all its validation constraints, and is therefore - * considered to be valid, or false if it fails any constraint. - * If true, the element matches the :valid CSS pseudo-class; the :invalid CSS pseudo-class otherwise. + * considered to be valid, or false if it fails any constraint. + * If true, the element matches the :valid CSS pseudo-class; the :invalid CSS pseudo-class otherwise. */ boolean isValidValidityState(); /** * @return true if the element has a required attribute, but no value, or false otherwise. - * If true, the element matches the :invalid CSS pseudo-class. + * If true, the element matches the :invalid CSS pseudo-class. */ default boolean isValueMissingValidityState() { return false; diff --git a/src/main/java/org/htmlunit/html/XHtmlPage.java b/src/main/java/org/htmlunit/html/XHtmlPage.java index 0ad14093a45..6f336bf0659 100644 --- a/src/main/java/org/htmlunit/html/XHtmlPage.java +++ b/src/main/java/org/htmlunit/html/XHtmlPage.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/XmlSerializer.java b/src/main/java/org/htmlunit/html/XmlSerializer.java index 0eb2cb5a44b..79e7c20789d 100644 --- a/src/main/java/org/htmlunit/html/XmlSerializer.java +++ b/src/main/java/org/htmlunit/html/XmlSerializer.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,6 +54,12 @@ public class XmlSerializer { private final StringBuilder indent_ = new StringBuilder(); private File outputDir_; + /** + * Saves the given {@link SgmlPage} to the file. + * @param page the page to save + * @param file the destination + * @throws IOException in case of error + */ public void save(final SgmlPage page, final File file) throws IOException { save(page, file, false); } diff --git a/src/main/java/org/htmlunit/html/impl/Color.java b/src/main/java/org/htmlunit/html/impl/Color.java index bdd1e267813..2dc3fe586e8 100644 --- a/src/main/java/org/htmlunit/html/impl/Color.java +++ b/src/main/java/org/htmlunit/html/impl/Color.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/impl/SelectableTextInput.java b/src/main/java/org/htmlunit/html/impl/SelectableTextInput.java index 04b4560a603..9e23ec7b611 100644 --- a/src/main/java/org/htmlunit/html/impl/SelectableTextInput.java +++ b/src/main/java/org/htmlunit/html/impl/SelectableTextInput.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/impl/SelectableTextSelectionDelegate.java b/src/main/java/org/htmlunit/html/impl/SelectableTextSelectionDelegate.java index 0430e4460e5..334d2805102 100644 --- a/src/main/java/org/htmlunit/html/impl/SelectableTextSelectionDelegate.java +++ b/src/main/java/org/htmlunit/html/impl/SelectableTextSelectionDelegate.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/impl/SelectionDelegate.java b/src/main/java/org/htmlunit/html/impl/SelectionDelegate.java index c2cdd07e260..0133077f0a5 100644 --- a/src/main/java/org/htmlunit/html/impl/SelectionDelegate.java +++ b/src/main/java/org/htmlunit/html/impl/SelectionDelegate.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/impl/SimpleRange.java b/src/main/java/org/htmlunit/html/impl/SimpleRange.java index fbef296df7e..a9fa08f70a3 100644 --- a/src/main/java/org/htmlunit/html/impl/SimpleRange.java +++ b/src/main/java/org/htmlunit/html/impl/SimpleRange.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. @@ -291,7 +291,7 @@ public DomDocumentFragment extractContents() throws DOMException { /** * @return true if startContainer equals endContainer and - * startOffset equals endOffset + * startOffset equals endOffset * @throws DOMException in case of error */ public boolean isCollapsed() throws DOMException { @@ -300,7 +300,7 @@ public boolean isCollapsed() throws DOMException { /** * @return the deepest common ancestor container of this range's two - * boundary-points. + * boundary-points. * @throws DOMException in case of error */ public DomNode getCommonAncestorContainer() throws DOMException { diff --git a/src/main/java/org/htmlunit/html/impl/SimpleSelectionDelegate.java b/src/main/java/org/htmlunit/html/impl/SimpleSelectionDelegate.java index 52458d67ba8..d45435cdb85 100644 --- a/src/main/java/org/htmlunit/html/impl/SimpleSelectionDelegate.java +++ b/src/main/java/org/htmlunit/html/impl/SimpleSelectionDelegate.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/impl/package-info.java b/src/main/java/org/htmlunit/html/impl/package-info.java index bad5bdf5a12..07d9b477f31 100644 --- a/src/main/java/org/htmlunit/html/impl/package-info.java +++ b/src/main/java/org/htmlunit/html/impl/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/html/package-info.java b/src/main/java/org/htmlunit/html/package-info.java index f2fb04e7dea..6aed541c35d 100644 --- a/src/main/java/org/htmlunit/html/package-info.java +++ b/src/main/java/org/htmlunit/html/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/html/parser/HTMLParser.java b/src/main/java/org/htmlunit/html/parser/HTMLParser.java index 63da9984060..4c56579a337 100644 --- a/src/main/java/org/htmlunit/html/parser/HTMLParser.java +++ b/src/main/java/org/htmlunit/html/parser/HTMLParser.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. @@ -17,6 +17,7 @@ import java.io.IOException; import org.htmlunit.SgmlPage; +import org.htmlunit.WebClient; import org.htmlunit.WebResponse; import org.htmlunit.html.DomNode; import org.htmlunit.html.ElementFactory; @@ -75,12 +76,19 @@ ElementFactory getElementFactory(SgmlPage page, String namespaceURI, * @param source the (X)HTML to be parsed * @throws SAXException if a SAX error occurs * @throws IOException if an IO error occurs + * + * @deprecated as of version 4.12.0; use + * {@link #parseFragment(WebClient, DomNode, DomNode, String, boolean)} instead. */ - void parseFragment(DomNode parent, String source) throws SAXException, IOException; + @Deprecated + default void parseFragment(DomNode parent, String source) throws SAXException, IOException { + parseFragment(null, parent, parent, source, false); + } /** * Parses the HTML content from the given string into an object tree representation. * + * @param webClient the {@link WebClient} * @param parent where the new parsed nodes will be added to * @param context the context to build the fragment context stack * @param source the (X)HTML to be parsed @@ -88,9 +96,41 @@ ElementFactory getElementFactory(SgmlPage page, String namespaceURI, * @throws SAXException if a SAX error occurs * @throws IOException if an IO error occurs */ - void parseFragment(DomNode parent, DomNode context, String source, + void parseFragment(WebClient webClient, DomNode parent, DomNode context, String source, boolean createdByJavascript) throws SAXException, IOException; + /** + * Parses the HTML content from the given string into an object tree representation. + * + * @param parent where the new parsed nodes will be added to + * @param context the context to build the fragment context stack + * @param source the (X)HTML to be parsed + * @param createdByJavascript if true the (script) tag was created by javascript + * @throws SAXException if a SAX error occurs + * @throws IOException if an IO error occurs + * + * @deprecated as of version 4.12.0; use + * {@link #parseFragment(WebClient, DomNode, DomNode, String, boolean)} instead. + */ + @Deprecated + default void parseFragment(DomNode parent, DomNode context, String source, + boolean createdByJavascript) throws SAXException, IOException { + parseFragment(null, parent, context, source, createdByJavascript); + } + + /** + * Parses the WebResponse into an object tree representation. + * + * @param webClient the {@link WebClient} + * @param webResponse the response data + * @param page the HtmlPage to add the nodes + * @param xhtml if true use the XHtml parser + * @param createdByJavascript if true the (script) tag was created by javascript + * @throws IOException if there is an IO error + */ + void parse(WebClient webClient, WebResponse webResponse, HtmlPage page, + boolean xhtml, boolean createdByJavascript) throws IOException; + /** * Parses the WebResponse into an object tree representation. * @@ -99,6 +139,12 @@ void parseFragment(DomNode parent, DomNode context, String source, * @param xhtml if true use the XHtml parser * @param createdByJavascript if true the (script) tag was created by javascript * @throws IOException if there is an IO error + * + * @deprecated as of version 4.12.0; use + * {@link #parse(WebClient, WebResponse, HtmlPage, boolean, boolean)} instead. */ - void parse(WebResponse webResponse, HtmlPage page, boolean xhtml, boolean createdByJavascript) throws IOException; + @Deprecated + default void parse(WebResponse webResponse, HtmlPage page, boolean xhtml, boolean createdByJavascript) throws IOException { + parse(null, webResponse, page, xhtml, createdByJavascript); + } } diff --git a/src/main/java/org/htmlunit/html/parser/HTMLParserDOMBuilder.java b/src/main/java/org/htmlunit/html/parser/HTMLParserDOMBuilder.java index f5adceaa6a8..c12143e4a9f 100644 --- a/src/main/java/org/htmlunit/html/parser/HTMLParserDOMBuilder.java +++ b/src/main/java/org/htmlunit/html/parser/HTMLParserDOMBuilder.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/parser/HTMLParserListener.java b/src/main/java/org/htmlunit/html/parser/HTMLParserListener.java index b941688e16d..0eb758ed0e6 100644 --- a/src/main/java/org/htmlunit/html/parser/HTMLParserListener.java +++ b/src/main/java/org/htmlunit/html/parser/HTMLParserListener.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/parser/neko/HtmlUnitNekoDOMBuilder.java b/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java index 9e68ab12967..6bb68c43b4a 100644 --- a/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java +++ b/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.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/parser/neko/HtmlUnitNekoHtmlParser.java b/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.java index 74b464f2385..7a601eff1f2 100644 --- a/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.java +++ b/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.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,14 +21,15 @@ import java.net.URL; import java.nio.charset.Charset; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.htmlunit.ObjectInstantiationException; import org.htmlunit.Page; import org.htmlunit.SgmlPage; import org.htmlunit.WebAssert; +import org.htmlunit.WebClient; import org.htmlunit.WebResponse; import org.htmlunit.cyberneko.HTMLScanner; import org.htmlunit.cyberneko.HTMLTagBalancer; @@ -73,7 +74,7 @@ public final class HtmlUnitNekoHtmlParser implements HTMLParser { */ public static final SvgElementFactory SVG_FACTORY = new SvgElementFactory(); - private static final Map ELEMENT_FACTORIES = new HashMap<>(); + private static final Map ELEMENT_FACTORIES = new ConcurrentHashMap<>(); static { final DefaultElementFactory defaultElementFactory = new DefaultElementFactory(); @@ -83,30 +84,10 @@ public final class HtmlUnitNekoHtmlParser implements HTMLParser { } /** - * Parses the HTML content from the given string into an object tree representation. - * - * @param parent the parent for the new nodes - * @param source the (X)HTML to be parsed - * @throws SAXException if a SAX error occurs - * @throws IOException if an IO error occurs - */ - @Override - public void parseFragment(final DomNode parent, final String source) throws SAXException, IOException { - parseFragment(parent, parent, source, false); - } - - /** - * Parses the HTML content from the given string into an object tree representation. - * - * @param parent where the new parsed nodes will be added to - * @param context the context to build the fragment context stack - * @param source the (X)HTML to be parsed - * @param createdByJavascript if true the (script) tag was created by javascript - * @throws SAXException if a SAX error occurs - * @throws IOException if an IO error occurs + *{@inheritDoc} */ @Override - public void parseFragment(final DomNode parent, final DomNode context, final String source, + public void parseFragment(final WebClient webClient, final DomNode parent, final DomNode context, final String source, final boolean createdByJavascript) throws SAXException, IOException { final Page page = parent.getPage(); @@ -153,16 +134,10 @@ else if (ancestors.size() == 1 } /** - * Parses the WebResponse into an object tree representation. - * - * @param webResponse the response data - * @param page the HtmlPage to add the nodes - * @param xhtml if true use the XHtml parser - * @param createdByJavascript if true the (script) tag was created by javascript - * @throws IOException if there is an IO error + * {@inheritDoc} */ @Override - public void parse(final WebResponse webResponse, final HtmlPage page, + public void parse(final WebClient webClient, final WebResponse webResponse, final HtmlPage page, final boolean xhtml, final boolean createdByJavascript) throws IOException { final URL url = webResponse.getWebRequest().getUrl(); final HtmlUnitNekoDOMBuilder domBuilder = @@ -182,6 +157,13 @@ public void parse(final WebResponse webResponse, final HtmlPage page, domBuilder.setFeature(HTMLScanner.STYLE_STRIP_CDATA_DELIMS, true); domBuilder.setFeature(HTMLScanner.CDATA_EARLY_CLOSING, false); } + + if (webClient != null) { + final int bufferSize = webClient.getOptions().getNekoReaderBufferSize(); + if (bufferSize > 0) { + domBuilder.setProperty(HTMLScanner.READER_BUFFER_SIZE, bufferSize); + } + } } catch (final Exception e) { throw new ObjectInstantiationException("Error setting HTML parser feature", e); @@ -315,7 +297,9 @@ class HtmlUnitNekoHTMLErrorHandler implements XMLErrorHandler { html_ = htmlContent; } - /** @see DefaultErrorHandler#error(String,String,XMLParseException) */ + /** + * @see DefaultErrorHandler#error(String,String,XMLParseException) + */ @Override public void error(final String domain, final String key, final XMLParseException exception) throws XNIException { @@ -327,7 +311,9 @@ public void error(final String domain, final String key, key); } - /** @see DefaultErrorHandler#warning(String,String,XMLParseException) */ + /** + * @see DefaultErrorHandler#warning(String,String,XMLParseException) + */ @Override public void warning(final String domain, final String key, final XMLParseException exception) throws XNIException { diff --git a/src/main/java/org/htmlunit/html/parser/neko/package-info.java b/src/main/java/org/htmlunit/html/parser/neko/package-info.java index 3ee2186e58e..2944fb2de07 100644 --- a/src/main/java/org/htmlunit/html/parser/neko/package-info.java +++ b/src/main/java/org/htmlunit/html/parser/neko/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/html/parser/package-info.java b/src/main/java/org/htmlunit/html/parser/package-info.java index 9d946ab60cc..53b21ca71ab 100644 --- a/src/main/java/org/htmlunit/html/parser/package-info.java +++ b/src/main/java/org/htmlunit/html/parser/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/html/serializer/HtmlSerializerInnerOuterText.java b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText.java index 2396e2593c4..3e919e6a3df 100644 --- a/src/main/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText.java +++ b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText.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/serializer/HtmlSerializerNormalizedText.java b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerNormalizedText.java index 35006258db1..9be60feb6dd 100644 --- a/src/main/java/org/htmlunit/html/serializer/HtmlSerializerNormalizedText.java +++ b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerNormalizedText.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/serializer/HtmlSerializerVisibleText.java b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerVisibleText.java index 635a3f33d93..435a3d22201 100644 --- a/src/main/java/org/htmlunit/html/serializer/HtmlSerializerVisibleText.java +++ b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerVisibleText.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. @@ -512,9 +512,7 @@ protected void appendSelect(final HtmlSerializerTextBuilder builder, */ protected void appendOption(final HtmlSerializerTextBuilder builder, final HtmlOption htmlOption, final Mode mode) { - builder.ignoreHtmlBreaks(); appendChildren(builder, htmlOption, mode); - builder.processHtmlBreaks(); } /** @@ -787,7 +785,6 @@ private enum State { private final StringBuilder builder_; private int trimRightPos_; private boolean contentAdded_; - private boolean ignoreHtmlBreaks_; /** * Ctor. @@ -985,10 +982,6 @@ public void appendBlockSeparator() { * @param mode the {@link Mode} */ public void appendBreak(final Mode mode) { - if (ignoreHtmlBreaks_) { - return; - } - builder_.setLength(trimRightPos_); builder_.append('\n'); @@ -1046,20 +1039,6 @@ public void resetContentAdded() { contentAdded_ = false; } - /** - * Ignore the following html breaks in the content to be added. - */ - public void ignoreHtmlBreaks() { - ignoreHtmlBreaks_ = true; - } - - /** - * Prozess the following html breaks in the content to be added. - */ - public void processHtmlBreaks() { - ignoreHtmlBreaks_ = false; - } - /** * @return the constructed text. */ diff --git a/src/main/java/org/htmlunit/html/serializer/package-info.java b/src/main/java/org/htmlunit/html/serializer/package-info.java index 040d6ac6e07..bf893024405 100644 --- a/src/main/java/org/htmlunit/html/serializer/package-info.java +++ b/src/main/java/org/htmlunit/html/serializer/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/html/xpath/HtmlUnitPrefixResolver.java b/src/main/java/org/htmlunit/html/xpath/HtmlUnitPrefixResolver.java index 46fe6e3feda..824f7a3d240 100644 --- a/src/main/java/org/htmlunit/html/xpath/HtmlUnitPrefixResolver.java +++ b/src/main/java/org/htmlunit/html/xpath/HtmlUnitPrefixResolver.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/xpath/XPathAdapter.java b/src/main/java/org/htmlunit/html/xpath/XPathAdapter.java index cf0b7497e3e..203c0cc72da 100644 --- a/src/main/java/org/htmlunit/html/xpath/XPathAdapter.java +++ b/src/main/java/org/htmlunit/html/xpath/XPathAdapter.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. @@ -45,14 +45,6 @@ private enum STATE { } private final Expression mainExp_; - private FunctionTable funcTable_; - - /** - * Initiates the function table. - */ - private void initFunctionTable() { - funcTable_ = new FunctionTable(); - } /** * Constructor. @@ -64,11 +56,9 @@ private void initFunctionTable() { public XPathAdapter(final String exprString, final PrefixResolver prefixResolver, final boolean caseSensitive) throws TransformerException { - initFunctionTable(); - final ErrorListener errorHandler = new DefaultErrorHandler(); final XPathParser parser = new XPathParser(errorHandler); - final Compiler compiler = new Compiler(errorHandler, funcTable_); + final Compiler compiler = new Compiler(errorHandler, new FunctionTable()); final String expression = preProcessXPath(exprString, caseSensitive); parser.initXPath(compiler, expression, prefixResolver); diff --git a/src/main/java/org/htmlunit/html/xpath/XPathHelper.java b/src/main/java/org/htmlunit/html/xpath/XPathHelper.java index cd608257e39..881058edc74 100644 --- a/src/main/java/org/htmlunit/html/xpath/XPathHelper.java +++ b/src/main/java/org/htmlunit/html/xpath/XPathHelper.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. @@ -92,6 +92,14 @@ public static List getByXPath(final DomNode contextNode, final String xpa } } + /** + * @param the type of nodes expected + * @param node the start node + * @param xpath the {@link XPathAdapter} to search for + * @param prefixResolver the {@link PrefixResolver} to be used + * @return a list of nodes matching the given xpath + * @throws TransformerException in case of error + */ public static List getByXPath(final Node node, final XPathAdapter xpath, final PrefixResolver prefixResolver) throws TransformerException { final List list = new ArrayList<>(); @@ -104,7 +112,8 @@ public static List getByXPath(final Node node, final XPathAdapter xpath, if (result instanceof XNodeSet) { final NodeList nodelist = result.nodelist(); - for (int i = 0; i < nodelist.getLength(); i++) { + final int length = nodelist.getLength(); + for (int i = 0; i < length; i++) { list.add((T) nodelist.item(i)); } } diff --git a/src/main/java/org/htmlunit/html/xpath/package-info.java b/src/main/java/org/htmlunit/html/xpath/package-info.java index 74e1b478cc0..e399cdcf4ab 100644 --- a/src/main/java/org/htmlunit/html/xpath/package-info.java +++ b/src/main/java/org/htmlunit/html/xpath/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/http/HttpStatus.java b/src/main/java/org/htmlunit/http/HttpStatus.java index 1533561f77d..436141565eb 100644 --- a/src/main/java/org/htmlunit/http/HttpStatus.java +++ b/src/main/java/org/htmlunit/http/HttpStatus.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/http/HttpUtils.java b/src/main/java/org/htmlunit/http/HttpUtils.java index fa6cf9de713..34d357f9c2b 100644 --- a/src/main/java/org/htmlunit/http/HttpUtils.java +++ b/src/main/java/org/htmlunit/http/HttpUtils.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. @@ -293,7 +293,7 @@ private HttpUtils() { * @param buf buffer with the sequence of chars to be parsed * @param range defines the bounds and current position of the buffer * @param delimiters set of delimiting characters. Can be {@code null} if the token - * is not delimited by any character. + * is not delimited by any character. */ private static String parseToken(final String buf, final ParseRange range, final BitSet delimiters) { final StringBuilder dst = new StringBuilder(); @@ -345,7 +345,7 @@ private static void skipWhiteSpace(final String buf, final ParseRange range) { * @param buf buffer with the sequence of chars to be parsed * @param range defines the bounds and current position of the buffer * @param delimiters set of delimiting characters. Can be {@code null} if the value - * is delimited by a whitespace only. + * is delimited by a whitespace only. * @param dst destination buffer */ private static void copyContent(final String buf, final ParseRange range, diff --git a/src/main/java/org/htmlunit/http/package-info.java b/src/main/java/org/htmlunit/http/package-info.java index 58526dc5f98..b9e197f8bc5 100644 --- a/src/main/java/org/htmlunit/http/package-info.java +++ b/src/main/java/org/htmlunit/http/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/httpclient/HtmlUnitBrowserCompatCookieHeaderValueFormatter.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitBrowserCompatCookieHeaderValueFormatter.java index 89718701242..0b0e8b2eac4 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitBrowserCompatCookieHeaderValueFormatter.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitBrowserCompatCookieHeaderValueFormatter.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/httpclient/HtmlUnitBrowserCompatCookieSpec.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitBrowserCompatCookieSpec.java index 77ca3918c30..fce1220057f 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitBrowserCompatCookieSpec.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitBrowserCompatCookieSpec.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. @@ -223,7 +223,8 @@ public List

formatCookies(final List cookies) { final CharArrayBuffer buffer = new CharArrayBuffer(20 * cookies.size()); buffer.append(SM.COOKIE); buffer.append(": "); - for (int i = 0; i < cookies.size(); i++) { + final int size = cookies.size(); + for (int i = 0; i < size; i++) { final Cookie cookie = cookies.get(i); if (i > 0) { buffer.append("; "); diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitCookieSpecProvider.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitCookieSpecProvider.java index 41063f6e0d6..35b6a5bce37 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitCookieSpecProvider.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitCookieSpecProvider.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/httpclient/HtmlUnitCookieStore.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitCookieStore.java index 79cdac2a5d4..dd371bb1f70 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitCookieStore.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitCookieStore.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/httpclient/HtmlUnitDomainHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitDomainHandler.java index b8d0c0c8cbc..9340bdd8a0d 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitDomainHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitDomainHandler.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/httpclient/HtmlUnitExpiresHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitExpiresHandler.java index b23bc40a79a..733632c4e33 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitExpiresHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitExpiresHandler.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/httpclient/HtmlUnitHttpOnlyHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitHttpOnlyHandler.java index b4cd18ca563..ea38eba236c 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitHttpOnlyHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitHttpOnlyHandler.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/httpclient/HtmlUnitMaxAgeHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitMaxAgeHandler.java index 063819cd62e..c49d93eb27f 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitMaxAgeHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitMaxAgeHandler.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/httpclient/HtmlUnitPathHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitPathHandler.java index 40773ec4676..ec1385557a1 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitPathHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitPathHandler.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/httpclient/HtmlUnitRedirectStrategie.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitRedirectStrategie.java index 24bbed61091..48f930f9f83 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitRedirectStrategie.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitRedirectStrategie.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/httpclient/HtmlUnitSSLConnectionSocketFactory.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitSSLConnectionSocketFactory.java index 6fab8d69698..b98582cc863 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitSSLConnectionSocketFactory.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitSSLConnectionSocketFactory.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/httpclient/HtmlUnitSameSiteHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitSameSiteHandler.java index 3123dadca5f..f9fb0fe5485 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitSameSiteHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitSameSiteHandler.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/httpclient/HtmlUnitSecureHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitSecureHandler.java index beda0515837..dfd8e8055f4 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitSecureHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitSecureHandler.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/httpclient/HtmlUnitUsernamePasswordCredentials.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitUsernamePasswordCredentials.java index 4502bcbc49d..a4095db56b1 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitUsernamePasswordCredentials.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitUsernamePasswordCredentials.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/httpclient/HtmlUnitVersionAttributeHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitVersionAttributeHandler.java index 5026a3a8626..4fc36c0f1ed 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitVersionAttributeHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitVersionAttributeHandler.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/httpclient/HttpClientConverter.java b/src/main/java/org/htmlunit/httpclient/HttpClientConverter.java index 45b626c082b..9a7a9562f26 100644 --- a/src/main/java/org/htmlunit/httpclient/HttpClientConverter.java +++ b/src/main/java/org/htmlunit/httpclient/HttpClientConverter.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,16 +16,12 @@ import java.net.MalformedURLException; import java.net.URL; -import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collection; -import java.util.Date; import java.util.List; import java.util.Set; import org.apache.http.NoHttpResponseException; -import org.apache.http.client.utils.DateUtils; -import org.apache.http.client.utils.URLEncodedUtils; import org.apache.http.cookie.ClientCookie; import org.apache.http.cookie.Cookie; import org.apache.http.cookie.CookieOrigin; @@ -35,8 +31,6 @@ import org.apache.http.message.BufferedHeader; import org.apache.http.util.CharArrayBuffer; import org.htmlunit.BrowserVersion; -import org.htmlunit.http.HttpStatus; -import org.htmlunit.http.HttpUtils; import org.htmlunit.util.NameValuePair; import org.htmlunit.util.UrlUtils; @@ -47,84 +41,6 @@ */ public final class HttpClientConverter { - /** Forwarder to HttpStatus.SC_OK. - * @deprecated as of version 4.1.0; use {@link HttpStatus#OK_200} instead - */ - @Deprecated - public static final int OK = org.apache.http.HttpStatus.SC_OK; - - /** Forwarder to HttpStatus.SC_NO_CONTENT. - * @deprecated as of version 4.1.0; use {@link HttpStatus#NO_CONTENT_204} instead - */ - @Deprecated - public static final int NO_CONTENT = org.apache.http.HttpStatus.SC_NO_CONTENT; - - /** Forwarder to HttpStatus.MULTIPLE_CHOICES. - * @deprecated as of version 4.1.0; use {@link HttpStatus#MULTIPLE_CHOICES_300} instead - */ - @Deprecated - public static final int MULTIPLE_CHOICES = org.apache.http.HttpStatus.SC_MULTIPLE_CHOICES; - - /** Forwarder to HttpStatus.MOVED_PERMANENTLY. - * @deprecated as of version 4.1.0; use {@link HttpStatus#MOVED_PERMANENTLY_301} instead - */ - @Deprecated - public static final int MOVED_PERMANENTLY = org.apache.http.HttpStatus.SC_MOVED_PERMANENTLY; - - /** Forwarder to HttpStatus.MOVED_TEMPORARILY. - * @deprecated as of version 4.1.0; use {@link HttpStatus#FOUND_302} instead - */ - @Deprecated - public static final int MOVED_TEMPORARILY = org.apache.http.HttpStatus.SC_MOVED_TEMPORARILY; - - /** Forwarder to HttpStatus.SEE_OTHER. - * @deprecated as of version 4.1.0; use {@link HttpStatus#SEE_OTHER_303} instead - */ - @Deprecated - public static final int SEE_OTHER = org.apache.http.HttpStatus.SC_SEE_OTHER; - - /** Forwarder to HttpStatus.TEMPORARY_REDIRECT. - * @deprecated as of version 4.1.0; use {@link HttpStatus#TEMPORARY_REDIRECT_307} instead - */ - @Deprecated - public static final int TEMPORARY_REDIRECT = org.apache.http.HttpStatus.SC_TEMPORARY_REDIRECT; - - /** 308. - * @deprecated as of version 4.1.0; use {@link HttpStatus#PERMANENT_REDIRECT_308} instead - */ - @Deprecated - public static final int PERMANENT_REDIRECT = 308; - - /** Forwarder to HttpStatus.NOT_MODIFIED. - * @deprecated as of version 4.1.0; use {@link HttpStatus#NOT_MODIFIED_304} instead - */ - @Deprecated - public static final int NOT_MODIFIED = org.apache.http.HttpStatus.SC_NOT_MODIFIED; - - /** Forwarder to HttpStatus.SC_USE_PROXY. - * @deprecated as of version 4.1.0; use {@link HttpStatus#USE_PROXY_305} instead - */ - @Deprecated - public static final int USE_PROXY = org.apache.http.HttpStatus.SC_USE_PROXY; - - /** Forwarder to HttpStatus.SC_FORBIDDEN. - * @deprecated as of version 4.1.0; use {@link HttpStatus#FORBIDDEN_403} instead - */ - @Deprecated - public static final int FORBIDDEN = org.apache.http.HttpStatus.SC_FORBIDDEN; - - /** Forwarder to HttpStatus.SC_NOT_FOUND. - * @deprecated as of version 4.1.0; use {@link HttpStatus#NOT_FOUND_404} instead - */ - @Deprecated - public static final int NOT_FOUND = org.apache.http.HttpStatus.SC_NOT_FOUND; - - /** Forwarder to HttpStatus.SC_INTERNAL_SERVER_ERROR. - * @deprecated as of version 4.1.0; use {@link HttpStatus#INTERNAL_SERVER_ERROR_500} instead - */ - @Deprecated - public static final int INTERNAL_SERVER_ERROR = org.apache.http.HttpStatus.SC_INTERNAL_SERVER_ERROR; - private HttpClientConverter() { // util class } @@ -142,67 +58,6 @@ public static List nameValuePairsToHttpClient(fin return resultingPairs; } - /** - * Parses url query into name/value pairs using methods from HttpClient. - * @param query the urlencoded query - * @param charset the charset or null (defaulting to utf-8) - * @return the name/value pairs - * - * @deprecated as of version 4.1.0; use {@link HttpUtils#parseUrlQuery(String, Charset)} instead - */ - @Deprecated - public static List parseUrlQuery(final String query, final Charset charset) { - final List pairs = URLEncodedUtils.parse(query, charset); - - final List resultingPairs = new ArrayList<>(); - for (final org.apache.http.NameValuePair pair : pairs) { - resultingPairs.add(new NameValuePair(pair.getName(), pair.getValue())); - } - return resultingPairs; - } - - /** - * @param parameters the paramters - * @param enc the charset - * @return the query string from the given parameters - * - * @deprecated as of version 4.1.0; use {@link HttpUtils#toQueryFormFields(Iterable, Charset)} instead - */ - @Deprecated - public static String toQueryFormFields(final List parameters, final Charset enc) { - return URLEncodedUtils.format(nameValuePairsToHttpClient(parameters), enc); - } - - /** - * Parses the specified date string, assuming that it is formatted according to RFC 1123, RFC 1036 or as an ANSI - * C HTTP date header. This method returns {@code null} if the specified string is {@code null} or unparseable. - * - * @param s the string to parse as a date - * @return the date version of the specified string, or {@code null} - * - * @deprecated as of version 4.1.0; use {@link HttpUtils#parseDate(String)} instead - */ - @Deprecated - public static Date parseHttpDate(final String s) { - if (s == null) { - return null; - } - return DateUtils.parseDate(s); - } - - /** - * Formats the given date according to the RFC 1123 pattern. - * - * @param date The date to format. - * @return An RFC 1123 formatted date string. - * - * @deprecated as of version 4.1.0; use {@link HttpUtils#parseDate(String)} instead - */ - @Deprecated - public static String formatDate(final Date date) { - return DateUtils.formatDate(date); - } - /** * @param e the exception to check * @return true if the provided Exception is na {@link NoHttpResponseException} @@ -254,6 +109,13 @@ public static URL replaceForCookieIfNecessary(URL url) { return url; } + /** + * @param cookieString the string to parse + * @param pageUrl the page url as root + * @param browserVersion the {@link BrowserVersion} + * @return a list of {@link org.htmlunit.util.Cookie}'s + * @throws MalformedCookieException in case the cookie does not conform to the spec + */ public static List parseCookie(final String cookieString, final URL pageUrl, final BrowserVersion browserVersion) throws MalformedCookieException { @@ -298,6 +160,13 @@ public static List fromHttpClient(final List c return list; } + /** + * Adds all matching cookies to the provided set. + * @param cookies the cookies to select from + * @param normalizedUrl the url to match against + * @param browserVersion the {@link BrowserVersion} + * @param matches the set to add + */ public static void addMatching(final Set cookies, final URL normalizedUrl, final BrowserVersion browserVersion, final Set matches) { diff --git a/src/main/java/org/htmlunit/httpclient/HttpDelete.java b/src/main/java/org/htmlunit/httpclient/HttpDelete.java index 5463dfb1743..3f9d2a671d5 100644 --- a/src/main/java/org/htmlunit/httpclient/HttpDelete.java +++ b/src/main/java/org/htmlunit/httpclient/HttpDelete.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,10 +25,17 @@ */ public class HttpDelete extends HttpEntityEnclosingRequestBase { + /** + * Ctor. + */ public HttpDelete() { super(); } + /** + * Ctor. + * @param uri the uri + */ public HttpDelete(final URI uri) { super(); setURI(uri); diff --git a/src/main/java/org/htmlunit/httpclient/HttpOptions.java b/src/main/java/org/htmlunit/httpclient/HttpOptions.java index 723fa53afa3..0b643b8ac96 100644 --- a/src/main/java/org/htmlunit/httpclient/HttpOptions.java +++ b/src/main/java/org/htmlunit/httpclient/HttpOptions.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,10 +25,17 @@ */ public class HttpOptions extends HttpEntityEnclosingRequestBase { + /** + * Ctor. + */ public HttpOptions() { super(); } + /** + * Ctor. + * @param uri the uri + */ public HttpOptions(final URI uri) { super(); setURI(uri); diff --git a/src/main/java/org/htmlunit/httpclient/SocksConnectionSocketFactory.java b/src/main/java/org/htmlunit/httpclient/SocksConnectionSocketFactory.java index 0821abd4099..e71a68a4383 100644 --- a/src/main/java/org/htmlunit/httpclient/SocksConnectionSocketFactory.java +++ b/src/main/java/org/htmlunit/httpclient/SocksConnectionSocketFactory.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/httpclient/package-info.java b/src/main/java/org/htmlunit/httpclient/package-info.java index 6ecc919c21c..a2147c5928d 100644 --- a/src/main/java/org/htmlunit/httpclient/package-info.java +++ b/src/main/java/org/htmlunit/httpclient/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/javascript/AbstractJavaScriptEngine.java b/src/main/java/org/htmlunit/javascript/AbstractJavaScriptEngine.java index 1a36e9ecbc4..29a558c6080 100644 --- a/src/main/java/org/htmlunit/javascript/AbstractJavaScriptEngine.java +++ b/src/main/java/org/htmlunit/javascript/AbstractJavaScriptEngine.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/javascript/DebugFrameAdapter.java b/src/main/java/org/htmlunit/javascript/DebugFrameAdapter.java index 9322c33abd4..99bbe72727a 100644 --- a/src/main/java/org/htmlunit/javascript/DebugFrameAdapter.java +++ b/src/main/java/org/htmlunit/javascript/DebugFrameAdapter.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/javascript/DebugFrameImpl.java b/src/main/java/org/htmlunit/javascript/DebugFrameImpl.java index a67a6441683..dbfa9d33993 100644 --- a/src/main/java/org/htmlunit/javascript/DebugFrameImpl.java +++ b/src/main/java/org/htmlunit/javascript/DebugFrameImpl.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/javascript/DebuggerAdapter.java b/src/main/java/org/htmlunit/javascript/DebuggerAdapter.java index 7d53f77c97a..f1434b77ec0 100644 --- a/src/main/java/org/htmlunit/javascript/DebuggerAdapter.java +++ b/src/main/java/org/htmlunit/javascript/DebuggerAdapter.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/javascript/DebuggerImpl.java b/src/main/java/org/htmlunit/javascript/DebuggerImpl.java index 716a619eb0c..ef35f99e8b0 100644 --- a/src/main/java/org/htmlunit/javascript/DebuggerImpl.java +++ b/src/main/java/org/htmlunit/javascript/DebuggerImpl.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/javascript/DefaultJavaScriptErrorListener.java b/src/main/java/org/htmlunit/javascript/DefaultJavaScriptErrorListener.java index 9dff512805d..10124fabc8d 100644 --- a/src/main/java/org/htmlunit/javascript/DefaultJavaScriptErrorListener.java +++ b/src/main/java/org/htmlunit/javascript/DefaultJavaScriptErrorListener.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/javascript/FunctionWrapper.java b/src/main/java/org/htmlunit/javascript/FunctionWrapper.java index 87f4e699086..0313778f880 100644 --- a/src/main/java/org/htmlunit/javascript/FunctionWrapper.java +++ b/src/main/java/org/htmlunit/javascript/FunctionWrapper.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/javascript/HtmlUnitContextFactory.java b/src/main/java/org/htmlunit/javascript/HtmlUnitContextFactory.java index e13a903f9a0..1926f59b5e2 100644 --- a/src/main/java/org/htmlunit/javascript/HtmlUnitContextFactory.java +++ b/src/main/java/org/htmlunit/javascript/HtmlUnitContextFactory.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,12 +18,14 @@ import static org.htmlunit.BrowserVersionFeatures.JS_PROPERTY_DESCRIPTOR_NAME; import java.io.Serializable; +import java.util.function.Consumer; import org.htmlunit.BrowserVersion; import org.htmlunit.ScriptException; import org.htmlunit.ScriptPreProcessor; import org.htmlunit.WebClient; import org.htmlunit.corejs.javascript.Callable; +import org.htmlunit.corejs.javascript.CompilerEnvirons; import org.htmlunit.corejs.javascript.Context; import org.htmlunit.corejs.javascript.ContextAction; import org.htmlunit.corejs.javascript.ContextFactory; @@ -32,12 +34,10 @@ import org.htmlunit.corejs.javascript.EvaluatorException; import org.htmlunit.corejs.javascript.Function; import org.htmlunit.corejs.javascript.Script; -import org.htmlunit.corejs.javascript.ScriptRuntime; import org.htmlunit.corejs.javascript.Scriptable; import org.htmlunit.corejs.javascript.debug.Debugger; import org.htmlunit.html.HtmlElement; import org.htmlunit.html.HtmlPage; -import org.htmlunit.javascript.regexp.HtmlUnitRegExpProxy; /** * ContextFactory that supports termination of scripts if they exceed a timeout. Based on example from @@ -156,7 +156,8 @@ public void terminateScriptIfNecessary() { @Override protected Script compileString(String source, final Evaluator compiler, final ErrorReporter compilationErrorReporter, final String sourceName, - final int lineno, final Object securityDomain) { + final int lineno, final Object securityDomain, + final Consumer compilerEnvironsProcessor) { // this method gets called by Context.compileString and by ScriptRuntime.evalSpecial // which is used for window.eval. We have to take care in which case we are. @@ -192,7 +193,7 @@ protected Script compileString(String source, final Evaluator compiler, source = preProcess(page, source, sourceName, lineno, null); return super.compileString(source, compiler, compilationErrorReporter, - sourceName, lineno, securityDomain); + sourceName, lineno, securityDomain, compilerEnvironsProcessor); } @Override @@ -252,7 +253,7 @@ protected Context makeContext() { cx.setClassShutter(fullClassName -> false); // Use pure interpreter mode to get observeInstructionCount() callbacks. - cx.setOptimizationLevel(-1); + cx.setInterpretedMode(true); // Set threshold on how often we want to receive the callbacks cx.setInstructionObserverThreshold(INSTRUCTION_COUNT_THRESHOLD); @@ -265,9 +266,6 @@ protected Context makeContext() { cx.setDebugger(debugger_, null); } - // register custom RegExp processing - ScriptRuntime.setRegExpProxy(cx, new HtmlUnitRegExpProxy(ScriptRuntime.getRegExpProxy(cx))); - cx.setMaximumInterpreterStackDepth(5_000); return cx; @@ -341,8 +339,6 @@ protected boolean hasFeature(final Context cx, final int featureIndex) { return true; case Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW: return true; - case Context.FEATURE_HTMLUNIT_FUNCTION_DECLARED_FORWARD_IN_BLOCK: - return true; case Context.FEATURE_HTMLUNIT_MEMBERBOX_NAME: return browserVersion_.hasFeature(JS_PROPERTY_DESCRIPTOR_NAME); case Context.FEATURE_HTMLUNIT_ARRAY_SORT_COMPERATOR_ACCEPTS_BOOL: diff --git a/src/main/java/org/htmlunit/javascript/HtmlUnitScriptable.java b/src/main/java/org/htmlunit/javascript/HtmlUnitScriptable.java index f7eba4f944c..608f982b3e0 100644 --- a/src/main/java/org/htmlunit/javascript/HtmlUnitScriptable.java +++ b/src/main/java/org/htmlunit/javascript/HtmlUnitScriptable.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. @@ -109,7 +109,7 @@ public void put(final String name, final Scriptable start, final Object value) { } catch (final IllegalArgumentException e) { // is it the right place or should Rhino throw a RuntimeError instead of an IllegalArgumentException? - throw JavaScriptEngine.reportRuntimeError("'set " + throw JavaScriptEngine.typeError("'set " + name + "' called on an object that does not implement interface " + getClassName()); } } @@ -117,22 +117,17 @@ public void put(final String name, final Scriptable start, final Object value) { /** * Gets a named property from the object. * Normally HtmlUnit objects don't need to overwrite this method as properties are defined - * on the prototypes from the XML configuration. In some cases where "content" of object + * on the prototypes. In some cases where "content" of object * has priority compared to the properties consider using utility {@link #getWithPreemption(String)}. + * * {@inheritDoc} */ @Override public Object get(final String name, final Scriptable start) { // Try to get property configured on object itself. - Object response = super.get(name, start); - if (response != NOT_FOUND) { - return response; - } - if (this == start) { - response = getWithPreemption(name); - } - if (response == NOT_FOUND && start instanceof Window) { - response = ((Window) start).getWithFallback(name); + final Object response = super.get(name, start); + if (response == NOT_FOUND && this == start) { + return getWithPreemption(name); } return response; } diff --git a/src/main/java/org/htmlunit/javascript/HtmlUnitScriptableProxy.java b/src/main/java/org/htmlunit/javascript/HtmlUnitScriptableProxy.java index 32bb6a37384..60d3bb07e29 100644 --- a/src/main/java/org/htmlunit/javascript/HtmlUnitScriptableProxy.java +++ b/src/main/java/org/htmlunit/javascript/HtmlUnitScriptableProxy.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/javascript/JavaScriptEngine.java b/src/main/java/org/htmlunit/javascript/JavaScriptEngine.java index 87cb90feb54..7d299d2301c 100644 --- a/src/main/java/org/htmlunit/javascript/JavaScriptEngine.java +++ b/src/main/java/org/htmlunit/javascript/JavaScriptEngine.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. @@ -46,7 +46,6 @@ import org.htmlunit.corejs.javascript.EcmaError; import org.htmlunit.corejs.javascript.Function; import org.htmlunit.corejs.javascript.FunctionObject; -import org.htmlunit.corejs.javascript.Interpreter; import org.htmlunit.corejs.javascript.JavaScriptException; import org.htmlunit.corejs.javascript.NativeArray; import org.htmlunit.corejs.javascript.NativeArrayIterator; @@ -104,7 +103,7 @@ * @author Sven Strickroth * * @see - * Rhino and Java Browser + * Rhino and Java Browser */ public class JavaScriptEngine implements AbstractJavaScriptEngine\n" + "\n" @@ -220,8 +212,7 @@ public void acceptHeaderJavascript() throws Exception { @Test @Alerts("Accept: */*") public void acceptHeaderJavascriptWithoutType() throws Exception { - final String html - = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + " \n" + "\n" @@ -240,8 +231,7 @@ public void acceptHeaderJavascriptWithoutType() throws Exception { @Test @Alerts("Accept: text/css,*/*;q=0.1") public void acceptHeaderCssWithoutType() throws Exception { - final String html - = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + " \n" + "\n" + "\n" + "\n" + "to page 2\n" + ""; - final String content2 = "page 2\n" + final String content2 = DOCTYPE_HTML + + "page 2\n" + "\n" + "\n" + "to page 1\n" @@ -235,11 +264,12 @@ public void usage() throws Exception { } /** - *@throws Exception if the test fails + * @throws Exception if the test fails */ @Test public void jsUrlEncoded() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + " page 1\n" + " \n" @@ -250,7 +280,8 @@ public void jsUrlEncoded() throws Exception { + "\n" + ""; - final String content2 = "\n" + final String content2 = DOCTYPE_HTML + + "\n" + "\n" + " page 2\n" + " \n" @@ -292,11 +323,12 @@ public void jsUrlEncoded() throws Exception { } /** - *@throws Exception if the test fails + * @throws Exception if the test fails */ @Test public void cssUrlEncoded() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + " page 1\n" + " \n" @@ -315,7 +347,8 @@ public void cssUrlEncoded() throws Exception { + "\n" + ""; - final String content2 = "\n" + final String content2 = DOCTYPE_HTML + + "\n" + "\n" + " page 2\n" + " \n" @@ -362,11 +395,12 @@ public void cssUrlEncoded() throws Exception { } /** - *@throws Exception if the test fails + * @throws Exception if the test fails */ @Test public void maxSizeMaintained() throws Exception { - final String html = "page 1\n" + final String html = DOCTYPE_HTML + + "page 1\n" + "\n" + "\n" + ""; @@ -581,7 +587,8 @@ public void domainDuplicateLeadingDot() throws Exception { */ @Test public void domainDuplicateLeadingDotSend() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "next page\n" + ""; @@ -608,7 +615,8 @@ public void domainDuplicateLeadingDotSend() throws Exception { */ @Test public void domainDuplicateLeadingDotRedirect() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "next page\n" + ""; @@ -647,7 +655,8 @@ public void domain2() throws Exception { responseHeader1.add(new NameValuePair("Set-Cookie", "c4=4; Domain=" + DOMAIN + "; Path=/")); responseHeader1.add(new NameValuePair("Set-Cookie", "c5=5; Domain=.org; Path=/")); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "

Cookie Domain Test

\n" @@ -678,7 +687,8 @@ public void domain3() throws Exception { responseHeader1.add(new NameValuePair("Set-Cookie", "c4=4; Domain=" + DOMAIN + "; Path=/")); responseHeader1.add(new NameValuePair("Set-Cookie", "c5=5; Domain=.org; Path=/")); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "

Cookie Domain Test

\n" @@ -705,7 +715,8 @@ public void differentHostsSameDomain() throws Exception { final List responseHeader1 = new ArrayList<>(); responseHeader1.add(new NameValuePair("Set-Cookie", "cross-domain=1; Domain=." + DOMAIN + "; Path=/")); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "

Cookie Domain Test

\n" @@ -729,7 +740,8 @@ public void differentHostsSameDomain() throws Exception { @Test @Alerts("cross-domain=1") public void differentHostsSameDomainCookieFromJS() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -755,7 +767,8 @@ public void differentHostsSameDomainCookieFromJS() throws Exception { @Test @Alerts("cross-domain=1") public void differentHostsSameDomainCookieFromMeta() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -947,7 +960,7 @@ public void sameSiteIncludeFromSameDomain() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c4=empty; SameSite=")); responseHeader.add(new NameValuePair("Set-Cookie", "c5=unknown; SameSite=unknown")); - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + " \n" + "\n" @@ -1002,7 +1015,7 @@ public void sameSiteIncludeFromSubDomain() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c4=empty; SameSite=")); responseHeader.add(new NameValuePair("Set-Cookie", "c5=unknown; SameSite=unknown")); - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + " \n" + "\n" @@ -1057,7 +1070,7 @@ public void sameSiteIFrameFromSameDomain() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c4=empty; SameSite=")); responseHeader.add(new NameValuePair("Set-Cookie", "c5=unknown; SameSite=unknown")); - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -1112,7 +1125,7 @@ public void sameSiteIFrameFromSubDomain() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c4=empty; SameSite=")); responseHeader.add(new NameValuePair("Set-Cookie", "c5=unknown; SameSite=unknown")); - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -1151,4 +1164,57 @@ public void sameSiteIFrameFromSubDomain() throws Exception { assertEquals("unknown", mgr.getCookie("c5").getSameSite()); } } + + /** + * Test for issue #270. + * @throws Exception in case of error + */ + @Test + @Alerts("JDSessionID=1234567890") + public void issue270() throws Exception { + final List responseHeader1 = new ArrayList<>(); + responseHeader1.add(new NameValuePair("Set-Cookie", "first=1; path=/c")); + + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + "\n" + + ""; + + final URL firstUrl = new URL(URL_HOST1); + getMockWebConnection().setResponse(firstUrl, html); + loadPage2(html, firstUrl); + + loadPage2(HTML_ALERT_COOKIE, firstUrl); + verifyTitle2(getWebDriver(), getExpectedAlerts()); + } + + @Override + protected final WebDriver getWebDriver() { + final WebDriver driver = super.getWebDriver(); + if (driver instanceof HtmlUnitDriver) { + // set timeout to fail fast when the url not mapped + ((HtmlUnitDriver) driver).getWebClient().getOptions().setTimeout(1000); + } + + return driver; + } } diff --git a/src/test/java/org/htmlunit/CookieManager5Test.java b/src/test/java/org/htmlunit/CookieManager5Test.java index 79f49ea6873..8ee29b6f46f 100644 --- a/src/test/java/org/htmlunit/CookieManager5Test.java +++ b/src/test/java/org/htmlunit/CookieManager5Test.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. @@ -27,7 +27,6 @@ import javax.servlet.http.HttpServletResponse; import org.apache.http.client.utils.DateUtils; -import org.htmlunit.html.HtmlPageTest; import org.htmlunit.junit.BrowserRunner; import org.htmlunit.util.Cookie; import org.htmlunit.util.MimeType; @@ -43,6 +42,9 @@ @RunWith(BrowserRunner.class) public class CookieManager5Test extends WebServerTestCase { + /** + * @throws Exception if an error occurs + */ @Test public void sameDomainWithClientCookie() throws Exception { final List headers = new ArrayList<>(); @@ -64,6 +66,9 @@ public void sameDomainWithClientCookie() throws Exception { } } + /** + * @throws Exception if an error occurs + */ @Test public void unqualifiedHostWithClientCookie() throws Exception { final List headers = new ArrayList<>(); @@ -85,6 +90,9 @@ public void unqualifiedHostWithClientCookie() throws Exception { } } + /** + * @throws Exception if an error occurs + */ @Test public void subdomainWithClientCookie() throws Exception { final List headers = new ArrayList<>(); @@ -106,6 +114,9 @@ public void subdomainWithClientCookie() throws Exception { } } + /** + * @throws Exception if an error occurs + */ @Test public void differentSubdomainWithClientCookie() throws Exception { final List headers = new ArrayList<>(); @@ -172,23 +183,32 @@ public void updateCookieExpires() throws Exception { servlets.put(SetCookieExpires1000Servlet.URL, SetCookieExpires1000Servlet.class); startWebServer("./", null, servlets); - final WebClient webClient = getWebClient(); - webClient.getPage("http://localhost:" + PORT + SetCookieExpires10Servlet.URL); - assertEquals(1, webClient.getCookieManager().getCookies().size()); - Cookie cookie = webClient.getCookieManager().getCookies().iterator().next(); - assertFalse("" + cookie.getExpires(), cookie.getExpires().after(date)); + try (WebClient webClient = getWebClient()) { + webClient.getPage("http://localhost:" + PORT + SetCookieExpires10Servlet.URL); + assertEquals(1, webClient.getCookieManager().getCookies().size()); + Cookie cookie = webClient.getCookieManager().getCookies().iterator().next(); + assertFalse("" + cookie.getExpires(), cookie.getExpires().after(date)); + + webClient.getPage("http://localhost:" + PORT + SetCookieExpires1000Servlet.URL); + assertEquals(1, webClient.getCookieManager().getCookies().size()); + cookie = webClient.getCookieManager().getCookies().iterator().next(); + assertTrue("" + cookie.getExpires(), cookie.getExpires().after(date)); + } + } - webClient.getPage("http://localhost:" + PORT + SetCookieExpires1000Servlet.URL); - assertEquals(1, webClient.getCookieManager().getCookies().size()); - cookie = webClient.getCookieManager().getCookies().iterator().next(); - assertTrue("" + cookie.getExpires(), cookie.getExpires().after(date)); + @Override + protected WebClient getWebClient() { + final WebClient webClient = super.getWebClient(); + // set timeout to fail fast when the url not mapped + webClient.getOptions().setTimeout(1000); + return webClient; } /** * Helper class for {@link #updateCookieExpires}. */ public abstract static class SetCookieExpiresServlet extends HttpServlet { - private static final String HTML_ = HtmlPageTest.STANDARDS_MODE_PREFIX_ + private static final String HTML_ = DOCTYPE_HTML + "\n" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/CookieManagerTest.java b/src/test/java/org/htmlunit/CookieManagerTest.java index bc82c12763c..34e9665b7b2 100644 --- a/src/test/java/org/htmlunit/CookieManagerTest.java +++ b/src/test/java/org/htmlunit/CookieManagerTest.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. @@ -24,9 +24,8 @@ import java.util.Map; import org.apache.http.client.utils.DateUtils; -import org.htmlunit.html.HtmlPageTest; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.MimeType; import org.htmlunit.util.NameValuePair; import org.junit.Test; @@ -48,8 +47,7 @@ public class CookieManagerTest extends WebDriverTestCase { /** HTML code with JS code alert(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 +302,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..e1b9ab8f10e 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. @@ -28,7 +28,7 @@ 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.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -135,7 +135,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 +184,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 +248,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 +307,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 +333,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 +372,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" @@ -1448,7 +1454,8 @@ public void loadJavascript() throws Exception { // PrimitiveWebServer @NotYetImplemented(value = {}, os = OS.Linux) public void loadJavascriptCharset() throws Exception { - String html = "" + String html = DOCTYPE_HTML + + "" + "" + "" + ""; diff --git a/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLTest.java b/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLTest.java index cc622a7edbd..b62022bb4f9 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. diff --git a/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLWithClientCertificateTest.java b/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLWithClientCertificateTest.java index 197fa70a0f4..3c7013da406 100644 --- a/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLWithClientCertificateTest.java +++ b/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLWithClientCertificateTest.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/test/java/org/htmlunit/HttpWebConnectionProxyTest.java b/src/test/java/org/htmlunit/HttpWebConnectionProxyTest.java index 84236df65dc..df47e09a647 100644 --- a/src/test/java/org/htmlunit/HttpWebConnectionProxyTest.java +++ b/src/test/java/org/htmlunit/HttpWebConnectionProxyTest.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/test/java/org/htmlunit/HttpWebConnectionTest.java b/src/test/java/org/htmlunit/HttpWebConnectionTest.java index 9dd4f7a155c..21aec5c549f 100644 --- a/src/test/java/org/htmlunit/HttpWebConnectionTest.java +++ b/src/test/java/org/htmlunit/HttpWebConnectionTest.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. @@ -292,7 +292,8 @@ public void emptyPut() throws Exception { public static class EmptyPutServlet extends ServletContentWrapper { /** Constructor. */ public EmptyPutServlet() { - super("\n" + super(DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/MiniServer.java b/src/test/java/org/htmlunit/MiniServer.java index a36cdc8d2ab..5f6e25c1bd5 100644 --- a/src/test/java/org/htmlunit/MiniServer.java +++ b/src/test/java/org/htmlunit/MiniServer.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. @@ -58,19 +58,35 @@ public class MiniServer extends Thread implements Closeable { private static final Set DROP_REQUESTS = new HashSet<>(); private static final Set DROP_GET_REQUESTS = new HashSet<>(); + /** + * Resets the drop and drop-get request counters. + */ public static void resetDropRequests() { DROP_REQUESTS.clear(); DROP_GET_REQUESTS.clear(); } + /** + * Add the given url to the list of drop requests. + * @param url to url to add + */ public static void configureDropRequest(final URL url) { DROP_REQUESTS.add(url); } + /** + * Add the given url to the list of drop-get requests. + * @param url to url to add + */ public static void configureDropGetRequest(final URL url) { DROP_GET_REQUESTS.add(url); } + /** + * Ctor. + * @param port the port to listen on + * @param mockWebConnection the {@link MockWebConnection} to get the responses from + */ public MiniServer(final int port, final MockWebConnection mockWebConnection) { port_ = port; mockWebConnection_ = mockWebConnection; @@ -211,6 +227,9 @@ else if ("POST".equalsIgnoreCase(methodText)) { } } + /** + * @return the last received request + */ public String getLastRequest() { return lastRequest_; } diff --git a/src/test/java/org/htmlunit/MockWebConnectionTest.java b/src/test/java/org/htmlunit/MockWebConnectionTest.java index 4b2784d7c82..547420d8214 100644 --- a/src/test/java/org/htmlunit/MockWebConnectionTest.java +++ b/src/test/java/org/htmlunit/MockWebConnectionTest.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. @@ -35,7 +35,8 @@ public class MockWebConnectionTest extends SimpleWebTestCase { */ @Test public void charset() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + " Pound Test\n" diff --git a/src/test/java/org/htmlunit/NiceRefreshHandlerTest.java b/src/test/java/org/htmlunit/NiceRefreshHandlerTest.java index de64339a37d..eb7ac4b2afd 100644 --- a/src/test/java/org/htmlunit/NiceRefreshHandlerTest.java +++ b/src/test/java/org/htmlunit/NiceRefreshHandlerTest.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. @@ -46,7 +46,8 @@ public void noRefreshForDelayLargerThanMax() throws Exception { } private void doTest(final int handlerMaxDelay, final URL expectedUrl) throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "Meta Redirect Page\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/NicelyResynchronizingAjaxControllerTest.java b/src/test/java/org/htmlunit/NicelyResynchronizingAjaxControllerTest.java index 9607ff8bbfa..91137f61f9e 100644 --- a/src/test/java/org/htmlunit/NicelyResynchronizingAjaxControllerTest.java +++ b/src/test/java/org/htmlunit/NicelyResynchronizingAjaxControllerTest.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/test/java/org/htmlunit/NoHttpResponseTest.java b/src/test/java/org/htmlunit/NoHttpResponseTest.java index 1ef0df8478e..febe69294b1 100644 --- a/src/test/java/org/htmlunit/NoHttpResponseTest.java +++ b/src/test/java/org/htmlunit/NoHttpResponseTest.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,8 +21,8 @@ import org.htmlunit.html.HtmlPage; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.After; import org.junit.Test; import org.junit.experimental.runners.Enclosed; @@ -60,6 +60,11 @@ public class NoHttpResponseTest { @RunWith(BrowserRunner.class) public static class WithWebDriverTest extends WebDriverTestCase { + /** + * Resets the {@link MiniServer}. + * + * @throws Exception in case of error + */ @After public void after() throws Exception { MiniServer.resetDropRequests(); @@ -79,7 +84,8 @@ public void submit() throws Exception { mockWebConnection.setResponse(URL_FIRST, HTML); MiniServer.configureDropRequest(new URL(URL_FIRST, "page2?textfield=")); final URL urlRightSubmit = new URL(URL_FIRST, "page2?textfield=new+value"); - mockWebConnection.setResponse(urlRightSubmit, "right submit"); + mockWebConnection.setResponse(urlRightSubmit, + DOCTYPE_HTML + "right submit"); expandExpectedAlertsVariables(URL_FIRST); final WebDriver driver = getWebDriver(); @@ -89,6 +95,9 @@ public void submit() throws Exception { driver.get(URL_FIRST.toString()); driver.findElement(By.id("inputSubmit")).click(); + if (useRealBrowser()) { + Thread.sleep(400); + } assertEquals(getExpectedAlerts()[0], driver.getCurrentUrl()); } catch (final WebDriverException e) { @@ -106,7 +115,8 @@ public void callSubmitInButtonAndReturnTrue() throws Exception { mockWebConnection.setResponse(URL_FIRST, HTML); MiniServer.configureDropRequest(new URL(URL_FIRST, "page2?textfield=")); final URL urlRightSubmit = new URL(URL_FIRST, "page2?textfield=new+value"); - mockWebConnection.setResponse(urlRightSubmit, "right submit"); + mockWebConnection.setResponse(urlRightSubmit, + DOCTYPE_HTML + "right submit"); final WebDriver driver = getWebDriver(); @@ -126,6 +136,11 @@ public void callSubmitInButtonAndReturnTrue() throws Exception { @RunWith(BrowserRunner.class) public static class WithWebClientTest extends SimpleWebTestCase { + /** + * Resets the {@link MiniServer}. + * + * @throws Exception in case of error + */ @After public void after() throws Exception { MiniServer.resetDropRequests(); @@ -140,7 +155,8 @@ public void submit() throws Throwable { mockWebConnection.setResponse(URL_FIRST, HTML); MiniServer.configureDropRequest(new URL(URL_FIRST, "page2?textfield=")); final URL urlRightSubmit = new URL(URL_FIRST, "page2?textfield=new+value"); - mockWebConnection.setResponse(urlRightSubmit, "right submit"); + mockWebConnection.setResponse(urlRightSubmit, + DOCTYPE_HTML + "right submit"); expandExpectedAlertsVariables(URL_FIRST); @@ -162,7 +178,8 @@ public void callSubmitInButtonAndReturnTrue() throws Throwable { mockWebConnection.setResponse(URL_FIRST, HTML); MiniServer.configureDropRequest(new URL(URL_FIRST, "page2?textfield=")); final URL urlRightSubmit = new URL(URL_FIRST, "page2?textfield=new+value"); - mockWebConnection.setResponse(urlRightSubmit, "right submit"); + mockWebConnection.setResponse(urlRightSubmit, + DOCTYPE_HTML + "right submit"); try (MiniServer miniServer = new MiniServer(PORT, mockWebConnection)) { miniServer.start(); diff --git a/src/test/java/org/htmlunit/NotYetImplementedTest.java b/src/test/java/org/htmlunit/NotYetImplementedTest.java index 4a86c5d829f..d16ebc43688 100644 --- a/src/test/java/org/htmlunit/NotYetImplementedTest.java +++ b/src/test/java/org/htmlunit/NotYetImplementedTest.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. @@ -58,6 +58,7 @@ private void process(final File dir) throws IOException { else { if (fileName.endsWith(".java") && !"SimpleWebTestCase.java".equals(fileName) + && !"AnnotationUtilsTest.java".equals(fileName) && !"NotYetImplementedTest.java".equals(fileName) && !"CodeStyleTest.java".equals(fileName)) { final List lines = FileUtils.readLines(file, ISO_8859_1); diff --git a/src/test/java/org/htmlunit/ObjectInstantiationExceptionTest.java b/src/test/java/org/htmlunit/ObjectInstantiationExceptionTest.java index 83486b76e4e..e393bfa3ced 100644 --- a/src/test/java/org/htmlunit/ObjectInstantiationExceptionTest.java +++ b/src/test/java/org/htmlunit/ObjectInstantiationExceptionTest.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/test/java/org/htmlunit/PageReloadTest.java b/src/test/java/org/htmlunit/PageReloadTest.java index 0d2f1e7bb1c..1e7b5928cec 100644 --- a/src/test/java/org/htmlunit/PageReloadTest.java +++ b/src/test/java/org/htmlunit/PageReloadTest.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. @@ -17,7 +17,7 @@ import java.net.URL; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.By; @@ -1682,6 +1682,9 @@ private void openUrlAndClickById( // click driver.findElement(By.id(id)).click(); + if (useRealBrowser()) { + Thread.sleep(400); + } assertEquals(counterChange, getMockWebConnection().getRequestCount() - 1); // check location visible to javascript diff --git a/src/test/java/org/htmlunit/PrimitiveWebServer.java b/src/test/java/org/htmlunit/PrimitiveWebServer.java index 6100a8304a8..c56e1650ff3 100644 --- a/src/test/java/org/htmlunit/PrimitiveWebServer.java +++ b/src/test/java/org/htmlunit/PrimitiveWebServer.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/test/java/org/htmlunit/ScriptExceptionTest.java b/src/test/java/org/htmlunit/ScriptExceptionTest.java index f6534045ee1..540c93f0505 100644 --- a/src/test/java/org/htmlunit/ScriptExceptionTest.java +++ b/src/test/java/org/htmlunit/ScriptExceptionTest.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. @@ -41,7 +41,7 @@ public final class ScriptExceptionTest extends SimpleWebTestCase { public void constructor() throws Exception { final String message = "bla bla"; final Throwable t = new RuntimeException(message); - final HtmlPage page = loadPage(""); + final HtmlPage page = loadPage(DOCTYPE_HTML + ""); final ScriptException exception = new ScriptException(page, t); assertEquals(t, exception.getCause()); @@ -54,7 +54,7 @@ public void constructor() throws Exception { */ @Test public void getPage() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; try { loadPage(html); } diff --git a/src/test/java/org/htmlunit/ScriptPreProcessorTest.java b/src/test/java/org/htmlunit/ScriptPreProcessorTest.java index 2d66a5a9ea5..f34d3680754 100644 --- a/src/test/java/org/htmlunit/ScriptPreProcessorTest.java +++ b/src/test/java/org/htmlunit/ScriptPreProcessorTest.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,8 @@ public void scriptPreProcessor() throws IOException { final MockWebConnection webConnection = new MockWebConnection(); final String alertText = "content"; final String newAlertText = "newcontent"; - final String content - = "foo\n" + "

hello world

\n" @@ -118,7 +118,8 @@ public void handleAlert(final Page page, final String message) { public void scriptPreProcessor_UnimplementedJavascript() throws Exception { final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); - final String content = "foo\n" + final String content = DOCTYPE_HTML + + "foo\n" + "

hello world

\n" + "\n" + "\n" @@ -151,7 +152,8 @@ public String preProcess(final HtmlPage htmlPage, final String sourceCode, final */ @Test public void scriptPreProcessor_Eval() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + + ""; final WebClient client = getWebClient(); final MockWebConnection conn = new MockWebConnection(); diff --git a/src/test/java/org/htmlunit/SgmlPage2Test.java b/src/test/java/org/htmlunit/SgmlPage2Test.java index 1ec03fba12b..f001c11f17d 100644 --- a/src/test/java/org/htmlunit/SgmlPage2Test.java +++ b/src/test/java/org/htmlunit/SgmlPage2Test.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,7 +16,7 @@ import org.htmlunit.html.HtmlPage; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.WebDriver; @@ -36,7 +36,8 @@ public final class SgmlPage2Test extends WebDriverTestCase { @Test @Alerts({"2", "2"}) public void getElementsByTagName() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -50,8 +50,8 @@ public void localStorage() throws Exception { assertEquals(1, localStorage.size()); assertEquals("Tom", localStorage.get("myCat")); - html - = "\n" + html = DOCTYPE_HTML + + "\n" + "\n" @@ -73,8 +73,8 @@ public void populateLocalStorage() throws Exception { localStorage.put("myCat", "Tom"); - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -96,8 +96,8 @@ public void sessionStorage() throws Exception { webClient.getStorageHolder().getSessionStorage(webClient.getCurrentWindow()); assertEquals(0, sessionStorage.size()); - String html - = "\n" + String html = DOCTYPE_HTML + + "\n" + "\n" @@ -107,8 +107,8 @@ public void sessionStorage() throws Exception { assertEquals(1, sessionStorage.size()); assertEquals("Tom", sessionStorage.get("myCat")); - html - = "\n" + html = DOCTYPE_HTML + + "\n" + "\n" @@ -131,8 +131,8 @@ public void populateSessionStorage() throws Exception { sessionStorage.put("myCat", "Tom"); - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/StringWebResponseTest.java b/src/test/java/org/htmlunit/StringWebResponseTest.java index 1ecb35b6fbd..a19a1cf3159 100644 --- a/src/test/java/org/htmlunit/StringWebResponseTest.java +++ b/src/test/java/org/htmlunit/StringWebResponseTest.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. @@ -43,6 +43,9 @@ public void charset() { assertSame(UTF_8, webResponse.getContentCharset()); } + /** + * @throws Exception if the test fails + */ @Test public void charsetImplicit() { final StringWebResponse webResponse = new StringWebResponse("hello", URL_FIRST); @@ -54,7 +57,8 @@ public void charsetImplicit() { */ @Test public void charsetInContent() { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\u010C\u00CDSLO"; final StringWebResponse webResponse = new StringWebResponse(content, UTF_8, URL_FIRST); @@ -63,9 +67,13 @@ public void charsetInContent() { assertEquals(content, webResponse.getContentAsString()); } + /** + * @throws Exception if the test fails + */ @Test public void charsetInContentImplicit() { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\u010C\u00CDSLO"; final StringWebResponse webResponse = new StringWebResponse(content, URL_FIRST); @@ -75,11 +83,12 @@ public void charsetInContentImplicit() { } /** - * @throws IOException + * @throws IOException in case of error */ @Test public void inputStream() throws IOException { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\u010C\u00CDSLO"; final StringWebResponse webResponse = new StringWebResponse(content, URL_FIRST); diff --git a/src/test/java/org/htmlunit/TestCaseTest.java b/src/test/java/org/htmlunit/TestCaseTest.java index 7afaf2c0656..3335c99b360 100644 --- a/src/test/java/org/htmlunit/TestCaseTest.java +++ b/src/test/java/org/htmlunit/TestCaseTest.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/test/java/org/htmlunit/TextPageTest.java b/src/test/java/org/htmlunit/TextPageTest.java index 719f8da1687..8998c80227c 100644 --- a/src/test/java/org/htmlunit/TextPageTest.java +++ b/src/test/java/org/htmlunit/TextPageTest.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/test/java/org/htmlunit/TopLevelWindowTest.java b/src/test/java/org/htmlunit/TopLevelWindowTest.java index 51142b533f9..49e837ab55b 100644 --- a/src/test/java/org/htmlunit/TopLevelWindowTest.java +++ b/src/test/java/org/htmlunit/TopLevelWindowTest.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,7 +25,7 @@ import org.htmlunit.javascript.background.JavaScriptJob; import org.htmlunit.javascript.background.JavaScriptJobManager; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -191,7 +191,8 @@ public void webWindowClosed(final WebWindowEvent event) { window.setJobManager(mgr); final MockWebConnection conn = getMockWebConnection(); - conn.setDefaultResponse(""); + conn.setDefaultResponse(DOCTYPE_HTML + + ""); client.getPage(URL_FIRST); assertEquals(1, jobCount.intValue()); @@ -210,10 +211,13 @@ public void history() throws Exception { final History history = window.getHistory(); final MockWebConnection conn = getMockWebConnection(); - conn.setResponse(URL_FIRST, "foo\n" - + "bar"); - conn.setResponse(URL_SECOND, "foo"); - conn.setResponse(URL_THIRD, "foo"); + conn.setResponse(URL_FIRST, DOCTYPE_HTML + + "foo\n" + + "bar"); + conn.setResponse(URL_SECOND, DOCTYPE_HTML + + "foo"); + conn.setResponse(URL_THIRD, DOCTYPE_HTML + + "foo"); assertEquals(0, history.getLength()); assertEquals(-1, history.getIndex()); @@ -305,7 +309,7 @@ public void history() throws Exception { */ @Test public void onBeforeUnloadCalledOnClose() throws Exception { - final String html = "abc"; + final String html = DOCTYPE_HTML + "abc"; final List alerts = new ArrayList<>(); final HtmlPage page = loadPage(html, alerts); assertTrue(alerts.isEmpty()); @@ -323,7 +327,8 @@ public void onBeforeUnloadCalledOnClose() throws Exception { @Test @Alerts("closing") public void setTimeoutDuringOnUnload() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "to second"; - final String secondContent = ""; + final String secondContent = DOCTYPE_HTML + ""; final MockWebConnection webConnection = getMockWebConnection(); webConnection.setResponse(URL_SECOND, secondContent); @@ -185,7 +188,8 @@ public void clickReturnsWhenThePageHasBeenCompleteLoaded() throws Exception { @Test @Alerts({"open", "first", "second"}) public void windowOpenedByAnchorTargetIsAttachedToJavascriptEventLoop() throws Exception { - final String firstContent = "\n" + final String firstContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; @@ -439,7 +458,8 @@ private void doTestDeflateCompression(final boolean gzipCompatibleCompression) t final MockWebConnection conn = getMockWebConnection(); conn.setResponse(URL_SECOND, content, 200, "OK", "text/javascript", headers); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "Hello world\n" + "\n" + ""; @@ -558,8 +578,8 @@ public void encodingCharsetGBK() throws Exception { private void encodingCharset(final String title, final String metaCharset, final String responseCharset) throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "" + title + "\n" + "\n" @@ -589,8 +609,8 @@ private void encodingCharset(final String title, @Test @Alerts({"en-US", "en-US,en"}) public void language() throws Exception { - final String html - = "\n" @@ -247,7 +257,8 @@ public void script() throws Exception { */ @Test public void link() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " foo\n" + " \n" @@ -271,7 +282,8 @@ public void link() throws Exception { */ @Test public void object() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " foo\n" + "\n" @@ -295,7 +307,8 @@ public void object() throws Exception { */ @Test public void svgScript() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " foo\n" + "\n" @@ -316,7 +329,8 @@ public void svgScript() throws Exception { */ @Test public void invalidElementEventWithNoJS() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + "" + " foo" + "" @@ -334,7 +348,8 @@ public void invalidElementEventWithNoJS() throws Exception { */ @Test public void checkingWithNoJS() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + "" + " foo" + "" @@ -362,7 +377,8 @@ public void checkingWithNoJS() throws Exception { */ @Test public void frameSetWithNoJS() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " foo\n" + "\n" @@ -384,7 +400,8 @@ public void frameSetWithNoJS() throws Exception { */ @Test public void imageEventHandlersWithNoJs() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" @@ -402,7 +419,8 @@ public void imageEventHandlersWithNoJs() throws Exception { */ @Test public void clickWithNoJs() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" diff --git a/src/test/java/org/htmlunit/WebClient9Test.java b/src/test/java/org/htmlunit/WebClient9Test.java index 90802dac309..b61568444a9 100644 --- a/src/test/java/org/htmlunit/WebClient9Test.java +++ b/src/test/java/org/htmlunit/WebClient9Test.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. @@ -141,6 +141,9 @@ public void flow1_2() { } } + /** + * @throws Exception if the test fails + */ @Test public void multithreading() throws InterruptedException { final String css = "body { background-color: green; }"; diff --git a/src/test/java/org/htmlunit/WebClientOptionsTest.java b/src/test/java/org/htmlunit/WebClientOptionsTest.java index ce12272e638..c64b1311012 100644 --- a/src/test/java/org/htmlunit/WebClientOptionsTest.java +++ b/src/test/java/org/htmlunit/WebClientOptionsTest.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,10 +14,13 @@ */ package org.htmlunit; +import java.security.KeyStore; + import javax.net.ssl.SSLContext; import org.apache.commons.lang3.SerializationUtils; import org.htmlunit.junit.BrowserRunner; +import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -48,6 +51,19 @@ public void serialization() throws Exception { assertEquals(original.isThrowExceptionOnScriptError(), deserialized.isThrowExceptionOnScriptError()); assertEquals(original.isPopupBlockerEnabled(), deserialized.isPopupBlockerEnabled()); assertEquals(original.isRedirectEnabled(), deserialized.isRedirectEnabled()); + + assertEquals(original.isGeolocationEnabled(), deserialized.isGeolocationEnabled()); + assertEquals(original.getGeolocation(), deserialized.getGeolocation()); + + assertEquals(original.getNekoReaderBufferSize(), deserialized.getNekoReaderBufferSize()); + + assertEquals(original.isWebSocketEnabled(), deserialized.isWebSocketEnabled()); + assertEquals(original.getWebSocketMaxTextMessageSize(), deserialized.getWebSocketMaxTextMessageSize()); + assertEquals(original.getWebSocketMaxTextMessageBufferSize(), deserialized.getWebSocketMaxTextMessageBufferSize()); + assertEquals(original.getWebSocketMaxBinaryMessageSize(), deserialized.getWebSocketMaxBinaryMessageSize()); + assertEquals(original.getWebSocketMaxBinaryMessageBufferSize(), deserialized.getWebSocketMaxBinaryMessageBufferSize()); + + assertEquals(original.isFetchPolyfillEnabled(), deserialized.isFetchPolyfillEnabled()); } /** @@ -65,6 +81,19 @@ public void serializationChanged() throws Exception { original.setPopupBlockerEnabled(true); original.setRedirectEnabled(false); + original.setGeolocationEnabled(true); + original.setGeolocation(new WebClientOptions.Geolocation(1d, 2d, 3d, 4d, 5d, 6d, 7d)); + + original.setNekoReaderBufferSize(1234567); + + original.setWebSocketEnabled(false); + original.setWebSocketMaxTextMessageSize(77); + original.setWebSocketMaxTextMessageBufferSize(771); + original.setWebSocketMaxBinaryMessageSize(44); + original.setWebSocketMaxBinaryMessageBufferSize(441); + + original.setFetchPolyfillEnabled(true); + final byte[] bytes = SerializationUtils.serialize(original); final WebClientOptions deserialized = (WebClientOptions) SerializationUtils.deserialize(bytes); @@ -77,6 +106,26 @@ public void serializationChanged() throws Exception { assertEquals(original.isThrowExceptionOnScriptError(), deserialized.isThrowExceptionOnScriptError()); assertEquals(original.isPopupBlockerEnabled(), deserialized.isPopupBlockerEnabled()); assertEquals(original.isRedirectEnabled(), deserialized.isRedirectEnabled()); + + assertEquals(original.isGeolocationEnabled(), deserialized.isGeolocationEnabled()); + assertEquals(original.getGeolocation().getAccuracy(), deserialized.getGeolocation().getAccuracy()); + assertEquals(original.getGeolocation().getLatitude(), deserialized.getGeolocation().getLatitude()); + assertEquals(original.getGeolocation().getLongitude(), deserialized.getGeolocation().getLongitude()); + assertEquals(original.getGeolocation().getAltitude(), deserialized.getGeolocation().getAltitude()); + assertEquals(original.getGeolocation().getAltitudeAccuracy(), + deserialized.getGeolocation().getAltitudeAccuracy()); + assertEquals(original.getGeolocation().getHeading(), deserialized.getGeolocation().getHeading()); + assertEquals(original.getGeolocation().getSpeed(), deserialized.getGeolocation().getSpeed()); + + assertEquals(original.getNekoReaderBufferSize(), deserialized.getNekoReaderBufferSize()); + + assertEquals(original.isWebSocketEnabled(), deserialized.isWebSocketEnabled()); + assertEquals(original.getWebSocketMaxTextMessageSize(), deserialized.getWebSocketMaxTextMessageSize()); + assertEquals(original.getWebSocketMaxTextMessageBufferSize(), deserialized.getWebSocketMaxTextMessageBufferSize()); + assertEquals(original.getWebSocketMaxBinaryMessageSize(), deserialized.getWebSocketMaxBinaryMessageSize()); + assertEquals(original.getWebSocketMaxBinaryMessageBufferSize(), deserialized.getWebSocketMaxBinaryMessageBufferSize()); + + assertEquals(original.isFetchPolyfillEnabled(), deserialized.isFetchPolyfillEnabled()); } /** @@ -92,4 +141,37 @@ public void serializationSSLContextProvider() throws Exception { assertNull(deserialized.getSSLContext()); } + + /** + * @throws Exception if an error occurs + */ + @Test + public void serializationSSLTrustStore() throws Exception { + final WebClientOptions original = new WebClientOptions(); + + final KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + original.setSSLTrustStore(keyStore); + + final byte[] bytes = SerializationUtils.serialize(original); + final WebClientOptions deserialized = (WebClientOptions) SerializationUtils.deserialize(bytes); + + assertNull(deserialized.getSSLTrustStore()); + } + + /** + * @throws Exception if an error occurs + */ + @Test + public void sslClientCertificateStore() throws Exception { + final WebClientOptions original = new WebClientOptions(); + + final KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + original.setSSLClientCertificateKeyStore(keyStore, "secret".toCharArray()); + + final byte[] bytes = SerializationUtils.serialize(original); + final WebClientOptions deserialized = (WebClientOptions) SerializationUtils.deserialize(bytes); + + assertNull(deserialized.getSSLClientCertificateStore()); + Assert.assertArrayEquals("secret".toCharArray(), deserialized.getSSLClientCertificatePassword()); + } } diff --git a/src/test/java/org/htmlunit/WebClientTest.java b/src/test/java/org/htmlunit/WebClientTest.java index f0a2afac0f5..2aa04f408dd 100644 --- a/src/test/java/org/htmlunit/WebClientTest.java +++ b/src/test/java/org/htmlunit/WebClientTest.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. @@ -45,13 +45,12 @@ import org.htmlunit.html.HtmlElement; import org.htmlunit.html.HtmlInlineFrame; import org.htmlunit.html.HtmlPage; -import org.htmlunit.html.HtmlPageTest; import org.htmlunit.html.parser.HTMLParser; import org.htmlunit.html.parser.neko.HtmlUnitNekoHtmlParser; import org.htmlunit.http.HttpStatus; import org.htmlunit.javascript.host.html.HTMLStyleElement; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.MimeType; import org.htmlunit.util.NameValuePair; import org.htmlunit.util.UrlUtils; @@ -87,7 +86,8 @@ public class WebClientTest extends SimpleWebTestCase { */ @Test public void credentialProvider_NoCredentials() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "No access"; final WebClient client = getWebClient(); client.getOptions().setPrintContentOnFailingStatusCode(false); @@ -113,7 +113,8 @@ public void credentialProvider_NoCredentials() throws Exception { */ @Test public void htmlWindowEvents_changed() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "link to foo2\n" + ""; final WebClient client = getWebClient(); @@ -164,12 +165,13 @@ public void webWindowClosed(final WebWindowEvent event) { */ @Test public void htmlWindowEvents_opened() throws Exception { - final String page1Content = "foo\n" + final String page1Content = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "link to foo2\n" + ""; - final String page2Content = "foo"; + final String page2Content = DOCTYPE_HTML + "foo"; final WebClient client = getWebClient(); final List events = new LinkedList<>(); @@ -219,12 +221,13 @@ public void webWindowClosed(final WebWindowEvent event) { */ @Test public void htmlWindowEvents_closedFromFrame() throws Exception { - final String firstContent = "first\n" + final String firstContent = DOCTYPE_HTML + + "first\n" + "\n" + "link to foo2\n" + ""; - final String secondContent = "second"; - final String thirdContent = "third"; + final String secondContent = DOCTYPE_HTML + "second"; + final String thirdContent = DOCTYPE_HTML + "third"; final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); @@ -289,8 +292,8 @@ public void redirection301_MovedPermanently_GetMethod() throws Exception { * @throws Exception if the test fails */ private void doTestRedirectionSameUrlAfterPost(final int statusCode) throws Exception { - final String firstContent = "First"; - final String secondContent = "Second"; + final String firstContent = DOCTYPE_HTML + "First"; + final String secondContent = DOCTYPE_HTML + "Second"; final WebClient webClient = getWebClient(); @@ -436,7 +439,7 @@ public void redirection307_TemporaryRedirect_PostMethod() throws Exception { * @param statusCode the code to return from the initial request * @param initialRequestMethod the initial request * @param expectedRedirectedRequestMethod the submit method of the second (redirected) request - * If a redirect is not expected to happen then this must be null + * If a redirect is not expected to happen then this must be null * @param newLocation the Location set in the redirection header * @throws Exception if the test fails */ @@ -470,8 +473,8 @@ public void redirectionSameURL() throws Exception { } private HtmlPage getPageWithRedirectionsSameURL(final int nbRedirections) throws Exception { - final String firstContent = "First"; - final String secondContent = "Second"; + final String firstContent = DOCTYPE_HTML + "First"; + final String secondContent = DOCTYPE_HTML + "Second"; final WebClient webClient = getWebClient(); @@ -523,7 +526,7 @@ private void redirection_AdditionalHeadersMaintained(final int statusCode) throw final List headers = asList(new NameValuePair("Location", URL_SECOND.toString())); conn.setResponse(URL_FIRST, "", statusCode, "", MimeType.TEXT_HTML, headers); - conn.setResponse(URL_SECOND, "abc"); + conn.setResponse(URL_SECOND, DOCTYPE_HTML + "abc"); final WebRequest request = new WebRequest(URL_FIRST); request.setAdditionalHeader("foo", "bar"); @@ -539,7 +542,7 @@ private void redirection_AdditionalHeadersMaintained(final int statusCode) throw * @param statusCode the code to return from the initial request * @param initialRequestMethod the initial request * @param expectedRedirectedRequestMethod the submit method of the second (redirected) request - * If a redirect is not expected to happen then this must be null + * If a redirect is not expected to happen then this must be null * @param newLocation the Location set in the redirection header * @param useProxy indicates if the test should be performed with a proxy * @throws Exception if the test fails @@ -553,8 +556,8 @@ private void doTestRedirection( final boolean useProxy) throws Exception { - final String firstContent = "First"; - final String secondContent = "Second"; + final String firstContent = DOCTYPE_HTML + "First"; + final String secondContent = DOCTYPE_HTML + "Second"; final WebClient webClient; final String proxyHost; @@ -644,7 +647,8 @@ public void setPageCreator_null() { */ @Test public void setPageCreator() throws Exception { - final String page1Content = "foo\n" + final String page1Content = DOCTYPE_HTML + + "foo\n" + "\n" + "link to foo2\n" + ""; @@ -706,7 +710,8 @@ public HTMLParser getHtmlParser() { */ @Test public void loadPage_PostWithParameters() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + ""; final WebClient client = getWebClient(); @@ -727,7 +732,8 @@ public void loadPage_PostWithParameters() throws Exception { */ @Test public void loadPage_SlashesInQueryString() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "to page 2\n" + ""; @@ -754,7 +760,7 @@ public void loadFilePage() throws Exception { // It could be useful to have existing files to test in a special location in filesystem. // It will be really needed when we have to test binary files using the file protocol. - final String htmlContent = "foo"; + final String htmlContent = DOCTYPE_HTML + "foo"; final File currentDirectory = new File((new File("")).getAbsolutePath()); final File tmpFile = File.createTempFile("test", ".html", currentDirectory); tmpFile.deleteOnExit(); @@ -873,10 +879,12 @@ public void loadFilePageXml() throws Exception { */ @Test public void redirectViaJavaScriptDuringInitialPageLoad() throws Exception { - final String firstContent = "First"; - final String secondContent = "Second"; + final String secondContent = DOCTYPE_HTML + + "Second"; final WebClient webClient = getWebClient(); @@ -900,7 +908,7 @@ public void redirectViaJavaScriptDuringInitialPageLoad() throws Exception { public void loadWebResponseInto() throws Exception { final WebClient webClient = getWebClient(); final WebResponse webResponse = new StringWebResponse( - "first", URL_FIRST); + DOCTYPE_HTML + "first", URL_FIRST); final Page page = webClient.loadWebResponseInto(webResponse, webClient.getCurrentWindow()); assertTrue(HtmlPage.class.isInstance(page)); @@ -917,7 +925,7 @@ public void loadWebResponseInto() throws Exception { */ @Test public void getPageFailingStatusCode() throws Exception { - final String firstContent = "Hello World"; + final String firstContent = DOCTYPE_HTML + "Hello World"; final WebClient webClient = getWebClient(); @@ -951,7 +959,7 @@ public void proxyConfig() throws Exception { defaultProxyHost, defaultProxyPort)) { // Configure the mock web connection. - final String html = "Hello World"; + final String html = DOCTYPE_HTML + "Hello World"; final MockWebConnection webConnection = new MockWebConnection(); webConnection.setResponse(URL_FIRST, html); webClient.setWebConnection(webConnection); @@ -1021,7 +1029,7 @@ public void proxyConfig() throws Exception { public void proxyConfigWithRedirect() throws Exception { final String defaultProxyHost = "defaultProxyHost"; final int defaultProxyPort = 777; - final String html = "Hello World"; + final String html = DOCTYPE_HTML + "Hello World"; try (WebClient webClient = new WebClient(getBrowserVersion(), defaultProxyHost, defaultProxyPort)) { webClient.getOptions().getProxyConfig().addHostsToProxyBypass("hostToByPass"); @@ -1030,7 +1038,8 @@ public void proxyConfigWithRedirect() throws Exception { final List headers = Collections.singletonList(new NameValuePair("Location", location2)); final MockWebConnection webConnection = new MockWebConnection(); webConnection.setResponse(URL_FIRST, html, 302, "Some error", MimeType.TEXT_HTML, headers); - webConnection.setResponse(new URL(location2), "2nd page"); + webConnection.setResponse(new URL(location2), + DOCTYPE_HTML + "2nd page"); webClient.setWebConnection(webConnection); final Page page2 = webClient.getPage(URL_FIRST); @@ -1060,7 +1069,8 @@ public void proxyConfigWithRedirect() throws Exception { public void proxyConfigForJS() throws Exception { final String defaultProxyHost = "defaultProxyHost"; final int defaultProxyPort = 777; - final String html = "Hello World\n" + final String html = DOCTYPE_HTML + + "Hello World\n" + "\n" + ""; try (WebClient webClient = new WebClient(getBrowserVersion(), defaultProxyHost, defaultProxyPort)) { @@ -1137,7 +1147,8 @@ public void refreshHandlerAccessors() { */ @Test public void badCharset() throws Exception { - final String page1Content = "foo\n" + final String page1Content = DOCTYPE_HTML + + "foo\n" + ""; final WebClient client = getWebClient(); @@ -1167,12 +1178,14 @@ public void expandUrlHandlesColonsInRelativeUrl() throws Exception { */ @Test public void reusingHtmlPageToSubmitFormMultipleTimes() throws Exception { - final String firstContent = "First\n" + final String firstContent = DOCTYPE_HTML + + "First\n" + "\n" + "
\n" + "\n" + "
"; - final String secondContent = "SecondSecond"; + final String secondContent = DOCTYPE_HTML + + "SecondSecond"; final WebClient webClient = getWebClient(); @@ -1195,11 +1208,13 @@ public void reusingHtmlPageToSubmitFormMultipleTimes() throws Exception { */ @Test public void openerInFrameset() throws Exception { - final String firstContent = "\n" + final String firstContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; - final String secondContent = "to top"; + final String secondContent = DOCTYPE_HTML + + "to top"; final WebClient webClient = getWebClient(); @@ -1212,7 +1227,7 @@ public void openerInFrameset() throws Exception { webClient.setAlertHandler(new CollectingAlertHandler(collectedAlerts)); final HtmlPage page = webClient.getPage(URL_FIRST); - final HtmlPage pageInFrame = (HtmlPage) ((WebWindow) page.getFrames().get(0)).getEnclosedPage(); + final HtmlPage pageInFrame = (HtmlPage) page.getFrames().get(0).getEnclosedPage(); pageInFrame.getAnchors().get(0).click(); final String[] expectedAlerts = {"null", "null"}; @@ -1301,7 +1316,7 @@ private File getTestFile(final String fileName) throws Exception { */ @Test public void requestHeader() throws Exception { - final String content = ""; + final String content = DOCTYPE_HTML + ""; final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); @@ -1330,7 +1345,7 @@ public void requestHeaderOverwritesClient() throws Exception { final String fromRequest = "from request"; final String fromClient = "from client"; - final String content = ""; + final String content = DOCTYPE_HTML + ""; final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); @@ -1364,7 +1379,7 @@ public void requestHeaderOverwritesClient() throws Exception { public void clientHeaderOverwritesDefault() throws Exception { final String fromClient = "from client"; - final String content = ""; + final String content = DOCTYPE_HTML + ""; final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); @@ -1385,7 +1400,7 @@ public void clientHeaderOverwritesDefault() throws Exception { */ @Test public void requestHeaderDoNotOverwriteWebRequestAcceptHeader() throws Exception { - final String content = ""; + final String content = DOCTYPE_HTML + ""; final WebClient webClient = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); @@ -1419,7 +1434,7 @@ public void requestHeaderDoNotOverwriteWebRequestAcceptHeader() throws Exception */ @Test public void requestHeaderDoNotOverwriteWebRequestAcceptHeader2() throws Exception { - final String content = ""; + final String content = DOCTYPE_HTML + ""; final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); @@ -1457,7 +1472,8 @@ public void requestHeaderDoNotOverwriteWebRequestAcceptHeader2() throws Exceptio */ @Test public void contentTypeCaseInsensitive() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + ""; final WebClient client = getWebClient(); @@ -1504,7 +1520,8 @@ public void loadFilePageWithExternalJS() throws Exception { FileUtils.writeStringToFile(tmpFileJS, "alert('foo')", encoding); // HTML file - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; final File tmpFile = File.createTempFile("test", ".html", currentDirectory); @@ -1528,7 +1545,7 @@ public void loadFilePageWithExternalJS() throws Exception { */ @Test public void onBeforeUnloadCalledOnCorrectPage() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final List alerts = new ArrayList<>(); loadPage(html, alerts); assertTrue(alerts.isEmpty()); @@ -1542,7 +1559,7 @@ public void onBeforeUnloadCalledOnCorrectPage() throws Exception { @Test public void urlEncoding() throws Exception { final URL url = new URL("http://host/x+y\u00E9/a\u00E9 b?c \u00E9 d"); - final HtmlPage page = loadPage(BrowserVersion.FIREFOX, "", new ArrayList<>(), url); + final HtmlPage page = loadPage(BrowserVersion.FIREFOX, DOCTYPE_HTML + "", new ArrayList<>(), url); final WebRequest wrs = page.getWebResponse().getWebRequest(); assertEquals("http://host/x+y%C3%A9/a%C3%A9%20b?c%20%C3%A9%20d", wrs.getUrl()); } @@ -1555,7 +1572,8 @@ public void urlEncoding() throws Exception { @Test public void urlEncoding2() throws Exception { final URL url = new URL("http://host/x+y\u00E9/a\u00E9 b?c \u00E9 d"); - final HtmlPage page = loadPage(BrowserVersion.BEST_SUPPORTED, "", new ArrayList<>(), url); + final HtmlPage page = loadPage(BrowserVersion.BEST_SUPPORTED, + DOCTYPE_HTML + "", new ArrayList<>(), url); final WebRequest wrs = page.getWebResponse().getWebRequest(); assertEquals("http://host/x+y%C3%A9/a%C3%A9%20b?c%20%C3%A9%20d", wrs.getUrl()); } @@ -1567,7 +1585,7 @@ public void urlEncoding2() throws Exception { @Test public void plusNotEncodedInUrl() throws Exception { final URL url = new URL("http://host/search/my+category/"); - final HtmlPage page = loadPage("", new ArrayList<>(), url); + final HtmlPage page = loadPage(DOCTYPE_HTML + "", new ArrayList<>(), url); final WebRequest wrs = page.getWebResponse().getWebRequest(); assertEquals("http://host/search/my+category/", wrs.getUrl()); } @@ -1581,8 +1599,8 @@ public void cssEnablementControlsCssLoading() throws Exception { final MockWebConnection conn = new MockWebConnection(); client.setWebConnection(conn); - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + " \n" @@ -1619,7 +1637,7 @@ public void cssEnablementControlsCssLoading() throws Exception { public void getPageDataProtocol() throws Exception { final WebClient webClient = getWebClient(); - final String html = "DataUrl Test"; + final String html = DOCTYPE_HTML + "DataUrl Test"; final Page page = webClient.getPage("data:text/html;charset=utf-8," + html); assertEquals("DataUrl Test", ((HtmlPage) page).asNormalizedText()); @@ -1632,7 +1650,8 @@ public void getPageDataProtocol() throws Exception { public void getPageJavascriptProtocol() throws Exception { final WebClient webClient = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); - webConnection.setDefaultResponse("Hello World"); + webConnection.setDefaultResponse(DOCTYPE_HTML + + "Hello World"); webClient.setWebConnection(webConnection); final List collectedAlerts = new ArrayList<>(); @@ -1686,7 +1705,7 @@ public void javaScriptTimeout() throws Exception { try { client.getOptions().setThrowExceptionOnScriptError(false); - final String content = ""; + final String content = DOCTYPE_HTML + ""; final MockWebConnection webConnection = new MockWebConnection(); webConnection.setDefaultResponse(content); client.setWebConnection(webConnection); @@ -1737,7 +1756,7 @@ public void openWindowWithNullUrl() throws Exception { public void basicWindowTracking() throws Exception { // Create mock web connection. final MockWebConnection conn = new MockWebConnection(); - conn.setDefaultResponse("First\n" + "
\n" + "\n" + "
"; conn.setResponse(URL_FIRST, html1); - final String html2 = "Second\n" + final String html2 = DOCTYPE_HTML + + "Second\n" + "\n" + ""; @@ -1853,13 +1876,15 @@ public void windowTracking_SpecialCase3() throws Exception { final List collectedAlerts = new ArrayList<>(); webClient.setAlertHandler(new CollectingAlertHandler(collectedAlerts)); - final String html1 = "First\n" + final String html1 = DOCTYPE_HTML + + "First\n" + "\n" + "\n" + ""; conn.setResponse(URL_FIRST, html1); - final String html2 = "Second\n" + final String html2 = DOCTYPE_HTML + + "Second\n" + "\n" + "
\n" + "
\n" @@ -1874,7 +1899,8 @@ public void windowTracking_SpecialCase3() throws Exception { + ""; conn.setResponse(URL_SECOND, html2); - final String html3 = "Third\n" + final String html3 = DOCTYPE_HTML + + "Third\n" + "\n" + "\n" @@ -2052,12 +2081,13 @@ public void currentWindow() throws Exception { final WebClient client = getWebClient(); final MockWebConnection conn = new MockWebConnection(); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; conn.setResponse(URL_FIRST, html); final URL frameUrl = new URL(URL_FIRST, "frame.html"); - conn.setResponse(frameUrl, ""); - conn.setResponse(URL_SECOND, ""); + conn.setResponse(frameUrl, DOCTYPE_HTML + ""); + conn.setResponse(URL_SECOND, DOCTYPE_HTML + ""); client.setWebConnection(conn); client.getPage(URL_FIRST); @@ -2076,7 +2106,8 @@ public void currentWindow() throws Exception { */ @Test public void currentWindow2() throws Exception { - final String html = "\n" + ""; - final String html2 = "\n" @@ -2272,7 +2306,8 @@ public void close() throws Exception { */ @Test public void test() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -2376,7 +2411,8 @@ public void webSocketDisabled() throws Exception { */ @Test public void loadHtmlCodeIntoCurrentWindow() throws Exception { - final String htmlCode = "" + final String htmlCode = DOCTYPE_HTML + + "" + " " + " Title" + " " @@ -2416,11 +2452,13 @@ public void loadXHtmlCodeIntoCurrentWindow() throws Exception { */ @Test public void reset() throws Exception { - final String html = "testpage\n" + final String html = DOCTYPE_HTML + + "testpage\n" + "\n" + ""; - final String html2 = "testpage\n" + final String html2 = DOCTYPE_HTML + + "testpage\n" + "\n" + "\n" + ""; @@ -2481,8 +2519,7 @@ public void reset() throws Exception { */ @Test public void loginFlowClickSubmitRedirect() throws Exception { - final String startPage = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String startPage = DOCTYPE_HTML + "Start page" + "
" + " " @@ -2492,8 +2529,7 @@ public void loginFlowClickSubmitRedirect() throws Exception { int reqCount = getMockWebConnection().getRequestCount(); - final String submitPage = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String submitPage = DOCTYPE_HTML + "Submit page" + "" + "" @@ -2508,8 +2544,7 @@ public void loginFlowClickSubmitRedirect() throws Exception { final URL urlRedirectPage = new URL(URL_FIRST, "redirect.html"); getMockWebConnection().setResponse(urlRedirectPage, "", 302, "Found", null, headers); - final String landingPage = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String landingPage = DOCTYPE_HTML + "Landing page" + ""; final URL urlLandingPage = new URL(URL_FIRST, "landing.html"); @@ -2543,7 +2578,8 @@ public void loginFlowClickSubmitRedirect() throws Exception { */ @Test public void getPageInSeparateThread() throws Exception { - final String html = "testpage\n" + final String html = DOCTYPE_HTML + + "testpage\n" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/WebClientWaitForBackgroundJobsTest.java b/src/test/java/org/htmlunit/WebClientWaitForBackgroundJobsTest.java index 81e79ea3a8e..5406e14d3e6 100644 --- a/src/test/java/org/htmlunit/WebClientWaitForBackgroundJobsTest.java +++ b/src/test/java/org/htmlunit/WebClientWaitForBackgroundJobsTest.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,7 +25,7 @@ import org.htmlunit.html.HtmlPage; import org.htmlunit.javascript.background.JavaScriptJobManager; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Tries; +import org.htmlunit.junit.annotation.Tries; import org.junit.Test; import org.junit.runner.RunWith; @@ -59,7 +59,8 @@ private void assertMaxTestRunTime(final long maxRunTimeMilliseconds) { */ @Test public void dontWaitWhenUnnecessary() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + " test\n" + " \n" + ""; - final String page3 = ""; diff --git a/src/test/java/org/htmlunit/WebDriverTestCase.java b/src/test/java/org/htmlunit/WebDriverTestCase.java index e1c2e2f09a6..c22fb1e0d98 100644 --- a/src/test/java/org/htmlunit/WebDriverTestCase.java +++ b/src/test/java/org/htmlunit/WebDriverTestCase.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,7 +16,6 @@ import static java.nio.charset.StandardCharsets.ISO_8859_1; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.junit.Assert.fail; import java.io.File; import java.io.FileInputStream; @@ -24,6 +23,7 @@ import java.net.URISyntaxException; import java.net.URL; import java.nio.charset.Charset; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -67,7 +67,6 @@ import org.eclipse.jetty.webapp.WebAppContext; import org.htmlunit.MockWebConnection.RawResponseData; import org.htmlunit.html.HtmlElement; -import org.htmlunit.html.HtmlPageTest; import org.htmlunit.javascript.JavaScriptEngine; import org.htmlunit.util.NameValuePair; import org.junit.After; @@ -90,7 +89,7 @@ import org.openqa.selenium.chrome.ChromeDriverService; import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.devtools.DevTools; -import org.openqa.selenium.devtools.v85.emulation.Emulation; +import org.openqa.selenium.devtools.v135.emulation.Emulation; import org.openqa.selenium.edge.EdgeDriver; import org.openqa.selenium.edge.EdgeDriverService; import org.openqa.selenium.edge.EdgeOptions; @@ -145,11 +144,33 @@ */ public abstract class WebDriverTestCase extends WebTestCase { + private static final String LOG_EX_FUNCTION = + " function logEx(e) {\n" + + " let toStr = null;\n" + + " if (toStr === null && e instanceof EvalError) { toStr = ''; }\n" + + " if (toStr === null && e instanceof RangeError) { toStr = ''; }\n" + + " if (toStr === null && e instanceof ReferenceError) { toStr = ''; }\n" + + " if (toStr === null && e instanceof SyntaxError) { toStr = ''; }\n" + + " if (toStr === null && e instanceof TypeError) { toStr = ''; }\n" + + " if (toStr === null && e instanceof URIError) { toStr = ''; }\n" + + " if (toStr === null && e instanceof AggregateError) { toStr = '/AggregateError'; }\n" + + " if (toStr === null && typeof InternalError == 'function' " + + "&& e instanceof InternalError) { toStr = '/InternalError'; }\n" + + " if (toStr === null) {\n" + + " let rx = /\\[object (.*)\\]/;\n" + + " toStr = Object.prototype.toString.call(e);\n" + + " let match = rx.exec(toStr);\n" + + " if (match != null) { toStr = '/' + match[1]; }\n" + + " }" + + " log(e.name + toStr);\n" + + "}\n"; + /** * Function used in many tests. */ public static final String LOG_TITLE_FUNCTION = - " function log(msg) { window.document.title += msg + '\\u00a7'; }\n"; + " function log(msg) { window.document.title += msg + '\\u00a7'; }\n" + + LOG_EX_FUNCTION; /** * Function used in many tests. @@ -162,13 +183,17 @@ public abstract class WebDriverTestCase extends WebTestCase { + "msg = msg.replace(/\\r/g, '\\\\r'); " + "msg = msg.replace(/\\t/g, '\\\\t'); " + "msg = msg.replace(/\\u001e/g, '\\\\u001e'); " - + "window.document.title += msg + '\u00A7';}\n"; + + "window.document.title += msg + '\u00A7';}\n" + + + LOG_EX_FUNCTION; /** * Function used in many tests. */ public static final String LOG_WINDOW_NAME_FUNCTION = - " function log(msg) { window.top.name += msg + '\\u00a7'; }\n window.top.name = '';"; + " function log(msg) { window.top.name += msg + '\\u00a7'; }\n" + + " window.top.name = '';" + + LOG_EX_FUNCTION; /** * Function used in many tests. @@ -182,7 +207,8 @@ public abstract class WebDriverTestCase extends WebTestCase { * Function used in many tests. */ public static final String LOG_TEXTAREA_FUNCTION = " function log(msg) { " - + "document.getElementById('myLog').value += msg + '\u00A7';}\n"; + + "document.getElementById('myLog').value += msg + '\u00A7';}\n" + + LOG_EX_FUNCTION; /** * HtmlSniped to insert text area used for logging. @@ -241,7 +267,6 @@ public abstract class WebDriverTestCase extends WebTestCase { private static final Executor EXECUTOR_POOL = Executors.newFixedThreadPool(4); private boolean useRealBrowser_; - private Boolean useStandards_; /** * The HtmlUnitDriver. @@ -256,6 +281,9 @@ protected boolean needThreeConnections() { return false; } + /** + * @return the browser properties (and initializes them lazy) + */ public static Set getBrowsersProperties() { if (BROWSERS_PROPERTIES_ == null) { try { @@ -477,14 +505,6 @@ public void setUseRealBrowser(final boolean useRealBrowser) { useRealBrowser_ = useRealBrowser; } - /** - * Sets whether to use {@code Standards Mode} or not. - * @param useStandards whether to use {@code Standards Mode} or not - */ - public void setUseStandards(final boolean useStandards) { - useStandards_ = useStandards; - } - /** * Builds a new WebDriver instance. * @return the instance @@ -506,7 +526,7 @@ protected WebDriver buildWebDriver() throws IOException { final EdgeOptions options = new EdgeOptions(); // BiDi - options.setCapability("webSocketUrl", true); + // options.setCapability("webSocketUrl", true); options.addArguments("--lang=" + locale); options.addArguments("--remote-allow-origins=*"); @@ -542,7 +562,7 @@ protected WebDriver buildWebDriver() throws IOException { final ChromeOptions options = new ChromeOptions(); // BiDi - options.setCapability("webSocketUrl", true); + // options.setCapability("webSocketUrl", true); options.addArguments("--lang=" + locale); options.addArguments("--remote-allow-origins=*"); @@ -597,7 +617,7 @@ private FirefoxDriver createFirefoxDriver(final String geckodriverBinary, final final FirefoxOptions options = new FirefoxOptions(); // BiDi - options.setCapability("webSocketUrl", true); + // options.setCapability("webSocketUrl", true); options.setBinary(binary); @@ -614,16 +634,6 @@ private FirefoxDriver createFirefoxDriver(final String geckodriverBinary, final return new FirefoxDriver(service, options); } - private static String getBrowserName(final BrowserVersion browserVersion) { - if (browserVersion == BrowserVersion.FIREFOX) { - return browserVersion.getNickname() + '-' + browserVersion.getBrowserVersionNumeric(); - } - if (browserVersion == BrowserVersion.FIREFOX_ESR) { - return browserVersion.getNickname() + '-' + browserVersion.getBrowserVersionNumeric(); - } - return browserVersion.getNickname(); - } - /** * Starts the web server delivering response from the provided connection. * @param mockConnection the sources for responses @@ -951,18 +961,9 @@ protected final WebDriver loadPage2(final String html, final URL url, * @return the web driver * @throws Exception if something goes wrong */ - protected final WebDriver loadPage2(String html, final URL url, + protected final WebDriver loadPage2(final String html, final URL url, final String contentType, final Charset charset, final Charset serverCharset) throws Exception { - if (useStandards_ != null) { - if (html.startsWith(HtmlPageTest.STANDARDS_MODE_PREFIX_)) { - fail("HTML must not be prefixed with Standards Mode."); - } - if (useStandards_) { - html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + html; - } - } getMockWebConnection().setResponse(url, html, contentType, charset); - return loadPage2(url, serverCharset); } @@ -1095,20 +1096,30 @@ protected final WebDriver loadPageVerifyTitle2(final String html, final String.. return verifyTitle2(driver, expectedAlerts); } - protected final WebDriver verifyTitle2(final long maxWaitTime, final WebDriver driver, + protected final WebDriver verifyTitle2(final Duration maxWaitTime, final WebDriver driver, final String... expectedAlerts) throws Exception { - final long maxWait = System.currentTimeMillis() + maxWaitTime; + + final StringBuilder expected = new StringBuilder(); + for (int i = 0; i < expectedAlerts.length; i++) { + expected.append(expectedAlerts[i]).append('\u00A7'); + } + final String expectedTitle = expected.toString(); + + final long maxWait = System.currentTimeMillis() + maxWaitTime.toMillis(); while (System.currentTimeMillis() < maxWait) { try { - return verifyTitle2(driver, expectedAlerts); + final String title = driver.getTitle(); + assertEquals(expectedTitle, title); + return driver; } catch (final AssertionError e) { // ignore and wait } } - return verifyTitle2(driver, expectedAlerts); + assertEquals(expectedTitle, driver.getTitle()); + return driver; } protected final WebDriver verifyTitle2(final WebDriver driver, @@ -1152,14 +1163,14 @@ protected final WebDriver verifyTextArea2(final WebDriver driver, final WebElement textArea = driver.findElement(By.id("myLog")); if (expectedAlerts.length == 0) { - assertEquals("", textArea.getAttribute("value")); + assertEquals("", textArea.getDomProperty("value")); return driver; } if (!useRealBrowser() && expectedAlerts.length == 1 && expectedAlerts[0].startsWith("data:image/png;base64,")) { - String value = textArea.getAttribute("value"); + String value = textArea.getDomProperty("value"); if (value.endsWith("\u00A7")) { value = value.substring(0, value.length() - 1); } @@ -1171,7 +1182,7 @@ protected final WebDriver verifyTextArea2(final WebDriver driver, for (int i = 0; i < expectedAlerts.length; i++) { expected.append(expectedAlerts[i]).append('\u00A7'); } - verify(() -> textArea.getAttribute("value"), expected.toString()); + verify(() -> textArea.getDomProperty("value"), expected.toString()); return driver; } @@ -1191,9 +1202,9 @@ protected final WebDriver verifyJsVariable(final WebDriver driver, final String return driver; } - protected final WebDriver verifyWindowName2(final long maxWaitTime, final WebDriver driver, + protected final WebDriver verifyWindowName2(final Duration maxWaitTime, final WebDriver driver, final String... expectedAlerts) throws Exception { - final long maxWait = System.currentTimeMillis() + maxWaitTime; + final long maxWait = System.currentTimeMillis() + maxWaitTime.toMillis(); while (System.currentTimeMillis() < maxWait) { try { @@ -1236,7 +1247,7 @@ protected final WebDriver verifySessionStorage2(final WebDriver driver, * @return the web driver * @throws Exception if something goes wrong */ - protected final WebDriver loadPageWithAlerts2(final String html, final long maxWaitTime) throws Exception { + protected final WebDriver loadPageWithAlerts2(final String html, final Duration maxWaitTime) throws Exception { return loadPageWithAlerts2(html, URL_FIRST, maxWaitTime); } @@ -1259,7 +1270,7 @@ protected final WebDriver loadPageWithAlerts2(final String html, final URL url) * @return the web driver * @throws Exception if something goes wrong */ - protected final WebDriver loadPageWithAlerts2(final String html, final URL url, final long maxWaitTime) + protected final WebDriver loadPageWithAlerts2(final String html, final URL url, final Duration maxWaitTime) throws Exception { final WebDriver driver = loadPage2(html, url); @@ -1285,7 +1296,7 @@ protected void verifyAlerts(final WebDriver driver, final String... expectedAler * @param expected the expected alerts * @throws Exception in case of failure */ - protected void verifyAlerts(final long maxWaitTime, final WebDriver driver, final String... expected) + protected void verifyAlerts(final Duration maxWaitTime, final WebDriver driver, final String... expected) throws Exception { final List actualAlerts = getCollectedAlerts(maxWaitTime, driver, expected.length); @@ -1333,7 +1344,7 @@ protected final WebDriver loadPageWithAlerts2(final String html, * @return the web driver * @throws Exception if something goes wrong */ - protected final WebDriver loadPageWithAlerts2(final String html, final URL url, final long maxWaitTime, + protected final WebDriver loadPageWithAlerts2(final String html, final URL url, final Duration maxWaitTime, final Map> servlets) throws Exception { expandExpectedAlertsVariables(URL_FIRST); @@ -1362,7 +1373,7 @@ protected final WebDriver loadPageWithAlerts2(final URL url) throws Exception { * @return the web driver * @throws Exception if something goes wrong */ - protected final WebDriver loadPageWithAlerts2(final URL url, final long maxWaitTime) throws Exception { + protected final WebDriver loadPageWithAlerts2(final URL url, final Duration maxWaitTime) throws Exception { startWebServer(getMockWebConnection(), null); final WebDriver driver = getWebDriver(); @@ -1404,11 +1415,11 @@ protected List getCollectedAlerts(final WebDriver driver, final int aler * @return the collected alerts * @throws Exception in case of problem */ - protected List getCollectedAlerts(final long maxWaitTime, final WebDriver driver, final int alertsLength) - throws Exception { + protected List getCollectedAlerts(final Duration maxWaitTime, + final WebDriver driver, final int alertsLength) throws Exception { final List collectedAlerts = new ArrayList<>(); - long maxWait = System.currentTimeMillis() + maxWaitTime; + long maxWait = System.currentTimeMillis() + maxWaitTime.toMillis(); while (collectedAlerts.size() < alertsLength && System.currentTimeMillis() < maxWait) { try { @@ -1558,7 +1569,7 @@ public void beforeTest() throws InterruptedException { * @throws Exception in case of failure */ protected void assertTitle(final WebDriver webdriver, final String expected) throws Exception { - final long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME; + final long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME.toMillis(); while (true) { final String title = webdriver.getTitle(); diff --git a/src/test/java/org/htmlunit/WebRequest2Test.java b/src/test/java/org/htmlunit/WebRequest2Test.java index 6a776fc3dc3..e83cd11acea 100644 --- a/src/test/java/org/htmlunit/WebRequest2Test.java +++ b/src/test/java/org/htmlunit/WebRequest2Test.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. @@ -186,6 +186,9 @@ public void getParametersFromQueryAndUrlEncodedBodyPost() throws Exception { assertEquals("d", parameters.get(1).getValue()); } + /** + * @throws Exception if the test fails + */ @Test public void getParametersFromQueryAndUrlEncodedBodyPostWhenEncodingTypeIsMultipart() throws Exception { final URL url = new URL(URL_FIRST, "?a=b"); @@ -206,6 +209,9 @@ public void getParametersFromQueryAndUrlEncodedBodyPostWhenEncodingTypeIsMultipa assertEquals("d", parameters.get(1).getValue()); } + /** + * @throws Exception if the test fails + */ @Test public void getParametersUrlEncodedPostNoBody() throws Exception { final URL url = new URL(URL_FIRST, "?a=b"); @@ -223,6 +229,9 @@ public void getParametersUrlEncodedPostNoBody() throws Exception { assertEquals("b", parameters.get(0).getValue()); } + /** + * @throws Exception if the test fails + */ @Test public void getParametersTextEncodedPostNoBody() throws Exception { final URL url = new URL(URL_FIRST, "?a=b"); @@ -240,6 +249,9 @@ public void getParametersTextEncodedPostNoBody() throws Exception { assertEquals("b", parameters.get(0).getValue()); } + /** + * @throws Exception if the test fails + */ @Test public void getParametersTextEncodedPostBody() throws Exception { final URL url = new URL(URL_FIRST, "?a=b"); diff --git a/src/test/java/org/htmlunit/WebRequestTest.java b/src/test/java/org/htmlunit/WebRequestTest.java index ac07ae40c53..ec9d572e1e1 100644 --- a/src/test/java/org/htmlunit/WebRequestTest.java +++ b/src/test/java/org/htmlunit/WebRequestTest.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/test/java/org/htmlunit/WebResponse2Test.java b/src/test/java/org/htmlunit/WebResponse2Test.java index 79f6c434fe4..ecc87406cef 100644 --- a/src/test/java/org/htmlunit/WebResponse2Test.java +++ b/src/test/java/org/htmlunit/WebResponse2Test.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. @@ -42,13 +42,13 @@ public class WebResponse2Test extends SimpleWebTestCase { */ @Test public void charsetInMetaTag() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "foo\n" + ""; final HtmlPage page = loadPage(html); - assertSame(UTF_8, page.getWebResponse().getContentCharsetOrNull()); + assertSame(UTF_8, page.getWebResponse().getContentCharset()); assertEquals(html, page.getWebResponse().getContentAsString()); } diff --git a/src/test/java/org/htmlunit/WebResponseData2Test.java b/src/test/java/org/htmlunit/WebResponseData2Test.java index ba2687af019..00dca7c4bda 100644 --- a/src/test/java/org/htmlunit/WebResponseData2Test.java +++ b/src/test/java/org/htmlunit/WebResponseData2Test.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/test/java/org/htmlunit/WebResponseDataTest.java b/src/test/java/org/htmlunit/WebResponseDataTest.java index 5b082206cae..1e3c7993252 100644 --- a/src/test/java/org/htmlunit/WebResponseDataTest.java +++ b/src/test/java/org/htmlunit/WebResponseDataTest.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/test/java/org/htmlunit/WebResponseTest.java b/src/test/java/org/htmlunit/WebResponseTest.java index 276be329ecb..c0db0a16024 100644 --- a/src/test/java/org/htmlunit/WebResponseTest.java +++ b/src/test/java/org/htmlunit/WebResponseTest.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. @@ -59,8 +59,8 @@ public class WebResponseTest extends WebServerTestCase { @Test public void encodingCharsetUtf8() throws Exception { final String title = "\u6211\u662F\u6211\u7684FOCUS"; - final String content = - "\n" + final String content = DOCTYPE_HTML + + "\n" + "" + title + "\n" + "\n" + "\n" @@ -178,7 +178,8 @@ public void getContentAsStringIllegalCharset() throws Exception { * Servlet for {@link #binaryResponseHeaders()}. */ public static class BinaryResponseHeadersServlet extends HttpServlet { - private static final String RESPONSE = "FooThis is foo!"; + private static final String RESPONSE = DOCTYPE_HTML + + "FooThis is foo!"; /** * {@inheritDoc} @@ -218,7 +219,7 @@ public void binaryResponseHeaders() throws Exception { page.getWebResponse().getContentAsString(UTF_8)); assertEquals("gzip", page.getWebResponse().getResponseHeaderValue("Content-Encoding")); - assertEquals("73", page.getWebResponse().getResponseHeaderValue(HttpHeader.CONTENT_LENGTH)); + assertEquals("85", page.getWebResponse().getResponseHeaderValue(HttpHeader.CONTENT_LENGTH)); } /** diff --git a/src/test/java/org/htmlunit/WebServerTestCase.java b/src/test/java/org/htmlunit/WebServerTestCase.java index 86721dab290..70f36b0efda 100644 --- a/src/test/java/org/htmlunit/WebServerTestCase.java +++ b/src/test/java/org/htmlunit/WebServerTestCase.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. @@ -20,6 +20,7 @@ import java.net.BindException; import java.net.URL; import java.nio.charset.Charset; +import java.time.Duration; import java.util.List; import java.util.Map; @@ -256,7 +257,7 @@ public void tearDown() throws Exception { */ protected final HtmlPage loadPageWithAlerts(final String html, final URL url) throws Exception { - return loadPageWithAlerts(html, url, 0); + return loadPageWithAlerts(html, url, Duration.ofSeconds(0)); } /** @@ -267,7 +268,7 @@ protected final HtmlPage loadPageWithAlerts(final String html, final URL url) * @return the page * @throws Exception if something goes wrong */ - protected final HtmlPage loadPageWithAlerts(final String html, final URL url, final long maxWaitTime) + protected final HtmlPage loadPageWithAlerts(final String html, final URL url, final Duration maxWaitTime) throws Exception { alertHandler_.clear(); expandExpectedAlertsVariables(URL_FIRST); @@ -276,7 +277,7 @@ protected final HtmlPage loadPageWithAlerts(final String html, final URL url, fi final HtmlPage page = loadPage(html, url); List actualAlerts = getCollectedAlerts(page); - final long maxWait = System.currentTimeMillis() + maxWaitTime; + final long maxWait = System.currentTimeMillis() + maxWaitTime.toMillis(); while (actualAlerts.size() < expectedAlerts.length && System.currentTimeMillis() < maxWait) { Thread.sleep(30); actualAlerts = getCollectedAlerts(page); @@ -493,7 +494,7 @@ protected SslConnectionFactory getSslConnectionFactory() { * Returns the WebClient instance for the current test with the current {@link BrowserVersion}. * @return a WebClient with the current {@link BrowserVersion} */ - protected final WebClient getWebClient() { + protected WebClient getWebClient() { if (webClient_ == null) { webClient_ = new WebClient(getBrowserVersion()); webClient_.setAlertHandler(alertHandler_); diff --git a/src/test/java/org/htmlunit/WebTestCase.java b/src/test/java/org/htmlunit/WebTestCase.java index c1cb0b1fa47..356a6606118 100644 --- a/src/test/java/org/htmlunit/WebTestCase.java +++ b/src/test/java/org/htmlunit/WebTestCase.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. @@ -27,8 +27,10 @@ import java.net.URL; import java.nio.file.Files; import java.nio.file.Paths; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; +import java.util.Base64; import java.util.List; import java.util.Locale; import java.util.Objects; @@ -36,7 +38,6 @@ import javax.imageio.ImageIO; -import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.SerializationUtils; import org.htmlunit.junit.RetryRule; @@ -67,6 +68,9 @@ */ public abstract class WebTestCase { + /** The html5 doctype. */ + public static final String DOCTYPE_HTML = "\n"; + /** * Make the test method name available to the tests. */ @@ -79,9 +83,7 @@ public abstract class WebTestCase { @Rule public final RetryRule retryRule_ = new RetryRule(4); - - - /** Logging support. */ + // /** Logging support. */ // private static final Log LOG = LogFactory.getLog(WebTestCase.class); /** save the environment */ @@ -114,7 +116,7 @@ public abstract class WebTestCase { public static final String SOCKS_PROXY_HOST = System.getProperty("htmlunit.test.socksproxy.host", "localhost"); /** The default time used to wait for the expected alerts. */ - protected static final long DEFAULT_WAIT_TIME = 1000; + protected static final Duration DEFAULT_WAIT_TIME = Duration.ofSeconds(1); /** Constant for the URL which is used in the tests. */ public static final URL URL_FIRST; @@ -484,8 +486,8 @@ protected void verify(final Supplier func, final String expected) throws * @throws Exception in case of failure */ protected void verify(final Supplier func, final String expected, - final long maxWaitTime) throws Exception { - final long maxWait = System.currentTimeMillis() + maxWaitTime; + final Duration maxWaitTime) throws Exception { + final long maxWait = System.currentTimeMillis() + maxWaitTime.toMillis(); String actual = null; while (System.currentTimeMillis() < maxWait) { @@ -553,7 +555,7 @@ protected String getFileContent(final String fileName) throws IOException { protected void compareImages(final String expected, final String current) throws IOException { final String currentBase64Image = current.split(",")[1]; - final byte[] currentImageBytes = Base64.decodeBase64(currentBase64Image); + final byte[] currentImageBytes = Base64.getDecoder().decode(currentBase64Image); try (ByteArrayInputStream currentBis = new ByteArrayInputStream(currentImageBytes)) { final BufferedImage currentImage = ImageIO.read(currentBis); @@ -565,7 +567,7 @@ protected void compareImages(final String expected, final String current) throws protected void compareImages(final String expected, final String current, final BufferedImage currentImage) throws IOException { final String expectedBase64Image = expected.split(",")[1]; - final byte[] expectedImageBytes = Base64.decodeBase64(expectedBase64Image); + final byte[] expectedImageBytes = Base64.getDecoder().decode(expectedBase64Image); try (ByteArrayInputStream expectedBis = new ByteArrayInputStream(expectedImageBytes)) { final BufferedImage expectedImage = ImageIO.read(expectedBis); diff --git a/src/test/java/org/htmlunit/WebWindowListenerTest.java b/src/test/java/org/htmlunit/WebWindowListenerTest.java index 72c8b61350a..ca46007d2f2 100644 --- a/src/test/java/org/htmlunit/WebWindowListenerTest.java +++ b/src/test/java/org/htmlunit/WebWindowListenerTest.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,9 +14,11 @@ */ package org.htmlunit; +import org.apache.commons.lang3.StringUtils; import org.htmlunit.html.HtmlPage; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.NotYetImplemented; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; @@ -34,10 +36,19 @@ public class WebWindowListenerTest extends SimpleWebTestCase { * @throws Exception if the test fails */ @Test - @NotYetImplemented + @Alerts("changed '(null)' - 'Test 1 [org.htmlunit.TopLevelWindow]'; " + + "changed 'Test 1 [org.htmlunit.TopLevelWindow]' - 'Test 2 [org.htmlunit.TopLevelWindow]'; ") + @HtmlUnitNYI(CHROME = "changed 'Test 1 [org.htmlunit.TopLevelWindow]' - 'Test 2 [org.htmlunit.TopLevelWindow]'; " + + "changed '(null)' - 'Test 1 [org.htmlunit.TopLevelWindow]'; ", + EDGE = "changed 'Test 1 [org.htmlunit.TopLevelWindow]' - 'Test 2 [org.htmlunit.TopLevelWindow]'; " + + "changed '(null)' - 'Test 1 [org.htmlunit.TopLevelWindow]'; ", + FF = "changed 'Test 1 [org.htmlunit.TopLevelWindow]' - 'Test 2 [org.htmlunit.TopLevelWindow]'; " + + "changed '(null)' - 'Test 1 [org.htmlunit.TopLevelWindow]'; ", + FF_ESR = "changed 'Test 1 [org.htmlunit.TopLevelWindow]' - 'Test 2 [org.htmlunit.TopLevelWindow]'; " + + "changed '(null)' - 'Test 1 [org.htmlunit.TopLevelWindow]'; ") public void eventOrder() throws Exception { - final String firstHtml - = "\n" + final String firstHtml = DOCTYPE_HTML + + "\n" + "Test 1\n" + "\n" + "\n" + " " + " \n"; final String workerJs = "onmessage = function(e) {\n" @@ -55,7 +56,7 @@ private void test(final String className) throws Exception { // normalize FF output + " clsName = clsName.replace('{\\n [native code]\\n}', '{ [native code] }');\n" + " workerResult += clsName;\n" - + " } catch(e) {workerResult = 'exception'}\n" + + " } catch(e) {workerResult = e.name}\n" + " postMessage(workerResult);\n" + "}\n"; @@ -69,7 +70,7 @@ private void test(final String className) throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void abstractList() throws Exception { test("AbstractList"); } @@ -78,7 +79,7 @@ public void abstractList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void abstractRange() throws Exception { test("AbstractRange"); } @@ -87,7 +88,7 @@ public void abstractRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void abstractWorker() throws Exception { test("AbstractWorker"); } @@ -98,7 +99,7 @@ public void abstractWorker() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void activeXObject() throws Exception { test("ActiveXObject"); } @@ -107,7 +108,7 @@ public void activeXObject() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ambientLightSensor() throws Exception { test("AmbientLightSensor"); } @@ -116,7 +117,7 @@ public void ambientLightSensor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ambientLightSensorReading() throws Exception { test("AmbientLightSensorReading"); } @@ -127,7 +128,7 @@ public void ambientLightSensorReading() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void analyserNode() throws Exception { test("AnalyserNode"); } @@ -136,7 +137,7 @@ public void analyserNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void angle_instanced_arrays() throws Exception { test("ANGLE_instanced_arrays"); } @@ -145,7 +146,7 @@ public void angle_instanced_arrays() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animation() throws Exception { test("Animation"); } @@ -154,7 +155,7 @@ public void animation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectReadOnly() throws Exception { test("AnimationEffectReadOnly"); } @@ -163,7 +164,7 @@ public void animationEffectReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectTiming() throws Exception { test("AnimationEffectTiming"); } @@ -172,7 +173,7 @@ public void animationEffectTiming() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectTimingProperties() throws Exception { test("AnimationEffectTimingProperties"); } @@ -181,7 +182,7 @@ public void animationEffectTimingProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectTimingReadOnly() throws Exception { test("AnimationEffectTimingReadOnly"); } @@ -190,7 +191,7 @@ public void animationEffectTimingReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEvent() throws Exception { test("AnimationEvent"); } @@ -199,7 +200,7 @@ public void animationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationPlaybackEvent() throws Exception { test("AnimationPlaybackEvent"); } @@ -208,7 +209,7 @@ public void animationPlaybackEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationPlayer() throws Exception { test("AnimationPlayer"); } @@ -217,7 +218,7 @@ public void animationPlayer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationTimeline() throws Exception { test("AnimationTimeline"); } @@ -226,7 +227,7 @@ public void animationTimeline() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void appBannerPromptResult() throws Exception { test("AppBannerPromptResult"); } @@ -237,7 +238,7 @@ public void appBannerPromptResult() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void applicationCache() throws Exception { test("ApplicationCache"); } @@ -246,7 +247,7 @@ public void applicationCache() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void applicationCacheErrorEvent() throws Exception { test("ApplicationCacheErrorEvent"); } @@ -255,7 +256,7 @@ public void applicationCacheErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void apps_mgmt() throws Exception { test("Apps.mgmt"); } @@ -297,7 +298,7 @@ public void arrayBuffer() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void arrayBufferView() throws Exception { test("ArrayBufferView"); } @@ -308,7 +309,7 @@ public void arrayBufferView() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void arrayBufferViewBase() throws Exception { test("ArrayBufferViewBase"); } @@ -317,7 +318,7 @@ public void arrayBufferViewBase() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void asyncFunction() throws Exception { test("AsyncFunction"); } @@ -337,7 +338,7 @@ public void atomics() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void attr() throws Exception { test("Attr"); } @@ -346,7 +347,7 @@ public void attr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audio() throws Exception { test("Audio"); } @@ -355,7 +356,7 @@ public void audio() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioBuffer() throws Exception { test("AudioBuffer"); } @@ -364,7 +365,7 @@ public void audioBuffer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioBufferSourceNode() throws Exception { test("AudioBufferSourceNode"); } @@ -373,7 +374,7 @@ public void audioBufferSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioChannelManager() throws Exception { test("AudioChannelManager"); } @@ -382,7 +383,7 @@ public void audioChannelManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioContext() throws Exception { test("AudioContext"); } @@ -391,7 +392,7 @@ public void audioContext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioDestinationNode() throws Exception { test("AudioDestinationNode"); } @@ -400,7 +401,7 @@ public void audioDestinationNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioListener() throws Exception { test("AudioListener"); } @@ -409,7 +410,7 @@ public void audioListener() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioNode() throws Exception { test("AudioNode"); } @@ -420,7 +421,7 @@ public void audioNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioParam() throws Exception { test("AudioParam"); } @@ -429,7 +430,7 @@ public void audioParam() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioProcessingEvent() throws Exception { test("AudioProcessingEvent"); } @@ -438,7 +439,7 @@ public void audioProcessingEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioScheduledSourceNode() throws Exception { test("AudioScheduledSourceNode"); } @@ -447,7 +448,7 @@ public void audioScheduledSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void autocompleteErrorEvent() throws Exception { test("AutocompleteErrorEvent"); } @@ -456,7 +457,7 @@ public void autocompleteErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void barProp() throws Exception { test("BarProp"); } @@ -465,7 +466,7 @@ public void barProp() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void baseAudioContext() throws Exception { test("BaseAudioContext"); } @@ -474,7 +475,7 @@ public void baseAudioContext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void batteryManager() throws Exception { test("BatteryManager"); } @@ -483,7 +484,7 @@ public void batteryManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void beforeInstallPrompt() throws Exception { test("BeforeInstallPrompt"); } @@ -492,7 +493,7 @@ public void beforeInstallPrompt() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void beforeInstallPromptEvent() throws Exception { test("BeforeInstallPromptEvent"); } @@ -503,7 +504,7 @@ public void beforeInstallPromptEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void beforeUnloadEvent() throws Exception { test("BeforeUnloadEvent"); } @@ -512,7 +513,16 @@ public void beforeUnloadEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("function BigInt() { [native code] }") + public void bigInt() throws Exception { + test("BigInt"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("ReferenceError") public void biquadFilterNode() throws Exception { test("BiquadFilterNode"); } @@ -530,7 +540,7 @@ public void blob() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void blobBuilder() throws Exception { test("BlobBuilder"); } @@ -539,7 +549,7 @@ public void blobBuilder() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void blobEvent() throws Exception { test("BlobEvent"); } @@ -548,7 +558,7 @@ public void blobEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetooth() throws Exception { test("Bluetooth"); } @@ -557,7 +567,7 @@ public void bluetooth() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothAdapter() throws Exception { test("BluetoothAdapter"); } @@ -566,7 +576,7 @@ public void bluetoothAdapter() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothAdvertisingData() throws Exception { test("BluetoothAdvertisingData"); } @@ -575,7 +585,7 @@ public void bluetoothAdvertisingData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothCharacteristicProperties() throws Exception { test("BluetoothCharacteristicProperties"); } @@ -584,7 +594,7 @@ public void bluetoothCharacteristicProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothDevice() throws Exception { test("BluetoothDevice"); } @@ -593,7 +603,7 @@ public void bluetoothDevice() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothDeviceEvent() throws Exception { test("BluetoothDeviceEvent"); } @@ -602,7 +612,7 @@ public void bluetoothDeviceEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothGATTRemoteServer() throws Exception { test("BluetoothGATTRemoteServer"); } @@ -611,7 +621,7 @@ public void bluetoothGATTRemoteServer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothGATTService() throws Exception { test("BluetoothGATTService"); } @@ -620,7 +630,7 @@ public void bluetoothGATTService() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothManager() throws Exception { test("BluetoothManager"); } @@ -629,7 +639,7 @@ public void bluetoothManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothRemoteGATTCharacteristic() throws Exception { test("BluetoothRemoteGATTCharacteristic"); } @@ -638,7 +648,7 @@ public void bluetoothRemoteGATTCharacteristic() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothRemoteGATTServer() throws Exception { test("BluetoothRemoteGATTServer"); } @@ -647,7 +657,7 @@ public void bluetoothRemoteGATTServer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothStatusChangedEvent() throws Exception { test("BluetoothStatusChangedEvent"); } @@ -656,7 +666,7 @@ public void bluetoothStatusChangedEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void body() throws Exception { test("Body"); } @@ -665,7 +675,7 @@ public void body() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void boxObject() throws Exception { test("BoxObject"); } @@ -683,7 +693,7 @@ public void broadcastChannel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void budgetService() throws Exception { test("BudgetService"); } @@ -692,7 +702,7 @@ public void budgetService() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void budgetState() throws Exception { test("BudgetState"); } @@ -701,7 +711,7 @@ public void budgetState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bufferSource() throws Exception { test("BufferSource"); } @@ -710,7 +720,7 @@ public void bufferSource() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void byteString() throws Exception { test("ByteString"); } @@ -737,7 +747,7 @@ public void cacheStorage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void callEvent() throws Exception { test("CallEvent"); } @@ -746,7 +756,7 @@ public void callEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cameraCapabilities() throws Exception { test("CameraCapabilities"); } @@ -755,7 +765,7 @@ public void cameraCapabilities() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cameraControl() throws Exception { test("CameraControl"); } @@ -764,7 +774,7 @@ public void cameraControl() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cameraManager() throws Exception { test("CameraManager"); } @@ -773,7 +783,7 @@ public void cameraManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void canvasCaptureMediaStream() throws Exception { test("CanvasCaptureMediaStream"); } @@ -782,7 +792,7 @@ public void canvasCaptureMediaStream() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void canvasCaptureMediaStreamTrack() throws Exception { test("CanvasCaptureMediaStreamTrack"); } @@ -800,7 +810,7 @@ public void canvasGradient() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void canvasImageSource() throws Exception { test("CanvasImageSource"); } @@ -820,7 +830,7 @@ public void canvasPattern() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void canvasRenderingContext2D() throws Exception { test("CanvasRenderingContext2D"); } @@ -829,7 +839,7 @@ public void canvasRenderingContext2D() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void caretPosition() throws Exception { test("CaretPosition"); } @@ -840,7 +850,7 @@ public void caretPosition() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cdataSection() throws Exception { test("CDATASection"); } @@ -851,7 +861,7 @@ public void cdataSection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void channelMergerNode() throws Exception { test("ChannelMergerNode"); } @@ -860,7 +870,7 @@ public void channelMergerNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void channelSplitterNode() throws Exception { test("ChannelSplitterNode"); } @@ -869,7 +879,7 @@ public void channelSplitterNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void characterData() throws Exception { test("CharacterData"); } @@ -880,7 +890,7 @@ public void characterData() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void characterDataImpl() throws Exception { test("CharacterDataImpl"); } @@ -889,7 +899,7 @@ public void characterDataImpl() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void childNode() throws Exception { test("ChildNode"); } @@ -898,7 +908,7 @@ public void childNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void chromeWorker() throws Exception { test("ChromeWorker"); } @@ -907,7 +917,7 @@ public void chromeWorker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void client() throws Exception { test("Client"); } @@ -918,7 +928,7 @@ public void client() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void clientRect() throws Exception { test("ClientRect"); } @@ -927,7 +937,7 @@ public void clientRect() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void clientRectList() throws Exception { test("ClientRectList"); } @@ -936,7 +946,7 @@ public void clientRectList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void clients() throws Exception { test("Clients"); } @@ -945,7 +955,7 @@ public void clients() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void clipboardData() throws Exception { test("ClipboardData"); } @@ -954,7 +964,7 @@ public void clipboardData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void clipboardEvent() throws Exception { test("ClipboardEvent"); } @@ -974,7 +984,7 @@ public void closeEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void comment() throws Exception { test("Comment"); } @@ -983,7 +993,7 @@ public void comment() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void compositionEvent() throws Exception { test("CompositionEvent"); } @@ -994,7 +1004,7 @@ public void compositionEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void computedCSSStyleDeclaration() throws Exception { test("ComputedCSSStyleDeclaration"); } @@ -1003,7 +1013,7 @@ public void computedCSSStyleDeclaration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void connection() throws Exception { test(HttpHeader.CONNECTION); } @@ -1014,7 +1024,7 @@ public void connection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void console() throws Exception { test("Console"); } @@ -1023,7 +1033,7 @@ public void console() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constantSourceNode() throws Exception { test("ConstantSourceNode"); } @@ -1032,7 +1042,7 @@ public void constantSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainBoolean() throws Exception { test("ConstrainBoolean"); } @@ -1041,7 +1051,7 @@ public void constrainBoolean() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainDOMString() throws Exception { test("ConstrainDOMString"); } @@ -1050,7 +1060,7 @@ public void constrainDOMString() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainDouble() throws Exception { test("ConstrainDouble"); } @@ -1059,7 +1069,7 @@ public void constrainDouble() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainLong() throws Exception { test("ConstrainLong"); } @@ -1068,7 +1078,7 @@ public void constrainLong() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void contactManager() throws Exception { test("ContactManager"); } @@ -1077,7 +1087,7 @@ public void contactManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void convolverNode() throws Exception { test("ConvolverNode"); } @@ -1088,7 +1098,7 @@ public void convolverNode() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void coordinates() throws Exception { test("Coordinates"); } @@ -1097,7 +1107,7 @@ public void coordinates() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void credential() throws Exception { test("Credential"); } @@ -1106,7 +1116,7 @@ public void credential() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void credentialsContainer() throws Exception { test("CredentialsContainer"); } @@ -1133,7 +1143,7 @@ public void cryptoKey() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void css() throws Exception { test("CSS"); } @@ -1144,7 +1154,7 @@ public void css() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void css2Properties() throws Exception { test("CSS2Properties"); } @@ -1155,7 +1165,7 @@ public void css2Properties() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssPageDescriptors() throws Exception { test("CSSPageDescriptors"); } @@ -1164,7 +1174,7 @@ public void cssPageDescriptors() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssCharsetRule() throws Exception { test("CSSCharsetRule"); } @@ -1173,7 +1183,7 @@ public void cssCharsetRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssConditionRule() throws Exception { test("CSSConditionRule"); } @@ -1182,7 +1192,7 @@ public void cssConditionRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssCounterStyleRule() throws Exception { test("CSSCounterStyleRule"); } @@ -1193,7 +1203,7 @@ public void cssCounterStyleRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssFontFaceRule() throws Exception { test("CSSFontFaceRule"); } @@ -1202,7 +1212,7 @@ public void cssFontFaceRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssGroupingRule() throws Exception { test("CSSGroupingRule"); } @@ -1213,7 +1223,7 @@ public void cssGroupingRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssImportRule() throws Exception { test("CSSImportRule"); } @@ -1222,7 +1232,7 @@ public void cssImportRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssKeyframeRule() throws Exception { test("CSSKeyframeRule"); } @@ -1231,7 +1241,7 @@ public void cssKeyframeRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssKeyframesRule() throws Exception { test("CSSKeyframesRule"); } @@ -1240,7 +1250,7 @@ public void cssKeyframesRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssMatrix() throws Exception { test("CSSMatrix"); } @@ -1251,7 +1261,7 @@ public void cssMatrix() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssMediaRule() throws Exception { test("CSSMediaRule"); } @@ -1260,7 +1270,7 @@ public void cssMediaRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssNamespaceRule() throws Exception { test("CSSNamespaceRule"); } @@ -1269,7 +1279,7 @@ public void cssNamespaceRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssPageRule() throws Exception { test("CSSPageRule"); } @@ -1280,7 +1290,7 @@ public void cssPageRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssPrimitiveValue() throws Exception { test("CSSPrimitiveValue"); } @@ -1291,7 +1301,7 @@ public void cssPrimitiveValue() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssRule() throws Exception { test("CSSRule"); } @@ -1302,7 +1312,7 @@ public void cssRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssRuleList() throws Exception { test("CSSRuleList"); } @@ -1313,7 +1323,7 @@ public void cssRuleList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssStyleDeclaration() throws Exception { test("CSSStyleDeclaration"); } @@ -1324,7 +1334,7 @@ public void cssStyleDeclaration() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssStyleRule() throws Exception { test("CSSStyleRule"); } @@ -1335,7 +1345,7 @@ public void cssStyleRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssStyleSheet() throws Exception { test("CSSStyleSheet"); } @@ -1344,7 +1354,7 @@ public void cssStyleSheet() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssSupportsRule() throws Exception { test("CSSSupportsRule"); } @@ -1353,7 +1363,7 @@ public void cssSupportsRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssUnknownRule() throws Exception { test("CSSUnknownRule"); } @@ -1364,7 +1374,7 @@ public void cssUnknownRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssValue() throws Exception { test("CSSValue"); } @@ -1373,7 +1383,7 @@ public void cssValue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssValueList() throws Exception { test("CSSValueList"); } @@ -1382,7 +1392,7 @@ public void cssValueList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssViewportRule() throws Exception { test("CSSViewportRule"); } @@ -1391,7 +1401,7 @@ public void cssViewportRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void customElementRegistry() throws Exception { test("CustomElementRegistry"); } @@ -1409,7 +1419,7 @@ public void customEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStore() throws Exception { test("DataStore"); } @@ -1418,7 +1428,7 @@ public void dataStore() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStoreChangeEvent() throws Exception { test("DataStoreChangeEvent"); } @@ -1427,7 +1437,7 @@ public void dataStoreChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStoreCursor() throws Exception { test("DataStoreCursor"); } @@ -1436,7 +1446,7 @@ public void dataStoreCursor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStoreTask() throws Exception { test("DataStoreTask"); } @@ -1445,7 +1455,7 @@ public void dataStoreTask() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataTransfer() throws Exception { test("DataTransfer"); } @@ -1454,7 +1464,7 @@ public void dataTransfer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataTransferItem() throws Exception { test("DataTransferItem"); } @@ -1463,7 +1473,7 @@ public void dataTransferItem() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataTransferItemList() throws Exception { test("DataTransferItemList"); } @@ -1519,7 +1529,7 @@ public void dedicatedWorkerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void delayNode() throws Exception { test("DelayNode"); } @@ -1528,7 +1538,7 @@ public void delayNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceAcceleration() throws Exception { test("DeviceAcceleration"); } @@ -1537,7 +1547,7 @@ public void deviceAcceleration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceLightEvent() throws Exception { test("DeviceLightEvent"); } @@ -1546,7 +1556,7 @@ public void deviceLightEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceMotionEvent() throws Exception { test("DeviceMotionEvent"); } @@ -1555,7 +1565,7 @@ public void deviceMotionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceOrientationEvent() throws Exception { test("DeviceOrientationEvent"); } @@ -1564,7 +1574,7 @@ public void deviceOrientationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceProximityEvent() throws Exception { test("DeviceProximityEvent"); } @@ -1573,7 +1583,7 @@ public void deviceProximityEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceRotationRate() throws Exception { test("DeviceRotationRate"); } @@ -1582,7 +1592,7 @@ public void deviceRotationRate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceStorage() throws Exception { test("DeviceStorage"); } @@ -1591,7 +1601,7 @@ public void deviceStorage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceStorageChangeEvent() throws Exception { test("DeviceStorageChangeEvent"); } @@ -1600,7 +1610,7 @@ public void deviceStorageChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryEntry() throws Exception { test("DirectoryEntry"); } @@ -1609,7 +1619,7 @@ public void directoryEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryEntrySync() throws Exception { test("DirectoryEntrySync"); } @@ -1618,7 +1628,7 @@ public void directoryEntrySync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryReader() throws Exception { test("DirectoryReader"); } @@ -1627,7 +1637,7 @@ public void directoryReader() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryReaderSync() throws Exception { test("DirectoryReaderSync"); } @@ -1638,7 +1648,7 @@ public void directoryReaderSync() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void document() throws Exception { test("Document"); } @@ -1649,7 +1659,7 @@ public void document() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void documentFragment() throws Exception { test("DocumentFragment"); } @@ -1658,7 +1668,7 @@ public void documentFragment() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void documentOrShadowRoot() throws Exception { test("DocumentOrShadowRoot"); } @@ -1667,7 +1677,7 @@ public void documentOrShadowRoot() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void documentTimeline() throws Exception { test("DocumentTimeline"); } @@ -1676,7 +1686,7 @@ public void documentTimeline() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void documentTouch() throws Exception { test("DocumentTouch"); } @@ -1687,7 +1697,7 @@ public void documentTouch() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void documentType() throws Exception { test("DocumentType"); } @@ -1696,7 +1706,7 @@ public void documentType() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domApplication() throws Exception { test("DOMApplication"); } @@ -1705,7 +1715,7 @@ public void domApplication() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domApplicationsManager() throws Exception { test("DOMApplicationsManager"); } @@ -1714,7 +1724,7 @@ public void domApplicationsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domApplicationsRegistry() throws Exception { test("DOMApplicationsRegistry"); } @@ -1723,7 +1733,7 @@ public void domApplicationsRegistry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domConfiguration() throws Exception { test("DOMConfiguration"); } @@ -1734,7 +1744,7 @@ public void domConfiguration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domCursor() throws Exception { test("DOMCursor"); } @@ -1743,7 +1753,7 @@ public void domCursor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domError() throws Exception { test("DOMError"); } @@ -1752,7 +1762,7 @@ public void domError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domErrorHandler() throws Exception { test("DOMErrorHandler"); } @@ -1772,7 +1782,7 @@ public void domException() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domHighResTimeStamp() throws Exception { test("DOMHighResTimeStamp"); } @@ -1783,7 +1793,7 @@ public void domHighResTimeStamp() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domImplementation() throws Exception { test("DOMImplementation"); } @@ -1792,7 +1802,7 @@ public void domImplementation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domImplementationList() throws Exception { test("DOMImplementationList"); } @@ -1801,7 +1811,7 @@ public void domImplementationList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domImplementationRegistry() throws Exception { test("DOMImplementationRegistry"); } @@ -1810,7 +1820,7 @@ public void domImplementationRegistry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domImplementationSource() throws Exception { test("DOMImplementationSource"); } @@ -1819,7 +1829,7 @@ public void domImplementationSource() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domLocator() throws Exception { test("DOMLocator"); } @@ -1846,7 +1856,7 @@ public void domMatrixReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domObject() throws Exception { test("DOMObject"); } @@ -1857,7 +1867,7 @@ public void domObject() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domParser() throws Exception { test("DOMParser"); } @@ -1895,7 +1905,7 @@ public void domRect() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domRectList() throws Exception { test("DOMRectList"); } @@ -1913,7 +1923,7 @@ public void domRectReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domRequest() throws Exception { test("DOMRequest"); } @@ -1922,7 +1932,7 @@ public void domRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domSettableTokenList() throws Exception { test("DOMSettableTokenList"); } @@ -1931,7 +1941,7 @@ public void domSettableTokenList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domString() throws Exception { test("DOMString"); } @@ -1951,7 +1961,7 @@ public void domStringList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domStringMap() throws Exception { test("DOMStringMap"); } @@ -1960,7 +1970,7 @@ public void domStringMap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domTimeStamp() throws Exception { test("DOMTimeStamp"); } @@ -1971,7 +1981,7 @@ public void domTimeStamp() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domTokenList() throws Exception { test("DOMTokenList"); } @@ -1980,7 +1990,7 @@ public void domTokenList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domUserData() throws Exception { test("DOMUserData"); } @@ -1989,7 +1999,7 @@ public void domUserData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void doubleRange() throws Exception { test("DoubleRange"); } @@ -1998,7 +2008,7 @@ public void doubleRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dragEvent() throws Exception { test("DragEvent"); } @@ -2007,7 +2017,7 @@ public void dragEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dynamicsCompressorNode() throws Exception { test("DynamicsCompressorNode"); } @@ -2018,7 +2028,7 @@ public void dynamicsCompressorNode() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void element() throws Exception { test("Element"); } @@ -2027,7 +2037,7 @@ public void element() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void elementTraversal() throws Exception { test("ElementTraversal"); } @@ -2054,7 +2064,7 @@ public void encodeURIComponent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entity() throws Exception { test("Entity"); } @@ -2063,7 +2073,7 @@ public void entity() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entityReference() throws Exception { test("EntityReference"); } @@ -2072,7 +2082,7 @@ public void entityReference() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entry() throws Exception { test("Entry"); } @@ -2081,7 +2091,7 @@ public void entry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entrySync() throws Exception { test("EntrySync"); } @@ -2092,7 +2102,7 @@ public void entrySync() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void enumerator() throws Exception { test("Enumerator"); } @@ -2157,7 +2167,7 @@ public void event() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void eventListener() throws Exception { test("EventListener"); } @@ -2166,7 +2176,7 @@ public void eventListener() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void eventNode() throws Exception { test("EventNode"); } @@ -2193,7 +2203,7 @@ public void eventTarget() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_blend_minmax() throws Exception { test("EXT_blend_minmax"); } @@ -2202,7 +2212,7 @@ public void ext_blend_minmax() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_color_buffer_float() throws Exception { test("EXT_color_buffer_float"); } @@ -2211,7 +2221,7 @@ public void ext_color_buffer_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_color_buffer_half_float() throws Exception { test("EXT_color_buffer_half_float"); } @@ -2220,7 +2230,7 @@ public void ext_color_buffer_half_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_disjoint_timer_query() throws Exception { test("EXT_disjoint_timer_query"); } @@ -2229,7 +2239,7 @@ public void ext_disjoint_timer_query() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_frag_depth() throws Exception { test("EXT_frag_depth"); } @@ -2238,7 +2248,7 @@ public void ext_frag_depth() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_shader_texture_lod() throws Exception { test("EXT_shader_texture_lod"); } @@ -2247,7 +2257,7 @@ public void ext_shader_texture_lod() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_sRGB() throws Exception { test("EXT_sRGB"); } @@ -2256,7 +2266,7 @@ public void ext_sRGB() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_texture_filter_anisotropic() throws Exception { test("EXT_texture_filter_anisotropic"); } @@ -2265,7 +2275,7 @@ public void ext_texture_filter_anisotropic() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void extendableEvent() throws Exception { test("ExtendableEvent"); } @@ -2274,7 +2284,7 @@ public void extendableEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void extendableMessageEvent() throws Exception { test("ExtendableMessageEvent"); } @@ -2285,7 +2295,7 @@ public void extendableMessageEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void external() throws Exception { test("External"); } @@ -2294,7 +2304,7 @@ public void external() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void federatedCredential() throws Exception { test("FederatedCredential"); } @@ -2303,7 +2313,7 @@ public void federatedCredential() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fetchEvent() throws Exception { test("FetchEvent"); } @@ -2321,7 +2331,7 @@ public void file() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileEntry() throws Exception { test("FileEntry"); } @@ -2330,7 +2340,7 @@ public void fileEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileEntrySync() throws Exception { test("FileEntrySync"); } @@ -2339,7 +2349,7 @@ public void fileEntrySync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileError() throws Exception { test("FileError"); } @@ -2348,7 +2358,7 @@ public void fileError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileException() throws Exception { test("FileException"); } @@ -2357,7 +2367,7 @@ public void fileException() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileHandle() throws Exception { test("FileHandle"); } @@ -2385,7 +2395,7 @@ public void fileReader() throws Exception { */ @Test @Alerts("function FileReaderSync() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception", FF = "exception", FF_ESR = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError", FF = "ReferenceError", FF_ESR = "ReferenceError") public void fileReaderSync() throws Exception { test("FileReaderSync"); } @@ -2394,7 +2404,7 @@ public void fileReaderSync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileRequest() throws Exception { test("FileRequest"); } @@ -2403,7 +2413,7 @@ public void fileRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystem() throws Exception { test("FileSystem"); } @@ -2412,7 +2422,7 @@ public void fileSystem() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemDirectoryEntry() throws Exception { test("FileSystemDirectoryEntry"); } @@ -2421,7 +2431,7 @@ public void fileSystemDirectoryEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemDirectoryReader() throws Exception { test("FileSystemDirectoryReader"); } @@ -2430,7 +2440,7 @@ public void fileSystemDirectoryReader() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemEntry() throws Exception { test("FileSystemEntry"); } @@ -2439,7 +2449,7 @@ public void fileSystemEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemFileEntry() throws Exception { test("FileSystemFileEntry"); } @@ -2448,7 +2458,7 @@ public void fileSystemFileEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemFlags() throws Exception { test("FileSystemFlags"); } @@ -2457,7 +2467,7 @@ public void fileSystemFlags() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemSync() throws Exception { test("FileSystemSync"); } @@ -2488,7 +2498,7 @@ public void float64Array() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fMRadio() throws Exception { test("FMRadio"); } @@ -2497,7 +2507,7 @@ public void fMRadio() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void focusEvent() throws Exception { test("FocusEvent"); } @@ -2515,7 +2525,7 @@ public void fontFace() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function FontFaceSet() { [native code] }", FF_ESR = "function FontFaceSet() { [native code] }") public void fontFaceSet() throws Exception { @@ -2526,7 +2536,7 @@ public void fontFaceSet() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void formChild() throws Exception { test("FormChild"); } @@ -2546,7 +2556,7 @@ public void formData() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void formField() throws Exception { test("FormField"); } @@ -2564,7 +2574,7 @@ public void function() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void gainNode() throws Exception { test("GainNode"); } @@ -2573,7 +2583,7 @@ public void gainNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void gamepad() throws Exception { test("Gamepad"); } @@ -2582,7 +2592,7 @@ public void gamepad() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void gamepadButton() throws Exception { test("GamepadButton"); } @@ -2591,7 +2601,7 @@ public void gamepadButton() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void gamepadEvent() throws Exception { test("GamepadEvent"); } @@ -2600,7 +2610,7 @@ public void gamepadEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void generator() throws Exception { test("Generator"); } @@ -2609,7 +2619,7 @@ public void generator() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void generatorFunction() throws Exception { test("GeneratorFunction"); } @@ -2620,7 +2630,7 @@ public void generatorFunction() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void geolocation() throws Exception { test("Geolocation"); } @@ -2631,7 +2641,7 @@ public void geolocation() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void geolocationCoordinates() throws Exception { test("GeolocationCoordinates"); } @@ -2642,7 +2652,7 @@ public void geolocationCoordinates() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void geolocationPosition() throws Exception { test("GeolocationPosition"); } @@ -2653,7 +2663,7 @@ public void geolocationPosition() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void geolocationPositionError() throws Exception { test("GeolocationPositionError"); } @@ -2662,7 +2672,7 @@ public void geolocationPositionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void gestureEvent() throws Exception { test("GestureEvent"); } @@ -2671,7 +2681,7 @@ public void gestureEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void globalEventHandlers() throws Exception { test("GlobalEventHandlers"); } @@ -2680,7 +2690,7 @@ public void globalEventHandlers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void globalFetch() throws Exception { test("GlobalFetch"); } @@ -2691,7 +2701,7 @@ public void globalFetch() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void hashChangeEvent() throws Exception { test("HashChangeEvent"); } @@ -2711,7 +2721,7 @@ public void headers() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void history() throws Exception { test("History"); } @@ -2720,7 +2730,7 @@ public void history() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void hMDVRDevice() throws Exception { test("HMDVRDevice"); } @@ -2731,7 +2741,7 @@ public void hMDVRDevice() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlAllCollection() throws Exception { test("HTMLAllCollection"); } @@ -2742,7 +2752,7 @@ public void htmlAllCollection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlAnchorElement() throws Exception { test("HTMLAnchorElement"); } @@ -2753,7 +2763,7 @@ public void htmlAnchorElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlAppletElement() throws Exception { test("HTMLAppletElement"); } @@ -2764,7 +2774,7 @@ public void htmlAppletElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlAreaElement() throws Exception { test("HTMLAreaElement"); } @@ -2775,7 +2785,7 @@ public void htmlAreaElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlAudioElement() throws Exception { test("HTMLAudioElement"); } @@ -2786,7 +2796,7 @@ public void htmlAudioElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBaseElement() throws Exception { test("HTMLBaseElement"); } @@ -2797,7 +2807,7 @@ public void htmlBaseElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBaseFontElement() throws Exception { test("HTMLBaseFontElement"); } @@ -2808,7 +2818,7 @@ public void htmlBaseFontElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBGSoundElement() throws Exception { test("HTMLBGSoundElement"); } @@ -2819,7 +2829,7 @@ public void htmlBGSoundElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBlockElement() throws Exception { test("HTMLBlockElement"); } @@ -2830,7 +2840,7 @@ public void htmlBlockElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBlockQuoteElement() throws Exception { test("HTMLBlockQuoteElement"); } @@ -2841,7 +2851,7 @@ public void htmlBlockQuoteElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBodyElement() throws Exception { test("HTMLBodyElement"); } @@ -2852,7 +2862,7 @@ public void htmlBodyElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBRElement() throws Exception { test("HTMLBRElement"); } @@ -2863,7 +2873,7 @@ public void htmlBRElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlButtonElement() throws Exception { test("HTMLButtonElement"); } @@ -2874,7 +2884,7 @@ public void htmlButtonElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlCanvasElement() throws Exception { test("HTMLCanvasElement"); } @@ -2885,7 +2895,7 @@ public void htmlCanvasElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlCollection() throws Exception { test("HTMLCollection"); } @@ -2896,7 +2906,7 @@ public void htmlCollection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlCommentElement() throws Exception { test("HTMLCommentElement"); } @@ -2905,7 +2915,7 @@ public void htmlCommentElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlContentElement() throws Exception { test("HTMLContentElement"); } @@ -2914,7 +2924,7 @@ public void htmlContentElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDataElement() throws Exception { test("HTMLDataElement"); } @@ -2925,7 +2935,7 @@ public void htmlDataElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDataListElement() throws Exception { test("HTMLDataListElement"); } @@ -2936,7 +2946,7 @@ public void htmlDataListElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDDElement() throws Exception { test("HTMLDDElement"); } @@ -2947,7 +2957,7 @@ public void htmlDDElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDefinitionDescriptionElement() throws Exception { test("HTMLDefinitionDescriptionElement"); } @@ -2958,7 +2968,7 @@ public void htmlDefinitionDescriptionElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDefinitionTermElement() throws Exception { test("HTMLDefinitionTermElement"); } @@ -2969,7 +2979,7 @@ public void htmlDefinitionTermElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDetailsElement() throws Exception { test("HTMLDetailsElement"); } @@ -2980,7 +2990,7 @@ public void htmlDetailsElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDialogElement() throws Exception { test("HTMLDialogElement"); } @@ -2991,7 +3001,7 @@ public void htmlDialogElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDirectoryElement() throws Exception { test("HTMLDirectoryElement"); } @@ -3002,7 +3012,7 @@ public void htmlDirectoryElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDivElement() throws Exception { test("HTMLDivElement"); } @@ -3013,7 +3023,7 @@ public void htmlDivElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDListElement() throws Exception { test("HTMLDListElement"); } @@ -3024,7 +3034,7 @@ public void htmlDListElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDocument() throws Exception { test("HTMLDocument"); } @@ -3035,7 +3045,7 @@ public void htmlDocument() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDTElement() throws Exception { test("HTMLDTElement"); } @@ -3046,7 +3056,7 @@ public void htmlDTElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlElement() throws Exception { test("HTMLElement"); } @@ -3057,7 +3067,7 @@ public void htmlElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlEmbedElement() throws Exception { test("HTMLEmbedElement"); } @@ -3068,7 +3078,7 @@ public void htmlEmbedElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlFieldSetElement() throws Exception { test("HTMLFieldSetElement"); } @@ -3079,7 +3089,7 @@ public void htmlFieldSetElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlFontElement() throws Exception { test("HTMLFontElement"); } @@ -3088,7 +3098,7 @@ public void htmlFontElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlFormControlsCollection() throws Exception { test("HTMLFormControlsCollection"); } @@ -3099,7 +3109,7 @@ public void htmlFormControlsCollection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlFormElement() throws Exception { test("HTMLFormElement"); } @@ -3110,7 +3120,7 @@ public void htmlFormElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlFrameElement() throws Exception { test("HTMLFrameElement"); } @@ -3121,7 +3131,7 @@ public void htmlFrameElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlFrameSetElement() throws Exception { test("HTMLFrameSetElement"); } @@ -3132,7 +3142,7 @@ public void htmlFrameSetElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlGenericElement() throws Exception { test("HTMLGenericElement"); } @@ -3143,7 +3153,7 @@ public void htmlGenericElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlHeadElement() throws Exception { test("HTMLHeadElement"); } @@ -3154,7 +3164,7 @@ public void htmlHeadElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlHeadingElement() throws Exception { test("HTMLHeadingElement"); } @@ -3165,7 +3175,7 @@ public void htmlHeadingElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlHRElement() throws Exception { test("HTMLHRElement"); } @@ -3176,7 +3186,7 @@ public void htmlHRElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlHtmlElement() throws Exception { test("HTMLHtmlElement"); } @@ -3185,7 +3195,7 @@ public void htmlHtmlElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlHyperlinkElementUtils() throws Exception { test("HTMLHyperlinkElementUtils"); } @@ -3196,7 +3206,7 @@ public void htmlHyperlinkElementUtils() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlIFrameElement() throws Exception { test("HTMLIFrameElement"); } @@ -3207,7 +3217,7 @@ public void htmlIFrameElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlImageElement() throws Exception { test("HTMLImageElement"); } @@ -3218,7 +3228,7 @@ public void htmlImageElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlInlineQuotationElement() throws Exception { test("HTMLInlineQuotationElement"); } @@ -3229,7 +3239,7 @@ public void htmlInlineQuotationElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlInputElement() throws Exception { test("HTMLInputElement"); } @@ -3240,7 +3250,7 @@ public void htmlInputElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlIsIndexElement() throws Exception { test("HTMLIsIndexElement"); } @@ -3249,7 +3259,7 @@ public void htmlIsIndexElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlKeygenElement() throws Exception { test("HTMLKeygenElement"); } @@ -3260,7 +3270,7 @@ public void htmlKeygenElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlLabelElement() throws Exception { test("HTMLLabelElement"); } @@ -3271,7 +3281,7 @@ public void htmlLabelElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlLegendElement() throws Exception { test("HTMLLegendElement"); } @@ -3282,7 +3292,7 @@ public void htmlLegendElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlLIElement() throws Exception { test("HTMLLIElement"); } @@ -3293,7 +3303,7 @@ public void htmlLIElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlLinkElement() throws Exception { test("HTMLLinkElement"); } @@ -3304,7 +3314,7 @@ public void htmlLinkElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlListElement() throws Exception { test("HTMLListElement"); } @@ -3315,7 +3325,7 @@ public void htmlListElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMapElement() throws Exception { test("HTMLMapElement"); } @@ -3326,7 +3336,7 @@ public void htmlMapElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMarqueeElement() throws Exception { test("HTMLMarqueeElement"); } @@ -3337,7 +3347,7 @@ public void htmlMarqueeElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMediaElement() throws Exception { test("HTMLMediaElement"); } @@ -3348,7 +3358,7 @@ public void htmlMediaElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMenuElement() throws Exception { test("HTMLMenuElement"); } @@ -3357,7 +3367,7 @@ public void htmlMenuElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMenuItemElement() throws Exception { test("HTMLMenuItemElement"); } @@ -3368,7 +3378,7 @@ public void htmlMenuItemElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMetaElement() throws Exception { test("HTMLMetaElement"); } @@ -3379,7 +3389,7 @@ public void htmlMetaElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMeterElement() throws Exception { test("HTMLMeterElement"); } @@ -3390,7 +3400,7 @@ public void htmlMeterElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlModElement() throws Exception { test("HTMLModElement"); } @@ -3401,7 +3411,7 @@ public void htmlModElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlNextIdElement() throws Exception { test("HTMLNextIdElement"); } @@ -3410,7 +3420,7 @@ public void htmlNextIdElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlNoShowElement() throws Exception { test("HTMLNoShowElement"); } @@ -3421,7 +3431,7 @@ public void htmlNoShowElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlObjectElement() throws Exception { test("HTMLObjectElement"); } @@ -3432,7 +3442,7 @@ public void htmlObjectElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlOListElement() throws Exception { test("HTMLOListElement"); } @@ -3443,7 +3453,7 @@ public void htmlOListElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlOptGroupElement() throws Exception { test("HTMLOptGroupElement"); } @@ -3454,7 +3464,7 @@ public void htmlOptGroupElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlOptionElement() throws Exception { test("HTMLOptionElement"); } @@ -3465,7 +3475,7 @@ public void htmlOptionElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlOptionsCollection() throws Exception { test("HTMLOptionsCollection"); } @@ -3476,7 +3486,7 @@ public void htmlOptionsCollection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlOutputElement() throws Exception { test("HTMLOutputElement"); } @@ -3487,7 +3497,7 @@ public void htmlOutputElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlParagraphElement() throws Exception { test("HTMLParagraphElement"); } @@ -3498,7 +3508,7 @@ public void htmlParagraphElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlParamElement() throws Exception { test("HTMLParamElement"); } @@ -3509,7 +3519,7 @@ public void htmlParamElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlPhraseElement() throws Exception { test("HTMLPhraseElement"); } @@ -3518,7 +3528,7 @@ public void htmlPhraseElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlPictureElement() throws Exception { test("HTMLPictureElement"); } @@ -3529,7 +3539,7 @@ public void htmlPictureElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlPreElement() throws Exception { test("HTMLPreElement"); } @@ -3540,7 +3550,7 @@ public void htmlPreElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlProgressElement() throws Exception { test("HTMLProgressElement"); } @@ -3551,7 +3561,7 @@ public void htmlProgressElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlQuoteElement() throws Exception { test("HTMLQuoteElement"); } @@ -3562,7 +3572,7 @@ public void htmlQuoteElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlScriptElement() throws Exception { test("HTMLScriptElement"); } @@ -3573,7 +3583,7 @@ public void htmlScriptElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlSelectElement() throws Exception { test("HTMLSelectElement"); } @@ -3584,7 +3594,7 @@ public void htmlSelectElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlShadowElement() throws Exception { test("HTMLShadowElement"); } @@ -3593,7 +3603,7 @@ public void htmlShadowElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlSlotElement() throws Exception { test("HTMLSlotElement"); } @@ -3604,7 +3614,7 @@ public void htmlSlotElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlSourceElement() throws Exception { test("HTMLSourceElement"); } @@ -3615,7 +3625,7 @@ public void htmlSourceElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlSpanElement() throws Exception { test("HTMLSpanElement"); } @@ -3626,7 +3636,7 @@ public void htmlSpanElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlStyleElement() throws Exception { test("HTMLStyleElement"); } @@ -3637,7 +3647,7 @@ public void htmlStyleElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableCaptionElement() throws Exception { test("HTMLTableCaptionElement"); } @@ -3648,7 +3658,7 @@ public void htmlTableCaptionElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableCellElement() throws Exception { test("HTMLTableCellElement"); } @@ -3659,7 +3669,7 @@ public void htmlTableCellElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableColElement() throws Exception { test("HTMLTableColElement"); } @@ -3670,7 +3680,7 @@ public void htmlTableColElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableComponent() throws Exception { test("HTMLTableComponent"); } @@ -3681,7 +3691,7 @@ public void htmlTableComponent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableDataCellElement() throws Exception { test("HTMLTableDataCellElement"); } @@ -3692,7 +3702,7 @@ public void htmlTableDataCellElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableElement() throws Exception { test("HTMLTableElement"); } @@ -3703,7 +3713,7 @@ public void htmlTableElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableHeaderCellElement() throws Exception { test("HTMLTableHeaderCellElement"); } @@ -3714,7 +3724,7 @@ public void htmlTableHeaderCellElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableRowElement() throws Exception { test("HTMLTableRowElement"); } @@ -3725,7 +3735,7 @@ public void htmlTableRowElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableSectionElement() throws Exception { test("HTMLTableSectionElement"); } @@ -3734,7 +3744,7 @@ public void htmlTableSectionElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTemplateElement() throws Exception { test("HTMLTemplateElement"); } @@ -3745,7 +3755,7 @@ public void htmlTemplateElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTextAreaElement() throws Exception { test("HTMLTextAreaElement"); } @@ -3754,7 +3764,7 @@ public void htmlTextAreaElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTextElement() throws Exception { test("HTMLTextElement"); } @@ -3765,7 +3775,7 @@ public void htmlTextElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTimeElement() throws Exception { test("HTMLTimeElement"); } @@ -3776,7 +3786,7 @@ public void htmlTimeElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTitleElement() throws Exception { test("HTMLTitleElement"); } @@ -3787,7 +3797,7 @@ public void htmlTitleElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTrackElement() throws Exception { test("HTMLTrackElement"); } @@ -3798,7 +3808,7 @@ public void htmlTrackElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlUListElement() throws Exception { test("HTMLUListElement"); } @@ -3809,7 +3819,7 @@ public void htmlUListElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlUnknownElement() throws Exception { test("HTMLUnknownElement"); } @@ -3820,7 +3830,7 @@ public void htmlUnknownElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlVideoElement() throws Exception { test("HTMLVideoElement"); } @@ -3829,7 +3839,7 @@ public void htmlVideoElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlWBRElement() throws Exception { test("HTMLWBRElement"); } @@ -3847,7 +3857,7 @@ public void idbCursor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbCursorSync() throws Exception { test("IDBCursorSync"); } @@ -3874,7 +3884,7 @@ public void idbDatabase() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbDatabaseException() throws Exception { test("IDBDatabaseException"); } @@ -3883,7 +3893,7 @@ public void idbDatabaseException() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbDatabaseSync() throws Exception { test("IDBDatabaseSync"); } @@ -3892,7 +3902,7 @@ public void idbDatabaseSync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbEnvironment() throws Exception { test("IDBEnvironment"); } @@ -3901,7 +3911,7 @@ public void idbEnvironment() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbEnvironmentSync() throws Exception { test("IDBEnvironmentSync"); } @@ -3919,7 +3929,7 @@ public void idbFactory() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbFactorySync() throws Exception { test("IDBFactorySync"); } @@ -3937,7 +3947,7 @@ public void idbIndex() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbIndexSync() throws Exception { test("IDBIndexSync"); } @@ -3955,7 +3965,7 @@ public void idbKeyRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbLocaleAwareKeyRange() throws Exception { test("IDBLocaleAwareKeyRange"); } @@ -3964,7 +3974,7 @@ public void idbLocaleAwareKeyRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbMutableFile() throws Exception { test("IDBMutableFile"); } @@ -3982,7 +3992,7 @@ public void idbObjectStore() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbObjectStoreSync() throws Exception { test("IDBObjectStoreSync"); } @@ -4018,7 +4028,7 @@ public void idbTransaction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbTransactionSync() throws Exception { test("IDBTransactionSync"); } @@ -4036,7 +4046,7 @@ public void idbVersionChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbVersionChangeRequest() throws Exception { test("IDBVersionChangeRequest"); } @@ -4045,7 +4055,7 @@ public void idbVersionChangeRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void identityManager() throws Exception { test("IdentityManager"); } @@ -4054,7 +4064,7 @@ public void identityManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idleDeadline() throws Exception { test("IdleDeadline"); } @@ -4063,7 +4073,7 @@ public void idleDeadline() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void iirFilterNode() throws Exception { test("IIRFilterNode"); } @@ -4074,7 +4084,7 @@ public void iirFilterNode() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void image() throws Exception { test("Image"); } @@ -4092,7 +4102,7 @@ public void imageBitmap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void imageBitmapFactories() throws Exception { test("ImageBitmapFactories"); } @@ -4119,7 +4129,7 @@ public void imageData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void index() throws Exception { test("Index"); } @@ -4128,7 +4138,7 @@ public void index() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void indexedDB() throws Exception { test("IndexedDB"); } @@ -4146,7 +4156,7 @@ public void infinity() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void inputDeviceCapabilities() throws Exception { test("InputDeviceCapabilities"); } @@ -4155,7 +4165,7 @@ public void inputDeviceCapabilities() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void inputEvent() throws Exception { test("InputEvent"); } @@ -4164,7 +4174,7 @@ public void inputEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void inputMethodContext() throws Exception { test("InputMethodContext"); } @@ -4173,7 +4183,7 @@ public void inputMethodContext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void installEvent() throws Exception { test("InstallEvent"); } @@ -4182,7 +4192,7 @@ public void installEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void installTrigger() throws Exception { test("InstallTrigger"); } @@ -4191,7 +4201,7 @@ public void installTrigger() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void installTriggerImpl() throws Exception { test("InstallTriggerImpl"); } @@ -4233,7 +4243,7 @@ public void int8Array() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function InternalError() { [native code] }", FF_ESR = "function InternalError() { [native code] }") @HtmlUnitNYI(CHROME = "function InternalError() { [native code] }", @@ -4246,7 +4256,7 @@ public void internalError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void intersectionObserver() throws Exception { test("IntersectionObserver"); } @@ -4255,7 +4265,7 @@ public void intersectionObserver() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void intersectionObserverEntry() throws Exception { test("IntersectionObserverEntry"); } @@ -4321,7 +4331,7 @@ public void isNaN() throws Exception { */ @Test @Alerts(DEFAULT = "function Iterator() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void iterator() throws Exception { test("Iterator"); } @@ -4341,7 +4351,7 @@ public void json() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void keyboardEvent() throws Exception { test("KeyboardEvent"); } @@ -4350,7 +4360,7 @@ public void keyboardEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void keyframeEffect() throws Exception { test("KeyframeEffect"); } @@ -4359,7 +4369,7 @@ public void keyframeEffect() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void keyframeEffectReadOnly() throws Exception { test("KeyframeEffectReadOnly"); } @@ -4368,7 +4378,7 @@ public void keyframeEffectReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n() throws Exception { test("L10n"); } @@ -4377,7 +4387,7 @@ public void l10n() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_formatValue() throws Exception { test("L10n.formatValue"); } @@ -4386,7 +4396,7 @@ public void l10n_formatValue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_get() throws Exception { test("L10n.get"); } @@ -4395,7 +4405,7 @@ public void l10n_get() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_code() throws Exception { test("L10n.language.code"); } @@ -4404,7 +4414,7 @@ public void l10n_language_code() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_direction() throws Exception { test("L10n.language.direction"); } @@ -4413,7 +4423,7 @@ public void l10n_language_direction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_once() throws Exception { test("L10n.once"); } @@ -4422,7 +4432,7 @@ public void l10n_once() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_ready() throws Exception { test("L10n.ready"); } @@ -4431,7 +4441,7 @@ public void l10n_ready() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_readyState() throws Exception { test("L10n.readyState"); } @@ -4440,7 +4450,7 @@ public void l10n_readyState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_setAttributes() throws Exception { test("L10n.setAttributes"); } @@ -4449,7 +4459,7 @@ public void l10n_setAttributes() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void linkStyle() throws Exception { test("LinkStyle"); } @@ -4458,7 +4468,7 @@ public void linkStyle() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void localFileSystem() throws Exception { test("LocalFileSystem"); } @@ -4467,7 +4477,7 @@ public void localFileSystem() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void localFileSystemSync() throws Exception { test("LocalFileSystemSync"); } @@ -4478,7 +4488,7 @@ public void localFileSystemSync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void localMediaStream() throws Exception { test("LocalMediaStream"); } @@ -4489,7 +4499,7 @@ public void localMediaStream() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void location() throws Exception { test("Location"); } @@ -4498,7 +4508,7 @@ public void location() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void lockedFile() throws Exception { test("LockedFile"); } @@ -4507,7 +4517,7 @@ public void lockedFile() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void longRange() throws Exception { test("LongRange"); } @@ -4534,7 +4544,7 @@ public void math() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaDeviceInfo() throws Exception { test("MediaDeviceInfo"); } @@ -4543,7 +4553,7 @@ public void mediaDeviceInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaDevices() throws Exception { test("MediaDevices"); } @@ -4552,7 +4562,7 @@ public void mediaDevices() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaElementAudioSourceNode() throws Exception { test("MediaElementAudioSourceNode"); } @@ -4561,7 +4571,7 @@ public void mediaElementAudioSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaEncryptedEvent() throws Exception { test("MediaEncryptedEvent"); } @@ -4570,7 +4580,7 @@ public void mediaEncryptedEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaError() throws Exception { test("MediaError"); } @@ -4579,7 +4589,7 @@ public void mediaError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeyError() throws Exception { test("MediaKeyError"); } @@ -4588,7 +4598,7 @@ public void mediaKeyError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeyEvent() throws Exception { test("MediaKeyEvent"); } @@ -4597,7 +4607,7 @@ public void mediaKeyEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeyMessageEvent() throws Exception { test("MediaKeyMessageEvent"); } @@ -4606,7 +4616,7 @@ public void mediaKeyMessageEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeys() throws Exception { test("MediaKeys"); } @@ -4615,7 +4625,7 @@ public void mediaKeys() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeySession() throws Exception { test("MediaKeySession"); } @@ -4624,7 +4634,7 @@ public void mediaKeySession() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeyStatusMap() throws Exception { test("MediaKeyStatusMap"); } @@ -4633,7 +4643,7 @@ public void mediaKeyStatusMap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeySystemAccess() throws Exception { test("MediaKeySystemAccess"); } @@ -4642,7 +4652,7 @@ public void mediaKeySystemAccess() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeySystemConfiguration() throws Exception { test("MediaKeySystemConfiguration"); } @@ -4653,7 +4663,7 @@ public void mediaKeySystemConfiguration() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaList() throws Exception { test("MediaList"); } @@ -4662,7 +4672,7 @@ public void mediaList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaQueryList() throws Exception { test("MediaQueryList"); } @@ -4671,7 +4681,7 @@ public void mediaQueryList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaQueryListEvent() throws Exception { test("MediaQueryListEvent"); } @@ -4680,7 +4690,7 @@ public void mediaQueryListEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaQueryListListener() throws Exception { test("MediaQueryListListener"); } @@ -4689,7 +4699,7 @@ public void mediaQueryListListener() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaRecorder() throws Exception { test("MediaRecorder"); } @@ -4699,8 +4709,8 @@ public void mediaRecorder() throws Exception { */ @Test @Alerts(DEFAULT = "function MediaSource() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void mediaSource() throws Exception { test("MediaSource"); } @@ -4709,7 +4719,7 @@ public void mediaSource() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStream() throws Exception { test("MediaStream"); } @@ -4718,7 +4728,7 @@ public void mediaStream() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStreamAudioDestinationNode() throws Exception { test("MediaStreamAudioDestinationNode"); } @@ -4727,7 +4737,7 @@ public void mediaStreamAudioDestinationNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStreamAudioSourceNode() throws Exception { test("MediaStreamAudioSourceNode"); } @@ -4736,7 +4746,7 @@ public void mediaStreamAudioSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStreamConstraints() throws Exception { test("MediaStreamConstraints"); } @@ -4745,7 +4755,7 @@ public void mediaStreamConstraints() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStreamEvent() throws Exception { test("MediaStreamEvent"); } @@ -4754,7 +4764,7 @@ public void mediaStreamEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStreamTrack() throws Exception { test("MediaStreamTrack"); } @@ -4763,7 +4773,7 @@ public void mediaStreamTrack() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStreamTrackEvent() throws Exception { test("MediaStreamTrackEvent"); } @@ -4772,7 +4782,7 @@ public void mediaStreamTrackEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaTrackConstraints() throws Exception { test("MediaTrackConstraints"); } @@ -4781,7 +4791,7 @@ public void mediaTrackConstraints() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaTrackSettings() throws Exception { test("MediaTrackSettings"); } @@ -4790,7 +4800,7 @@ public void mediaTrackSettings() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaTrackSupportedConstraints() throws Exception { test("MediaTrackSupportedConstraints"); } @@ -4832,7 +4842,7 @@ public void messagePort() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void metadata() throws Exception { test("Metadata"); } @@ -4841,7 +4851,7 @@ public void metadata() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiAccess() throws Exception { test("MIDIAccess"); } @@ -4850,7 +4860,7 @@ public void midiAccess() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiConnectionEvent() throws Exception { test("MIDIConnectionEvent"); } @@ -4859,7 +4869,7 @@ public void midiConnectionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiInput() throws Exception { test("MIDIInput"); } @@ -4868,7 +4878,7 @@ public void midiInput() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiInputMap() throws Exception { test("MIDIInputMap"); } @@ -4877,7 +4887,7 @@ public void midiInputMap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiMessageEvent() throws Exception { test("MIDIMessageEvent"); } @@ -4886,7 +4896,7 @@ public void midiMessageEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiOutput() throws Exception { test("MIDIOutput"); } @@ -4895,7 +4905,7 @@ public void midiOutput() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiOutputMap() throws Exception { test("MIDIOutputMap"); } @@ -4904,7 +4914,7 @@ public void midiOutputMap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiPort() throws Exception { test("MIDIPort"); } @@ -4915,7 +4925,7 @@ public void midiPort() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mimeType() throws Exception { test("MimeType"); } @@ -4926,7 +4936,7 @@ public void mimeType() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mimeTypeArray() throws Exception { test("MimeTypeArray"); } @@ -4937,7 +4947,7 @@ public void mimeTypeArray() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mouseEvent() throws Exception { test("MouseEvent"); } @@ -4946,7 +4956,7 @@ public void mouseEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mouseScrollEvent() throws Exception { test("MouseScrollEvent"); } @@ -4955,7 +4965,7 @@ public void mouseScrollEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mouseWheelEvent() throws Exception { test("MouseWheelEvent"); } @@ -4964,7 +4974,7 @@ public void mouseWheelEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozActivity() throws Exception { test("MozActivity"); } @@ -4973,7 +4983,7 @@ public void mozActivity() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozActivityOptions() throws Exception { test("MozActivityOptions"); } @@ -4982,7 +4992,7 @@ public void mozActivityOptions() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozActivityRequestHandler() throws Exception { test("MozActivityRequestHandler"); } @@ -4991,7 +5001,7 @@ public void mozActivityRequestHandler() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozAlarmsManager() throws Exception { test("MozAlarmsManager"); } @@ -5000,7 +5010,7 @@ public void mozAlarmsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozContact() throws Exception { test("MozContact"); } @@ -5009,7 +5019,7 @@ public void mozContact() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozContactChangeEvent() throws Exception { test("MozContactChangeEvent"); } @@ -5018,7 +5028,7 @@ public void mozContactChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozCSSKeyframesRule() throws Exception { test("MozCSSKeyframesRule"); } @@ -5027,7 +5037,7 @@ public void mozCSSKeyframesRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozIccManager() throws Exception { test("MozIccManager"); } @@ -5036,7 +5046,7 @@ public void mozIccManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMmsEvent() throws Exception { test("MozMmsEvent"); } @@ -5045,7 +5055,7 @@ public void mozMmsEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMmsMessage() throws Exception { test("MozMmsMessage"); } @@ -5054,7 +5064,7 @@ public void mozMmsMessage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileCellInfo() throws Exception { test("MozMobileCellInfo"); } @@ -5063,7 +5073,7 @@ public void mozMobileCellInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileCFInfo() throws Exception { test("MozMobileCFInfo"); } @@ -5072,7 +5082,7 @@ public void mozMobileCFInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileConnection() throws Exception { test("MozMobileConnection"); } @@ -5081,7 +5091,7 @@ public void mozMobileConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileConnectionInfo() throws Exception { test("MozMobileConnectionInfo"); } @@ -5090,7 +5100,7 @@ public void mozMobileConnectionInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileICCInfo() throws Exception { test("MozMobileICCInfo"); } @@ -5099,7 +5109,7 @@ public void mozMobileICCInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileMessageManager() throws Exception { test("MozMobileMessageManager"); } @@ -5108,7 +5118,7 @@ public void mozMobileMessageManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileMessageThread() throws Exception { test("MozMobileMessageThread"); } @@ -5117,7 +5127,7 @@ public void mozMobileMessageThread() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileNetworkInfo() throws Exception { test("MozMobileNetworkInfo"); } @@ -5126,7 +5136,7 @@ public void mozMobileNetworkInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNDEFRecord() throws Exception { test("MozNDEFRecord"); } @@ -5135,7 +5145,7 @@ public void mozNDEFRecord() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNetworkStats() throws Exception { test("MozNetworkStats"); } @@ -5144,7 +5154,7 @@ public void mozNetworkStats() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNetworkStatsData() throws Exception { test("MozNetworkStatsData"); } @@ -5153,7 +5163,7 @@ public void mozNetworkStatsData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNetworkStatsManager() throws Exception { test("MozNetworkStatsManager"); } @@ -5162,7 +5172,7 @@ public void mozNetworkStatsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNFC() throws Exception { test("MozNFC"); } @@ -5171,7 +5181,7 @@ public void mozNFC() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNFCPeer() throws Exception { test("MozNFCPeer"); } @@ -5180,7 +5190,7 @@ public void mozNFCPeer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNFCTag() throws Exception { test("MozNFCTag"); } @@ -5189,7 +5199,7 @@ public void mozNFCTag() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozPowerManager() throws Exception { test("MozPowerManager"); } @@ -5198,7 +5208,7 @@ public void mozPowerManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozRTCIceCandidate() throws Exception { test("mozRTCIceCandidate"); } @@ -5207,7 +5217,7 @@ public void mozRTCIceCandidate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozRTCPeerConnection() throws Exception { test("mozRTCPeerConnection"); } @@ -5216,7 +5226,7 @@ public void mozRTCPeerConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozRTCSessionDescription() throws Exception { test("mozRTCSessionDescription"); } @@ -5225,7 +5235,7 @@ public void mozRTCSessionDescription() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSettingsEvent() throws Exception { test("MozSettingsEvent"); } @@ -5234,7 +5244,7 @@ public void mozSettingsEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsEvent() throws Exception { test("MozSmsEvent"); } @@ -5243,7 +5253,7 @@ public void mozSmsEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsFilter() throws Exception { test("MozSmsFilter"); } @@ -5252,7 +5262,7 @@ public void mozSmsFilter() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsManager() throws Exception { test("MozSmsManager"); } @@ -5261,7 +5271,7 @@ public void mozSmsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsMessage() throws Exception { test("MozSmsMessage"); } @@ -5270,7 +5280,7 @@ public void mozSmsMessage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsSegmentInfo() throws Exception { test("MozSmsSegmentInfo"); } @@ -5279,7 +5289,7 @@ public void mozSmsSegmentInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSocial() throws Exception { test("MozSocial"); } @@ -5288,7 +5298,7 @@ public void mozSocial() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozTimeManager() throws Exception { test("MozTimeManager"); } @@ -5297,7 +5307,7 @@ public void mozTimeManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozVoicemail() throws Exception { test("MozVoicemail"); } @@ -5306,7 +5316,7 @@ public void mozVoicemail() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozVoicemailEvent() throws Exception { test("MozVoicemailEvent"); } @@ -5315,7 +5325,7 @@ public void mozVoicemailEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozVoicemailStatus() throws Exception { test("MozVoicemailStatus"); } @@ -5324,7 +5334,7 @@ public void mozVoicemailStatus() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiConnectionInfoEvent() throws Exception { test("MozWifiConnectionInfoEvent"); } @@ -5333,7 +5343,7 @@ public void mozWifiConnectionInfoEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiP2pGroupOwner() throws Exception { test("MozWifiP2pGroupOwner"); } @@ -5342,7 +5352,7 @@ public void mozWifiP2pGroupOwner() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiP2pManager() throws Exception { test("MozWifiP2pManager"); } @@ -5351,7 +5361,7 @@ public void mozWifiP2pManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiStatusChangeEvent() throws Exception { test("MozWifiStatusChangeEvent"); } @@ -5362,7 +5372,7 @@ public void mozWifiStatusChangeEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void msCurrentStyleCSSProperties() throws Exception { test("MSCurrentStyleCSSProperties"); } @@ -5371,7 +5381,7 @@ public void msCurrentStyleCSSProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void msGestureEvent() throws Exception { test("MSGestureEvent"); } @@ -5382,7 +5392,7 @@ public void msGestureEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void msStyleCSSProperties() throws Exception { test("MSStyleCSSProperties"); } @@ -5393,7 +5403,7 @@ public void msStyleCSSProperties() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mutationEvent() throws Exception { test("MutationEvent"); } @@ -5402,7 +5412,7 @@ public void mutationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mutationObserver() throws Exception { test("MutationObserver"); } @@ -5411,7 +5421,7 @@ public void mutationObserver() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mutationRecord() throws Exception { test("MutationRecord"); } @@ -5422,7 +5432,7 @@ public void mutationRecord() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void namedNodeMap() throws Exception { test("NamedNodeMap"); } @@ -5431,7 +5441,7 @@ public void namedNodeMap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nameList() throws Exception { test("NameList"); } @@ -5442,7 +5452,7 @@ public void nameList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void namespace() throws Exception { test("Namespace"); } @@ -5453,7 +5463,7 @@ public void namespace() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void namespaceCollection() throws Exception { test("NamespaceCollection"); } @@ -5473,7 +5483,7 @@ public void naN() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nativeXPathNSResolver() throws Exception { test("NativeXPathNSResolver"); } @@ -5484,7 +5494,7 @@ public void nativeXPathNSResolver() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigator() throws Exception { test("Navigator"); } @@ -5493,7 +5503,7 @@ public void navigator() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorConcurrentHardware() throws Exception { test("NavigatorConcurrentHardware"); } @@ -5502,7 +5512,7 @@ public void navigatorConcurrentHardware() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorGeolocation() throws Exception { test("NavigatorGeolocation"); } @@ -5511,7 +5521,7 @@ public void navigatorGeolocation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorID() throws Exception { test("NavigatorID"); } @@ -5520,7 +5530,7 @@ public void navigatorID() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorLanguage() throws Exception { test("NavigatorLanguage"); } @@ -5529,7 +5539,7 @@ public void navigatorLanguage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorOnLine() throws Exception { test("NavigatorOnLine"); } @@ -5538,7 +5548,7 @@ public void navigatorOnLine() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorPlugins() throws Exception { test("NavigatorPlugins"); } @@ -5547,7 +5557,7 @@ public void navigatorPlugins() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorStorage() throws Exception { test("NavigatorStorage"); } @@ -5559,8 +5569,8 @@ public void navigatorStorage() throws Exception { */ @Test @Alerts(DEFAULT = "function NetworkInformation() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void networkInformation() throws Exception { test("NetworkInformation"); } @@ -5571,7 +5581,7 @@ public void networkInformation() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void node() throws Exception { test("Node"); } @@ -5582,7 +5592,7 @@ public void node() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nodeFilter() throws Exception { test("NodeFilter"); } @@ -5591,7 +5601,7 @@ public void nodeFilter() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nodeIterator() throws Exception { test("NodeIterator"); } @@ -5602,7 +5612,7 @@ public void nodeIterator() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nodeList() throws Exception { test("NodeList"); } @@ -5611,7 +5621,7 @@ public void nodeList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nonDocumentTypeChildNode() throws Exception { test("NonDocumentTypeChildNode"); } @@ -5620,7 +5630,7 @@ public void nonDocumentTypeChildNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void notation() throws Exception { test("Notation"); } @@ -5640,7 +5650,7 @@ public void notification() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void notificationEvent() throws Exception { test("NotificationEvent"); } @@ -5649,7 +5659,7 @@ public void notificationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void notifyAudioAvailableEvent() throws Exception { test("NotifyAudioAvailableEvent"); } @@ -5676,7 +5686,7 @@ public void object() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_element_index_uint() throws Exception { test("OES_element_index_uint"); } @@ -5685,7 +5695,7 @@ public void oes_element_index_uint() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_standard_derivatives() throws Exception { test("OES_standard_derivatives"); } @@ -5694,7 +5704,7 @@ public void oes_standard_derivatives() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_float() throws Exception { test("OES_texture_float"); } @@ -5703,7 +5713,7 @@ public void oes_texture_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_float_linear() throws Exception { test("OES_texture_float_linear"); } @@ -5712,7 +5722,7 @@ public void oes_texture_float_linear() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_half_float() throws Exception { test("OES_texture_half_float"); } @@ -5721,7 +5731,7 @@ public void oes_texture_half_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_half_float_linear() throws Exception { test("OES_texture_half_float_linear"); } @@ -5730,7 +5740,7 @@ public void oes_texture_half_float_linear() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_vertex_array_object() throws Exception { test("OES_vertex_array_object"); } @@ -5739,7 +5749,7 @@ public void oes_vertex_array_object() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void offlineAudioCompletionEvent() throws Exception { test("OfflineAudioCompletionEvent"); } @@ -5748,7 +5758,7 @@ public void offlineAudioCompletionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void offlineAudioContext() throws Exception { test("OfflineAudioContext"); } @@ -5759,7 +5769,7 @@ public void offlineAudioContext() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void offlineResourceList() throws Exception { test("OfflineResourceList"); } @@ -5769,7 +5779,7 @@ public void offlineResourceList() throws Exception { */ @Test @Alerts("function OffscreenCanvas() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception", FF = "exception", FF_ESR = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError", FF = "ReferenceError", FF_ESR = "ReferenceError") public void offscreenCanvas() throws Exception { test("OffscreenCanvas"); } @@ -5780,7 +5790,7 @@ public void offscreenCanvas() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void option() throws Exception { test("Option"); } @@ -5789,7 +5799,7 @@ public void option() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oscillatorNode() throws Exception { test("OscillatorNode"); } @@ -5798,7 +5808,7 @@ public void oscillatorNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void overflowEvent() throws Exception { test("OverflowEvent"); } @@ -5807,7 +5817,7 @@ public void overflowEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pageTransitionEvent() throws Exception { test("PageTransitionEvent"); } @@ -5816,7 +5826,7 @@ public void pageTransitionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pannerNode() throws Exception { test("PannerNode"); } @@ -5825,7 +5835,7 @@ public void pannerNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void parallelArray() throws Exception { test("ParallelArray"); } @@ -5834,7 +5844,7 @@ public void parallelArray() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void parentNode() throws Exception { test("ParentNode"); } @@ -5861,7 +5871,7 @@ public void parseInt() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void passwordCredential() throws Exception { test("PasswordCredential"); } @@ -5881,7 +5891,7 @@ public void path2D() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void paymentAddress() throws Exception { test("PaymentAddress"); } @@ -5890,7 +5900,7 @@ public void paymentAddress() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void paymentRequest() throws Exception { test("PaymentRequest"); } @@ -5899,7 +5909,7 @@ public void paymentRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void paymentResponse() throws Exception { test("PaymentResponse"); } @@ -5926,7 +5936,7 @@ public void performanceEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void performanceFrameTiming() throws Exception { test("PerformanceFrameTiming"); } @@ -5953,7 +5963,7 @@ public void performanceMeasure() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void performanceNavigation() throws Exception { test("PerformanceNavigation"); } @@ -5962,7 +5972,7 @@ public void performanceNavigation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void performanceNavigationTiming() throws Exception { test("PerformanceNavigationTiming"); } @@ -5998,7 +6008,7 @@ public void performanceResourceTiming() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void performanceTiming() throws Exception { test("PerformanceTiming"); } @@ -6007,7 +6017,7 @@ public void performanceTiming() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void periodicSyncEvent() throws Exception { test("PeriodicSyncEvent"); } @@ -6017,8 +6027,8 @@ public void periodicSyncEvent() throws Exception { */ @Test @Alerts(DEFAULT = "function PeriodicSyncManager() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void periodicSyncManager() throws Exception { test("PeriodicSyncManager"); } @@ -6027,7 +6037,7 @@ public void periodicSyncManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void periodicSyncRegistration() throws Exception { test("PeriodicSyncRegistration"); } @@ -6036,7 +6046,7 @@ public void periodicSyncRegistration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void periodicWave() throws Exception { test("PeriodicWave"); } @@ -6046,7 +6056,7 @@ public void periodicWave() throws Exception { */ @Test @Alerts(DEFAULT = "function Permissions() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void permissions() throws Exception { test("Permissions"); } @@ -6055,7 +6065,7 @@ public void permissions() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void permissionSettings() throws Exception { test("PermissionSettings"); } @@ -6065,7 +6075,7 @@ public void permissionSettings() throws Exception { */ @Test @Alerts(DEFAULT = "function PermissionStatus() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void permissionStatus() throws Exception { test("PermissionStatus"); } @@ -6076,7 +6086,7 @@ public void permissionStatus() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void plugin() throws Exception { test("Plugin"); } @@ -6087,7 +6097,7 @@ public void plugin() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pluginArray() throws Exception { test("PluginArray"); } @@ -6096,7 +6106,7 @@ public void pluginArray() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void point() throws Exception { test("Point"); } @@ -6107,7 +6117,7 @@ public void point() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pointerEvent() throws Exception { test("PointerEvent"); } @@ -6116,7 +6126,7 @@ public void pointerEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void popStateEvent() throws Exception { test("PopStateEvent"); } @@ -6125,7 +6135,7 @@ public void popStateEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void popup() throws Exception { test("Popup"); } @@ -6134,7 +6144,7 @@ public void popup() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void portCollection() throws Exception { test("PortCollection"); } @@ -6145,7 +6155,7 @@ public void portCollection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void position() throws Exception { test("Position"); } @@ -6154,7 +6164,7 @@ public void position() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void positionError() throws Exception { test("PositionError"); } @@ -6163,7 +6173,7 @@ public void positionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void positionOptions() throws Exception { test("PositionOptions"); } @@ -6172,7 +6182,7 @@ public void positionOptions() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void positionSensorVRDevice() throws Exception { test("PositionSensorVRDevice"); } @@ -6181,7 +6191,7 @@ public void positionSensorVRDevice() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void powerManager() throws Exception { test("PowerManager"); } @@ -6190,7 +6200,7 @@ public void powerManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentation() throws Exception { test("Presentation"); } @@ -6199,7 +6209,7 @@ public void presentation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationAvailability() throws Exception { test("PresentationAvailability"); } @@ -6208,7 +6218,7 @@ public void presentationAvailability() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationConnection() throws Exception { test("PresentationConnection"); } @@ -6217,7 +6227,7 @@ public void presentationConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationConnectionAvailableEvent() throws Exception { test("PresentationConnectionAvailableEvent"); } @@ -6226,7 +6236,7 @@ public void presentationConnectionAvailableEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationConnectionClosedEvent() throws Exception { test("PresentationConnectionClosedEvent"); } @@ -6235,7 +6245,7 @@ public void presentationConnectionClosedEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationConnectionCloseEvent() throws Exception { test("PresentationConnectionCloseEvent"); } @@ -6244,7 +6254,7 @@ public void presentationConnectionCloseEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationConnectionList() throws Exception { test("PresentationConnectionList"); } @@ -6253,7 +6263,7 @@ public void presentationConnectionList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationReceiver() throws Exception { test("PresentationReceiver"); } @@ -6262,7 +6272,7 @@ public void presentationReceiver() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationRequest() throws Exception { test("PresentationRequest"); } @@ -6273,7 +6283,7 @@ public void presentationRequest() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void processingInstruction() throws Exception { test("ProcessingInstruction"); } @@ -6300,7 +6310,7 @@ public void promise() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void promiseRejection() throws Exception { test("PromiseRejection"); } @@ -6318,7 +6328,7 @@ public void promiseRejectionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void promiseResolver() throws Exception { test("PromiseResolver"); } @@ -6336,7 +6346,7 @@ public void proxy() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pushEvent() throws Exception { test("PushEvent"); } @@ -6346,7 +6356,7 @@ public void pushEvent() throws Exception { */ @Test @Alerts(DEFAULT = "function PushManager() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void pushManager() throws Exception { test("PushManager"); } @@ -6355,7 +6365,7 @@ public void pushManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pushMessageData() throws Exception { test("PushMessageData"); } @@ -6364,7 +6374,7 @@ public void pushMessageData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pushRegistrationManager() throws Exception { test("PushRegistrationManager"); } @@ -6374,7 +6384,7 @@ public void pushRegistrationManager() throws Exception { */ @Test @Alerts(DEFAULT = "function PushSubscription() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void pushSubscription() throws Exception { test("PushSubscription"); } @@ -6384,7 +6394,7 @@ public void pushSubscription() throws Exception { */ @Test @Alerts(DEFAULT = "function PushSubscriptionOptions() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void pushSubscriptionOptions() throws Exception { test("PushSubscriptionOptions"); } @@ -6393,7 +6403,7 @@ public void pushSubscriptionOptions() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void radioNodeList() throws Exception { test("RadioNodeList"); } @@ -6402,7 +6412,7 @@ public void radioNodeList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void randomSource() throws Exception { test("RandomSource"); } @@ -6413,7 +6423,7 @@ public void randomSource() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void range() throws Exception { test("Range"); } @@ -6431,7 +6441,7 @@ public void rangeError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void readableByteStream() throws Exception { test("ReadableByteStream"); } @@ -6476,7 +6486,7 @@ public void regExp() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void remotePlayback() throws Exception { test("RemotePlayback"); } @@ -6485,7 +6495,7 @@ public void remotePlayback() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void renderingContext() throws Exception { test("RenderingContext"); } @@ -6514,7 +6524,7 @@ public void response() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rowContainer() throws Exception { test("RowContainer"); } @@ -6523,7 +6533,7 @@ public void rowContainer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcCertificate() throws Exception { test("RTCCertificate"); } @@ -6532,7 +6542,7 @@ public void rtcCertificate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcConfiguration() throws Exception { test("RTCConfiguration"); } @@ -6542,9 +6552,9 @@ public void rtcConfiguration() throws Exception { */ @Test @Alerts(DEFAULT = "function RTCDataChannel() { [native code] }", - FF = "exception", - FF_ESR = "exception") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError") public void rtcDataChannel() throws Exception { test("RTCDataChannel"); } @@ -6553,7 +6563,7 @@ public void rtcDataChannel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcDataChannelEvent() throws Exception { test("RTCDataChannelEvent"); } @@ -6562,7 +6572,7 @@ public void rtcDataChannelEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIceCandidate() throws Exception { test("RTCIceCandidate"); } @@ -6571,7 +6581,7 @@ public void rtcIceCandidate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIceServer() throws Exception { test("RTCIceServer"); } @@ -6580,7 +6590,7 @@ public void rtcIceServer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIdentityAssertion() throws Exception { test("RTCIdentityAssertion"); } @@ -6589,7 +6599,7 @@ public void rtcIdentityAssertion() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIdentityErrorEvent() throws Exception { test("RTCIdentityErrorEvent"); } @@ -6598,7 +6608,7 @@ public void rtcIdentityErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIdentityEvent() throws Exception { test("RTCIdentityEvent"); } @@ -6607,7 +6617,7 @@ public void rtcIdentityEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcPeerConnection() throws Exception { test("RTCPeerConnection"); } @@ -6616,7 +6626,7 @@ public void rtcPeerConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcPeerConnectionIceEvent() throws Exception { test("RTCPeerConnectionIceEvent"); } @@ -6625,7 +6635,7 @@ public void rtcPeerConnectionIceEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcSctpTransport() throws Exception { test("RTCSctpTransport"); } @@ -6634,7 +6644,7 @@ public void rtcSctpTransport() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcSessionDescription() throws Exception { test("RTCSessionDescription"); } @@ -6643,7 +6653,7 @@ public void rtcSessionDescription() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcSessionDescriptionCallback() throws Exception { test("RTCSessionDescriptionCallback"); } @@ -6652,7 +6662,7 @@ public void rtcSessionDescriptionCallback() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcStatsReport() throws Exception { test("RTCStatsReport"); } @@ -6663,7 +6673,7 @@ public void rtcStatsReport() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void screen() throws Exception { test("Screen"); } @@ -6672,7 +6682,7 @@ public void screen() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void screenOrientation() throws Exception { test("ScreenOrientation"); } @@ -6681,7 +6691,7 @@ public void screenOrientation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void scriptProcessorNode() throws Exception { test("ScriptProcessorNode"); } @@ -6691,8 +6701,8 @@ public void scriptProcessorNode() throws Exception { */ @Test @Alerts(DEFAULT = "function SecurityPolicyViolationEvent() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void securityPolicyViolationEvent() throws Exception { test("SecurityPolicyViolationEvent"); } @@ -6703,7 +6713,7 @@ public void securityPolicyViolationEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void selection() throws Exception { test("Selection"); } @@ -6712,9 +6722,9 @@ public void selection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function ServiceWorker() { [native code] }") - @HtmlUnitNYI(FF = "exception") + @HtmlUnitNYI(FF = "ReferenceError") public void serviceWorker() throws Exception { test("ServiceWorker"); } @@ -6723,9 +6733,9 @@ public void serviceWorker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function ServiceWorkerContainer() { [native code] }") - @HtmlUnitNYI(FF = "exception") + @HtmlUnitNYI(FF = "ReferenceError") public void serviceWorkerContainer() throws Exception { test("ServiceWorkerContainer"); } @@ -6734,7 +6744,7 @@ public void serviceWorkerContainer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void serviceWorkerGlobalScope() throws Exception { test("ServiceWorkerGlobalScope"); } @@ -6743,7 +6753,7 @@ public void serviceWorkerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void serviceWorkerMessageEvent() throws Exception { test("ServiceWorkerMessageEvent"); } @@ -6753,7 +6763,7 @@ public void serviceWorkerMessageEvent() throws Exception { */ @Test @Alerts(DEFAULT = "function ServiceWorkerRegistration() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void serviceWorkerRegistration() throws Exception { test("ServiceWorkerRegistration"); } @@ -6762,7 +6772,7 @@ public void serviceWorkerRegistration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void serviceWorkerState() throws Exception { test("ServiceWorkerState"); } @@ -6780,7 +6790,7 @@ public void set() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void settingsLock() throws Exception { test("SettingsLock"); } @@ -6789,7 +6799,7 @@ public void settingsLock() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void settingsManager() throws Exception { test("SettingsManager"); } @@ -6800,7 +6810,7 @@ public void settingsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void shadowRoot() throws Exception { test("ShadowRoot"); } @@ -6809,7 +6819,7 @@ public void shadowRoot() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void sharedArrayBuffer() throws Exception { test("SharedArrayBuffer"); } @@ -6818,7 +6828,7 @@ public void sharedArrayBuffer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void sharedKeyframeList() throws Exception { test("SharedKeyframeList"); } @@ -6829,7 +6839,7 @@ public void sharedKeyframeList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void sharedWorker() throws Exception { test("SharedWorker"); } @@ -6838,7 +6848,7 @@ public void sharedWorker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void sharedWorkerGlobalScope() throws Exception { test("SharedWorkerGlobalScope"); } @@ -6847,7 +6857,7 @@ public void sharedWorkerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd() throws Exception { test("SIMD"); } @@ -6856,7 +6866,7 @@ public void simd() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool16x8() throws Exception { test("SIMD.Bool16x8"); } @@ -6865,7 +6875,7 @@ public void simd_Bool16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool32x4() throws Exception { test("SIMD.Bool32x4"); } @@ -6874,7 +6884,7 @@ public void simd_Bool32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool64x2() throws Exception { test("SIMD.Bool64x2"); } @@ -6883,7 +6893,7 @@ public void simd_Bool64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool8x16() throws Exception { test("SIMD.Bool8x16"); } @@ -6892,7 +6902,7 @@ public void simd_Bool8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float32x4() throws Exception { test("SIMD.float32x4"); } @@ -6901,7 +6911,7 @@ public void simd_float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float32x4() throws Exception { test("SIMD.Float32x4"); } @@ -6910,7 +6920,7 @@ public void simd_Float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float64x2() throws Exception { test("SIMD.float64x2"); } @@ -6919,7 +6929,7 @@ public void simd_float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float64x2() throws Exception { test("SIMD.Float64x2"); } @@ -6928,7 +6938,7 @@ public void simd_Float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int16x8() throws Exception { test("SIMD.int16x8"); } @@ -6937,7 +6947,7 @@ public void simd_int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int16x8() throws Exception { test("SIMD.Int16x8"); } @@ -6946,7 +6956,7 @@ public void simd_Int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int32x4() throws Exception { test("SIMD.int32x4"); } @@ -6955,7 +6965,7 @@ public void simd_int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int32x4() throws Exception { test("SIMD.Int32x4"); } @@ -6964,7 +6974,7 @@ public void simd_Int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int8x16() throws Exception { test("SIMD.int8x16"); } @@ -6973,7 +6983,7 @@ public void simd_int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int8x16() throws Exception { test("SIMD.Int8x16"); } @@ -6982,7 +6992,7 @@ public void simd_Int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint16x8() throws Exception { test("SIMD.Uint16x8"); } @@ -6991,7 +7001,7 @@ public void simd_Uint16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint32x4() throws Exception { test("SIMD.Uint32x4"); } @@ -7000,7 +7010,7 @@ public void simd_Uint32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint8x16() throws Exception { test("SIMD.Uint8x16"); } @@ -7011,7 +7021,7 @@ public void simd_Uint8x16() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simpleArray() throws Exception { test("SimpleArray"); } @@ -7020,7 +7030,7 @@ public void simpleArray() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void siteBoundCredential() throws Exception { test("SiteBoundCredential"); } @@ -7030,8 +7040,8 @@ public void siteBoundCredential() throws Exception { */ @Test @Alerts(DEFAULT = "function SourceBuffer() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void sourceBuffer() throws Exception { test("SourceBuffer"); } @@ -7041,8 +7051,8 @@ public void sourceBuffer() throws Exception { */ @Test @Alerts(DEFAULT = "function SourceBufferList() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void sourceBufferList() throws Exception { test("SourceBufferList"); } @@ -7051,7 +7061,7 @@ public void sourceBufferList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechGrammar() throws Exception { test("SpeechGrammar"); } @@ -7060,7 +7070,7 @@ public void speechGrammar() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechGrammarList() throws Exception { test("SpeechGrammarList"); } @@ -7069,7 +7079,7 @@ public void speechGrammarList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognition() throws Exception { test("SpeechRecognition"); } @@ -7078,7 +7088,7 @@ public void speechRecognition() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionAlternative() throws Exception { test("SpeechRecognitionAlternative"); } @@ -7087,7 +7097,7 @@ public void speechRecognitionAlternative() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionError() throws Exception { test("SpeechRecognitionError"); } @@ -7096,7 +7106,7 @@ public void speechRecognitionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionErrorEvent() throws Exception { test("SpeechRecognitionErrorEvent"); } @@ -7105,7 +7115,7 @@ public void speechRecognitionErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionEvent() throws Exception { test("SpeechRecognitionEvent"); } @@ -7114,7 +7124,7 @@ public void speechRecognitionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionResult() throws Exception { test("SpeechRecognitionResult"); } @@ -7123,7 +7133,7 @@ public void speechRecognitionResult() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionResultList() throws Exception { test("SpeechRecognitionResultList"); } @@ -7132,7 +7142,7 @@ public void speechRecognitionResultList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechSynthesis() throws Exception { test("SpeechSynthesis"); } @@ -7141,7 +7151,7 @@ public void speechSynthesis() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechSynthesisErrorEvent() throws Exception { test("SpeechSynthesisErrorEvent"); } @@ -7150,7 +7160,7 @@ public void speechSynthesisErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechSynthesisEvent() throws Exception { test("SpeechSynthesisEvent"); } @@ -7159,7 +7169,7 @@ public void speechSynthesisEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechSynthesisUtterance() throws Exception { test("SpeechSynthesisUtterance"); } @@ -7168,7 +7178,7 @@ public void speechSynthesisUtterance() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechSynthesisVoice() throws Exception { test("SpeechSynthesisVoice"); } @@ -7177,7 +7187,7 @@ public void speechSynthesisVoice() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void staticNodeList() throws Exception { test("StaticNodeList"); } @@ -7186,7 +7196,7 @@ public void staticNodeList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void stereoPannerNode() throws Exception { test("StereoPannerNode"); } @@ -7197,7 +7207,7 @@ public void stereoPannerNode() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void stopIteration() throws Exception { test("StopIteration"); } @@ -7208,7 +7218,7 @@ public void stopIteration() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void storage() throws Exception { test("Storage"); } @@ -7217,7 +7227,7 @@ public void storage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void storageEstimate() throws Exception { test("StorageEstimate"); } @@ -7226,7 +7236,7 @@ public void storageEstimate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void storageEvent() throws Exception { test("StorageEvent"); } @@ -7244,7 +7254,7 @@ public void storageManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void storageQuota() throws Exception { test("StorageQuota"); } @@ -7262,7 +7272,7 @@ public void string() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void styleMedia() throws Exception { test("StyleMedia"); } @@ -7271,7 +7281,7 @@ public void styleMedia() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void styleSheet() throws Exception { test("StyleSheet"); } @@ -7282,7 +7292,7 @@ public void styleSheet() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void styleSheetList() throws Exception { test("StyleSheetList"); } @@ -7291,7 +7301,7 @@ public void styleSheetList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void submitEvent() throws Exception { test("SubmitEvent"); } @@ -7311,7 +7321,7 @@ public void subtleCrypto() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAElement() throws Exception { test("SVGAElement"); } @@ -7320,7 +7330,7 @@ public void svgAElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAltGlyphElement() throws Exception { test("SVGAltGlyphElement"); } @@ -7331,7 +7341,7 @@ public void svgAltGlyphElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAngle() throws Exception { test("SVGAngle"); } @@ -7340,7 +7350,7 @@ public void svgAngle() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimateColorElement() throws Exception { test("SVGAnimateColorElement"); } @@ -7349,7 +7359,7 @@ public void svgAnimateColorElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedAngle() throws Exception { test("SVGAnimatedAngle"); } @@ -7358,7 +7368,7 @@ public void svgAnimatedAngle() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedBoolean() throws Exception { test("SVGAnimatedBoolean"); } @@ -7367,7 +7377,7 @@ public void svgAnimatedBoolean() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedEnumeration() throws Exception { test("SVGAnimatedEnumeration"); } @@ -7376,7 +7386,7 @@ public void svgAnimatedEnumeration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedInteger() throws Exception { test("SVGAnimatedInteger"); } @@ -7385,7 +7395,7 @@ public void svgAnimatedInteger() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedLength() throws Exception { test("SVGAnimatedLength"); } @@ -7394,7 +7404,7 @@ public void svgAnimatedLength() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedLengthList() throws Exception { test("SVGAnimatedLengthList"); } @@ -7403,7 +7413,7 @@ public void svgAnimatedLengthList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedNumber() throws Exception { test("SVGAnimatedNumber"); } @@ -7412,7 +7422,7 @@ public void svgAnimatedNumber() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedNumberList() throws Exception { test("SVGAnimatedNumberList"); } @@ -7421,7 +7431,7 @@ public void svgAnimatedNumberList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedPoints() throws Exception { test("SVGAnimatedPoints"); } @@ -7430,7 +7440,7 @@ public void svgAnimatedPoints() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedPreserveAspectRatio() throws Exception { test("SVGAnimatedPreserveAspectRatio"); } @@ -7439,7 +7449,7 @@ public void svgAnimatedPreserveAspectRatio() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedRect() throws Exception { test("SVGAnimatedRect"); } @@ -7448,7 +7458,7 @@ public void svgAnimatedRect() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedString() throws Exception { test("SVGAnimatedString"); } @@ -7457,7 +7467,7 @@ public void svgAnimatedString() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedTransformList() throws Exception { test("SVGAnimatedTransformList"); } @@ -7468,7 +7478,7 @@ public void svgAnimatedTransformList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimateElement() throws Exception { test("SVGAnimateElement"); } @@ -7479,7 +7489,7 @@ public void svgAnimateElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimateMotionElement() throws Exception { test("SVGAnimateMotionElement"); } @@ -7490,7 +7500,7 @@ public void svgAnimateMotionElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimateTransformElement() throws Exception { test("SVGAnimateTransformElement"); } @@ -7499,7 +7509,7 @@ public void svgAnimateTransformElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimationElement() throws Exception { test("SVGAnimationElement"); } @@ -7510,7 +7520,7 @@ public void svgAnimationElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgCircleElement() throws Exception { test("SVGCircleElement"); } @@ -7521,7 +7531,7 @@ public void svgCircleElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgClipPathElement() throws Exception { test("SVGClipPathElement"); } @@ -7530,7 +7540,7 @@ public void svgClipPathElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgComponentTransferFunctionElement() throws Exception { test("SVGComponentTransferFunctionElement"); } @@ -7539,7 +7549,7 @@ public void svgComponentTransferFunctionElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgCursorElement() throws Exception { test("SVGCursorElement"); } @@ -7550,7 +7560,7 @@ public void svgCursorElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgDefsElement() throws Exception { test("SVGDefsElement"); } @@ -7561,7 +7571,7 @@ public void svgDefsElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgDescElement() throws Exception { test("SVGDescElement"); } @@ -7570,7 +7580,7 @@ public void svgDescElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgDiscardElement() throws Exception { test("SVGDiscardElement"); } @@ -7579,7 +7589,7 @@ public void svgDiscardElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgDocument() throws Exception { test("SVGDocument"); } @@ -7590,7 +7600,7 @@ public void svgDocument() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgElement() throws Exception { test("SVGElement"); } @@ -7601,7 +7611,7 @@ public void svgElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgEllipseElement() throws Exception { test("SVGEllipseElement"); } @@ -7610,7 +7620,7 @@ public void svgEllipseElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgEvent() throws Exception { test("SVGEvent"); } @@ -7621,7 +7631,7 @@ public void svgEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEBlendElement() throws Exception { test("SVGFEBlendElement"); } @@ -7632,7 +7642,7 @@ public void svgFEBlendElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEColorMatrixElement() throws Exception { test("SVGFEColorMatrixElement"); } @@ -7643,7 +7653,7 @@ public void svgFEColorMatrixElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEComponentTransferElement() throws Exception { test("SVGFEComponentTransferElement"); } @@ -7654,7 +7664,7 @@ public void svgFEComponentTransferElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFECompositeElement() throws Exception { test("SVGFECompositeElement"); } @@ -7665,7 +7675,7 @@ public void svgFECompositeElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEConvolveMatrixElement() throws Exception { test("SVGFEConvolveMatrixElement"); } @@ -7676,7 +7686,7 @@ public void svgFEConvolveMatrixElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEDiffuseLightingElement() throws Exception { test("SVGFEDiffuseLightingElement"); } @@ -7687,7 +7697,7 @@ public void svgFEDiffuseLightingElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEDisplacementMapElement() throws Exception { test("SVGFEDisplacementMapElement"); } @@ -7698,7 +7708,7 @@ public void svgFEDisplacementMapElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEDistantLightElement() throws Exception { test("SVGFEDistantLightElement"); } @@ -7707,7 +7717,7 @@ public void svgFEDistantLightElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEDropShadowElement() throws Exception { test("SVGFEDropShadowElement"); } @@ -7718,7 +7728,7 @@ public void svgFEDropShadowElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEFloodElement() throws Exception { test("SVGFEFloodElement"); } @@ -7729,7 +7739,7 @@ public void svgFEFloodElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEFuncAElement() throws Exception { test("SVGFEFuncAElement"); } @@ -7740,7 +7750,7 @@ public void svgFEFuncAElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEFuncBElement() throws Exception { test("SVGFEFuncBElement"); } @@ -7751,7 +7761,7 @@ public void svgFEFuncBElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEFuncGElement() throws Exception { test("SVGFEFuncGElement"); } @@ -7762,7 +7772,7 @@ public void svgFEFuncGElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEFuncRElement() throws Exception { test("SVGFEFuncRElement"); } @@ -7773,7 +7783,7 @@ public void svgFEFuncRElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEGaussianBlurElement() throws Exception { test("SVGFEGaussianBlurElement"); } @@ -7784,7 +7794,7 @@ public void svgFEGaussianBlurElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEImageElement() throws Exception { test("SVGFEImageElement"); } @@ -7795,7 +7805,7 @@ public void svgFEImageElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEMergeElement() throws Exception { test("SVGFEMergeElement"); } @@ -7806,7 +7816,7 @@ public void svgFEMergeElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEMergeNodeElement() throws Exception { test("SVGFEMergeNodeElement"); } @@ -7817,7 +7827,7 @@ public void svgFEMergeNodeElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEMorphologyElement() throws Exception { test("SVGFEMorphologyElement"); } @@ -7828,7 +7838,7 @@ public void svgFEMorphologyElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEOffsetElement() throws Exception { test("SVGFEOffsetElement"); } @@ -7839,7 +7849,7 @@ public void svgFEOffsetElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEPointLightElement() throws Exception { test("SVGFEPointLightElement"); } @@ -7850,7 +7860,7 @@ public void svgFEPointLightElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFESpecularLightingElement() throws Exception { test("SVGFESpecularLightingElement"); } @@ -7861,7 +7871,7 @@ public void svgFESpecularLightingElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFESpotLightElement() throws Exception { test("SVGFESpotLightElement"); } @@ -7872,7 +7882,7 @@ public void svgFESpotLightElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFETileElement() throws Exception { test("SVGFETileElement"); } @@ -7883,7 +7893,7 @@ public void svgFETileElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFETurbulenceElement() throws Exception { test("SVGFETurbulenceElement"); } @@ -7894,7 +7904,7 @@ public void svgFETurbulenceElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFilterElement() throws Exception { test("SVGFilterElement"); } @@ -7903,7 +7913,7 @@ public void svgFilterElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontElement() throws Exception { test("SVGFontElement"); } @@ -7912,7 +7922,7 @@ public void svgFontElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceElement() throws Exception { test("SVGFontFaceElement"); } @@ -7921,7 +7931,7 @@ public void svgFontFaceElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceFormatElement() throws Exception { test("SVGFontFaceFormatElement"); } @@ -7930,7 +7940,7 @@ public void svgFontFaceFormatElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceNameElement() throws Exception { test("SVGFontFaceNameElement"); } @@ -7939,7 +7949,7 @@ public void svgFontFaceNameElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceSrcElement() throws Exception { test("SVGFontFaceSrcElement"); } @@ -7948,7 +7958,7 @@ public void svgFontFaceSrcElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceUriElement() throws Exception { test("SVGFontFaceUriElement"); } @@ -7959,7 +7969,7 @@ public void svgFontFaceUriElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgForeignObjectElement() throws Exception { test("SVGForeignObjectElement"); } @@ -7970,7 +7980,7 @@ public void svgForeignObjectElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgGElement() throws Exception { test("SVGGElement"); } @@ -7979,7 +7989,7 @@ public void svgGElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgGeometryElement() throws Exception { test("SVGGeometryElement"); } @@ -7988,7 +7998,7 @@ public void svgGeometryElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgGlyphElement() throws Exception { test("SVGGlyphElement"); } @@ -7997,7 +8007,7 @@ public void svgGlyphElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgGradientElement() throws Exception { test("SVGGradientElement"); } @@ -8006,7 +8016,7 @@ public void svgGradientElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgGraphicsElement() throws Exception { test("SVGGraphicsElement"); } @@ -8015,7 +8025,7 @@ public void svgGraphicsElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgHKernElement() throws Exception { test("SVGHKernElement"); } @@ -8026,7 +8036,7 @@ public void svgHKernElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgImageElement() throws Exception { test("SVGImageElement"); } @@ -8035,7 +8045,7 @@ public void svgImageElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgLength() throws Exception { test("SVGLength"); } @@ -8044,7 +8054,7 @@ public void svgLength() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgLengthList() throws Exception { test("SVGLengthList"); } @@ -8055,7 +8065,7 @@ public void svgLengthList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgLinearGradientElement() throws Exception { test("SVGLinearGradientElement"); } @@ -8066,7 +8076,7 @@ public void svgLinearGradientElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgLineElement() throws Exception { test("SVGLineElement"); } @@ -8077,7 +8087,7 @@ public void svgLineElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgMarkerElement() throws Exception { test("SVGMarkerElement"); } @@ -8088,7 +8098,7 @@ public void svgMarkerElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgMaskElement() throws Exception { test("SVGMaskElement"); } @@ -8099,7 +8109,7 @@ public void svgMaskElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgMatrix() throws Exception { test("SVGMatrix"); } @@ -8110,7 +8120,7 @@ public void svgMatrix() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgMetadataElement() throws Exception { test("SVGMetadataElement"); } @@ -8119,7 +8129,7 @@ public void svgMetadataElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgMissingGlyphElement() throws Exception { test("SVGMissingGlyphElement"); } @@ -8130,7 +8140,7 @@ public void svgMissingGlyphElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgMPathElement() throws Exception { test("SVGMPathElement"); } @@ -8139,7 +8149,7 @@ public void svgMPathElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgNumber() throws Exception { test("SVGNumber"); } @@ -8148,7 +8158,7 @@ public void svgNumber() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgNumberList() throws Exception { test("SVGNumberList"); } @@ -8159,7 +8169,7 @@ public void svgNumberList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathElement() throws Exception { test("SVGPathElement"); } @@ -8168,7 +8178,7 @@ public void svgPathElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSeg() throws Exception { test("SVGPathSeg"); } @@ -8177,7 +8187,7 @@ public void svgPathSeg() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegArcAbs() throws Exception { test("SVGPathSegArcAbs"); } @@ -8186,7 +8196,7 @@ public void svgPathSegArcAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegArcRel() throws Exception { test("SVGPathSegArcRel"); } @@ -8195,7 +8205,7 @@ public void svgPathSegArcRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegClosePath() throws Exception { test("SVGPathSegClosePath"); } @@ -8204,7 +8214,7 @@ public void svgPathSegClosePath() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicAbs() throws Exception { test("SVGPathSegCurvetoCubicAbs"); } @@ -8213,7 +8223,7 @@ public void svgPathSegCurvetoCubicAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicRel() throws Exception { test("SVGPathSegCurvetoCubicRel"); } @@ -8222,7 +8232,7 @@ public void svgPathSegCurvetoCubicRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicSmoothAbs() throws Exception { test("SVGPathSegCurvetoCubicSmoothAbs"); } @@ -8231,7 +8241,7 @@ public void svgPathSegCurvetoCubicSmoothAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicSmoothRel() throws Exception { test("SVGPathSegCurvetoCubicSmoothRel"); } @@ -8240,7 +8250,7 @@ public void svgPathSegCurvetoCubicSmoothRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticAbs() throws Exception { test("SVGPathSegCurvetoQuadraticAbs"); } @@ -8249,7 +8259,7 @@ public void svgPathSegCurvetoQuadraticAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticRel() throws Exception { test("SVGPathSegCurvetoQuadraticRel"); } @@ -8258,7 +8268,7 @@ public void svgPathSegCurvetoQuadraticRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticSmoothAbs() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothAbs"); } @@ -8267,7 +8277,7 @@ public void svgPathSegCurvetoQuadraticSmoothAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticSmoothRel() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothRel"); } @@ -8276,7 +8286,7 @@ public void svgPathSegCurvetoQuadraticSmoothRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoAbs() throws Exception { test("SVGPathSegLinetoAbs"); } @@ -8285,7 +8295,7 @@ public void svgPathSegLinetoAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoHorizontalAbs() throws Exception { test("SVGPathSegLinetoHorizontalAbs"); } @@ -8294,7 +8304,7 @@ public void svgPathSegLinetoHorizontalAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoHorizontalRel() throws Exception { test("SVGPathSegLinetoHorizontalRel"); } @@ -8303,7 +8313,7 @@ public void svgPathSegLinetoHorizontalRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoRel() throws Exception { test("SVGPathSegLinetoRel"); } @@ -8312,7 +8322,7 @@ public void svgPathSegLinetoRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoVerticalAbs() throws Exception { test("SVGPathSegLinetoVerticalAbs"); } @@ -8321,7 +8331,7 @@ public void svgPathSegLinetoVerticalAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoVerticalRel() throws Exception { test("SVGPathSegLinetoVerticalRel"); } @@ -8330,7 +8340,7 @@ public void svgPathSegLinetoVerticalRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegList() throws Exception { test("SVGPathSegList"); } @@ -8339,7 +8349,7 @@ public void svgPathSegList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegMovetoAbs() throws Exception { test("SVGPathSegMovetoAbs"); } @@ -8348,7 +8358,7 @@ public void svgPathSegMovetoAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegMovetoRel() throws Exception { test("SVGPathSegMovetoRel"); } @@ -8359,7 +8369,7 @@ public void svgPathSegMovetoRel() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPatternElement() throws Exception { test("SVGPatternElement"); } @@ -8368,7 +8378,7 @@ public void svgPatternElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPoint() throws Exception { test("SVGPoint"); } @@ -8377,7 +8387,7 @@ public void svgPoint() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPointList() throws Exception { test("SVGPointList"); } @@ -8388,7 +8398,7 @@ public void svgPointList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPolygonElement() throws Exception { test("SVGPolygonElement"); } @@ -8399,7 +8409,7 @@ public void svgPolygonElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPolylineElement() throws Exception { test("SVGPolylineElement"); } @@ -8408,7 +8418,7 @@ public void svgPolylineElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPreserveAspectRatio() throws Exception { test("SVGPreserveAspectRatio"); } @@ -8419,7 +8429,7 @@ public void svgPreserveAspectRatio() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgRadialGradientElement() throws Exception { test("SVGRadialGradientElement"); } @@ -8430,7 +8440,7 @@ public void svgRadialGradientElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgRect() throws Exception { test("SVGRect"); } @@ -8441,7 +8451,7 @@ public void svgRect() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgRectElement() throws Exception { test("SVGRectElement"); } @@ -8450,7 +8460,7 @@ public void svgRectElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgRenderingIntent() throws Exception { test("SVGRenderingIntent"); } @@ -8461,7 +8471,7 @@ public void svgRenderingIntent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgScriptElement() throws Exception { test("SVGScriptElement"); } @@ -8472,7 +8482,7 @@ public void svgScriptElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgSetElement() throws Exception { test("SVGSetElement"); } @@ -8483,7 +8493,7 @@ public void svgSetElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgStopElement() throws Exception { test("SVGStopElement"); } @@ -8492,7 +8502,7 @@ public void svgStopElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgStringList() throws Exception { test("SVGStringList"); } @@ -8501,7 +8511,7 @@ public void svgStringList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgStylable() throws Exception { test("SVGStylable"); } @@ -8512,7 +8522,7 @@ public void svgStylable() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgStyleElement() throws Exception { test("SVGStyleElement"); } @@ -8523,7 +8533,7 @@ public void svgStyleElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgSVGElement() throws Exception { test("SVGSVGElement"); } @@ -8534,7 +8544,7 @@ public void svgSVGElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgSwitchElement() throws Exception { test("SVGSwitchElement"); } @@ -8545,7 +8555,7 @@ public void svgSwitchElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgSymbolElement() throws Exception { test("SVGSymbolElement"); } @@ -8554,7 +8564,7 @@ public void svgSymbolElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTests() throws Exception { test("SVGTests"); } @@ -8563,7 +8573,7 @@ public void svgTests() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTextContentElement() throws Exception { test("SVGTextContentElement"); } @@ -8574,7 +8584,7 @@ public void svgTextContentElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTextElement() throws Exception { test("SVGTextElement"); } @@ -8585,7 +8595,7 @@ public void svgTextElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTextPathElement() throws Exception { test("SVGTextPathElement"); } @@ -8594,7 +8604,7 @@ public void svgTextPathElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTextPositioningElement() throws Exception { test("SVGTextPositioningElement"); } @@ -8605,7 +8615,7 @@ public void svgTextPositioningElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTitleElement() throws Exception { test("SVGTitleElement"); } @@ -8614,7 +8624,7 @@ public void svgTitleElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTransform() throws Exception { test("SVGTransform"); } @@ -8623,7 +8633,7 @@ public void svgTransform() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTransformable() throws Exception { test("SVGTransformable"); } @@ -8632,7 +8642,7 @@ public void svgTransformable() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTransformList() throws Exception { test("SVGTransformList"); } @@ -8641,7 +8651,7 @@ public void svgTransformList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTRefElement() throws Exception { test("SVGTRefElement"); } @@ -8652,7 +8662,7 @@ public void svgTRefElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTSpanElement() throws Exception { test("SVGTSpanElement"); } @@ -8661,7 +8671,7 @@ public void svgTSpanElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgUnitTypes() throws Exception { test("SVGUnitTypes"); } @@ -8672,7 +8682,7 @@ public void svgUnitTypes() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgUseElement() throws Exception { test("SVGUseElement"); } @@ -8683,7 +8693,7 @@ public void svgUseElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgViewElement() throws Exception { test("SVGViewElement"); } @@ -8692,7 +8702,7 @@ public void svgViewElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgViewSpec() throws Exception { test("SVGViewSpec"); } @@ -8701,7 +8711,7 @@ public void svgViewSpec() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgVKernElement() throws Exception { test("SVGVKernElement"); } @@ -8710,7 +8720,7 @@ public void svgVKernElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgZoomEvent() throws Exception { test("SVGZoomEvent"); } @@ -8728,7 +8738,7 @@ public void symbol() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void syncEvent() throws Exception { test("SyncEvent"); } @@ -8738,8 +8748,8 @@ public void syncEvent() throws Exception { */ @Test @Alerts(DEFAULT = "function SyncManager() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void syncManager() throws Exception { test("SyncManager"); } @@ -8748,7 +8758,7 @@ public void syncManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void syncRegistration() throws Exception { test("SyncRegistration"); } @@ -8766,7 +8776,7 @@ public void syntaxError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void tcpServerSocket() throws Exception { test("TCPServerSocket"); } @@ -8775,7 +8785,7 @@ public void tcpServerSocket() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void tcpSocket() throws Exception { test("TCPSocket"); } @@ -8784,7 +8794,7 @@ public void tcpSocket() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void telephony() throws Exception { test("Telephony"); } @@ -8793,7 +8803,7 @@ public void telephony() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void telephonyCall() throws Exception { test("TelephonyCall"); } @@ -8802,7 +8812,7 @@ public void telephonyCall() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void telephonyCallGroup() throws Exception { test("TelephonyCallGroup"); } @@ -8813,7 +8823,7 @@ public void telephonyCallGroup() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void text() throws Exception { test("Text"); } @@ -8840,7 +8850,7 @@ public void textEncoder() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void textEvent() throws Exception { test("TextEvent"); } @@ -8860,7 +8870,7 @@ public void textMetrics() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void textRange() throws Exception { test("TextRange"); } @@ -8869,7 +8879,7 @@ public void textRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void textTrack() throws Exception { test("TextTrack"); } @@ -8878,7 +8888,7 @@ public void textTrack() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void textTrackCue() throws Exception { test("TextTrackCue"); } @@ -8887,7 +8897,7 @@ public void textTrackCue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void textTrackCueList() throws Exception { test("TextTrackCueList"); } @@ -8896,7 +8906,7 @@ public void textTrackCueList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void textTrackList() throws Exception { test("TextTrackList"); } @@ -8905,7 +8915,7 @@ public void textTrackList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void timeEvent() throws Exception { test("TimeEvent"); } @@ -8914,7 +8924,7 @@ public void timeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void timeRanges() throws Exception { test("TimeRanges"); } @@ -8923,7 +8933,7 @@ public void timeRanges() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void touch() throws Exception { test("Touch"); } @@ -8932,7 +8942,7 @@ public void touch() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void touchEvent() throws Exception { test("TouchEvent"); } @@ -8941,7 +8951,7 @@ public void touchEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void touchList() throws Exception { test("TouchList"); } @@ -8950,7 +8960,7 @@ public void touchList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void trackDefault() throws Exception { test("TrackDefault"); } @@ -8959,7 +8969,7 @@ public void trackDefault() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void trackDefaultList() throws Exception { test("TrackDefaultList"); } @@ -8968,7 +8978,7 @@ public void trackDefaultList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void trackEvent() throws Exception { test("TrackEvent"); } @@ -8977,7 +8987,7 @@ public void trackEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void transferable() throws Exception { test("Transferable"); } @@ -8986,7 +8996,7 @@ public void transferable() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void transitionEvent() throws Exception { test("TransitionEvent"); } @@ -8997,7 +9007,7 @@ public void transitionEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void treeWalker() throws Exception { test("TreeWalker"); } @@ -9006,7 +9016,7 @@ public void treeWalker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void typedArray() throws Exception { test("TypedArray"); } @@ -9024,7 +9034,7 @@ public void typeError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void typeInfo() throws Exception { test("TypeInfo"); } @@ -9033,7 +9043,7 @@ public void typeInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void uDPSocket() throws Exception { test("UDPSocket"); } @@ -9044,7 +9054,7 @@ public void uDPSocket() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void uiEvent() throws Exception { test("UIEvent"); } @@ -9115,7 +9125,7 @@ public void unescape() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void uneval() throws Exception { test("uneval"); } @@ -9153,7 +9163,7 @@ public void urlSearchParams() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void urlUtils() throws Exception { test("URLUtils"); } @@ -9162,7 +9172,7 @@ public void urlUtils() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void urlUtilsReadOnly() throws Exception { test("URLUtilsReadOnly"); } @@ -9171,7 +9181,7 @@ public void urlUtilsReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void userDataHandler() throws Exception { test("UserDataHandler"); } @@ -9180,7 +9190,7 @@ public void userDataHandler() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void userProximityEvent() throws Exception { test("UserProximityEvent"); } @@ -9189,7 +9199,7 @@ public void userProximityEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void uSVString() throws Exception { test("USVString"); } @@ -9198,7 +9208,7 @@ public void uSVString() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void validityState() throws Exception { test("ValidityState"); } @@ -9207,7 +9217,7 @@ public void validityState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void videoPlaybackQuality() throws Exception { test("VideoPlaybackQuality"); } @@ -9216,7 +9226,7 @@ public void videoPlaybackQuality() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrDevice() throws Exception { test("VRDevice"); } @@ -9225,7 +9235,7 @@ public void vrDevice() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrDisplay() throws Exception { test("VRDisplay"); } @@ -9234,7 +9244,7 @@ public void vrDisplay() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrDisplayCapabilities() throws Exception { test("VRDisplayCapabilities"); } @@ -9243,7 +9253,7 @@ public void vrDisplayCapabilities() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrEyeParameters() throws Exception { test("VREyeParameters"); } @@ -9252,7 +9262,7 @@ public void vrEyeParameters() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrFieldOfView() throws Exception { test("VRFieldOfView"); } @@ -9261,7 +9271,7 @@ public void vrFieldOfView() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrFieldOfViewReadOnly() throws Exception { test("VRFieldOfViewReadOnly"); } @@ -9270,7 +9280,7 @@ public void vrFieldOfViewReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrLayer() throws Exception { test("VRLayer"); } @@ -9279,7 +9289,7 @@ public void vrLayer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrPose() throws Exception { test("VRPose"); } @@ -9288,7 +9298,7 @@ public void vrPose() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrPositionState() throws Exception { test("VRPositionState"); } @@ -9297,7 +9307,7 @@ public void vrPositionState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrStageParameters() throws Exception { test("VRStageParameters"); } @@ -9306,7 +9316,7 @@ public void vrStageParameters() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vTTCue() throws Exception { test("VTTCue"); } @@ -9315,7 +9325,7 @@ public void vTTCue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void waveShaperNode() throws Exception { test("WaveShaperNode"); } @@ -9342,7 +9352,7 @@ public void weakSet() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL() throws Exception { test("WebGL"); } @@ -9351,7 +9361,7 @@ public void webGL() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_color_buffer_float() throws Exception { test("WEBGL_color_buffer_float"); } @@ -9360,7 +9370,7 @@ public void webGL_color_buffer_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_atc() throws Exception { test("WEBGL_compressed_texture_atc"); } @@ -9369,7 +9379,7 @@ public void webGL_compressed_texture_atc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_es3() throws Exception { test("WEBGL_compressed_texture_es3"); } @@ -9378,7 +9388,7 @@ public void webGL_compressed_texture_es3() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void wEBGL_compressed_texture_etc() throws Exception { test("WEBGL_compressed_texture_etc"); } @@ -9387,7 +9397,7 @@ public void wEBGL_compressed_texture_etc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_etc1() throws Exception { test("WEBGL_compressed_texture_etc1"); } @@ -9396,7 +9406,7 @@ public void webGL_compressed_texture_etc1() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_pvrtc() throws Exception { test("WEBGL_compressed_texture_pvrtc"); } @@ -9405,7 +9415,7 @@ public void webGL_compressed_texture_pvrtc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_s3tc() throws Exception { test("WEBGL_compressed_texture_s3tc"); } @@ -9414,7 +9424,7 @@ public void webGL_compressed_texture_s3tc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_debug_renderer_info() throws Exception { test("WEBGL_debug_renderer_info"); } @@ -9423,7 +9433,7 @@ public void webGL_debug_renderer_info() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_debug_shaders() throws Exception { test("WEBGL_debug_shaders"); } @@ -9432,7 +9442,7 @@ public void webGL_debug_shaders() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_depth_texture() throws Exception { test("WEBGL_depth_texture"); } @@ -9441,7 +9451,7 @@ public void webGL_depth_texture() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_draw_buffers() throws Exception { test("WEBGL_draw_buffers"); } @@ -9450,7 +9460,7 @@ public void webGL_draw_buffers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_lose_context() throws Exception { test("WEBGL_lose_context"); } @@ -9585,7 +9595,7 @@ public void webGLTexture() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGLTimerQueryEXT() throws Exception { test("WebGLTimerQueryEXT"); } @@ -9621,7 +9631,7 @@ public void webGLVertexArrayObject() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGLVertexArrayObjectOES() throws Exception { test("WebGLVertexArrayObjectOES"); } @@ -9630,7 +9640,7 @@ public void webGLVertexArrayObjectOES() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webKitAnimationEvent() throws Exception { test("WebKitAnimationEvent"); } @@ -9639,7 +9649,7 @@ public void webKitAnimationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitAudioContext() throws Exception { test("webkitAudioContext"); } @@ -9648,7 +9658,7 @@ public void webkitAudioContext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webKitCSSMatrix() throws Exception { test("WebKitCSSMatrix"); } @@ -9657,7 +9667,7 @@ public void webKitCSSMatrix() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBCursor() throws Exception { test("webkitIDBCursor"); } @@ -9666,7 +9676,7 @@ public void webkitIDBCursor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBDatabase() throws Exception { test("webkitIDBDatabase"); } @@ -9675,7 +9685,7 @@ public void webkitIDBDatabase() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBFactory() throws Exception { test("webkitIDBFactory"); } @@ -9684,7 +9694,7 @@ public void webkitIDBFactory() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBIndex() throws Exception { test("webkitIDBIndex"); } @@ -9693,7 +9703,7 @@ public void webkitIDBIndex() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBKeyRange() throws Exception { test("webkitIDBKeyRange"); } @@ -9702,7 +9712,7 @@ public void webkitIDBKeyRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBObjectStore() throws Exception { test("webkitIDBObjectStore"); } @@ -9711,7 +9721,7 @@ public void webkitIDBObjectStore() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBRequest() throws Exception { test("webkitIDBRequest"); } @@ -9720,7 +9730,7 @@ public void webkitIDBRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBTransaction() throws Exception { test("webkitIDBTransaction"); } @@ -9729,7 +9739,7 @@ public void webkitIDBTransaction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitMediaStream() throws Exception { test("webkitMediaStream"); } @@ -9738,7 +9748,7 @@ public void webkitMediaStream() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webKitMutationObserver() throws Exception { test("WebKitMutationObserver"); } @@ -9747,7 +9757,7 @@ public void webKitMutationObserver() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitOfflineAudioContext() throws Exception { test("webkitOfflineAudioContext"); } @@ -9756,7 +9766,7 @@ public void webkitOfflineAudioContext() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitRTCPeerConnection() throws Exception { test("webkitRTCPeerConnection"); } @@ -9765,7 +9775,7 @@ public void webkitRTCPeerConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitRTCSessionDescription() throws Exception { test("webkitRTCSessionDescription"); } @@ -9774,7 +9784,7 @@ public void webkitRTCSessionDescription() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitSpeechGrammar() throws Exception { test("webkitSpeechGrammar"); } @@ -9783,7 +9793,7 @@ public void webkitSpeechGrammar() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitSpeechGrammarList() throws Exception { test("webkitSpeechGrammarList"); } @@ -9792,7 +9802,7 @@ public void webkitSpeechGrammarList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitSpeechRecognition() throws Exception { test("webkitSpeechRecognition"); } @@ -9801,7 +9811,7 @@ public void webkitSpeechRecognition() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitSpeechRecognitionError() throws Exception { test("webkitSpeechRecognitionError"); } @@ -9810,7 +9820,7 @@ public void webkitSpeechRecognitionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitSpeechRecognitionEvent() throws Exception { test("webkitSpeechRecognitionEvent"); } @@ -9819,7 +9829,7 @@ public void webkitSpeechRecognitionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webKitTransitionEvent() throws Exception { test("WebKitTransitionEvent"); } @@ -9828,7 +9838,7 @@ public void webKitTransitionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitURL() throws Exception { test("webkitURL"); } @@ -9837,7 +9847,7 @@ public void webkitURL() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webSMS() throws Exception { test("WebSMS"); } @@ -9857,7 +9867,7 @@ public void webSocket() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webSockets() throws Exception { test("WebSockets"); } @@ -9866,7 +9876,7 @@ public void webSockets() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webVTT() throws Exception { test("WebVTT"); } @@ -9875,7 +9885,7 @@ public void webVTT() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void wheelEvent() throws Exception { test("WheelEvent"); } @@ -9884,7 +9894,7 @@ public void wheelEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void wifiManager() throws Exception { test("WifiManager"); } @@ -9895,7 +9905,7 @@ public void wifiManager() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void window() throws Exception { test("Window"); } @@ -9904,7 +9914,7 @@ public void window() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowBase64() throws Exception { test("WindowBase64"); } @@ -9913,7 +9923,7 @@ public void windowBase64() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowClient() throws Exception { test("WindowClient"); } @@ -9922,7 +9932,7 @@ public void windowClient() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowEventHandlers() throws Exception { test("WindowEventHandlers"); } @@ -9931,7 +9941,7 @@ public void windowEventHandlers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowEventHandlers_onbeforeprint() throws Exception { test("WindowEventHandlers.onbeforeprint"); } @@ -9940,7 +9950,7 @@ public void windowEventHandlers_onbeforeprint() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowOrWorkerGlobalScope() throws Exception { test("WindowOrWorkerGlobalScope"); } @@ -9949,7 +9959,7 @@ public void windowOrWorkerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowProperties() throws Exception { test("WindowProperties"); } @@ -9958,7 +9968,7 @@ public void windowProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowTimers() throws Exception { test("WindowTimers"); } @@ -10005,7 +10015,7 @@ public void workerNavigator() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xDomainRequest() throws Exception { test("XDomainRequest"); } @@ -10016,7 +10026,7 @@ public void xDomainRequest() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xmlDocument() throws Exception { test("XMLDocument"); } @@ -10045,7 +10055,7 @@ public void xmlHttpRequestEventTarget() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xmlHttpRequestProgressEvent() throws Exception { test("XMLHttpRequestProgressEvent"); } @@ -10065,7 +10075,7 @@ public void xmlHttpRequestUpload() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xmlSerializer() throws Exception { test("XMLSerializer"); } @@ -10076,7 +10086,7 @@ public void xmlSerializer() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xPathEvaluator() throws Exception { test("XPathEvaluator"); } @@ -10085,7 +10095,7 @@ public void xPathEvaluator() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xPathExpression() throws Exception { test("XPathExpression"); } @@ -10096,7 +10106,7 @@ public void xPathExpression() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xPathNSResolver() throws Exception { test("XPathNSResolver"); } @@ -10107,7 +10117,7 @@ public void xPathNSResolver() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xPathResult() throws Exception { test("XPathResult"); } @@ -10116,7 +10126,7 @@ public void xPathResult() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xsltemplate() throws Exception { test("XSLTemplate"); } @@ -10127,7 +10137,7 @@ public void xsltemplate() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xsltProcessor() throws Exception { test("XSLTProcessor"); } diff --git a/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeConstantsTest.java b/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeConstantsTest.java index 5d929df73ec..bc59ea5455e 100644 --- a/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeConstantsTest.java +++ b/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeConstantsTest.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. @@ -31,7 +31,7 @@ import org.htmlunit.javascript.configuration.WorkerJavaScriptConfiguration; import org.htmlunit.junit.BrowserParameterizedRunner; import org.htmlunit.junit.BrowserParameterizedRunner.Default; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.MimeType; import org.junit.Test; import org.junit.runner.RunWith; @@ -80,7 +80,8 @@ public void test() throws Exception { } private void test(final String className, final String[] expectedAlerts) throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + "\n"; final String workerJs = "onmessage = function(e) {\n" + " var workerResult = '';\n" + " try {\n" + " workerResult += typeof " + className + ";\n" - + " } catch(e) {workerResult = 'exception'}\n" + + " } catch(e) {workerResult = e.name}\n" + " postMessage(workerResult);\n" + "}\n"; @@ -252,7 +253,7 @@ public void applicationCacheErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void apps_mgmt() throws Exception { test("Apps.mgmt"); } @@ -505,6 +506,15 @@ public void beforeUnloadEvent() throws Exception { test("BeforeUnloadEvent"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("function") + public void bigInt() throws Exception { + test("BigInt"); + } + /** * @throws Exception if the test fails */ @@ -4374,7 +4384,7 @@ public void l10n() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_formatValue() throws Exception { test("L10n.formatValue"); } @@ -4383,7 +4393,7 @@ public void l10n_formatValue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_get() throws Exception { test("L10n.get"); } @@ -4392,7 +4402,7 @@ public void l10n_get() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_code() throws Exception { test("L10n.language.code"); } @@ -4401,7 +4411,7 @@ public void l10n_language_code() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_direction() throws Exception { test("L10n.language.direction"); } @@ -4410,7 +4420,7 @@ public void l10n_language_direction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_once() throws Exception { test("L10n.once"); } @@ -4419,7 +4429,7 @@ public void l10n_once() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_ready() throws Exception { test("L10n.ready"); } @@ -4428,7 +4438,7 @@ public void l10n_ready() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_readyState() throws Exception { test("L10n.readyState"); } @@ -4437,7 +4447,7 @@ public void l10n_readyState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_setAttributes() throws Exception { test("L10n.setAttributes"); } @@ -6853,7 +6863,7 @@ public void simd() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool16x8() throws Exception { test("SIMD.Bool16x8"); } @@ -6862,7 +6872,7 @@ public void simd_Bool16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool32x4() throws Exception { test("SIMD.Bool32x4"); } @@ -6871,7 +6881,7 @@ public void simd_Bool32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool64x2() throws Exception { test("SIMD.Bool64x2"); } @@ -6880,7 +6890,7 @@ public void simd_Bool64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool8x16() throws Exception { test("SIMD.Bool8x16"); } @@ -6889,7 +6899,7 @@ public void simd_Bool8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float32x4() throws Exception { test("SIMD.float32x4"); } @@ -6898,7 +6908,7 @@ public void simd_float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float32x4() throws Exception { test("SIMD.Float32x4"); } @@ -6907,7 +6917,7 @@ public void simd_Float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float64x2() throws Exception { test("SIMD.float64x2"); } @@ -6916,7 +6926,7 @@ public void simd_float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float64x2() throws Exception { test("SIMD.Float64x2"); } @@ -6925,7 +6935,7 @@ public void simd_Float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int16x8() throws Exception { test("SIMD.int16x8"); } @@ -6934,7 +6944,7 @@ public void simd_int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int16x8() throws Exception { test("SIMD.Int16x8"); } @@ -6943,7 +6953,7 @@ public void simd_Int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int32x4() throws Exception { test("SIMD.int32x4"); } @@ -6952,7 +6962,7 @@ public void simd_int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int32x4() throws Exception { test("SIMD.Int32x4"); } @@ -6961,7 +6971,7 @@ public void simd_Int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int8x16() throws Exception { test("SIMD.int8x16"); } @@ -6970,7 +6980,7 @@ public void simd_int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int8x16() throws Exception { test("SIMD.Int8x16"); } @@ -6979,7 +6989,7 @@ public void simd_Int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint16x8() throws Exception { test("SIMD.Uint16x8"); } @@ -6988,7 +6998,7 @@ public void simd_Uint16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint32x4() throws Exception { test("SIMD.Uint32x4"); } @@ -6997,7 +7007,7 @@ public void simd_Uint32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint8x16() throws Exception { test("SIMD.Uint8x16"); } @@ -9928,7 +9938,7 @@ public void windowEventHandlers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowEventHandlers_onbeforeprint() throws Exception { test("WindowEventHandlers.onbeforeprint"); } diff --git a/src/test/java/org/htmlunit/general/ElementChildNodesTest.java b/src/test/java/org/htmlunit/general/ElementChildNodesTest.java index a2b95e9b4fd..ca837ffac10 100644 --- a/src/test/java/org/htmlunit/general/ElementChildNodesTest.java +++ b/src/test/java/org/htmlunit/general/ElementChildNodesTest.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,7 +16,8 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,7 +33,8 @@ public class ElementChildNodesTest extends WebDriverTestCase { private static String test(final String tagName) { - return "\n" + return DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -116,7 +119,8 @@ private void test(final String tagName) throws Exception { } private static String headElementClosesItself(final String tagName) { - return "\n" + return DOCTYPE_HTML + + "\n" + "<" + tagName + " id='outer'><" + tagName + ">\n" + "\n" + "\n" @@ -73,7 +70,7 @@ private void test(final String className) throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void abstractList() throws Exception { test("AbstractList"); } @@ -91,7 +88,7 @@ public void abstractRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void abstractWorker() throws Exception { test("AbstractWorker"); } @@ -102,7 +99,7 @@ public void abstractWorker() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void activeXObject() throws Exception { test("ActiveXObject"); } @@ -111,7 +108,7 @@ public void activeXObject() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ambientLightSensor() throws Exception { test("AmbientLightSensor"); } @@ -120,7 +117,7 @@ public void ambientLightSensor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ambientLightSensorReading() throws Exception { test("AmbientLightSensorReading"); } @@ -140,7 +137,7 @@ public void analyserNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void angle_instanced_arrays() throws Exception { test("ANGLE_instanced_arrays"); } @@ -158,7 +155,7 @@ public void animation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectReadOnly() throws Exception { test("AnimationEffectReadOnly"); } @@ -167,7 +164,7 @@ public void animationEffectReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectTiming() throws Exception { test("AnimationEffectTiming"); } @@ -176,7 +173,7 @@ public void animationEffectTiming() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectTimingProperties() throws Exception { test("AnimationEffectTimingProperties"); } @@ -185,7 +182,7 @@ public void animationEffectTimingProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectTimingReadOnly() throws Exception { test("AnimationEffectTimingReadOnly"); } @@ -206,7 +203,7 @@ public void animationEvent() throws Exception { */ @Test @Alerts("function AnimationPlaybackEvent() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception", FF = "exception", FF_ESR = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError", FF = "ReferenceError", FF_ESR = "ReferenceError") public void animationPlaybackEvent() throws Exception { test("AnimationPlaybackEvent"); } @@ -215,7 +212,7 @@ public void animationPlaybackEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationPlayer() throws Exception { test("AnimationPlayer"); } @@ -225,7 +222,7 @@ public void animationPlayer() throws Exception { */ @Test @Alerts("function AnimationTimeline() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception", FF = "exception", FF_ESR = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError", FF = "ReferenceError", FF_ESR = "ReferenceError") public void animationTimeline() throws Exception { test("AnimationTimeline"); } @@ -234,7 +231,7 @@ public void animationTimeline() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void appBannerPromptResult() throws Exception { test("AppBannerPromptResult"); } @@ -245,7 +242,7 @@ public void appBannerPromptResult() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void applicationCache() throws Exception { test("ApplicationCache"); } @@ -254,7 +251,7 @@ public void applicationCache() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void applicationCacheErrorEvent() throws Exception { test("ApplicationCacheErrorEvent"); } @@ -263,7 +260,7 @@ public void applicationCacheErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void apps_mgmt() throws Exception { test("Apps.mgmt"); } @@ -305,7 +302,7 @@ public void arrayBuffer() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void arrayBufferView() throws Exception { test("ArrayBufferView"); } @@ -316,7 +313,7 @@ public void arrayBufferView() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void arrayBufferViewBase() throws Exception { test("ArrayBufferViewBase"); } @@ -325,7 +322,7 @@ public void arrayBufferViewBase() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void asyncFunction() throws Exception { test("AsyncFunction"); } @@ -383,7 +380,7 @@ public void audioBufferSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioChannelManager() throws Exception { test("AudioChannelManager"); } @@ -457,7 +454,7 @@ public void audioScheduledSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void autocompleteErrorEvent() throws Exception { test("AutocompleteErrorEvent"); } @@ -484,7 +481,7 @@ public void baseAudioContext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function BatteryManager() { [native code] }", EDGE = "function BatteryManager() { [native code] }") public void batteryManager() throws Exception { @@ -495,7 +492,7 @@ public void batteryManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void beforeInstallPrompt() throws Exception { test("BeforeInstallPrompt"); } @@ -504,7 +501,7 @@ public void beforeInstallPrompt() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function BeforeInstallPromptEvent() { [native code] }", EDGE = "function BeforeInstallPromptEvent() { [native code] }") public void beforeInstallPromptEvent() throws Exception { @@ -522,6 +519,15 @@ public void beforeUnloadEvent() throws Exception { test("BeforeUnloadEvent"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("function BigInt() { [native code] }") + public void bigInt() throws Exception { + test("BigInt"); + } + /** * @throws Exception if the test fails */ @@ -544,7 +550,7 @@ public void blob() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void blobBuilder() throws Exception { test("BlobBuilder"); } @@ -562,10 +568,10 @@ public void blobEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function Bluetooth() { [native code] }", EDGE = "function Bluetooth() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError") public void bluetooth() throws Exception { test("Bluetooth"); } @@ -574,7 +580,7 @@ public void bluetooth() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothAdapter() throws Exception { test("BluetoothAdapter"); } @@ -583,7 +589,7 @@ public void bluetoothAdapter() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothAdvertisingData() throws Exception { test("BluetoothAdvertisingData"); } @@ -592,10 +598,10 @@ public void bluetoothAdvertisingData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function BluetoothCharacteristicProperties() { [native code] }", EDGE = "function BluetoothCharacteristicProperties() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError") public void bluetoothCharacteristicProperties() throws Exception { test("BluetoothCharacteristicProperties"); } @@ -604,10 +610,10 @@ public void bluetoothCharacteristicProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function BluetoothDevice() { [native code] }", EDGE = "function BluetoothDevice() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError") public void bluetoothDevice() throws Exception { test("BluetoothDevice"); } @@ -616,7 +622,7 @@ public void bluetoothDevice() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothDeviceEvent() throws Exception { test("BluetoothDeviceEvent"); } @@ -625,7 +631,7 @@ public void bluetoothDeviceEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothGATTRemoteServer() throws Exception { test("BluetoothGATTRemoteServer"); } @@ -634,7 +640,7 @@ public void bluetoothGATTRemoteServer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothGATTService() throws Exception { test("BluetoothGATTService"); } @@ -643,7 +649,7 @@ public void bluetoothGATTService() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothManager() throws Exception { test("BluetoothManager"); } @@ -652,10 +658,10 @@ public void bluetoothManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function BluetoothRemoteGATTCharacteristic() { [native code] }", EDGE = "function BluetoothRemoteGATTCharacteristic() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError") public void bluetoothRemoteGATTCharacteristic() throws Exception { test("BluetoothRemoteGATTCharacteristic"); } @@ -664,10 +670,10 @@ public void bluetoothRemoteGATTCharacteristic() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function BluetoothRemoteGATTServer() { [native code] }", EDGE = "function BluetoothRemoteGATTServer() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError") public void bluetoothRemoteGATTServer() throws Exception { test("BluetoothRemoteGATTServer"); } @@ -676,7 +682,7 @@ public void bluetoothRemoteGATTServer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothStatusChangedEvent() throws Exception { test("BluetoothStatusChangedEvent"); } @@ -685,7 +691,7 @@ public void bluetoothStatusChangedEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void body() throws Exception { test("Body"); } @@ -694,7 +700,7 @@ public void body() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void boxObject() throws Exception { test("BoxObject"); } @@ -712,7 +718,7 @@ public void broadcastChannel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void budgetService() throws Exception { test("BudgetService"); } @@ -721,7 +727,7 @@ public void budgetService() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void budgetState() throws Exception { test("BudgetState"); } @@ -730,7 +736,7 @@ public void budgetState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bufferSource() throws Exception { test("BufferSource"); } @@ -739,7 +745,7 @@ public void bufferSource() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void byteString() throws Exception { test("ByteString"); } @@ -766,7 +772,7 @@ public void cacheStorage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void callEvent() throws Exception { test("CallEvent"); } @@ -775,7 +781,7 @@ public void callEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cameraCapabilities() throws Exception { test("CameraCapabilities"); } @@ -784,7 +790,7 @@ public void cameraCapabilities() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cameraControl() throws Exception { test("CameraControl"); } @@ -793,7 +799,7 @@ public void cameraControl() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cameraManager() throws Exception { test("CameraManager"); } @@ -802,7 +808,7 @@ public void cameraManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function CanvasCaptureMediaStream() { [native code] }", FF_ESR = "function CanvasCaptureMediaStream() { [native code] }") public void canvasCaptureMediaStream() throws Exception { @@ -813,7 +819,7 @@ public void canvasCaptureMediaStream() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function CanvasCaptureMediaStreamTrack() { [native code] }", EDGE = "function CanvasCaptureMediaStreamTrack() { [native code] }") public void canvasCaptureMediaStreamTrack() throws Exception { @@ -833,7 +839,7 @@ public void canvasGradient() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void canvasImageSource() throws Exception { test("CanvasImageSource"); } @@ -915,7 +921,7 @@ public void characterData() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void characterDataImpl() throws Exception { test("CharacterDataImpl"); } @@ -924,7 +930,7 @@ public void characterDataImpl() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void childNode() throws Exception { test("ChildNode"); } @@ -933,7 +939,7 @@ public void childNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void chromeWorker() throws Exception { test("ChromeWorker"); } @@ -942,7 +948,7 @@ public void chromeWorker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void client() throws Exception { test("Client"); } @@ -953,7 +959,7 @@ public void client() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void clientRect() throws Exception { test("ClientRect"); } @@ -964,7 +970,7 @@ public void clientRect() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void clientRectList() throws Exception { test("ClientRectList"); } @@ -973,7 +979,7 @@ public void clientRectList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void clients() throws Exception { test("Clients"); } @@ -982,7 +988,7 @@ public void clients() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void clipboardData() throws Exception { test("ClipboardData"); } @@ -1031,7 +1037,7 @@ public void compositionEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void computedCSSStyleDeclaration() throws Exception { test("ComputedCSSStyleDeclaration"); } @@ -1040,7 +1046,7 @@ public void computedCSSStyleDeclaration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void connection() throws Exception { test(HttpHeader.CONNECTION); } @@ -1051,7 +1057,7 @@ public void connection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void console() throws Exception { test("Console"); } @@ -1069,7 +1075,7 @@ public void constantSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainBoolean() throws Exception { test("ConstrainBoolean"); } @@ -1078,7 +1084,7 @@ public void constrainBoolean() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainDOMString() throws Exception { test("ConstrainDOMString"); } @@ -1087,7 +1093,7 @@ public void constrainDOMString() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainDouble() throws Exception { test("ConstrainDouble"); } @@ -1096,7 +1102,7 @@ public void constrainDouble() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainLong() throws Exception { test("ConstrainLong"); } @@ -1105,7 +1111,7 @@ public void constrainLong() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void contactManager() throws Exception { test("ContactManager"); } @@ -1125,7 +1131,7 @@ public void convolverNode() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void coordinates() throws Exception { test("Coordinates"); } @@ -1181,7 +1187,7 @@ public void css() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function CSS2Properties() { [native code] }", FF_ESR = "function CSS2Properties() { [native code] }") public void css2Properties() throws Exception { @@ -1194,9 +1200,9 @@ public void css2Properties() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function CSSPageDescriptors() { [native code] }") - @HtmlUnitNYI(FF = "exception") + @HtmlUnitNYI(FF = "ReferenceError") public void cssPageDescriptors() throws Exception { test("CSSPageDescriptors"); } @@ -1205,7 +1211,7 @@ public void cssPageDescriptors() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssCharsetRule() throws Exception { test("CSSCharsetRule"); } @@ -1281,7 +1287,7 @@ public void cssKeyframesRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssMatrix() throws Exception { test("CSSMatrix"); } @@ -1323,7 +1329,7 @@ public void cssPageRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssPrimitiveValue() throws Exception { test("CSSPrimitiveValue"); } @@ -1368,7 +1374,6 @@ public void cssStyleDeclaration() throws Exception { */ @Test @Alerts("function CSSStyleRule() { [native code] }") - @AlertsStandards("function CSSStyleRule() { [native code] }") public void cssStyleRule() throws Exception { test("CSSStyleRule"); } @@ -1397,7 +1402,7 @@ public void cssSupportsRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssUnknownRule() throws Exception { test("CSSUnknownRule"); } @@ -1408,7 +1413,7 @@ public void cssUnknownRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssValue() throws Exception { test("CSSValue"); } @@ -1417,7 +1422,7 @@ public void cssValue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssValueList() throws Exception { test("CSSValueList"); } @@ -1426,7 +1431,7 @@ public void cssValueList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssViewportRule() throws Exception { test("CSSViewportRule"); } @@ -1453,7 +1458,7 @@ public void customEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStore() throws Exception { test("DataStore"); } @@ -1462,7 +1467,7 @@ public void dataStore() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStoreChangeEvent() throws Exception { test("DataStoreChangeEvent"); } @@ -1471,7 +1476,7 @@ public void dataStoreChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStoreCursor() throws Exception { test("DataStoreCursor"); } @@ -1480,7 +1485,7 @@ public void dataStoreCursor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStoreTask() throws Exception { test("DataStoreTask"); } @@ -1554,7 +1559,7 @@ public void decodeURIComponent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dedicatedWorkerGlobalScope() throws Exception { test("DedicatedWorkerGlobalScope"); } @@ -1572,7 +1577,7 @@ public void delayNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceAcceleration() throws Exception { test("DeviceAcceleration"); } @@ -1581,7 +1586,7 @@ public void deviceAcceleration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceLightEvent() throws Exception { test("DeviceLightEvent"); } @@ -1608,7 +1613,7 @@ public void deviceOrientationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceProximityEvent() throws Exception { test("DeviceProximityEvent"); } @@ -1617,7 +1622,7 @@ public void deviceProximityEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceRotationRate() throws Exception { test("DeviceRotationRate"); } @@ -1626,7 +1631,7 @@ public void deviceRotationRate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceStorage() throws Exception { test("DeviceStorage"); } @@ -1635,7 +1640,7 @@ public void deviceStorage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceStorageChangeEvent() throws Exception { test("DeviceStorageChangeEvent"); } @@ -1644,7 +1649,7 @@ public void deviceStorageChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryEntry() throws Exception { test("DirectoryEntry"); } @@ -1653,7 +1658,7 @@ public void directoryEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryEntrySync() throws Exception { test("DirectoryEntrySync"); } @@ -1662,7 +1667,7 @@ public void directoryEntrySync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryReader() throws Exception { test("DirectoryReader"); } @@ -1671,7 +1676,7 @@ public void directoryReader() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryReaderSync() throws Exception { test("DirectoryReaderSync"); } @@ -1702,7 +1707,7 @@ public void documentFragment() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void documentOrShadowRoot() throws Exception { test("DocumentOrShadowRoot"); } @@ -1712,7 +1717,7 @@ public void documentOrShadowRoot() throws Exception { */ @Test @Alerts("function DocumentTimeline() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception", FF = "exception", FF_ESR = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError", FF = "ReferenceError", FF_ESR = "ReferenceError") public void documentTimeline() throws Exception { test("DocumentTimeline"); } @@ -1721,7 +1726,7 @@ public void documentTimeline() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void documentTouch() throws Exception { test("DocumentTouch"); } @@ -1741,7 +1746,7 @@ public void documentType() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domApplication() throws Exception { test("DOMApplication"); } @@ -1750,7 +1755,7 @@ public void domApplication() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domApplicationsManager() throws Exception { test("DOMApplicationsManager"); } @@ -1759,7 +1764,7 @@ public void domApplicationsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domApplicationsRegistry() throws Exception { test("DOMApplicationsRegistry"); } @@ -1768,7 +1773,7 @@ public void domApplicationsRegistry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domConfiguration() throws Exception { test("DOMConfiguration"); } @@ -1779,7 +1784,7 @@ public void domConfiguration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domCursor() throws Exception { test("DOMCursor"); } @@ -1789,8 +1794,8 @@ public void domCursor() throws Exception { */ @Test @Alerts(DEFAULT = "function DOMError() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void domError() throws Exception { test("DOMError"); } @@ -1799,7 +1804,7 @@ public void domError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domErrorHandler() throws Exception { test("DOMErrorHandler"); } @@ -1819,7 +1824,7 @@ public void domException() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domHighResTimeStamp() throws Exception { test("DOMHighResTimeStamp"); } @@ -1839,7 +1844,7 @@ public void domImplementation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domImplementationList() throws Exception { test("DOMImplementationList"); } @@ -1848,7 +1853,7 @@ public void domImplementationList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domImplementationRegistry() throws Exception { test("DOMImplementationRegistry"); } @@ -1857,7 +1862,7 @@ public void domImplementationRegistry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domImplementationSource() throws Exception { test("DOMImplementationSource"); } @@ -1866,7 +1871,7 @@ public void domImplementationSource() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domLocator() throws Exception { test("DOMLocator"); } @@ -1893,7 +1898,7 @@ public void domMatrixReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domObject() throws Exception { test("DOMObject"); } @@ -1960,7 +1965,7 @@ public void domRectReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domRequest() throws Exception { test("DOMRequest"); } @@ -1969,7 +1974,7 @@ public void domRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domSettableTokenList() throws Exception { test("DOMSettableTokenList"); } @@ -1978,7 +1983,7 @@ public void domSettableTokenList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domString() throws Exception { test("DOMString"); } @@ -2007,7 +2012,7 @@ public void domStringMap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domTimeStamp() throws Exception { test("DOMTimeStamp"); } @@ -2027,7 +2032,7 @@ public void domTokenList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domUserData() throws Exception { test("DOMUserData"); } @@ -2036,7 +2041,7 @@ public void domUserData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void doubleRange() throws Exception { test("DoubleRange"); } @@ -2074,7 +2079,7 @@ public void element() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void elementTraversal() throws Exception { test("ElementTraversal"); } @@ -2101,7 +2106,7 @@ public void encodeURIComponent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entity() throws Exception { test("Entity"); } @@ -2110,7 +2115,7 @@ public void entity() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entityReference() throws Exception { test("EntityReference"); } @@ -2119,7 +2124,7 @@ public void entityReference() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entry() throws Exception { test("Entry"); } @@ -2128,7 +2133,7 @@ public void entry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entrySync() throws Exception { test("EntrySync"); } @@ -2139,7 +2144,7 @@ public void entrySync() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void enumerator() throws Exception { test("Enumerator"); } @@ -2204,7 +2209,7 @@ public void event() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void eventListener() throws Exception { test("EventListener"); } @@ -2213,7 +2218,7 @@ public void eventListener() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void eventNode() throws Exception { test("EventNode"); } @@ -2240,7 +2245,7 @@ public void eventTarget() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_blend_minmax() throws Exception { test("EXT_blend_minmax"); } @@ -2249,7 +2254,7 @@ public void ext_blend_minmax() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_color_buffer_float() throws Exception { test("EXT_color_buffer_float"); } @@ -2258,7 +2263,7 @@ public void ext_color_buffer_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_color_buffer_half_float() throws Exception { test("EXT_color_buffer_half_float"); } @@ -2267,7 +2272,7 @@ public void ext_color_buffer_half_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_disjoint_timer_query() throws Exception { test("EXT_disjoint_timer_query"); } @@ -2276,7 +2281,7 @@ public void ext_disjoint_timer_query() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_frag_depth() throws Exception { test("EXT_frag_depth"); } @@ -2285,7 +2290,7 @@ public void ext_frag_depth() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_shader_texture_lod() throws Exception { test("EXT_shader_texture_lod"); } @@ -2294,7 +2299,7 @@ public void ext_shader_texture_lod() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_sRGB() throws Exception { test("EXT_sRGB"); } @@ -2303,7 +2308,7 @@ public void ext_sRGB() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_texture_filter_anisotropic() throws Exception { test("EXT_texture_filter_anisotropic"); } @@ -2312,7 +2317,7 @@ public void ext_texture_filter_anisotropic() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void extendableEvent() throws Exception { test("ExtendableEvent"); } @@ -2321,7 +2326,7 @@ public void extendableEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void extendableMessageEvent() throws Exception { test("ExtendableMessageEvent"); } @@ -2332,7 +2337,7 @@ public void extendableMessageEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function External() { [native code] }", EDGE = "function External() { [native code] }") public void external() throws Exception { @@ -2343,7 +2348,7 @@ public void external() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function FederatedCredential() { [native code] }", EDGE = "function FederatedCredential() { [native code] }") public void federatedCredential() throws Exception { @@ -2354,7 +2359,7 @@ public void federatedCredential() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fetchEvent() throws Exception { test("FetchEvent"); } @@ -2372,7 +2377,7 @@ public void file() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileEntry() throws Exception { test("FileEntry"); } @@ -2381,7 +2386,7 @@ public void fileEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileEntrySync() throws Exception { test("FileEntrySync"); } @@ -2390,7 +2395,7 @@ public void fileEntrySync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileError() throws Exception { test("FileError"); } @@ -2399,7 +2404,7 @@ public void fileError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileException() throws Exception { test("FileException"); } @@ -2408,7 +2413,7 @@ public void fileException() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileHandle() throws Exception { test("FileHandle"); } @@ -2435,7 +2440,7 @@ public void fileReader() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileReaderSync() throws Exception { test("FileReaderSync"); } @@ -2444,7 +2449,7 @@ public void fileReaderSync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileRequest() throws Exception { test("FileRequest"); } @@ -2453,7 +2458,7 @@ public void fileRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function FileSystem() { [native code] }", FF_ESR = "function FileSystem() { [native code] }") public void fileSystem() throws Exception { @@ -2464,7 +2469,7 @@ public void fileSystem() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function FileSystemDirectoryEntry() { [native code] }", FF_ESR = "function FileSystemDirectoryEntry() { [native code] }") public void fileSystemDirectoryEntry() throws Exception { @@ -2475,7 +2480,7 @@ public void fileSystemDirectoryEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function FileSystemDirectoryReader() { [native code] }", FF_ESR = "function FileSystemDirectoryReader() { [native code] }") public void fileSystemDirectoryReader() throws Exception { @@ -2486,7 +2491,7 @@ public void fileSystemDirectoryReader() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function FileSystemEntry() { [native code] }", FF_ESR = "function FileSystemEntry() { [native code] }") public void fileSystemEntry() throws Exception { @@ -2497,7 +2502,7 @@ public void fileSystemEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function FileSystemFileEntry() { [native code] }", FF_ESR = "function FileSystemFileEntry() { [native code] }") public void fileSystemFileEntry() throws Exception { @@ -2508,7 +2513,7 @@ public void fileSystemFileEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemFlags() throws Exception { test("FileSystemFlags"); } @@ -2517,7 +2522,7 @@ public void fileSystemFlags() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemSync() throws Exception { test("FileSystemSync"); } @@ -2548,7 +2553,7 @@ public void float64Array() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fMRadio() throws Exception { test("FMRadio"); } @@ -2575,7 +2580,7 @@ public void fontFace() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function FontFaceSet() { [native code] }", FF_ESR = "function FontFaceSet() { [native code] }") public void fontFaceSet() throws Exception { @@ -2586,7 +2591,7 @@ public void fontFaceSet() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void formChild() throws Exception { test("FormChild"); } @@ -2606,7 +2611,7 @@ public void formData() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void formField() throws Exception { test("FormField"); } @@ -2662,7 +2667,7 @@ public void gamepadEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void generator() throws Exception { test("Generator"); } @@ -2671,7 +2676,7 @@ public void generator() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void generatorFunction() throws Exception { test("GeneratorFunction"); } @@ -2724,7 +2729,7 @@ public void geolocationPositionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void gestureEvent() throws Exception { test("GestureEvent"); } @@ -2733,7 +2738,7 @@ public void gestureEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void globalEventHandlers() throws Exception { test("GlobalEventHandlers"); } @@ -2742,7 +2747,7 @@ public void globalEventHandlers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void globalFetch() throws Exception { test("GlobalFetch"); } @@ -2782,7 +2787,7 @@ public void history() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void hMDVRDevice() throws Exception { test("HMDVRDevice"); } @@ -2815,7 +2820,7 @@ public void htmlAnchorElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlAppletElement() throws Exception { test("HTMLAppletElement"); } @@ -2859,7 +2864,7 @@ public void htmlBaseElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBaseFontElement() throws Exception { test("HTMLBaseFontElement"); } @@ -2870,7 +2875,7 @@ public void htmlBaseFontElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBGSoundElement() throws Exception { test("HTMLBGSoundElement"); } @@ -2881,7 +2886,7 @@ public void htmlBGSoundElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBlockElement() throws Exception { test("HTMLBlockElement"); } @@ -2892,7 +2897,7 @@ public void htmlBlockElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBlockQuoteElement() throws Exception { test("HTMLBlockQuoteElement"); } @@ -2958,7 +2963,7 @@ public void htmlCollection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlCommentElement() throws Exception { test("HTMLCommentElement"); } @@ -2967,7 +2972,7 @@ public void htmlCommentElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlContentElement() throws Exception { test("HTMLContentElement"); } @@ -2998,7 +3003,7 @@ public void htmlDataListElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDDElement() throws Exception { test("HTMLDDElement"); } @@ -3009,7 +3014,7 @@ public void htmlDDElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDefinitionDescriptionElement() throws Exception { test("HTMLDefinitionDescriptionElement"); } @@ -3020,7 +3025,7 @@ public void htmlDefinitionDescriptionElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDefinitionTermElement() throws Exception { test("HTMLDefinitionTermElement"); } @@ -3097,7 +3102,7 @@ public void htmlDocument() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDTElement() throws Exception { test("HTMLDTElement"); } @@ -3194,7 +3199,7 @@ public void htmlFrameSetElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlGenericElement() throws Exception { test("HTMLGenericElement"); } @@ -3247,7 +3252,7 @@ public void htmlHtmlElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlHyperlinkElementUtils() throws Exception { test("HTMLHyperlinkElementUtils"); } @@ -3280,7 +3285,7 @@ public void htmlImageElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlInlineQuotationElement() throws Exception { test("HTMLInlineQuotationElement"); } @@ -3302,7 +3307,7 @@ public void htmlInputElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlIsIndexElement() throws Exception { test("HTMLIsIndexElement"); } @@ -3311,7 +3316,7 @@ public void htmlIsIndexElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlKeygenElement() throws Exception { test("HTMLKeygenElement"); } @@ -3366,7 +3371,7 @@ public void htmlLinkElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlListElement() throws Exception { test("HTMLListElement"); } @@ -3419,7 +3424,7 @@ public void htmlMenuElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMenuItemElement() throws Exception { test("HTMLMenuItemElement"); } @@ -3463,7 +3468,7 @@ public void htmlModElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlNextIdElement() throws Exception { test("HTMLNextIdElement"); } @@ -3472,7 +3477,7 @@ public void htmlNextIdElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlNoShowElement() throws Exception { test("HTMLNoShowElement"); } @@ -3571,7 +3576,7 @@ public void htmlParamElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlPhraseElement() throws Exception { test("HTMLPhraseElement"); } @@ -3646,7 +3651,7 @@ public void htmlSelectElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlShadowElement() throws Exception { test("HTMLShadowElement"); } @@ -3732,7 +3737,7 @@ public void htmlTableColElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableComponent() throws Exception { test("HTMLTableComponent"); } @@ -3743,7 +3748,7 @@ public void htmlTableComponent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableDataCellElement() throws Exception { test("HTMLTableDataCellElement"); } @@ -3765,7 +3770,7 @@ public void htmlTableElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableHeaderCellElement() throws Exception { test("HTMLTableHeaderCellElement"); } @@ -3816,7 +3821,7 @@ public void htmlTextAreaElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTextElement() throws Exception { test("HTMLTextElement"); } @@ -3891,7 +3896,7 @@ public void htmlVideoElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlWBRElement() throws Exception { test("HTMLWBRElement"); } @@ -3909,7 +3914,7 @@ public void idbCursor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbCursorSync() throws Exception { test("IDBCursorSync"); } @@ -3936,7 +3941,7 @@ public void idbDatabase() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbDatabaseException() throws Exception { test("IDBDatabaseException"); } @@ -3945,7 +3950,7 @@ public void idbDatabaseException() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbDatabaseSync() throws Exception { test("IDBDatabaseSync"); } @@ -3954,7 +3959,7 @@ public void idbDatabaseSync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbEnvironment() throws Exception { test("IDBEnvironment"); } @@ -3963,7 +3968,7 @@ public void idbEnvironment() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbEnvironmentSync() throws Exception { test("IDBEnvironmentSync"); } @@ -3983,7 +3988,7 @@ public void idbFactory() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbFactorySync() throws Exception { test("IDBFactorySync"); } @@ -4001,7 +4006,7 @@ public void idbIndex() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbIndexSync() throws Exception { test("IDBIndexSync"); } @@ -4019,7 +4024,7 @@ public void idbKeyRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbLocaleAwareKeyRange() throws Exception { test("IDBLocaleAwareKeyRange"); } @@ -4028,7 +4033,7 @@ public void idbLocaleAwareKeyRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbMutableFile() throws Exception { test("IDBMutableFile"); } @@ -4046,7 +4051,7 @@ public void idbObjectStore() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbObjectStoreSync() throws Exception { test("IDBObjectStoreSync"); } @@ -4082,7 +4087,7 @@ public void idbTransaction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbTransactionSync() throws Exception { test("IDBTransactionSync"); } @@ -4100,7 +4105,7 @@ public void idbVersionChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbVersionChangeRequest() throws Exception { test("IDBVersionChangeRequest"); } @@ -4109,7 +4114,7 @@ public void idbVersionChangeRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void identityManager() throws Exception { test("IdentityManager"); } @@ -4156,7 +4161,7 @@ public void imageBitmap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void imageBitmapFactories() throws Exception { test("ImageBitmapFactories"); } @@ -4183,7 +4188,7 @@ public void imageData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void index() throws Exception { test("Index"); } @@ -4192,7 +4197,7 @@ public void index() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void indexedDB() throws Exception { test("IndexedDB"); } @@ -4210,7 +4215,7 @@ public void infinity() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function InputDeviceCapabilities() { [native code] }", EDGE = "function InputDeviceCapabilities() { [native code] }") public void inputDeviceCapabilities() throws Exception { @@ -4230,7 +4235,7 @@ public void inputEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void inputMethodContext() throws Exception { test("InputMethodContext"); } @@ -4239,7 +4244,7 @@ public void inputMethodContext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void installEvent() throws Exception { test("InstallEvent"); } @@ -4248,7 +4253,7 @@ public void installEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "null", FF_ESR = "null") public void installTrigger() throws Exception { @@ -4259,7 +4264,7 @@ public void installTrigger() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void installTriggerImpl() throws Exception { test("InstallTriggerImpl"); } @@ -4301,7 +4306,7 @@ public void int8Array() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function InternalError() { [native code] }", FF_ESR = "function InternalError() { [native code] }") @HtmlUnitNYI(CHROME = "function InternalError() { [native code] }", @@ -4389,7 +4394,7 @@ public void isNaN() throws Exception { */ @Test @Alerts(DEFAULT = "function Iterator() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void iterator() throws Exception { test("Iterator"); } @@ -4427,7 +4432,7 @@ public void keyframeEffect() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void keyframeEffectReadOnly() throws Exception { test("KeyframeEffectReadOnly"); } @@ -4436,7 +4441,7 @@ public void keyframeEffectReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n() throws Exception { test("L10n"); } @@ -4445,7 +4450,7 @@ public void l10n() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_formatValue() throws Exception { test("L10n.formatValue"); } @@ -4454,7 +4459,7 @@ public void l10n_formatValue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_get() throws Exception { test("L10n.get"); } @@ -4463,7 +4468,7 @@ public void l10n_get() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_code() throws Exception { test("L10n.language.code"); } @@ -4472,7 +4477,7 @@ public void l10n_language_code() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_direction() throws Exception { test("L10n.language.direction"); } @@ -4481,7 +4486,7 @@ public void l10n_language_direction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_once() throws Exception { test("L10n.once"); } @@ -4490,7 +4495,7 @@ public void l10n_once() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_ready() throws Exception { test("L10n.ready"); } @@ -4499,7 +4504,7 @@ public void l10n_ready() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_readyState() throws Exception { test("L10n.readyState"); } @@ -4508,7 +4513,7 @@ public void l10n_readyState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_setAttributes() throws Exception { test("L10n.setAttributes"); } @@ -4517,7 +4522,7 @@ public void l10n_setAttributes() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void linkStyle() throws Exception { test("LinkStyle"); } @@ -4526,7 +4531,7 @@ public void linkStyle() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void localFileSystem() throws Exception { test("LocalFileSystem"); } @@ -4535,7 +4540,7 @@ public void localFileSystem() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void localFileSystemSync() throws Exception { test("LocalFileSystemSync"); } @@ -4546,7 +4551,7 @@ public void localFileSystemSync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void localMediaStream() throws Exception { test("LocalMediaStream"); } @@ -4558,7 +4563,6 @@ public void localMediaStream() throws Exception { */ @Test @Alerts("function Location() { [native code] }") - @AlertsStandards("function Location() { [native code] }") public void location() throws Exception { test("Location"); } @@ -4567,7 +4571,7 @@ public void location() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void lockedFile() throws Exception { test("LockedFile"); } @@ -4576,7 +4580,7 @@ public void lockedFile() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void longRange() throws Exception { test("LongRange"); } @@ -4648,7 +4652,7 @@ public void mediaError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function MediaKeyError() { [native code] }", FF_ESR = "function MediaKeyError() { [native code] }") public void mediaKeyError() throws Exception { @@ -4659,7 +4663,7 @@ public void mediaKeyError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeyEvent() throws Exception { test("MediaKeyEvent"); } @@ -4713,7 +4717,7 @@ public void mediaKeySystemAccess() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeySystemConfiguration() throws Exception { test("MediaKeySystemConfiguration"); } @@ -4751,7 +4755,7 @@ public void mediaQueryListEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaQueryListListener() throws Exception { test("MediaQueryListListener"); } @@ -4805,7 +4809,7 @@ public void mediaStreamAudioSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStreamConstraints() throws Exception { test("MediaStreamConstraints"); } @@ -4841,7 +4845,7 @@ public void mediaStreamTrackEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaTrackConstraints() throws Exception { test("MediaTrackConstraints"); } @@ -4850,7 +4854,7 @@ public void mediaTrackConstraints() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaTrackSettings() throws Exception { test("MediaTrackSettings"); } @@ -4859,7 +4863,7 @@ public void mediaTrackSettings() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaTrackSupportedConstraints() throws Exception { test("MediaTrackSupportedConstraints"); } @@ -4901,7 +4905,7 @@ public void messagePort() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void metadata() throws Exception { test("Metadata"); } @@ -5015,7 +5019,7 @@ public void mouseEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function MouseScrollEvent() { [native code] }", FF_ESR = "function MouseScrollEvent() { [native code] }") public void mouseScrollEvent() throws Exception { @@ -5026,7 +5030,7 @@ public void mouseScrollEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mouseWheelEvent() throws Exception { test("MouseWheelEvent"); } @@ -5035,7 +5039,7 @@ public void mouseWheelEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozActivity() throws Exception { test("MozActivity"); } @@ -5044,7 +5048,7 @@ public void mozActivity() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozActivityOptions() throws Exception { test("MozActivityOptions"); } @@ -5053,7 +5057,7 @@ public void mozActivityOptions() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozActivityRequestHandler() throws Exception { test("MozActivityRequestHandler"); } @@ -5062,7 +5066,7 @@ public void mozActivityRequestHandler() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozAlarmsManager() throws Exception { test("MozAlarmsManager"); } @@ -5071,7 +5075,7 @@ public void mozAlarmsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozContact() throws Exception { test("MozContact"); } @@ -5080,7 +5084,7 @@ public void mozContact() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozContactChangeEvent() throws Exception { test("MozContactChangeEvent"); } @@ -5089,7 +5093,7 @@ public void mozContactChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozCSSKeyframesRule() throws Exception { test("MozCSSKeyframesRule"); } @@ -5098,7 +5102,7 @@ public void mozCSSKeyframesRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozIccManager() throws Exception { test("MozIccManager"); } @@ -5107,7 +5111,7 @@ public void mozIccManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMmsEvent() throws Exception { test("MozMmsEvent"); } @@ -5116,7 +5120,7 @@ public void mozMmsEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMmsMessage() throws Exception { test("MozMmsMessage"); } @@ -5125,7 +5129,7 @@ public void mozMmsMessage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileCellInfo() throws Exception { test("MozMobileCellInfo"); } @@ -5134,7 +5138,7 @@ public void mozMobileCellInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileCFInfo() throws Exception { test("MozMobileCFInfo"); } @@ -5143,7 +5147,7 @@ public void mozMobileCFInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileConnection() throws Exception { test("MozMobileConnection"); } @@ -5152,7 +5156,7 @@ public void mozMobileConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileConnectionInfo() throws Exception { test("MozMobileConnectionInfo"); } @@ -5161,7 +5165,7 @@ public void mozMobileConnectionInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileICCInfo() throws Exception { test("MozMobileICCInfo"); } @@ -5170,7 +5174,7 @@ public void mozMobileICCInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileMessageManager() throws Exception { test("MozMobileMessageManager"); } @@ -5179,7 +5183,7 @@ public void mozMobileMessageManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileMessageThread() throws Exception { test("MozMobileMessageThread"); } @@ -5188,7 +5192,7 @@ public void mozMobileMessageThread() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileNetworkInfo() throws Exception { test("MozMobileNetworkInfo"); } @@ -5197,7 +5201,7 @@ public void mozMobileNetworkInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNDEFRecord() throws Exception { test("MozNDEFRecord"); } @@ -5206,7 +5210,7 @@ public void mozNDEFRecord() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNetworkStats() throws Exception { test("MozNetworkStats"); } @@ -5215,7 +5219,7 @@ public void mozNetworkStats() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNetworkStatsData() throws Exception { test("MozNetworkStatsData"); } @@ -5224,7 +5228,7 @@ public void mozNetworkStatsData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNetworkStatsManager() throws Exception { test("MozNetworkStatsManager"); } @@ -5233,7 +5237,7 @@ public void mozNetworkStatsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNFC() throws Exception { test("MozNFC"); } @@ -5242,7 +5246,7 @@ public void mozNFC() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNFCPeer() throws Exception { test("MozNFCPeer"); } @@ -5251,7 +5255,7 @@ public void mozNFCPeer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNFCTag() throws Exception { test("MozNFCTag"); } @@ -5260,7 +5264,7 @@ public void mozNFCTag() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozPowerManager() throws Exception { test("MozPowerManager"); } @@ -5269,7 +5273,7 @@ public void mozPowerManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozRTCIceCandidate() throws Exception { test("mozRTCIceCandidate"); } @@ -5278,7 +5282,7 @@ public void mozRTCIceCandidate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozRTCPeerConnection() throws Exception { test("mozRTCPeerConnection"); } @@ -5287,7 +5291,7 @@ public void mozRTCPeerConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozRTCSessionDescription() throws Exception { test("mozRTCSessionDescription"); } @@ -5296,7 +5300,7 @@ public void mozRTCSessionDescription() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSettingsEvent() throws Exception { test("MozSettingsEvent"); } @@ -5305,7 +5309,7 @@ public void mozSettingsEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsEvent() throws Exception { test("MozSmsEvent"); } @@ -5314,7 +5318,7 @@ public void mozSmsEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsFilter() throws Exception { test("MozSmsFilter"); } @@ -5323,7 +5327,7 @@ public void mozSmsFilter() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsManager() throws Exception { test("MozSmsManager"); } @@ -5332,7 +5336,7 @@ public void mozSmsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsMessage() throws Exception { test("MozSmsMessage"); } @@ -5341,7 +5345,7 @@ public void mozSmsMessage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsSegmentInfo() throws Exception { test("MozSmsSegmentInfo"); } @@ -5350,7 +5354,7 @@ public void mozSmsSegmentInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSocial() throws Exception { test("MozSocial"); } @@ -5359,7 +5363,7 @@ public void mozSocial() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozTimeManager() throws Exception { test("MozTimeManager"); } @@ -5368,7 +5372,7 @@ public void mozTimeManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozVoicemail() throws Exception { test("MozVoicemail"); } @@ -5377,7 +5381,7 @@ public void mozVoicemail() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozVoicemailEvent() throws Exception { test("MozVoicemailEvent"); } @@ -5386,7 +5390,7 @@ public void mozVoicemailEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozVoicemailStatus() throws Exception { test("MozVoicemailStatus"); } @@ -5395,7 +5399,7 @@ public void mozVoicemailStatus() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiConnectionInfoEvent() throws Exception { test("MozWifiConnectionInfoEvent"); } @@ -5404,7 +5408,7 @@ public void mozWifiConnectionInfoEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiP2pGroupOwner() throws Exception { test("MozWifiP2pGroupOwner"); } @@ -5413,7 +5417,7 @@ public void mozWifiP2pGroupOwner() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiP2pManager() throws Exception { test("MozWifiP2pManager"); } @@ -5422,7 +5426,7 @@ public void mozWifiP2pManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiStatusChangeEvent() throws Exception { test("MozWifiStatusChangeEvent"); } @@ -5431,7 +5435,7 @@ public void mozWifiStatusChangeEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void msCurrentStyleCSSProperties() throws Exception { test("MSCurrentStyleCSSProperties"); } @@ -5440,7 +5444,7 @@ public void msCurrentStyleCSSProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void msGestureEvent() throws Exception { test("MSGestureEvent"); } @@ -5449,7 +5453,7 @@ public void msGestureEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void msStyleCSSProperties() throws Exception { test("MSStyleCSSProperties"); } @@ -5460,7 +5464,7 @@ public void msStyleCSSProperties() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function MutationEvent() { [native code] }", FF_ESR = "function MutationEvent() { [native code] }") public void mutationEvent() throws Exception { @@ -5500,7 +5504,7 @@ public void namedNodeMap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nameList() throws Exception { test("NameList"); } @@ -5511,7 +5515,7 @@ public void nameList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void namespace() throws Exception { test("Namespace"); } @@ -5522,7 +5526,7 @@ public void namespace() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void namespaceCollection() throws Exception { test("NamespaceCollection"); } @@ -5542,7 +5546,7 @@ public void naN() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nativeXPathNSResolver() throws Exception { test("NativeXPathNSResolver"); } @@ -5562,7 +5566,7 @@ public void navigator() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorConcurrentHardware() throws Exception { test("NavigatorConcurrentHardware"); } @@ -5571,7 +5575,7 @@ public void navigatorConcurrentHardware() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorGeolocation() throws Exception { test("NavigatorGeolocation"); } @@ -5580,7 +5584,7 @@ public void navigatorGeolocation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorID() throws Exception { test("NavigatorID"); } @@ -5589,7 +5593,7 @@ public void navigatorID() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorLanguage() throws Exception { test("NavigatorLanguage"); } @@ -5598,7 +5602,7 @@ public void navigatorLanguage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorOnLine() throws Exception { test("NavigatorOnLine"); } @@ -5607,7 +5611,7 @@ public void navigatorOnLine() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorPlugins() throws Exception { test("NavigatorPlugins"); } @@ -5616,7 +5620,7 @@ public void navigatorPlugins() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorStorage() throws Exception { test("NavigatorStorage"); } @@ -5625,7 +5629,7 @@ public void navigatorStorage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function NetworkInformation() { [native code] }", EDGE = "function NetworkInformation() { [native code] }") public void networkInformation() throws Exception { @@ -5678,7 +5682,7 @@ public void nodeList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nonDocumentTypeChildNode() throws Exception { test("NonDocumentTypeChildNode"); } @@ -5687,7 +5691,7 @@ public void nonDocumentTypeChildNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void notation() throws Exception { test("Notation"); } @@ -5707,7 +5711,7 @@ public void notification() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void notificationEvent() throws Exception { test("NotificationEvent"); } @@ -5716,7 +5720,7 @@ public void notificationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void notifyAudioAvailableEvent() throws Exception { test("NotifyAudioAvailableEvent"); } @@ -5743,7 +5747,7 @@ public void object() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_element_index_uint() throws Exception { test("OES_element_index_uint"); } @@ -5752,7 +5756,7 @@ public void oes_element_index_uint() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_standard_derivatives() throws Exception { test("OES_standard_derivatives"); } @@ -5761,7 +5765,7 @@ public void oes_standard_derivatives() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_float() throws Exception { test("OES_texture_float"); } @@ -5770,7 +5774,7 @@ public void oes_texture_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_float_linear() throws Exception { test("OES_texture_float_linear"); } @@ -5779,7 +5783,7 @@ public void oes_texture_float_linear() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_half_float() throws Exception { test("OES_texture_half_float"); } @@ -5788,7 +5792,7 @@ public void oes_texture_half_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_half_float_linear() throws Exception { test("OES_texture_half_float_linear"); } @@ -5797,7 +5801,7 @@ public void oes_texture_half_float_linear() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_vertex_array_object() throws Exception { test("OES_vertex_array_object"); } @@ -5824,7 +5828,7 @@ public void offlineAudioContext() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void offlineResourceList() throws Exception { test("OfflineResourceList"); } @@ -5834,10 +5838,10 @@ public void offlineResourceList() throws Exception { */ @Test @Alerts("function OffscreenCanvas() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", - EDGE = "exception", - FF = "exception", - FF_ESR = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", + EDGE = "ReferenceError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void offscreenCanvas() throws Exception { test("OffscreenCanvas"); } @@ -5866,7 +5870,7 @@ public void oscillatorNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void overflowEvent() throws Exception { test("OverflowEvent"); } @@ -5893,7 +5897,7 @@ public void pannerNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void parallelArray() throws Exception { test("ParallelArray"); } @@ -5902,7 +5906,7 @@ public void parallelArray() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void parentNode() throws Exception { test("ParentNode"); } @@ -5929,7 +5933,7 @@ public void parseInt() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PasswordCredential() { [native code] }", EDGE = "function PasswordCredential() { [native code] }") public void passwordCredential() throws Exception { @@ -5951,7 +5955,7 @@ public void path2D() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PaymentAddress() { [native code] }", EDGE = "function PaymentAddress() { [native code] }") public void paymentAddress() throws Exception { @@ -5962,7 +5966,7 @@ public void paymentAddress() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PaymentRequest() { [native code] }", EDGE = "function PaymentRequest() { [native code] }") public void paymentRequest() throws Exception { @@ -5973,7 +5977,7 @@ public void paymentRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PaymentResponse() { [native code] }", EDGE = "function PaymentResponse() { [native code] }") public void paymentResponse() throws Exception { @@ -6002,7 +6006,7 @@ public void performanceEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void performanceFrameTiming() throws Exception { test("PerformanceFrameTiming"); } @@ -6083,7 +6087,7 @@ public void performanceTiming() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void periodicSyncEvent() throws Exception { test("PeriodicSyncEvent"); } @@ -6092,7 +6096,7 @@ public void periodicSyncEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PeriodicSyncManager() { [native code] }", EDGE = "function PeriodicSyncManager() { [native code] }") public void periodicSyncManager() throws Exception { @@ -6103,7 +6107,7 @@ public void periodicSyncManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void periodicSyncRegistration() throws Exception { test("PeriodicSyncRegistration"); } @@ -6130,7 +6134,7 @@ public void permissions() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void permissionSettings() throws Exception { test("PermissionSettings"); } @@ -6170,7 +6174,7 @@ public void pluginArray() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void point() throws Exception { test("Point"); } @@ -6199,7 +6203,7 @@ public void popStateEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void popup() throws Exception { test("Popup"); } @@ -6208,7 +6212,7 @@ public void popup() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void portCollection() throws Exception { test("PortCollection"); } @@ -6219,7 +6223,7 @@ public void portCollection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void position() throws Exception { test("Position"); } @@ -6228,7 +6232,7 @@ public void position() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void positionError() throws Exception { test("PositionError"); } @@ -6237,7 +6241,7 @@ public void positionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void positionOptions() throws Exception { test("PositionOptions"); } @@ -6246,7 +6250,7 @@ public void positionOptions() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void positionSensorVRDevice() throws Exception { test("PositionSensorVRDevice"); } @@ -6255,7 +6259,7 @@ public void positionSensorVRDevice() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void powerManager() throws Exception { test("PowerManager"); } @@ -6264,7 +6268,7 @@ public void powerManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function Presentation() { [native code] }", EDGE = "function Presentation() { [native code] }") public void presentation() throws Exception { @@ -6275,7 +6279,7 @@ public void presentation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PresentationAvailability() { [native code] }", EDGE = "function PresentationAvailability() { [native code] }") public void presentationAvailability() throws Exception { @@ -6286,7 +6290,7 @@ public void presentationAvailability() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PresentationConnection() { [native code] }", EDGE = "function PresentationConnection() { [native code] }") public void presentationConnection() throws Exception { @@ -6297,7 +6301,7 @@ public void presentationConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PresentationConnectionAvailableEvent() { [native code] }", EDGE = "function PresentationConnectionAvailableEvent() { [native code] }") public void presentationConnectionAvailableEvent() throws Exception { @@ -6308,7 +6312,7 @@ public void presentationConnectionAvailableEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationConnectionClosedEvent() throws Exception { test("PresentationConnectionClosedEvent"); } @@ -6317,7 +6321,7 @@ public void presentationConnectionClosedEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PresentationConnectionCloseEvent() { [native code] }", EDGE = "function PresentationConnectionCloseEvent() { [native code] }") public void presentationConnectionCloseEvent() throws Exception { @@ -6328,11 +6332,11 @@ public void presentationConnectionCloseEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PresentationConnectionList() { [native code] }", EDGE = "function PresentationConnectionList() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", - EDGE = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", + EDGE = "ReferenceError") public void presentationConnectionList() throws Exception { test("PresentationConnectionList"); } @@ -6341,11 +6345,11 @@ public void presentationConnectionList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PresentationReceiver() { [native code] }", EDGE = "function PresentationReceiver() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", - EDGE = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", + EDGE = "ReferenceError") public void presentationReceiver() throws Exception { test("PresentationReceiver"); } @@ -6354,7 +6358,7 @@ public void presentationReceiver() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PresentationRequest() { [native code] }", EDGE = "function PresentationRequest() { [native code] }") public void presentationRequest() throws Exception { @@ -6394,7 +6398,7 @@ public void promise() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void promiseRejection() throws Exception { test("PromiseRejection"); } @@ -6412,7 +6416,7 @@ public void promiseRejectionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void promiseResolver() throws Exception { test("PromiseResolver"); } @@ -6430,7 +6434,7 @@ public void proxy() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pushEvent() throws Exception { test("PushEvent"); } @@ -6448,7 +6452,7 @@ public void pushManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pushMessageData() throws Exception { test("PushMessageData"); } @@ -6457,7 +6461,7 @@ public void pushMessageData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pushRegistrationManager() throws Exception { test("PushRegistrationManager"); } @@ -6493,7 +6497,7 @@ public void radioNodeList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void randomSource() throws Exception { test("RandomSource"); } @@ -6522,7 +6526,7 @@ public void rangeError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void readableByteStream() throws Exception { test("ReadableByteStream"); } @@ -6567,7 +6571,7 @@ public void regExp() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function RemotePlayback() { [native code] }", EDGE = "function RemotePlayback() { [native code] }") public void remotePlayback() throws Exception { @@ -6578,7 +6582,7 @@ public void remotePlayback() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void renderingContext() throws Exception { test("RenderingContext"); } @@ -6607,7 +6611,7 @@ public void response() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rowContainer() throws Exception { test("RowContainer"); } @@ -6625,7 +6629,7 @@ public void rtcCertificate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcConfiguration() throws Exception { test("RTCConfiguration"); } @@ -6635,10 +6639,10 @@ public void rtcConfiguration() throws Exception { */ @Test @Alerts("function RTCDataChannel() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", - EDGE = "exception", - FF = "exception", - FF_ESR = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", + EDGE = "ReferenceError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void rtcDataChannel() throws Exception { test("RTCDataChannel"); } @@ -6665,7 +6669,7 @@ public void rtcIceCandidate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIceServer() throws Exception { test("RTCIceServer"); } @@ -6674,7 +6678,7 @@ public void rtcIceServer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIdentityAssertion() throws Exception { test("RTCIdentityAssertion"); } @@ -6683,7 +6687,7 @@ public void rtcIdentityAssertion() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIdentityErrorEvent() throws Exception { test("RTCIdentityErrorEvent"); } @@ -6692,7 +6696,7 @@ public void rtcIdentityErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIdentityEvent() throws Exception { test("RTCIdentityEvent"); } @@ -6737,7 +6741,7 @@ public void rtcSessionDescription() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcSessionDescriptionCallback() throws Exception { test("RTCSessionDescriptionCallback"); } @@ -6822,7 +6826,7 @@ public void serviceWorkerContainer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void serviceWorkerGlobalScope() throws Exception { test("ServiceWorkerGlobalScope"); } @@ -6831,7 +6835,7 @@ public void serviceWorkerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void serviceWorkerMessageEvent() throws Exception { test("ServiceWorkerMessageEvent"); } @@ -6849,7 +6853,7 @@ public void serviceWorkerRegistration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void serviceWorkerState() throws Exception { test("ServiceWorkerState"); } @@ -6867,7 +6871,7 @@ public void set() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void settingsLock() throws Exception { test("SettingsLock"); } @@ -6876,7 +6880,7 @@ public void settingsLock() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void settingsManager() throws Exception { test("SettingsManager"); } @@ -6896,7 +6900,7 @@ public void shadowRoot() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void sharedArrayBuffer() throws Exception { test("SharedArrayBuffer"); } @@ -6905,7 +6909,7 @@ public void sharedArrayBuffer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void sharedKeyframeList() throws Exception { test("SharedKeyframeList"); } @@ -6925,7 +6929,7 @@ public void sharedWorker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void sharedWorkerGlobalScope() throws Exception { test("SharedWorkerGlobalScope"); } @@ -6934,7 +6938,7 @@ public void sharedWorkerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd() throws Exception { test("SIMD"); } @@ -6943,7 +6947,7 @@ public void simd() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool16x8() throws Exception { test("SIMD.Bool16x8"); } @@ -6952,7 +6956,7 @@ public void simd_Bool16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool32x4() throws Exception { test("SIMD.Bool32x4"); } @@ -6961,7 +6965,7 @@ public void simd_Bool32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool64x2() throws Exception { test("SIMD.Bool64x2"); } @@ -6970,7 +6974,7 @@ public void simd_Bool64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool8x16() throws Exception { test("SIMD.Bool8x16"); } @@ -6979,7 +6983,7 @@ public void simd_Bool8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float32x4() throws Exception { test("SIMD.float32x4"); } @@ -6988,7 +6992,7 @@ public void simd_float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float32x4() throws Exception { test("SIMD.Float32x4"); } @@ -6997,7 +7001,7 @@ public void simd_Float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float64x2() throws Exception { test("SIMD.float64x2"); } @@ -7006,7 +7010,7 @@ public void simd_float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float64x2() throws Exception { test("SIMD.Float64x2"); } @@ -7015,7 +7019,7 @@ public void simd_Float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int16x8() throws Exception { test("SIMD.int16x8"); } @@ -7024,7 +7028,7 @@ public void simd_int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int16x8() throws Exception { test("SIMD.Int16x8"); } @@ -7033,7 +7037,7 @@ public void simd_Int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int32x4() throws Exception { test("SIMD.int32x4"); } @@ -7042,7 +7046,7 @@ public void simd_int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int32x4() throws Exception { test("SIMD.Int32x4"); } @@ -7051,7 +7055,7 @@ public void simd_Int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int8x16() throws Exception { test("SIMD.int8x16"); } @@ -7060,7 +7064,7 @@ public void simd_int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int8x16() throws Exception { test("SIMD.Int8x16"); } @@ -7069,7 +7073,7 @@ public void simd_Int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint16x8() throws Exception { test("SIMD.Uint16x8"); } @@ -7078,7 +7082,7 @@ public void simd_Uint16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint32x4() throws Exception { test("SIMD.Uint32x4"); } @@ -7087,7 +7091,7 @@ public void simd_Uint32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint8x16() throws Exception { test("SIMD.Uint8x16"); } @@ -7098,7 +7102,7 @@ public void simd_Uint8x16() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simpleArray() throws Exception { test("SimpleArray"); } @@ -7107,7 +7111,7 @@ public void simpleArray() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void siteBoundCredential() throws Exception { test("SiteBoundCredential"); } @@ -7134,7 +7138,7 @@ public void sourceBufferList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechGrammar() throws Exception { test("SpeechGrammar"); } @@ -7143,7 +7147,7 @@ public void speechGrammar() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechGrammarList() throws Exception { test("SpeechGrammarList"); } @@ -7152,7 +7156,7 @@ public void speechGrammarList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognition() throws Exception { test("SpeechRecognition"); } @@ -7161,7 +7165,7 @@ public void speechRecognition() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionAlternative() throws Exception { test("SpeechRecognitionAlternative"); } @@ -7170,7 +7174,7 @@ public void speechRecognitionAlternative() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionError() throws Exception { test("SpeechRecognitionError"); } @@ -7179,7 +7183,7 @@ public void speechRecognitionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionErrorEvent() throws Exception { test("SpeechRecognitionErrorEvent"); } @@ -7188,7 +7192,7 @@ public void speechRecognitionErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionEvent() throws Exception { test("SpeechRecognitionEvent"); } @@ -7197,7 +7201,7 @@ public void speechRecognitionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionResult() throws Exception { test("SpeechRecognitionResult"); } @@ -7206,7 +7210,7 @@ public void speechRecognitionResult() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionResultList() throws Exception { test("SpeechRecognitionResultList"); } @@ -7260,7 +7264,7 @@ public void speechSynthesisVoice() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void staticNodeList() throws Exception { test("StaticNodeList"); } @@ -7280,7 +7284,7 @@ public void stereoPannerNode() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void stopIteration() throws Exception { test("StopIteration"); } @@ -7300,7 +7304,7 @@ public void storage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void storageEstimate() throws Exception { test("StorageEstimate"); } @@ -7327,7 +7331,7 @@ public void storageManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void storageQuota() throws Exception { test("StorageQuota"); } @@ -7345,7 +7349,7 @@ public void string() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void styleMedia() throws Exception { test("StyleMedia"); } @@ -7403,7 +7407,7 @@ public void svgAElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAltGlyphElement() throws Exception { test("SVGAltGlyphElement"); } @@ -7423,7 +7427,7 @@ public void svgAngle() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimateColorElement() throws Exception { test("SVGAnimateColorElement"); } @@ -7504,7 +7508,7 @@ public void svgAnimatedNumberList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedPoints() throws Exception { test("SVGAnimatedPoints"); } @@ -7622,7 +7626,7 @@ public void svgComponentTransferFunctionElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgCursorElement() throws Exception { test("SVGCursorElement"); } @@ -7653,7 +7657,8 @@ public void svgDescElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "ReferenceError", + FF = "function SVGDiscardElement() { [native code] }") public void svgDiscardElement() throws Exception { test("SVGDiscardElement"); } @@ -7662,7 +7667,7 @@ public void svgDiscardElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgDocument() throws Exception { test("SVGDocument"); } @@ -7693,7 +7698,7 @@ public void svgEllipseElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgEvent() throws Exception { test("SVGEvent"); } @@ -7986,7 +7991,7 @@ public void svgFilterElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontElement() throws Exception { test("SVGFontElement"); } @@ -7995,7 +8000,7 @@ public void svgFontElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceElement() throws Exception { test("SVGFontFaceElement"); } @@ -8004,7 +8009,7 @@ public void svgFontFaceElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceFormatElement() throws Exception { test("SVGFontFaceFormatElement"); } @@ -8013,7 +8018,7 @@ public void svgFontFaceFormatElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceNameElement() throws Exception { test("SVGFontFaceNameElement"); } @@ -8022,7 +8027,7 @@ public void svgFontFaceNameElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceSrcElement() throws Exception { test("SVGFontFaceSrcElement"); } @@ -8031,7 +8036,7 @@ public void svgFontFaceSrcElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceUriElement() throws Exception { test("SVGFontFaceUriElement"); } @@ -8071,7 +8076,7 @@ public void svgGeometryElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgGlyphElement() throws Exception { test("SVGGlyphElement"); } @@ -8098,7 +8103,7 @@ public void svgGraphicsElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgHKernElement() throws Exception { test("SVGHKernElement"); } @@ -8202,7 +8207,7 @@ public void svgMetadataElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgMissingGlyphElement() throws Exception { test("SVGMissingGlyphElement"); } @@ -8251,7 +8256,7 @@ public void svgPathElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSeg() throws Exception { test("SVGPathSeg"); } @@ -8260,7 +8265,7 @@ public void svgPathSeg() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegArcAbs() throws Exception { test("SVGPathSegArcAbs"); } @@ -8269,7 +8274,7 @@ public void svgPathSegArcAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegArcRel() throws Exception { test("SVGPathSegArcRel"); } @@ -8278,7 +8283,7 @@ public void svgPathSegArcRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegClosePath() throws Exception { test("SVGPathSegClosePath"); } @@ -8287,7 +8292,7 @@ public void svgPathSegClosePath() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicAbs() throws Exception { test("SVGPathSegCurvetoCubicAbs"); } @@ -8296,7 +8301,7 @@ public void svgPathSegCurvetoCubicAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicRel() throws Exception { test("SVGPathSegCurvetoCubicRel"); } @@ -8305,7 +8310,7 @@ public void svgPathSegCurvetoCubicRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicSmoothAbs() throws Exception { test("SVGPathSegCurvetoCubicSmoothAbs"); } @@ -8314,7 +8319,7 @@ public void svgPathSegCurvetoCubicSmoothAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicSmoothRel() throws Exception { test("SVGPathSegCurvetoCubicSmoothRel"); } @@ -8323,7 +8328,7 @@ public void svgPathSegCurvetoCubicSmoothRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticAbs() throws Exception { test("SVGPathSegCurvetoQuadraticAbs"); } @@ -8332,7 +8337,7 @@ public void svgPathSegCurvetoQuadraticAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticRel() throws Exception { test("SVGPathSegCurvetoQuadraticRel"); } @@ -8341,7 +8346,7 @@ public void svgPathSegCurvetoQuadraticRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticSmoothAbs() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothAbs"); } @@ -8350,7 +8355,7 @@ public void svgPathSegCurvetoQuadraticSmoothAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticSmoothRel() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothRel"); } @@ -8359,7 +8364,7 @@ public void svgPathSegCurvetoQuadraticSmoothRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoAbs() throws Exception { test("SVGPathSegLinetoAbs"); } @@ -8368,7 +8373,7 @@ public void svgPathSegLinetoAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoHorizontalAbs() throws Exception { test("SVGPathSegLinetoHorizontalAbs"); } @@ -8377,7 +8382,7 @@ public void svgPathSegLinetoHorizontalAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoHorizontalRel() throws Exception { test("SVGPathSegLinetoHorizontalRel"); } @@ -8386,7 +8391,7 @@ public void svgPathSegLinetoHorizontalRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoRel() throws Exception { test("SVGPathSegLinetoRel"); } @@ -8395,7 +8400,7 @@ public void svgPathSegLinetoRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoVerticalAbs() throws Exception { test("SVGPathSegLinetoVerticalAbs"); } @@ -8404,7 +8409,7 @@ public void svgPathSegLinetoVerticalAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoVerticalRel() throws Exception { test("SVGPathSegLinetoVerticalRel"); } @@ -8413,7 +8418,7 @@ public void svgPathSegLinetoVerticalRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegList() throws Exception { test("SVGPathSegList"); } @@ -8422,7 +8427,7 @@ public void svgPathSegList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegMovetoAbs() throws Exception { test("SVGPathSegMovetoAbs"); } @@ -8431,7 +8436,7 @@ public void svgPathSegMovetoAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegMovetoRel() throws Exception { test("SVGPathSegMovetoRel"); } @@ -8533,7 +8538,7 @@ public void svgRectElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgRenderingIntent() throws Exception { test("SVGRenderingIntent"); } @@ -8584,7 +8589,7 @@ public void svgStringList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgStylable() throws Exception { test("SVGStylable"); } @@ -8637,7 +8642,7 @@ public void svgSymbolElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTests() throws Exception { test("SVGTests"); } @@ -8706,7 +8711,7 @@ public void svgTransform() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTransformable() throws Exception { test("SVGTransformable"); } @@ -8724,7 +8729,7 @@ public void svgTransformList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTRefElement() throws Exception { test("SVGTRefElement"); } @@ -8775,7 +8780,7 @@ public void svgViewElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgViewSpec() throws Exception { test("SVGViewSpec"); } @@ -8784,7 +8789,7 @@ public void svgViewSpec() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgVKernElement() throws Exception { test("SVGVKernElement"); } @@ -8793,7 +8798,7 @@ public void svgVKernElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgZoomEvent() throws Exception { test("SVGZoomEvent"); } @@ -8811,7 +8816,7 @@ public void symbol() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void syncEvent() throws Exception { test("SyncEvent"); } @@ -8820,7 +8825,7 @@ public void syncEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function SyncManager() { [native code] }", EDGE = "function SyncManager() { [native code] }") public void syncManager() throws Exception { @@ -8831,7 +8836,7 @@ public void syncManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void syncRegistration() throws Exception { test("SyncRegistration"); } @@ -8849,7 +8854,7 @@ public void syntaxError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void tcpServerSocket() throws Exception { test("TCPServerSocket"); } @@ -8858,7 +8863,7 @@ public void tcpServerSocket() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void tcpSocket() throws Exception { test("TCPSocket"); } @@ -8867,7 +8872,7 @@ public void tcpSocket() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void telephony() throws Exception { test("Telephony"); } @@ -8876,7 +8881,7 @@ public void telephony() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void telephonyCall() throws Exception { test("TelephonyCall"); } @@ -8885,7 +8890,7 @@ public void telephonyCall() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void telephonyCallGroup() throws Exception { test("TelephonyCallGroup"); } @@ -8924,7 +8929,7 @@ public void textEncoder() throws Exception { */ @Test @Alerts(DEFAULT = "function TextEvent() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void textEvent() throws Exception { test("TextEvent"); } @@ -8944,7 +8949,7 @@ public void textMetrics() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void textRange() throws Exception { test("TextRange"); } @@ -8989,7 +8994,7 @@ public void textTrackList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function TimeEvent() { [native code] }", FF_ESR = "function TimeEvent() { [native code] }") public void timeEvent() throws Exception { @@ -9009,7 +9014,7 @@ public void timeRanges() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function Touch() { [native code] }", EDGE = "function Touch() { [native code] }") public void touch() throws Exception { @@ -9020,7 +9025,7 @@ public void touch() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function TouchEvent() { [native code] }", EDGE = "function TouchEvent() { [native code] }") public void touchEvent() throws Exception { @@ -9031,7 +9036,7 @@ public void touchEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function TouchList() { [native code] }", EDGE = "function TouchList() { [native code] }") public void touchList() throws Exception { @@ -9042,7 +9047,7 @@ public void touchList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void trackDefault() throws Exception { test("TrackDefault"); } @@ -9051,7 +9056,7 @@ public void trackDefault() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void trackDefaultList() throws Exception { test("TrackDefaultList"); } @@ -9069,7 +9074,7 @@ public void trackEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void transferable() throws Exception { test("Transferable"); } @@ -9098,7 +9103,7 @@ public void treeWalker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void typedArray() throws Exception { test("TypedArray"); } @@ -9116,7 +9121,7 @@ public void typeError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void typeInfo() throws Exception { test("TypeInfo"); } @@ -9125,7 +9130,7 @@ public void typeInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void uDPSocket() throws Exception { test("UDPSocket"); } @@ -9207,7 +9212,7 @@ public void unescape() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void uneval() throws Exception { test("uneval"); } @@ -9245,7 +9250,7 @@ public void urlSearchParams() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void urlUtils() throws Exception { test("URLUtils"); } @@ -9254,7 +9259,7 @@ public void urlUtils() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void urlUtilsReadOnly() throws Exception { test("URLUtilsReadOnly"); } @@ -9263,7 +9268,7 @@ public void urlUtilsReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void userDataHandler() throws Exception { test("UserDataHandler"); } @@ -9272,7 +9277,7 @@ public void userDataHandler() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void userProximityEvent() throws Exception { test("UserProximityEvent"); } @@ -9281,7 +9286,7 @@ public void userProximityEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void uSVString() throws Exception { test("USVString"); } @@ -9308,7 +9313,7 @@ public void videoPlaybackQuality() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrDevice() throws Exception { test("VRDevice"); } @@ -9317,7 +9322,7 @@ public void vrDevice() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrDisplay() throws Exception { test("VRDisplay"); } @@ -9326,7 +9331,7 @@ public void vrDisplay() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrDisplayCapabilities() throws Exception { test("VRDisplayCapabilities"); } @@ -9335,7 +9340,7 @@ public void vrDisplayCapabilities() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrEyeParameters() throws Exception { test("VREyeParameters"); } @@ -9344,7 +9349,7 @@ public void vrEyeParameters() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrFieldOfView() throws Exception { test("VRFieldOfView"); } @@ -9353,7 +9358,7 @@ public void vrFieldOfView() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrFieldOfViewReadOnly() throws Exception { test("VRFieldOfViewReadOnly"); } @@ -9362,7 +9367,7 @@ public void vrFieldOfViewReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrLayer() throws Exception { test("VRLayer"); } @@ -9371,7 +9376,7 @@ public void vrLayer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrPose() throws Exception { test("VRPose"); } @@ -9380,7 +9385,7 @@ public void vrPose() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrPositionState() throws Exception { test("VRPositionState"); } @@ -9389,7 +9394,7 @@ public void vrPositionState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrStageParameters() throws Exception { test("VRStageParameters"); } @@ -9434,7 +9439,7 @@ public void weakSet() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL() throws Exception { test("WebGL"); } @@ -9443,7 +9448,7 @@ public void webGL() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_color_buffer_float() throws Exception { test("WEBGL_color_buffer_float"); } @@ -9452,7 +9457,7 @@ public void webGL_color_buffer_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_atc() throws Exception { test("WEBGL_compressed_texture_atc"); } @@ -9461,7 +9466,7 @@ public void webGL_compressed_texture_atc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_es3() throws Exception { test("WEBGL_compressed_texture_es3"); } @@ -9470,7 +9475,7 @@ public void webGL_compressed_texture_es3() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void wEBGL_compressed_texture_etc() throws Exception { test("WEBGL_compressed_texture_etc"); } @@ -9479,7 +9484,7 @@ public void wEBGL_compressed_texture_etc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_etc1() throws Exception { test("WEBGL_compressed_texture_etc1"); } @@ -9488,7 +9493,7 @@ public void webGL_compressed_texture_etc1() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_pvrtc() throws Exception { test("WEBGL_compressed_texture_pvrtc"); } @@ -9497,7 +9502,7 @@ public void webGL_compressed_texture_pvrtc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_s3tc() throws Exception { test("WEBGL_compressed_texture_s3tc"); } @@ -9506,7 +9511,7 @@ public void webGL_compressed_texture_s3tc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_debug_renderer_info() throws Exception { test("WEBGL_debug_renderer_info"); } @@ -9515,7 +9520,7 @@ public void webGL_debug_renderer_info() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_debug_shaders() throws Exception { test("WEBGL_debug_shaders"); } @@ -9524,7 +9529,7 @@ public void webGL_debug_shaders() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_depth_texture() throws Exception { test("WEBGL_depth_texture"); } @@ -9533,7 +9538,7 @@ public void webGL_depth_texture() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_draw_buffers() throws Exception { test("WEBGL_draw_buffers"); } @@ -9542,7 +9547,7 @@ public void webGL_draw_buffers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_lose_context() throws Exception { test("WEBGL_lose_context"); } @@ -9679,7 +9684,7 @@ public void webGLTexture() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGLTimerQueryEXT() throws Exception { test("WebGLTimerQueryEXT"); } @@ -9715,7 +9720,7 @@ public void webGLVertexArrayObject() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGLVertexArrayObjectOES() throws Exception { test("WebGLVertexArrayObjectOES"); } @@ -9724,7 +9729,7 @@ public void webGLVertexArrayObjectOES() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webKitAnimationEvent() throws Exception { test("WebKitAnimationEvent"); } @@ -9733,7 +9738,7 @@ public void webKitAnimationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitAudioContext() throws Exception { test("webkitAudioContext"); } @@ -9751,7 +9756,7 @@ public void webKitCSSMatrix() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBCursor() throws Exception { test("webkitIDBCursor"); } @@ -9760,7 +9765,7 @@ public void webkitIDBCursor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBDatabase() throws Exception { test("webkitIDBDatabase"); } @@ -9769,7 +9774,7 @@ public void webkitIDBDatabase() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBFactory() throws Exception { test("webkitIDBFactory"); } @@ -9778,7 +9783,7 @@ public void webkitIDBFactory() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBIndex() throws Exception { test("webkitIDBIndex"); } @@ -9787,7 +9792,7 @@ public void webkitIDBIndex() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBKeyRange() throws Exception { test("webkitIDBKeyRange"); } @@ -9796,7 +9801,7 @@ public void webkitIDBKeyRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBObjectStore() throws Exception { test("webkitIDBObjectStore"); } @@ -9805,7 +9810,7 @@ public void webkitIDBObjectStore() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBRequest() throws Exception { test("webkitIDBRequest"); } @@ -9814,7 +9819,7 @@ public void webkitIDBRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBTransaction() throws Exception { test("webkitIDBTransaction"); } @@ -9823,7 +9828,7 @@ public void webkitIDBTransaction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function MediaStream() { [native code] }", EDGE = "function MediaStream() { [native code] }") public void webkitMediaStream() throws Exception { @@ -9834,7 +9839,7 @@ public void webkitMediaStream() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function MutationObserver() { [native code] }", EDGE = "function MutationObserver() { [native code] }") public void webKitMutationObserver() throws Exception { @@ -9845,7 +9850,7 @@ public void webKitMutationObserver() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitOfflineAudioContext() throws Exception { test("webkitOfflineAudioContext"); } @@ -9854,7 +9859,7 @@ public void webkitOfflineAudioContext() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function RTCPeerConnection() { [native code] }", EDGE = "function RTCPeerConnection() { [native code] }") public void webkitRTCPeerConnection() throws Exception { @@ -9865,7 +9870,7 @@ public void webkitRTCPeerConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitRTCSessionDescription() throws Exception { test("webkitRTCSessionDescription"); } @@ -9874,7 +9879,7 @@ public void webkitRTCSessionDescription() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function SpeechGrammar() { [native code] }", EDGE = "function SpeechGrammar() { [native code] }") public void webkitSpeechGrammar() throws Exception { @@ -9885,7 +9890,7 @@ public void webkitSpeechGrammar() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function SpeechGrammarList() { [native code] }", EDGE = "function SpeechGrammarList() { [native code] }") public void webkitSpeechGrammarList() throws Exception { @@ -9896,7 +9901,7 @@ public void webkitSpeechGrammarList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function SpeechRecognition() { [native code] }", EDGE = "function SpeechRecognition() { [native code] }") public void webkitSpeechRecognition() throws Exception { @@ -9907,7 +9912,7 @@ public void webkitSpeechRecognition() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function SpeechRecognitionErrorEvent() { [native code] }", EDGE = "function SpeechRecognitionErrorEvent() { [native code] }") public void webkitSpeechRecognitionError() throws Exception { @@ -9918,7 +9923,7 @@ public void webkitSpeechRecognitionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function SpeechRecognitionEvent() { [native code] }", EDGE = "function SpeechRecognitionEvent() { [native code] }") public void webkitSpeechRecognitionEvent() throws Exception { @@ -9929,7 +9934,7 @@ public void webkitSpeechRecognitionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webKitTransitionEvent() throws Exception { test("WebKitTransitionEvent"); } @@ -9947,7 +9952,7 @@ public void webkitURL() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webSMS() throws Exception { test("WebSMS"); } @@ -9967,7 +9972,7 @@ public void webSocket() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webSockets() throws Exception { test("WebSockets"); } @@ -9976,7 +9981,7 @@ public void webSockets() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webVTT() throws Exception { test("WebVTT"); } @@ -9994,7 +9999,7 @@ public void wheelEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void wifiManager() throws Exception { test("WifiManager"); } @@ -10014,7 +10019,7 @@ public void window() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowBase64() throws Exception { test("WindowBase64"); } @@ -10023,7 +10028,7 @@ public void windowBase64() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowClient() throws Exception { test("WindowClient"); } @@ -10032,7 +10037,7 @@ public void windowClient() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowEventHandlers() throws Exception { test("WindowEventHandlers"); } @@ -10041,7 +10046,7 @@ public void windowEventHandlers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowEventHandlers_onbeforeprint() throws Exception { test("WindowEventHandlers.onbeforeprint"); } @@ -10050,7 +10055,7 @@ public void windowEventHandlers_onbeforeprint() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowOrWorkerGlobalScope() throws Exception { test("WindowOrWorkerGlobalScope"); } @@ -10059,7 +10064,7 @@ public void windowOrWorkerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowProperties() throws Exception { test("WindowProperties"); } @@ -10068,7 +10073,7 @@ public void windowProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowTimers() throws Exception { test("WindowTimers"); } @@ -10088,7 +10093,7 @@ public void worker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void workerGlobalScope() throws Exception { test("WorkerGlobalScope"); } @@ -10097,7 +10102,7 @@ public void workerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void workerLocation() throws Exception { test("WorkerLocation"); } @@ -10106,7 +10111,7 @@ public void workerLocation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void workerNavigator() throws Exception { test("WorkerNavigator"); } @@ -10115,7 +10120,7 @@ public void workerNavigator() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xDomainRequest() throws Exception { test("XDomainRequest"); } @@ -10155,7 +10160,7 @@ public void xmlHttpRequestEventTarget() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xmlHttpRequestProgressEvent() throws Exception { test("XMLHttpRequestProgressEvent"); } @@ -10206,7 +10211,7 @@ public void xPathExpression() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xPathNSResolver() throws Exception { test("XPathNSResolver"); } @@ -10226,7 +10231,7 @@ public void xPathResult() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xsltemplate() throws Exception { test("XSLTemplate"); } diff --git a/src/test/java/org/htmlunit/general/HostConstantsTest.java b/src/test/java/org/htmlunit/general/HostConstantsTest.java index 4de7c7d729f..9ccab39dcd2 100644 --- a/src/test/java/org/htmlunit/general/HostConstantsTest.java +++ b/src/test/java/org/htmlunit/general/HostConstantsTest.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. @@ -76,7 +76,8 @@ public static Collection data() throws Exception { public void test() throws Exception { setExpectedAlerts(getExpectedString()); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/general/HostConstructorTest.java b/src/test/java/org/htmlunit/general/HostConstructorTest.java index 5236915c625..49eb81ba6e9 100644 --- a/src/test/java/org/htmlunit/general/HostConstructorTest.java +++ b/src/test/java/org/htmlunit/general/HostConstructorTest.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,7 +25,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserParameterizedRunner; import org.htmlunit.junit.BrowserParameterizedRunner.Default; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -87,14 +87,15 @@ public void test() throws Exception { } private void test(final String className) throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "" + "\n" + ""; @@ -106,7 +107,7 @@ private String getExpectedString(final String className) throws Exception { return "[object " + className_ + "]"; } - return "exception"; + return "ReferenceError"; } /** diff --git a/src/test/java/org/htmlunit/general/HostExtractor.java b/src/test/java/org/htmlunit/general/HostExtractor.java index f70969795bf..00402ffb5b8 100644 --- a/src/test/java/org/htmlunit/general/HostExtractor.java +++ b/src/test/java/org/htmlunit/general/HostExtractor.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/test/java/org/htmlunit/general/HostTestsTest.java b/src/test/java/org/htmlunit/general/HostTestsTest.java index 05db3bc63fb..adecdadc7fb 100644 --- a/src/test/java/org/htmlunit/general/HostTestsTest.java +++ b/src/test/java/org/htmlunit/general/HostTestsTest.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/test/java/org/htmlunit/general/HostTypeOfTest.java b/src/test/java/org/htmlunit/general/HostTypeOfTest.java index 6a810bc4ddd..00aad7156bd 100644 --- a/src/test/java/org/htmlunit/general/HostTypeOfTest.java +++ b/src/test/java/org/htmlunit/general/HostTypeOfTest.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. @@ -19,8 +19,8 @@ import org.htmlunit.javascript.host.css.CSSStyleRule; import org.htmlunit.javascript.host.css.CSSStyleSheet; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; @@ -35,13 +35,13 @@ public class HostTypeOfTest extends WebDriverTestCase { private void test(final String className) throws Exception { - final String html = - "\n" + ""; @@ -241,7 +241,7 @@ public void applicationCacheErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void apps_mgmt() throws Exception { test("Apps.mgmt"); } @@ -498,6 +498,15 @@ public void beforeUnloadEvent() throws Exception { test("BeforeUnloadEvent"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("function") + public void bigInt() throws Exception { + test("BigInt"); + } + /** * @throws Exception if the test fails */ @@ -4413,7 +4422,7 @@ public void l10n() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_formatValue() throws Exception { test("L10n.formatValue"); } @@ -4422,7 +4431,7 @@ public void l10n_formatValue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_get() throws Exception { test("L10n.get"); } @@ -4431,7 +4440,7 @@ public void l10n_get() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_code() throws Exception { test("L10n.language.code"); } @@ -4440,7 +4449,7 @@ public void l10n_language_code() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_direction() throws Exception { test("L10n.language.direction"); } @@ -4449,7 +4458,7 @@ public void l10n_language_direction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_once() throws Exception { test("L10n.once"); } @@ -4458,7 +4467,7 @@ public void l10n_once() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_ready() throws Exception { test("L10n.ready"); } @@ -4467,7 +4476,7 @@ public void l10n_ready() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_readyState() throws Exception { test("L10n.readyState"); } @@ -4476,7 +4485,7 @@ public void l10n_readyState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_setAttributes() throws Exception { test("L10n.setAttributes"); } @@ -6918,7 +6927,7 @@ public void simd() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool16x8() throws Exception { test("SIMD.Bool16x8"); } @@ -6927,7 +6936,7 @@ public void simd_Bool16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool32x4() throws Exception { test("SIMD.Bool32x4"); } @@ -6936,7 +6945,7 @@ public void simd_Bool32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool64x2() throws Exception { test("SIMD.Bool64x2"); } @@ -6945,7 +6954,7 @@ public void simd_Bool64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool8x16() throws Exception { test("SIMD.Bool8x16"); } @@ -6954,7 +6963,7 @@ public void simd_Bool8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float32x4() throws Exception { test("SIMD.float32x4"); } @@ -6963,7 +6972,7 @@ public void simd_float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float32x4() throws Exception { test("SIMD.Float32x4"); } @@ -6972,7 +6981,7 @@ public void simd_Float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float64x2() throws Exception { test("SIMD.float64x2"); } @@ -6981,7 +6990,7 @@ public void simd_float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float64x2() throws Exception { test("SIMD.Float64x2"); } @@ -6990,7 +6999,7 @@ public void simd_Float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int16x8() throws Exception { test("SIMD.int16x8"); } @@ -6999,7 +7008,7 @@ public void simd_int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int16x8() throws Exception { test("SIMD.Int16x8"); } @@ -7008,7 +7017,7 @@ public void simd_Int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int32x4() throws Exception { test("SIMD.int32x4"); } @@ -7017,7 +7026,7 @@ public void simd_int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int32x4() throws Exception { test("SIMD.Int32x4"); } @@ -7026,7 +7035,7 @@ public void simd_Int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int8x16() throws Exception { test("SIMD.int8x16"); } @@ -7035,7 +7044,7 @@ public void simd_int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int8x16() throws Exception { test("SIMD.Int8x16"); } @@ -7044,7 +7053,7 @@ public void simd_Int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint16x8() throws Exception { test("SIMD.Uint16x8"); } @@ -7053,7 +7062,7 @@ public void simd_Uint16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint32x4() throws Exception { test("SIMD.Uint32x4"); } @@ -7062,7 +7071,7 @@ public void simd_Uint32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint8x16() throws Exception { test("SIMD.Uint8x16"); } @@ -7628,7 +7637,8 @@ public void svgDescElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("undefined") + @Alerts(DEFAULT = "undefined", + FF = "function") public void svgDiscardElement() throws Exception { test("SVGDiscardElement"); } @@ -10014,7 +10024,7 @@ public void windowEventHandlers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowEventHandlers_onbeforeprint() throws Exception { test("WindowEventHandlers.onbeforeprint"); } diff --git a/src/test/java/org/htmlunit/general/huge/ElementClosesElementTest.java b/src/test/java/org/htmlunit/general/huge/ElementClosesElementTest.java index 95c0f183755..7a47665ea67 100644 --- a/src/test/java/org/htmlunit/general/huge/ElementClosesElementTest.java +++ b/src/test/java/org/htmlunit/general/huge/ElementClosesElementTest.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. @@ -24,8 +24,8 @@ import org.htmlunit.html.DefaultElementFactory; import org.htmlunit.junit.BrowserParameterizedRunner; import org.htmlunit.junit.BrowserParameterizedRunner.Default; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; @@ -138,7 +138,8 @@ else if ("tr".equals(parent)) { html = "<" + parent + " id='outer'><" + child + ">\n"; } - String pageHtml = "\n" + String pageHtml = DOCTYPE_HTML + + "\n" + "-\n" + "\n" + bodyStart @@ -149,18 +150,21 @@ else if ("tr".equals(parent)) { if ("basefont".equals(parent) || "base".equals(parent) || "isindex".equals(parent)) { - pageHtml = "\n" + pageHtml = DOCTYPE_HTML + + "\n" + "<" + parent + " id='outer'><" + child + ">\n" + "\n" + ""; } else if ("head".equals(parent)) { - pageHtml = "<" + child + ">\n" + pageHtml = DOCTYPE_HTML + + "<" + child + ">\n" + "\n" + ""; } else if ("title".equals(parent)) { - pageHtml = "\n" + pageHtml = DOCTYPE_HTML + + "\n" + "<" + child + ">\n" + "</head><body>\n" + "</body></html>"; diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOf.java b/src/test/java/org/htmlunit/general/huge/HostParentOf.java index 7fd0d9a0ebc..feb1838a719 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOf.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOf.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. @@ -22,9 +22,8 @@ import org.htmlunit.TestCaseTest; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.html.HtmlPageTest; import org.htmlunit.junit.BrowserParameterizedRunner.Default; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.After; import org.junit.Test; import org.junit.runners.Parameterized.Parameter; @@ -91,7 +90,7 @@ public void isParentOf() throws Exception { * @throws Exception if an error occurs */ protected void test(final String parent, final String child) throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "<html>\n" + "<head>\n" + "<title>-\n" diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfATest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfATest.java index e1957f7cfea..7bde3ff4508 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfATest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfATest.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. @@ -17,8 +17,8 @@ import java.util.Collection; import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameters; diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfBTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfBTest.java index f2f67ef17af..79135e439c6 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfBTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfBTest.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. @@ -17,7 +17,7 @@ import java.util.Collection; import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameters; diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfCTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfCTest.java index 8421cbaaef7..7c72ec953d7 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfCTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfCTest.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. @@ -17,8 +17,8 @@ import java.util.Collection; import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameters; diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfDTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfDTest.java index 80909973ad1..b747bd862af 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfDTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfDTest.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. @@ -17,8 +17,8 @@ import java.util.Collection; import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameters; @@ -1290,6 +1290,18 @@ public void _Element_SVGDescElement() throws Exception { test("Element", "SVGDescElement"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + CHROME = "false", + EDGE = "false", + FF_ESR = "false") + public void _Element_SVGDiscardElement() throws Exception { + test("Element", "SVGDiscardElement"); + } + /** * @throws Exception if the test fails */ @@ -3996,11 +4008,7 @@ public void _EventTarget_StereoPannerNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - @HtmlUnitNYI(CHROME = "false", - EDGE = "false") + @Alerts("false") public void _EventTarget_StorageManager() throws Exception { test("EventTarget", "StorageManager"); } @@ -4095,6 +4103,18 @@ public void _EventTarget_SVGDescElement() throws Exception { test("EventTarget", "SVGDescElement"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + CHROME = "false", + EDGE = "false", + FF_ESR = "false") + public void _EventTarget_SVGDiscardElement() throws Exception { + test("EventTarget", "SVGDiscardElement"); + } + /** * @throws Exception if the test fails */ diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfFTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfFTest.java index 569716dad66..59d4449c74b 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfFTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfFTest.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. @@ -17,7 +17,7 @@ import java.util.Collection; import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameters; diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfHTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfHTest.java index c0eb78f9db2..665a5f01ef7 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfHTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfHTest.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. @@ -17,8 +17,8 @@ import java.util.Collection; import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameters; diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfITest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfITest.java index 2046de55e75..cad8052c7d8 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfITest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfITest.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. @@ -17,7 +17,7 @@ import java.util.Collection; import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameters; diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfMTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfMTest.java index bdfe2faa99e..8ffdad8e860 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfMTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfMTest.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. @@ -17,7 +17,7 @@ import java.util.Collection; import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameters; diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfNTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfNTest.java index 568384ba250..7dc4e30f9cd 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfNTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfNTest.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. @@ -17,8 +17,8 @@ import java.util.Collection; import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameters; @@ -1160,6 +1160,19 @@ public void _Node_SVGDescElement() throws Exception { test("Node", "SVGDescElement"); } + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + CHROME = "false", + EDGE = "false", + FF_ESR = "false") + public void _Node_SVGDiscardElement() throws Exception { + test("Node", "SVGDiscardElement"); + } + /** * @throws Exception * if the test fails diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfPTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfPTest.java index 66f9966e52a..8cdbcb7f9df 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfPTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfPTest.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. @@ -17,7 +17,7 @@ import java.util.Collection; import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameters; diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfS2Test.java b/src/test/java/org/htmlunit/general/huge/HostParentOfS2Test.java index de12f48fb1f..6a84794588d 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfS2Test.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfS2Test.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,8 +18,8 @@ import org.apache.commons.lang3.StringUtils; import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameters; diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfSTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfSTest.java index 743d951e28b..43fc189fa81 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfSTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfSTest.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,7 +18,7 @@ import org.apache.commons.lang3.StringUtils; import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameters; @@ -506,6 +506,16 @@ public void _SVGAnimationElement_SVGAnimationElement() throws Exception { test("SVGAnimationElement", "SVGAnimationElement"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + FF = "true") + public void _SVGAnimationElement_SVGDiscardElement() throws Exception { + test("SVGAnimationElement", "SVGDiscardElement"); + } + /** * @throws Exception if the test fails */ @@ -596,6 +606,16 @@ public void _SVGDescElement_SVGDescElement() throws Exception { test("SVGDescElement", "SVGDescElement"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + FF = "true") + public void _SVGDiscardElement_SVGDiscardElement() throws Exception { + test("SVGDiscardElement", "SVGDiscardElement"); + } + /** * @throws Exception if the test fails */ @@ -686,6 +706,16 @@ public void _SVGElement_SVGDescElement() throws Exception { test("SVGElement", "SVGDescElement"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + FF = "true") + public void _SVGElement_SVGDiscardElement() throws Exception { + test("SVGElement", "SVGDiscardElement"); + } + /** * @throws Exception if the test fails */ diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfTTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfTTest.java index f05ec67af60..0594b18fc33 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfTTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfTTest.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. @@ -17,7 +17,7 @@ import java.util.Collection; import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameters; diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfWTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfWTest.java index 9c188ea1df8..be977b4ba25 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfWTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfWTest.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. @@ -17,7 +17,7 @@ import java.util.Collection; import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameters; diff --git a/src/test/java/org/htmlunit/html/AttributesTest.java b/src/test/java/org/htmlunit/html/AttributesTest.java index c95dd11ecb5..8f81b6398b3 100644 --- a/src/test/java/org/htmlunit/html/AttributesTest.java +++ b/src/test/java/org/htmlunit/html/AttributesTest.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/test/java/org/htmlunit/html/BaseFrameElement2Test.java b/src/test/java/org/htmlunit/html/BaseFrameElement2Test.java index 5cb9f97088a..e408c086d31 100644 --- a/src/test/java/org/htmlunit/html/BaseFrameElement2Test.java +++ b/src/test/java/org/htmlunit/html/BaseFrameElement2Test.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,7 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.WebDriver; @@ -36,8 +36,8 @@ public class BaseFrameElement2Test extends WebDriverTestCase { @Test @Alerts("posted called") public void windowEventListenersContainer() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -58,21 +58,23 @@ public void clickOnFocus() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("click click dblclick ") + @Alerts({"click", "click", "dblclick"}) public void dblClick() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + "\n" - + "\n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(content); @@ -81,6 +83,6 @@ public void dblClick() throws Exception { action.doubleClick(driver.findElement(By.id("myBody"))); action.perform(); - assertEquals(getExpectedAlerts()[0], driver.findElement(By.id("myTextarea")).getAttribute("value")); + verifyTextArea2(driver, getExpectedAlerts()); } } diff --git a/src/test/java/org/htmlunit/html/ClickableElementTest.java b/src/test/java/org/htmlunit/html/ClickableElementTest.java index b88d905e90b..ef681564a4a 100644 --- a/src/test/java/org/htmlunit/html/ClickableElementTest.java +++ b/src/test/java/org/htmlunit/html/ClickableElementTest.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. @@ -22,8 +22,8 @@ import org.htmlunit.SimpleWebTestCase; import org.htmlunit.WebClient; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.BuggyWebDriver; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.BuggyWebDriver; import org.junit.Test; import org.junit.runner.RunWith; @@ -43,8 +43,8 @@ public class ClickableElementTest extends SimpleWebTestCase { * Full page driver for onClick tests. * * @param htmlContent HTML fragment for body of page with clickable element - * identified by clickId ID attribute. Must have onClick that raises - * an alert of "foo". + * identified by clickId ID attribute. Must have onClick that raises + * an alert of "foo". * @throws Exception if the test fails */ private void onClickPageTest(final String htmlContent) throws Exception { @@ -56,7 +56,7 @@ private void onClickPageTest(final String htmlContent) throws Exception { * Full page driver for onClick tests. * * @param htmlContent HTML fragment for body of page with clickable element - * identified by clickId ID attribute. + * identified by clickId ID attribute. * @param numClicks number of times to click element * @param expectedAlerts array of expected popup values * @throws Exception if the test fails @@ -71,7 +71,7 @@ private void onClickPageTest(final String htmlContent, final int numClicks) thro * @param htmlContent HTML fragment for body of page with clickable element identified by clickId ID attribute * @param numClicks number of times to click element * @param expectedAlerts array of expected popup values - * @param exceptionOnError + * @param exceptionOnError indicate to throw on error * @throws Exception if the test fails */ private void onClickPageTest(final String htmlContent, final int numClicks, @@ -104,7 +104,7 @@ private void onClickPageTest(final String htmlContent, final int numClicks, * @throws Exception if the test fails */ private void onClickBodyTest(final String htmlBody) throws Exception { - onClickPageTest("foo\n" + htmlBody + onClickPageTest(DOCTYPE_HTML + "foo\n" + htmlBody + ""); } @@ -309,7 +309,8 @@ public void definitionDescription_onClick() throws Exception { */ @Test public void javaScriptError_onClick() throws Exception { - onClickPageTest("\n" + onClickPageTest(DOCTYPE_HTML + + "\n" + "
\n" + "", 1, false); @@ -577,7 +578,8 @@ public void object_onClick() throws Exception { @BuggyWebDriver(CHROME = "") // ChromeDriver does not generate a "foo" but it occurs manually public void option_onClick() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "
\n" + ""; @@ -825,7 +827,8 @@ public void tableRow_onClick() throws Exception { */ @Test public void tableRow_onClickSetOnLoad() throws Exception { - onClickPageTest("\n" + onClickPageTest(DOCTYPE_HTML + + "\n" + "\n" @@ -60,9 +62,10 @@ public void appendChild_recursive() throws Exception { * @throws Exception on test failure */ @Test - @Alerts({"true", "exception", "1", "0"}) + @Alerts({"true", "HierarchyRequestError/DOMException", "1", "0"}) public void appendChild_recursive_parent() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -56,7 +55,8 @@ public void nextNode() throws Exception { final HtmlPage page = (HtmlPage) getEnclosedPage(); final NodeIterator iterator = page.createNodeIterator(page.getDocumentElement(), NodeFilter.SHOW_ALL, null, true); - assertThat(iterator.nextNode(), instanceOf(HtmlHtml.class)); + final Node node = iterator.nextNode(); + assertTrue(node.getClass().getName(), node instanceof HtmlHtml); } } } diff --git a/src/test/java/org/htmlunit/html/DomNodeListTest.java b/src/test/java/org/htmlunit/html/DomNodeListTest.java index 0721b58b617..1ee0ca57401 100644 --- a/src/test/java/org/htmlunit/html/DomNodeListTest.java +++ b/src/test/java/org/htmlunit/html/DomNodeListTest.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. @@ -36,8 +36,8 @@ public class DomNodeListTest extends SimpleWebTestCase { */ @Test public void getElementsByTagName() throws Exception { - final String firstContent - = "First\n" + final String firstContent = DOCTYPE_HTML + + "First\n" + "\n" + "
\n" + "
a
b
c
\n" @@ -61,8 +61,8 @@ public void getElementsByTagName() throws Exception { */ @Test public void getChildNodes() throws Exception { - final String firstContent - = "First\n" + final String firstContent = DOCTYPE_HTML + + "First\n" + "\n" + "
\n" + "
a
b
c
\n" diff --git a/src/test/java/org/htmlunit/html/DomNodeTest.java b/src/test/java/org/htmlunit/html/DomNodeTest.java index b01d3340ad2..94b76231985 100644 --- a/src/test/java/org/htmlunit/html/DomNodeTest.java +++ b/src/test/java/org/htmlunit/html/DomNodeTest.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. @@ -24,7 +24,7 @@ import org.htmlunit.WebClient; import org.htmlunit.html.DomNode.DescendantHtmlElementsIterator; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.MimeType; import org.htmlunit.xml.XmlPage; import org.junit.Test; @@ -47,7 +47,7 @@ public class DomNodeTest extends SimpleWebTestCase { */ @Test public void elementHasAttributesWith() throws Exception { - final String content = "text"; + final String content = DOCTYPE_HTML + "text"; final HtmlPage page = loadPage(content); final DomNode node = page.getElementById("tag"); @@ -60,7 +60,7 @@ public void elementHasAttributesWith() throws Exception { */ @Test public void elementHasAttributesNone() throws Exception { - final String content = "text"; + final String content = DOCTYPE_HTML + "text"; final HtmlPage page = loadPage(content); final DomNode node = page.getElementById("tag"); @@ -74,7 +74,7 @@ public void elementHasAttributesNone() throws Exception { */ @Test public void nonElementHasAttributes() throws Exception { - final String content = "text"; + final String content = DOCTYPE_HTML + "text"; final HtmlPage page = loadPage(content); final DomNode node = page.getElementById("tag"); @@ -88,7 +88,7 @@ public void nonElementHasAttributes() throws Exception { */ @Test public void nonElementGetPrefix() throws Exception { - final String content = "text"; + final String content = DOCTYPE_HTML + "text"; final HtmlPage page = loadPage(content); final DomNode node = page.getElementById("tag"); @@ -102,7 +102,7 @@ public void nonElementGetPrefix() throws Exception { */ @Test public void nonElementGetNamespaceURI() throws Exception { - final String content = "text"; + final String content = DOCTYPE_HTML + "text"; final HtmlPage page = loadPage(content); final DomNode node = page.getElementById("tag"); @@ -116,7 +116,7 @@ public void nonElementGetNamespaceURI() throws Exception { */ @Test public void nonElementGetLocalName() throws Exception { - final String content = "text"; + final String content = DOCTYPE_HTML + "text"; final HtmlPage page = loadPage(content); final DomNode node = page.getElementById("tag"); @@ -130,7 +130,7 @@ public void nonElementGetLocalName() throws Exception { */ @Test public void nonElementSetPrefix() throws Exception { - final String content = "text"; + final String content = DOCTYPE_HTML + "text"; final HtmlPage page = loadPage(content); final DomNode node = page.getElementById("tag"); @@ -144,8 +144,8 @@ public void nonElementSetPrefix() throws Exception { */ @Test public void removeAllChildren() throws Exception { - final String content - = "\n" + final String content = DOCTYPE_HTML + + "\n" + "

\n" + "\n" + "\n" @@ -162,8 +162,8 @@ public void removeAllChildren() throws Exception { */ @Test public void replace() throws Exception { - final String content - = "\n" + final String content = DOCTYPE_HTML + + "\n" + "

"; final HtmlPage page = loadPage(content); @@ -202,8 +202,8 @@ public void replace() throws Exception { */ @Test public void getNewNodeById() throws Exception { - final String content - = "\n" + final String content = DOCTYPE_HTML + + "\n" + "
"; final HtmlPage page = loadPage(content); @@ -242,8 +242,8 @@ public void getNewNodeById() throws Exception { */ @Test public void appendChild() throws Exception { - final String content - = "\n" + final String content = DOCTYPE_HTML + + "\n" + "

"; final HtmlPage page = loadPage(content); @@ -272,8 +272,8 @@ public void appendChild() throws Exception { */ @Test public void insertBefore() throws Exception { - final String content - = "\n" + final String content = DOCTYPE_HTML + + "\n" + "

"; final HtmlPage page = loadPage(content); @@ -320,8 +320,8 @@ private static int readPositionAmongParentChildren(final DomNode node) { */ @Test public void getByXPath() throws Exception { - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + " \n" + " my title\n" + " " @@ -362,8 +362,8 @@ public void getByXPath() throws Exception { */ @Test public void getByXPathSelectedNode() throws Exception { - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + " \n" + " my title\n" + " " @@ -388,7 +388,8 @@ public void getByXPathSelectedNode() throws Exception { */ @Test public void getByXPath_trim_namespace() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "
bla
\n" + ""; @@ -404,8 +405,8 @@ public void getByXPath_trim_namespace() throws Exception { */ @Test public void getFirstByXPathDisplayNone() throws Exception { - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + " \n" + " my title\n" + " " @@ -429,8 +430,8 @@ public void getFirstByXPathDisplayNone() throws Exception { */ @Test public void getFirstByXPath() throws Exception { - final String htmlContent - = "my title\n" + final String htmlContent = DOCTYPE_HTML + + "my title\n" + "
  • foo 1
  • foo 2
\n" + "
bla
\n" + ""; @@ -459,7 +460,8 @@ public void getFirstByXPath() throws Exception { */ @Test public void getHtmlElementDescendantsOrder() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -489,8 +491,8 @@ public void getHtmlElementDescendantsOrder() throws Exception { */ @Test public void getDescendants_remove() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "
a
b
a
c
a
d
\n" + ""; final HtmlPage page = loadPage(html); @@ -528,8 +530,8 @@ List getCollectedValues() { */ @Test public void domChangeListenerTestImpl_insertBefore() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "a1\n" + "a2\n" + "a3\n" @@ -349,7 +349,8 @@ public void click_javascriptUrl_encoded() throws Exception { */ @Test public void openLinkInNewWindow() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "link to foo1\n" + ""; @@ -378,11 +379,12 @@ public void openLinkInNewWindow() throws Exception { */ @Test public void correctLinkTargetWhenOnclickOpensWindow() throws Exception { - final String firstContent = "First\n" + final String firstContent = DOCTYPE_HTML + + "First\n" + "X\n" + ""; - final String html2 = "Second"; - final String htmlPopup = "Popup"; + final String html2 = DOCTYPE_HTML + "Second"; + final String htmlPopup = DOCTYPE_HTML + "Popup"; final WebClient client = getWebClient(); final List collectedAlerts = new ArrayList<>(); @@ -410,8 +412,8 @@ public void correctLinkTargetWhenOnclickOpensWindow() throws Exception { */ @Test public void preventDefault1() throws Exception { - final String html = - "\n" + "\n" @@ -450,7 +450,8 @@ public void setText() throws Exception { @Test @Alerts("foo") public void innerHtmlHrefQuotedEvenInIE() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -465,16 +466,16 @@ public void innerHtmlHrefQuotedEvenInIE() throws Exception { */ @Test public void click() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "link to foo1\n" + "link to foo2\n" + ""; - final String secondContent - = "Second"; + final String secondContent = DOCTYPE_HTML + + "Second"; final MockWebConnection webConnection = getMockWebConnection(); webConnection.setDefaultResponse(secondContent); @@ -497,8 +498,8 @@ public void click() throws Exception { */ @Test public void clickAnchorName() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + " link to foo1\n" @@ -519,8 +520,8 @@ public void clickAnchorName() throws Exception { @Test @Alerts({"", "#anchor", "#!bang"}) public void dontReloadHashBang() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " link1\n" @@ -560,8 +561,8 @@ public void dontReloadHashBang() throws Exception { @Test @Alerts({"#!board/WebDev", "#!article/WebDev/35", "#!article/WebDev/35"}) public void dontReloadHashBang2() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " link1\n" @@ -599,23 +600,26 @@ public void dontReloadHashBang2() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("click href click doubleClick href ") - @BuggyWebDriver( - FF = "click click doubleClick href href ", - FF_ESR = "click click doubleClick href href ") - @HtmlUnitNYI(CHROME = "click href click href doubleClick ", - EDGE = "click href click href doubleClick ", - FF = "click href click href doubleClick ", - FF_ESR = "click href click href doubleClick ") + @Alerts({"click", "href", "click", "doubleClick", "href"}) + @BuggyWebDriver(FF_ESR = {"click", "click", "doubleClick", "href", "href"}) + @HtmlUnitNYI(CHROME = {"click", "href", "click", "href", "doubleClick"}, + EDGE = {"click", "href", "click", "href", "doubleClick"}, + FF = {"click", "href", "click", "href", "doubleClick"}, + FF_ESR = {"click", "href", "click", "href", "doubleClick"}) public void doubleClick() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + "\n" + + "\n" + "\n" + " foo\n" - + " \n" + + "href=\"javascript:log('href');void(0);\" " + + "onClick=\"log('click');\" " + + "onDblClick=\"log('doubleClick');\">foo\n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(html); @@ -624,7 +628,7 @@ public void doubleClick() throws Exception { action.doubleClick(driver.findElement(By.id("myAnchor"))); action.perform(); - assertEquals(getExpectedAlerts()[0], driver.findElement(By.id("myTextarea")).getAttribute("value")); + verifyTextArea2(driver, getExpectedAlerts()); } /** @@ -635,8 +639,8 @@ public void doubleClick() throws Exception { public void encoding() throws Exception { final String href = "bug.html?" + URLEncoder.encode("h\u00F6", "UTF-8") + '=' + URLEncoder.encode("G\u00FCnter", "UTF-8"); - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -664,8 +668,8 @@ public void encoding() throws Exception { */ @Test public void javascriptWithReturn() throws Exception { - final String html - = "First\n" + final String html = DOCTYPE_HTML + + "First\n" + " hi\n" + ""; final WebDriver webDriver = loadPage2(html); @@ -677,8 +681,8 @@ public void javascriptWithReturn() throws Exception { */ @Test public void javascriptWithReturnWhitespace() throws Exception { - final String html - = "First\n" + final String html = DOCTYPE_HTML + + "First\n" + " hi\n" + ""; final WebDriver webDriver = loadPage2(html); @@ -691,7 +695,8 @@ public void javascriptWithReturnWhitespace() throws Exception { @Test @Alerts({"1", "First"}) public void shiftClick() throws Exception { - final String html = "First\n" + final String html = DOCTYPE_HTML + + "First\n" + "Click Me\n" + ""; @@ -721,7 +726,8 @@ public void shiftClick() throws Exception { @Test @Alerts({"1", "First"}) public void ctrlClick() throws Exception { - final String html = "First\n" + final String html = DOCTYPE_HTML + + "First\n" + "Click Me\n" + ""; @@ -739,7 +745,7 @@ public void ctrlClick() throws Exception { .keyUp(Keys.CONTROL) .perform(); - Thread.sleep(DEFAULT_WAIT_TIME); + Thread.sleep(DEFAULT_WAIT_TIME.toMillis()); assertEquals("Should have opened a new window", windowsSize + Integer.parseInt(getExpectedAlerts()[0]), driver.getWindowHandles().size()); assertEquals("Should not have navigated away", getExpectedAlerts()[1], driver.getTitle()); @@ -752,12 +758,12 @@ public void ctrlClick() throws Exception { @Test @Alerts("§§URL§§index.html?test") public void click_refererHeader() throws Exception { - final String firstContent - = "Page A\n" + final String firstContent = DOCTYPE_HTML + + "Page A\n" + "link\n" + ""; - final String secondContent - = "Page B\n" + final String secondContent = DOCTYPE_HTML + + "Page B\n" + "\n" + ""; @@ -783,12 +789,12 @@ public void click_refererHeader() throws Exception { */ @Test public void click_refererHeaderNoReferrer() throws Exception { - final String firstContent - = "Page A\n" + final String firstContent = DOCTYPE_HTML + + "Page A\n" + "link\n" + ""; - final String secondContent - = "Page B\n" + final String secondContent = DOCTYPE_HTML + + "Page B\n" + "\n" + ""; @@ -812,12 +818,12 @@ public void click_refererHeaderNoReferrer() throws Exception { */ @Test public void click_refererHeaderNoReferrerCaseSensitive() throws Exception { - final String firstContent - = "Page A\n" + final String firstContent = DOCTYPE_HTML + + "Page A\n" + "link\n" + ""; - final String secondContent - = "Page B\n" + final String secondContent = DOCTYPE_HTML + + "Page B\n" + "\n" + ""; @@ -841,14 +847,14 @@ public void click_refererHeaderNoReferrerCaseSensitive() throws Exception { @Test @Alerts("§§URL§§index.html?test") public void controlClick_refererHeader() throws Exception { - final String firstContent - = "Page A\n" + final String firstContent = DOCTYPE_HTML + + "Page A\n" + "\n" + " link\n" + "\n" + ""; - final String secondContent - = "Page B\n" + final String secondContent = DOCTYPE_HTML + + "Page B\n" + "\n" + ""; @@ -866,7 +872,7 @@ public void controlClick_refererHeader() throws Exception { .keyUp(Keys.CONTROL) .build().perform(); - Thread.sleep(DEFAULT_WAIT_TIME / 10); + Thread.sleep(DEFAULT_WAIT_TIME.toMillis() / 10); assertEquals(2, getMockWebConnection().getRequestCount()); diff --git a/src/test/java/org/htmlunit/html/HtmlArea2Test.java b/src/test/java/org/htmlunit/html/HtmlArea2Test.java index ef831423fca..986fa3275f4 100644 --- a/src/test/java/org/htmlunit/html/HtmlArea2Test.java +++ b/src/test/java/org/htmlunit/html/HtmlArea2Test.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,16 +50,16 @@ private WebClient createWebClient(final String onClick) throws IOException { webConnection.setResponse(urlImage, directBytes, 200, "ok", "image/jpg", Collections.emptyList()); } - final String firstContent - = "first\n" + final String firstContent = DOCTYPE_HTML + + "first\n" + "\n" + "\n" + "\n" + "\n" + ""; - final String secondContent = "second"; - final String thirdContent = "third"; + final String secondContent = DOCTYPE_HTML + "second"; + final String thirdContent = DOCTYPE_HTML + "third"; final WebClient client = getWebClient(); @@ -126,8 +126,8 @@ public void click_onclickReturnsTrue() throws Exception { */ @Test public void click_javascriptUrl_javascriptDisabled() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + ""; final WebClient client = getWebClient(); diff --git a/src/test/java/org/htmlunit/html/HtmlAreaTest.java b/src/test/java/org/htmlunit/html/HtmlAreaTest.java index 226c1bd77f3..55e48cc968b 100644 --- a/src/test/java/org/htmlunit/html/HtmlAreaTest.java +++ b/src/test/java/org/htmlunit/html/HtmlAreaTest.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. @@ -24,8 +24,8 @@ import org.htmlunit.Page; import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.BuggyWebDriver; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.BuggyWebDriver; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.By; @@ -49,8 +49,8 @@ private WebDriver createWebClient(final String onClick) throws Exception { getMockWebConnection().setResponse(urlImage, directBytes, 200, "ok", "image/jpg", Collections.emptyList()); } - final String firstContent - = "first\n" + final String firstContent = DOCTYPE_HTML + + "first\n" + "\n" + " \n" + " \n" @@ -59,8 +59,8 @@ private WebDriver createWebClient(final String onClick) throws Exception { + " \n" + " \n" + ""; - final String secondContent = "second"; - final String thirdContent = "third"; + final String secondContent = DOCTYPE_HTML + "second"; + final String thirdContent = DOCTYPE_HTML + "third"; getMockWebConnection().setResponse(URL_SECOND, secondContent); getMockWebConnection().setResponse(URL_THIRD, thirdContent); @@ -97,7 +97,8 @@ public void referer() throws Exception { */ @Test public void isDisplayedRect() throws Exception { - final String html = "Page A\n" + final String html = DOCTYPE_HTML + + "Page A\n" + "\n" + " \n" + " \n" @@ -375,8 +384,8 @@ public void click_javascriptUrl() throws Exception { getMockWebConnection().setResponse(urlImage, directBytes, 200, "ok", "image/jpg", Collections.emptyList()); } - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" @@ -415,8 +424,8 @@ public void click_javascriptUrlMixedCase() throws Exception { getMockWebConnection().setResponse(urlImage, directBytes, 200, "ok", "image/jpg", Collections.emptyList()); } - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" @@ -456,8 +465,8 @@ public void click_javascriptUrlLeadingWhitespace() throws Exception { getMockWebConnection().setResponse(urlImage, directBytes, 200, "ok", "image/jpg", Collections.emptyList()); } - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" @@ -497,8 +506,8 @@ public void thisInJavascriptHref() throws Exception { getMockWebConnection().setResponse(urlImage, directBytes, 200, "ok", "image/jpg", Collections.emptyList()); } - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" diff --git a/src/test/java/org/htmlunit/html/HtmlAttrTest.java b/src/test/java/org/htmlunit/html/HtmlAttrTest.java index 181433f254f..55020f7c18e 100644 --- a/src/test/java/org/htmlunit/html/HtmlAttrTest.java +++ b/src/test/java/org/htmlunit/html/HtmlAttrTest.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. @@ -128,7 +128,8 @@ public void getParent() { */ @Test public void nodeType() throws Exception { - final String content = "foo\n" + "\n" + "
\n" - + "\n" + + " \n" + "\n" - + "\n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(html); driver.findElement(By.id("chkbox")).click(); - assertEquals(Arrays.asList(getExpectedAlerts()).toString(), - '[' + driver.findElement(By.id("myTextarea")).getAttribute("value") + ']'); + verifyTextArea2(driver, getExpectedAlerts()); } /** * @throws Exception if the test fails */ @Test - @Alerts("foo,change,boo,blur,") + @Alerts({"onchange change", "onblur blur"}) public void onchangeFires2() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "foo\n" + "\n" + "\n" + "
\n" + "\n" + "\n" + "\n" - + "\n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(html); driver.findElement(By.id("chkbox")).click(); driver.findElement(By.id("chkbox2")).click(); - assertEquals(Arrays.asList(getExpectedAlerts()).toString(), - '[' + driver.findElement(By.id("myTextarea")).getAttribute("value") + ']'); + verifyTextArea2(driver, getExpectedAlerts()); } /** @@ -521,15 +509,14 @@ public void onchangeFires2() throws Exception { @Test @Alerts("Second") public void setChecked() throws Exception { - final String firstHtml = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String firstHtml = DOCTYPE_HTML + "First\n" + "
\n" + "\n" + "\n" + ""; - final String secondHtml - = "Second"; + final String secondHtml = DOCTYPE_HTML + + "Second"; getMockWebConnection().setDefaultResponse(secondHtml); final WebDriver driver = loadPage2(firstHtml); @@ -544,16 +531,15 @@ public void setChecked() throws Exception { @Test @Alerts("Second") public void setChecked2() throws Exception { - final String firstHtml = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String firstHtml = DOCTYPE_HTML + "First\n" + "
\n" + "\n" + "\n" + "\n" + ""; - final String secondHtml - = "Second"; + final String secondHtml = DOCTYPE_HTML + + "Second"; getMockWebConnection().setDefaultResponse(secondHtml); final WebDriver driver = loadPage2(firstHtml); @@ -567,8 +553,7 @@ public void setChecked2() throws Exception { */ @Test public void preventDefault() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" @@ -519,9 +525,9 @@ public void selection() throws Exception { * @throws Exception if test fails */ @Test - @Alerts({"null,null", "exception value", "null,null", - "exception", "null,null", - "exception", "null,null"}) + @Alerts({"null,null", "InvalidStateError/DOMException", "null,null", + "InvalidStateError/DOMException", "null,null", + "InvalidStateError/DOMException", "null,null"}) public void selection2_1() throws Exception { selection2(3, 10); } @@ -530,9 +536,9 @@ public void selection2_1() throws Exception { * @throws Exception if test fails */ @Test - @Alerts({"null,null", "exception value", "null,null", - "exception", "null,null", - "exception", "null,null"}) + @Alerts({"null,null", "InvalidStateError/DOMException", "null,null", + "InvalidStateError/DOMException", "null,null", + "InvalidStateError/DOMException", "null,null"}) public void selection2_2() throws Exception { selection2(-3, 15); } @@ -541,15 +547,16 @@ public void selection2_2() throws Exception { * @throws Exception if test fails */ @Test - @Alerts({"null,null", "exception value", "null,null", - "exception", "null,null", - "exception", "null,null"}) + @Alerts({"null,null", "InvalidStateError/DOMException", "null,null", + "InvalidStateError/DOMException", "null,null", + "InvalidStateError/DOMException", "null,null"}) public void selection2_3() throws Exception { selection2(10, 5); } private void selection2(final int selectionStart, final int selectionEnd) throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + "\n" + ""; @@ -591,9 +598,10 @@ private void selection2(final int selectionStart, final int selectionEnd) throws * @throws Exception if test fails */ @Test - @Alerts({"null,null", "exception"}) + @Alerts({"null,null", "InvalidStateError/DOMException"}) public void selectionOnUpdate() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + "\n" + ""; @@ -631,7 +639,8 @@ public void selectionOnUpdate() throws Exception { @Test @Alerts({"changed2", "changed"}) public void firingOnchange() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -657,7 +666,8 @@ public void firingOnchange() throws Exception { @Test @Alerts({"true", "true"}) public void nonZeroWidthHeight() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "

hello world

\n" @@ -152,17 +152,17 @@ public void asFunction() throws Exception { @Test @Alerts("TypeError") public void asFunctionFormsFunction() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "

hello world

\n" @@ -180,19 +180,23 @@ public void asFunctionFormsFunction() throws Exception { */ @Test public void base() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "\n" + "
\n" + " \n" + ""; - getMockWebConnection().setDefaultResponse("foo"); + getMockWebConnection().setDefaultResponse(DOCTYPE_HTML + "foo"); final WebDriver driver = loadPage2(html); driver.findElement(new ByTagName("input")).click(); + if (useRealBrowser()) { + Thread.sleep(400); + } + assertEquals(2, getMockWebConnection().getRequestCount()); final URL requestedUrl = getMockWebConnection().getLastWebRequest().getUrl(); final URL expectedUrl = new URL(URL_SECOND, "two.html"); assertEquals(expectedUrl, requestedUrl); @@ -203,19 +207,23 @@ public void base() throws Exception { */ @Test public void emptyActionWithBase() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "\n" + "
\n" + " \n" + ""; - getMockWebConnection().setDefaultResponse("foo"); + getMockWebConnection().setDefaultResponse(DOCTYPE_HTML + "foo"); final WebDriver driver = loadPage2(html); driver.findElement(new ByTagName("input")).click(); + if (useRealBrowser()) { + Thread.sleep(400); + } + assertEquals(2, getMockWebConnection().getRequestCount()); final URL requestedUrl = getMockWebConnection().getLastWebRequest().getUrl(); assertEquals(URL_FIRST.toExternalForm(), requestedUrl); } @@ -225,8 +233,8 @@ public void emptyActionWithBase() throws Exception { */ @Test public void emptyActionWithBase2() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "\n" + "
\n" @@ -234,27 +242,28 @@ public void emptyActionWithBase2() throws Exception { + " \n" + ""; - getMockWebConnection().setDefaultResponse("foo"); + getMockWebConnection().setDefaultResponse(DOCTYPE_HTML + "foo"); final WebDriver driver = loadPage2(html); driver.findElement(new ByTagName("input")).click(); + assertEquals(1, getMockWebConnection().getRequestCount()); final URL requestedUrl = getMockWebConnection().getLastWebRequest().getUrl(); assertEquals(URL_FIRST.toExternalForm(), requestedUrl); } /** - * Simulates a bug report where using JavaScript to submit a form that contains a - * JavaScript action causes a an "IllegalArgumentException: JavaScript URLs can only - * be used to load content into frames and iframes". - * - * @throws Exception if the test fails - */ + * Simulates a bug report where using JavaScript to submit a form that contains a + * JavaScript action causes a an "IllegalArgumentException: JavaScript URLs can only + * be used to load content into frames and iframes". + * + * @throws Exception if the test fails + */ @Test @Alerts("clicked") public void jSSubmit_JavaScriptAction() throws Exception { - final String html - = "First\n" + final String html = DOCTYPE_HTML + + "First\n" + "\n" + "
\n" @@ -269,8 +278,8 @@ public void jSSubmit_JavaScriptAction() throws Exception { @Test @Alerts({"1", "val2", "3", "3"}) public void malformedHtml_nestedForms() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + "Click me\n" + ""; - final String secondHtml = "Second"; + final String secondHtml = DOCTYPE_HTML + "Second"; final WebClient client = getWebClientWithMockWebConnection(); final List collectedAlerts = new ArrayList<>(); @@ -542,8 +542,8 @@ public void submit_AnchorCausesSubmit_onSubmitHandler_returnFalse() throws Excep */ @Test public void submit_CheckboxClicked() throws Exception { - final String html - = "foo\n" + final String html = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + ""; - final String secondHtml = "\n" + final String secondHtml = DOCTYPE_HTML + + "\n" + "\n" @@ -73,7 +75,8 @@ public void crossFrameJavascript() throws Exception { @HtmlUnitNYI(CHROME = "1", EDGE = "1") public void iframeOnloadCalledOnlyOnce() throws Exception { - final String firstHtml = "\n" + final String firstHtml = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -90,7 +93,8 @@ public void iframeOnloadCalledOnlyOnce() throws Exception { @Test @Alerts("1") public void iframeOnloadAboutBlank() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -114,12 +118,14 @@ public void postponeLoading() throws Exception { + " \n" + ""; - final String secondHtml = "\n" + final String secondHtml = DOCTYPE_HTML + + "\n" + "\n" + "

second

\n" + ""; - final String thirdHtml = "\n" + final String thirdHtml = DOCTYPE_HTML + + "\n" + "\n" + "
\n" + " \n" @@ -145,12 +151,14 @@ public void frameOnload() throws Exception { + " \n" + ""; - final String secondHtml = "\n" + final String secondHtml = DOCTYPE_HTML + + "\n" + "\n" + "

second

\n" + ""; - final String thirdHtml = "\n" + final String thirdHtml = DOCTYPE_HTML + + "\n" + "\n" + "

third

\n" + ""; @@ -175,7 +183,8 @@ public void frameOnloadFrameInFrame() throws Exception { + " \n" + ""; - final String secondHtml = "\n" + final String secondHtml = DOCTYPE_HTML + + "\n" + "\n" + "

second

\n" + ""; @@ -184,7 +193,8 @@ public void frameOnloadFrameInFrame() throws Exception { + " \n" + ""; - final String fourthHtml = "\n" + final String fourthHtml = DOCTYPE_HTML + + "\n" + "\n" + "

fourth

\n" + ""; @@ -207,7 +217,8 @@ public void frameOnloadFrameInFrame() throws Exception { @Test @Alerts("myInputName") public void iframeContentNotLoaded() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "FooBar\n" + "\n" + "\n" @@ -248,16 +259,18 @@ public void iframeContentNotLoaded() throws Exception { @Test @Alerts("foo") public void onloadInNavigatedFrame() throws Exception { - final String html = "first\n" + final String html = DOCTYPE_HTML + + "first\n" + "\n" + " \n" + ""; - final String firstHtml = "\n" + final String firstHtml = DOCTYPE_HTML + + "\n" + "hello\n" + ""; - final String secondHtml = ""; + final String secondHtml = DOCTYPE_HTML + ""; final MockWebConnection webConnection = getMockWebConnection(); webConnection.setResponse(new URL(URL_FIRST, "frame1.html"), firstHtml); @@ -277,8 +290,8 @@ public void onloadInNavigatedFrame() throws Exception { @Test @Alerts("loaded") public void lineBreaksInUrl() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "Test\n" + ""; @@ -286,8 +299,8 @@ public void lineBreaksInUrl() throws Exception { getMockWebConnection().setResponse(new URL(URL_SECOND, "abcd"), html); expandExpectedAlertsVariables(URL_SECOND); - final String frame - = "\n" + final String frame = DOCTYPE_HTML + + "\n" + " \n" + " \n" + " "; @@ -302,8 +315,8 @@ public void lineBreaksInUrl() throws Exception { @Test @Alerts("loaded") public void lineBreaksInUrlIFrame() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "Test\n" + ""; @@ -311,8 +324,8 @@ public void lineBreaksInUrlIFrame() throws Exception { getMockWebConnection().setResponse(new URL(URL_SECOND, "abcd"), html); expandExpectedAlertsVariables(URL_SECOND); - final String frame - = "\n" + final String frame = DOCTYPE_HTML + + "\n" + " \n" + " \n" + " \n" diff --git a/src/test/java/org/htmlunit/html/HtmlFrameSetTest.java b/src/test/java/org/htmlunit/html/HtmlFrameSetTest.java index 5fa2da8f657..6f82c6316e5 100644 --- a/src/test/java/org/htmlunit/html/HtmlFrameSetTest.java +++ b/src/test/java/org/htmlunit/html/HtmlFrameSetTest.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. @@ -26,7 +26,7 @@ import org.htmlunit.WebClient; import org.htmlunit.WebWindow; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.NotYetImplemented; +import org.htmlunit.junit.annotation.NotYetImplemented; import org.junit.Test; import org.junit.runner.RunWith; @@ -46,8 +46,8 @@ public class HtmlFrameSetTest extends SimpleWebTestCase { */ @Test public void loadingFrameSet() throws Exception { - final String firstContent - = "First\n" + final String firstContent = DOCTYPE_HTML + + "First\n" + "\n" + " \n" + " \n" @@ -56,8 +56,8 @@ public void loadingFrameSet() throws Exception { + " \n" + "\n" + ""; - final String secondContent = "Second"; - final String thirdContent = "Third"; + final String secondContent = DOCTYPE_HTML + "Second"; + final String thirdContent = DOCTYPE_HTML + "Third"; final WebClient webClient = getWebClientWithMockWebConnection(); @@ -84,13 +84,13 @@ public void loadingFrameSet() throws Exception { */ @Test public void loadingIFrames() throws Exception { - final String firstContent - = "First\n" + final String firstContent = DOCTYPE_HTML + + "First\n" + "\n" + " \n" + " \n" + "\n" + ""; - final String rightFrame = "Right Frame\n" + final String rightFrame = DOCTYPE_HTML + + "Right Frame\n" + "
Body of right frame
\n" + ""; - final String leftFrame = "Left Frame\n" + final String leftFrame = DOCTYPE_HTML + + "Left Frame\n" + "\n" + "
Body of left frame
\n" + " Click link\n" @@ -122,11 +127,13 @@ public void targetResolution() throws Exception { + "\n" + ""; - final String innerFrame = "Inner Frame\n" + final String innerFrame = DOCTYPE_HTML + + "Inner Frame\n" + "
Body of inner frame
\n" + ""; - final String newInnerFrame = "New inner Frame\n" + final String newInnerFrame = DOCTYPE_HTML + + "New inner Frame\n" + "
Body of new inner frame
\n" + ""; @@ -184,15 +191,15 @@ public void targetResolution() throws Exception { @Test @Alerts("2") public void scriptUnderIFrame() throws Exception { - final String firstContent - = "\n" + final String firstContent = DOCTYPE_HTML + + "\n" + "\n" + ""; - final String secondContent - = ""; + final String secondContent = DOCTYPE_HTML + + ""; final String thirdContent = "alert('3');"; getMockWebConnection().setResponse(URL_SECOND, secondContent); @@ -213,15 +220,15 @@ public void scriptUnderIFrame() throws Exception { EDGE = "about://unsupported") @NotYetImplemented({CHROME, EDGE}) public void aboutSrc() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -250,7 +257,8 @@ public void aboutSrc() throws Exception { FF = {"1:false", "2:false", "3:false", "4:false"}, FF_ESR = {"1:false", "2:false", "3:false", "4:false"}) public void createIframeFromStrictFunction() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; - final String secondContent = "Second"; - final String thirdContent = "Third"; + final String secondContent = DOCTYPE_HTML + "Second"; + final String thirdContent = DOCTYPE_HTML + "Third"; final WebClient client = getWebClientWithMockWebConnection(); final MockWebConnection webConnection = getMockWebConnection(); @@ -196,8 +197,8 @@ public void setSrcAttribute_ViaJavaScript() throws Exception { */ @Test public void frameCloneDoesNotReloadFrame() throws Exception { - final String html1 = ""; - final String html2 = "abc"; + final String html1 = DOCTYPE_HTML + ""; + final String html2 = DOCTYPE_HTML + "abc"; final WebClient client = getWebClientWithMockWebConnection(); @@ -218,11 +219,11 @@ public void frameCloneDoesNotReloadFrame() throws Exception { */ @Test public void frameWriteDoesNotReloadFrame() throws Exception { - final String html1 = - "\n" + final String html1 = DOCTYPE_HTML + + "\n" + "\n" + ""; - final String html2 = "iframe content"; + final String html2 = DOCTYPE_HTML + "iframe content"; final WebClient client = getWebClientWithMockWebConnection(); @@ -247,8 +248,8 @@ public void frameWriteDoesNotReloadFrame() throws Exception { */ @Test public void frameSetInnerHtmlDoesLoadFrame() throws Exception { - final String html1 = - "\n" + final String html1 = DOCTYPE_HTML + + "\n" + "';\n" + "\n" + "\n" + ""; - final String html2 = "iframe content"; - final String html3 = "Third content"; + final String html2 = DOCTYPE_HTML + "iframe content"; + final String html3 = DOCTYPE_HTML + "Third content"; final WebClient client = getWebClientWithMockWebConnection(); @@ -289,8 +290,8 @@ public void frameSetInnerHtmlDoesLoadFrame() throws Exception { */ @Test public void frameSetInnerHtmlDoesLoadFrameContentTimeout() throws Exception { - final String html1 = - "\n" + final String html1 = DOCTYPE_HTML + + "\n" + "';\n" + "\n" + "\n" + ""; - final String html2 = "iframe content"; - final String html3 = "Third content"; + final String html2 = DOCTYPE_HTML + "iframe content"; + final String html3 = DOCTYPE_HTML + "Third content"; final WebClient client = getWebClientWithMockWebConnection(); @@ -339,8 +340,8 @@ public void frameSetInnerHtmlDoesLoadFrameContentTimeout() throws Exception { */ @Test public void frameContentCreationViaJavascript() throws Exception { - final String html = - "frames\n" + final String html = DOCTYPE_HTML + + "frames\n" + "\n" + "\n" + "\n" @@ -82,8 +82,8 @@ public void onchangeDirectCall() throws Exception { @Test @Alerts({"function handler() {}", "null"}) public void onchangeNull() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -665,8 +665,8 @@ public void detached_datetime() throws Exception { } private void changeTypeDetached(final String value, final String targetType) throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/html/HtmlInputTest.java b/src/test/java/org/htmlunit/html/HtmlInputTest.java index cb6575e1fae..cc833d608da 100644 --- a/src/test/java/org/htmlunit/html/HtmlInputTest.java +++ b/src/test/java/org/htmlunit/html/HtmlInputTest.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,8 +48,8 @@ public final class HtmlInputTest extends SimpleWebTestCase { */ @Test public void radioButtonsAreMutuallyExclusive() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "\n" @@ -81,8 +81,8 @@ public void radioButtonsAreMutuallyExclusive() throws Exception { */ @Test public void setChecked_CheckBox() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "\n" @@ -105,8 +105,8 @@ public void setChecked_CheckBox() throws Exception { */ @Test public void getChecked_RadioButton() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "\n" @@ -128,8 +128,8 @@ public void getChecked_RadioButton() throws Exception { */ @Test public void setValueAttribute() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + ""; @@ -150,8 +150,8 @@ public void setValueAttribute() throws Exception { */ @Test public void checkboxDefaultValue() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "
\n" + "\n" + ""; @@ -169,8 +169,8 @@ public void checkboxDefaultValue() throws Exception { */ @Test public void clickRadioButton() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "
\n" + "\n" + "\n" @@ -195,8 +195,8 @@ public void clickRadioButton() throws Exception { */ @Test public void inputNoType() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + ""; @@ -212,8 +212,8 @@ public void inputNoType() throws Exception { */ @Test public void onChangeHandlerNotFiredOnLoad() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "
\n" + "\n" + ""; @@ -228,7 +228,8 @@ public void onChangeHandlerNotFiredOnLoad() throws Exception { */ @Test public void testRequiredValidation() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "
\n" @@ -242,10 +243,13 @@ public void testRequiredValidation() throws Exception { assertFalse(input.isValid()); } + /** + * @throws Exception if an error occurs + */ @Test public void changeType_javascriptEngineDisabled() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + ""; @@ -261,10 +265,13 @@ public void changeType_javascriptEngineDisabled() throws Exception { } } + /** + * @throws Exception if an error occurs + */ @Test public void changeType_javascriptDisabled() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "
\n" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/html/HtmlInsertedTextTest.java b/src/test/java/org/htmlunit/html/HtmlInsertedTextTest.java index cb84bf182a2..e75c9bf86be 100644 --- a/src/test/java/org/htmlunit/html/HtmlInsertedTextTest.java +++ b/src/test/java/org/htmlunit/html/HtmlInsertedTextTest.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,7 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -35,7 +35,8 @@ public class HtmlInsertedTextTest extends WebDriverTestCase { @Test @Alerts({"abcdef", "abcdef"}) public void simple() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " abcdef\n" + " \n" @@ -133,8 +134,8 @@ public void testJavaScript() throws Exception { */ @Test public void formValues() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "
\n" + "
\n" + " \n" - + " \n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(html); driver.findElement(By.id("opt3")).click(); - assertEquals(Arrays.asList(getExpectedAlerts()).toString(), - '[' + driver.findElement(By.id("myTextarea")).getAttribute("value") + ']'); + verifyTextArea2(driver, getExpectedAlerts()); } /** @@ -167,7 +165,8 @@ public void onMouse() throws Exception { */ @Test public void isSelected() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + " \n" + ""; @@ -190,7 +189,8 @@ public void isSelected() throws Exception { */ @Test public void isSelectedJavaScript() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; + final String html = DOCTYPE_HTML + ""; final String js = "alert('Hello there')"; @@ -135,7 +137,7 @@ public void save() throws Exception { */ @Test public void save_image() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final URL url = getClass().getClassLoader().getResource("testfiles/tiny-jpg.img"); final WebClient webClient = getWebClientWithMockWebConnection(); @@ -168,7 +170,7 @@ public void save_image() throws Exception { */ @Test public void save_imageNotImage() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final MockWebConnection webConnection = getMockWebConnection(); @@ -191,7 +193,7 @@ public void save_imageNotImage() throws Exception { */ @Test public void save_image_without_src() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final WebClient webClient = getWebClientWithMockWebConnection(); final MockWebConnection webConnection = getMockWebConnection(); @@ -214,7 +216,7 @@ public void save_image_without_src() throws Exception { */ @Test public void save_image_empty_src() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final WebClient webClient = getWebClientWithMockWebConnection(); final MockWebConnection webConnection = getMockWebConnection(); @@ -237,20 +239,23 @@ public void save_image_empty_src() throws Exception { */ @Test public void save_frames() throws Exception { - final String mainContent - = "First\n" + final String mainContent = DOCTYPE_HTML + + "First\n" + "\n" + " \n" + " \n" + " \n" + "\n" + ""; - final String frameLeftContent = "Second\n" + final String frameLeftContent = DOCTYPE_HTML + + "Second\n" + "\n" + "\n" + ""; - final String frameRightContent = "Thirdframe right"; - final String iframeContent = "Iframeiframe"; + final String frameRightContent = DOCTYPE_HTML + + "Thirdframe right"; + final String iframeContent = DOCTYPE_HTML + + "Iframeiframe"; try (InputStream is = getClass().getClassLoader().getResourceAsStream("testfiles/tiny-jpg.img")) { final byte[] directBytes = IOUtils.toByteArray(is); @@ -297,7 +302,8 @@ public void save_frames() throws Exception { */ @Test public void save_css() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; final String css = "body {color: blue}"; @@ -328,7 +334,8 @@ public void save_css() throws Exception { */ @Test public void save_css_without_href() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; final WebClient webClient = getWebClientWithMockWebConnection(); @@ -352,7 +359,8 @@ public void save_css_without_href() throws Exception { */ @Test public void save_css_empty_href() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; final WebClient webClient = getWebClientWithMockWebConnection(); @@ -380,12 +388,12 @@ public void save_css_empty_href() throws Exception { public void saveShouldStripLongFileNames() throws Exception { final RandomStringGenerator generator = new RandomStringGenerator.Builder().withinRange('a', 'z').get(); final String longName = generator.generate(500) + ".html"; - final String html = ""; + final String html = DOCTYPE_HTML + ""; final WebClient webClient = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); - webConnection.setDefaultResponse(""); + webConnection.setDefaultResponse(DOCTYPE_HTML + ""); webConnection.setResponse(URL_FIRST, html); webClient.setWebConnection(webConnection); @@ -403,7 +411,8 @@ public void saveShouldStripLongFileNames() throws Exception { */ @Test public void serialization_attributeListenerLock() throws Exception { - final String html = "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/html/HtmlPageTest.java b/src/test/java/org/htmlunit/html/HtmlPageTest.java index 3b595f4be63..f57b099a023 100644 --- a/src/test/java/org/htmlunit/html/HtmlPageTest.java +++ b/src/test/java/org/htmlunit/html/HtmlPageTest.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 @@ import org.htmlunit.WebResponse; import org.htmlunit.html.HtmlElementTest.HtmlAttributeChangeListenerTestImpl; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.Cookie; import org.htmlunit.util.MimeType; import org.htmlunit.util.NameValuePair; @@ -84,7 +84,8 @@ public class HtmlPageTest extends SimpleWebTestCase { */ @Test public void formSubmit() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -124,7 +125,8 @@ public void formSubmit() throws Exception { */ @Test public void getElementByIdNull() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -140,7 +142,8 @@ public void getElementByIdNull() throws Exception { */ @Test public void getElementsByIdNull() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -158,7 +161,8 @@ public void getElementsByIdNull() throws Exception { */ @Test public void getElementsByIdOrNameNull() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -176,7 +180,8 @@ public void getElementsByIdOrNameNull() throws Exception { */ @Test(expected = ElementNotFoundException.class) public void getElementByNameNull() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -192,7 +197,8 @@ public void getElementByNameNull() throws Exception { */ @Test public void getElementsByNameNull() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -211,7 +217,8 @@ public void getElementsByNameNull() throws Exception { */ @Test public void getHtmlElement() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -277,7 +284,8 @@ public void getHtmlElement() throws Exception { */ @Test public void getAnchorByText() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " anchor text\n" @@ -299,7 +307,8 @@ public void getAnchorByText() throws Exception { */ @Test public void getTabbableElements_None() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -316,7 +325,8 @@ public void getTabbableElements_None() throws Exception { */ @Test public void getTabbableElements_OneEnabled_OneDisabled() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -336,7 +346,8 @@ public void getTabbableElements_OneEnabled_OneDisabled() throws Exception { */ @Test public void getTabbableElements() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "foo\n" @@ -372,7 +383,8 @@ public void getTabbableElements() throws Exception { */ @Test public void getHtmlElementByAccessKey() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "foo\n" @@ -396,7 +408,8 @@ public void getHtmlElementByAccessKey() throws Exception { */ @Test public void getHtmlElementsByAccessKey() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "foo\n" + "foo\n" @@ -416,7 +429,8 @@ public void getHtmlElementsByAccessKey() throws Exception { */ @Test public void getFullQualifiedUrl_NoBaseSpecified() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "
row 1
row 2
\n" + ""; @@ -467,7 +481,8 @@ private void testGetFullQualifiedUrl_WithBase(final String baseProtocol, final S throws Exception { final String baseUrl = baseProtocol + "://second" + basePortPart; - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "

\n" @@ -490,7 +505,7 @@ private void testGetFullQualifiedUrl_WithBase(final String baseProtocol, final S */ @Test(expected = MalformedURLException.class) public void getFullQualifiedUrl_invalid() throws Exception { - final String htmlContent = ""; + final String htmlContent = DOCTYPE_HTML + ""; final HtmlPage page = loadPage(htmlContent); page.getFullyQualifiedUrl("http://"); @@ -501,7 +516,8 @@ public void getFullQualifiedUrl_invalid() throws Exception { */ @Test public void testBase_Multiple() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -536,7 +552,8 @@ public void notify(final String message, final Object origin) { */ @Test public void testBase_InsideBody() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " link\n" + ""; @@ -558,7 +575,8 @@ public void testBase_InsideBody() throws Exception { */ @Test public void onLoadHandler_BodyStatement() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + ""; final List collectedAlerts = new ArrayList<>(); @@ -575,7 +593,8 @@ public void onLoadHandler_BodyStatement() throws Exception { */ @Test public void onLoadHandler_TwoBodyStatements() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + ""; final List collectedAlerts = new ArrayList<>(); @@ -592,7 +611,8 @@ public void onLoadHandler_TwoBodyStatements() throws Exception { */ @Test public void onLoadHandler_BodyName() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + ""; @@ -610,7 +630,8 @@ public void onLoadHandler_BodyName() throws Exception { */ @Test public void onLoadHandler_BodyName_NotAFunction() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + ""; @@ -630,7 +651,8 @@ public void onLoadHandler_BodyName_NotAFunction() throws Exception { */ @Test public void onLoadHandler_ScriptName() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "

helloworld &amp; helloall

\n" @@ -1092,7 +1132,8 @@ public void asXml2() throws Exception { @Test public void asXml_unicode() throws Exception { final String unicodeString = "\u064A\u0627 \u0644\u064A\u064A\u0644"; - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "" + unicodeString + ""; @@ -1113,7 +1154,8 @@ public void asXml_unicode() throws Exception { */ @Test public void asXml_noscript() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + "" + "" + ""; @@ -1137,7 +1179,8 @@ public void asXml_noscript() throws Exception { */ @Test public void getElementsById() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + "
foo
" + "
" + "
" @@ -1163,7 +1206,8 @@ public void getElementsById() throws Exception { */ @Test public void getElementsByName() throws Exception { - final String html = "
foo
"; + final String html = DOCTYPE_HTML + + "
foo
"; final HtmlPage page = loadPage(html); assertEquals(1, page.getElementsByName("a").size()); assertEquals(2, page.getElementsByName("b").size()); @@ -1183,7 +1227,8 @@ public void getElementsByName() throws Exception { */ @Test public void getElementByName() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "
foo
\n" + "
bar
\n" + "
baz
"; @@ -1200,7 +1245,8 @@ public void getElementByName() throws Exception { */ @Test(expected = ElementNotFoundException.class) public void getElementByNameNotfound() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "
foo
\n" + "
bar
\n" + "
baz
"; @@ -1213,8 +1259,9 @@ public void getElementByNameNotfound() throws Exception { */ @Test public void getHtmlElementsByIdAndOrName() throws Exception { - final String html = "
foo
bar
" - + "
bar
"; + final String html = DOCTYPE_HTML + + "
foo
bar
" + + "
bar
"; final HtmlPage page = loadPage(html); assertEquals(1, page.getElementsByIdAndOrName("a").size()); assertEquals(2, page.getElementsByIdAndOrName("b").size()); @@ -1236,8 +1283,8 @@ public void getHtmlElementsByIdAndOrName() throws Exception { */ @Test public void getHtmlElementByIdAfterRemove() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "
\n" + "
\n" @@ -1274,8 +1321,8 @@ public void getHtmlElementByIdAfterRemove() throws Exception { */ @Test public void getHtmlElementById_idTwice() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "
foo
\n" + "bla\n" @@ -1296,7 +1343,8 @@ public void getHtmlElementById_idTwice() throws Exception { @Test @Alerts("webm=none") public void setCookieMetaTag() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -1325,12 +1373,12 @@ public void noSlashURL() throws Exception { } private void testNoSlashURL(final String url) throws Exception { - final String firstContent - = "\n" + final String firstContent = DOCTYPE_HTML + + "\n" + "\n" + ""; - final String secondContent = ""; + final String secondContent = DOCTYPE_HTML + ""; final WebClient client = getWebClient(); final URL secondURL = new URL("http://second/"); @@ -1360,7 +1408,7 @@ public void metaTagWithEmptyURL() throws Exception { private int nbCalls_ = 0; @Override public WebResponse getResponse(final WebRequest request) throws IOException { - String content = "\n"; + String content = DOCTYPE_HTML + "\n"; if (nbCalls_ == 0) { content += "\n"; } @@ -1387,8 +1435,8 @@ public void serialization() throws Exception { // The document.all and form.elements calls are important because they trigger the creation // of HTMLCollections, which have caused serialization problems in the past (see bug #606). - final String content = - "\n" + final String content = DOCTYPE_HTML + + "\n" + "
Hello there!
\n" + "\n" @@ -1465,8 +1513,8 @@ public void serializationLambda() throws Exception { */ @Test public void serializationStaticDomNodeList() throws Exception { - final String content = - "\n" + final String content = DOCTYPE_HTML + + "\n" + "
Hello there!
\n" + "\n" + "\n" @@ -1495,7 +1543,8 @@ public void serializationStaticDomNodeList() throws Exception { */ @Test public void clonedPageHasOwnIdMap() throws Exception { - final String content = "foo" + final String content = DOCTYPE_HTML + + "foo" + "" + "
" + ""; @@ -1529,7 +1578,8 @@ public void clonedPageHasOwnIdMap() throws Exception { */ @Test public void clonedPageHasOwnDocumentElement() throws Exception { - final String content = "foo\n" + final String content = DOCTYPE_HTML + + "foo\n" + "\n" + "
\n" + ""; @@ -1547,8 +1597,8 @@ public void clonedPageHasOwnDocumentElement() throws Exception { */ @Test public void htmlAttributeChangeListener_AddAttribute() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + ""; @@ -1852,8 +1908,8 @@ public void srcJavaScript() throws Exception { */ @Test public void asNormalizedText() throws Exception { - final String htmlContent - = "test\n" + final String htmlContent = DOCTYPE_HTML + + "test\n" + "\n" + "\n" + "
a
"; @@ -1867,8 +1923,8 @@ public void asNormalizedText() throws Exception { */ @Test public void getElementsByTagName() throws Exception { - final String firstContent - = "First\n" + final String firstContent = DOCTYPE_HTML + + "First\n" + "\n" + "
\n" + "
a
b
c
\n" @@ -1907,8 +1963,8 @@ public void getElementsByTagName() throws Exception { */ @Test public void readyState() throws Exception { - final String htmlContent - = "test\n" + final String htmlContent = DOCTYPE_HTML + + "test\n" + "\n" + "\n" + "
a
"; @@ -1922,7 +1978,8 @@ public void readyState() throws Exception { */ @Test public void cloneNode() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -1938,16 +1995,16 @@ public void cloneNode() throws Exception { */ @Test public void cloneHtmlPageWithFrame() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "
" + " " + "
" + ""; - final String frameContent = - "\n" + final String frameContent = DOCTYPE_HTML + + "\n" + "\n" + "" + "

frame1

" @@ -2024,8 +2081,8 @@ public void addAutoCloseableNull() throws Exception { */ @Test public void getBaseUrl() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "body\n" + ""; diff --git a/src/test/java/org/htmlunit/html/HtmlPageTest5.java b/src/test/java/org/htmlunit/html/HtmlPageTest5.java index 6e8ef8b7dd4..fbd5182d306 100644 --- a/src/test/java/org/htmlunit/html/HtmlPageTest5.java +++ b/src/test/java/org/htmlunit/html/HtmlPageTest5.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. @@ -19,7 +19,7 @@ import org.htmlunit.SimpleWebTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -37,7 +37,8 @@ public class HtmlPageTest5 extends SimpleWebTestCase { @Test @Alerts({"focus-0", "blur-0", "focus-1", "blur-1", "focus-2"}) public void tabNext() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "First\n" + "\n" + "\n" @@ -69,7 +70,8 @@ public void tabNext() throws Exception { @Test @Alerts({"focus-2", "blur-2", "focus-1", "blur-1", "focus-0"}) public void tabPrevious() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "First\n" + "\n" + "\n" @@ -100,7 +102,8 @@ public void tabPrevious() throws Exception { */ @Test public void keyboard_NoTabbableElements() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "First\n" + "\n" + "\n" @@ -138,7 +141,8 @@ public void keyboard_NoTabbableElements() throws Exception { @Test @Alerts({"focus-0", "blur-0", "focus-0"}) public void keyboard_OneTabbableElement() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "First\n" + "\n" + "\n" @@ -184,7 +188,8 @@ public void keyboard_OneTabbableElement() throws Exception { @Test @Alerts({"focus-0", "blur-0", "focus-2", "blur-2", "focus-1"}) public void accessKeys() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "First\n" + "\n" + "\n" @@ -216,7 +221,8 @@ public void accessKeys() throws Exception { @Test @Alerts("buttonPushed") public void pressAccessKey_Button() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "First\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/html/HtmlParagraphTest.java b/src/test/java/org/htmlunit/html/HtmlParagraphTest.java index 9a453a88ab2..c0ac0b3ff0c 100644 --- a/src/test/java/org/htmlunit/html/HtmlParagraphTest.java +++ b/src/test/java/org/htmlunit/html/HtmlParagraphTest.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. @@ -32,7 +32,8 @@ public class HtmlParagraphTest extends SimpleWebTestCase { */ @Test public void asXml_emptyTag() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "

\n" + ""; @@ -46,7 +47,8 @@ public void asXml_emptyTag() throws Exception { */ @Test public void asNormalizedText_getTextContent() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "

\n" + "

abc

\n" + "

$24.43

\n" diff --git a/src/test/java/org/htmlunit/html/HtmlParameterTest.java b/src/test/java/org/htmlunit/html/HtmlParameterTest.java index 86f393ac434..20b18bed1eb 100644 --- a/src/test/java/org/htmlunit/html/HtmlParameterTest.java +++ b/src/test/java/org/htmlunit/html/HtmlParameterTest.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,7 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.WebDriver; @@ -37,7 +37,8 @@ public class HtmlParameterTest extends WebDriverTestCase { @Test @Alerts("[object HTMLParamElement]") public void simpleScriptable() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -138,7 +152,8 @@ public void typeDoesNotChangeValueAttribute() throws Exception { @Test @Alerts({"HtmlUnit", "HtmlUnit"}) public void typeDoesNotChangeValueAttributeWithInitialValue() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -165,8 +180,8 @@ public void typeDoesNotChangeValueAttributeWithInitialValue() throws Exception { */ @Test public void preventDefault_OnKeyDown() throws Exception { - final String html = - "\n" + "\n" + "\n" @@ -256,8 +275,8 @@ public void typeOnChange() throws Exception { */ @Test public void setValueOnChange() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -283,8 +302,8 @@ public void setValueOnChange() throws Exception { */ @Test public void setDefaultValueOnChange() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" + "\n" + "\n" + "
\n" + "Check me\n" + + " onchange='log(\"foo\");log(event.type);'>Check me\n" + "
\n" - + "\n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(html); driver.findElement(By.id("radio")).click(); - assertEquals(Arrays.asList(getExpectedAlerts()).toString(), - '[' + driver.findElement(By.id("myTextarea")).getAttribute("value") + ']'); + verifyTextArea2(driver, getExpectedAlerts()); } /** * @throws Exception if the test fails */ @Test - @Alerts("foo,change,boo,blur,") + @Alerts({"foo", "change", "boo", "blur"}) public void onchangeFires2() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "foo\n" + "\n" + "\n" + "
\n" + "Check Me\n" + "Or Check Me\n" + "
\n" - + "\n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(html); driver.findElement(By.id("radio1")).click(); driver.findElement(By.id("radio2")).click(); - assertEquals(Arrays.asList(getExpectedAlerts()).toString(), - '[' + driver.findElement(By.id("myTextarea")).getAttribute("value") + ']'); + verifyTextArea2(driver, getExpectedAlerts()); } /** @@ -606,16 +592,15 @@ public void onchangeFires2() throws Exception { @Test @Alerts("Second") public void setChecked() throws Exception { - final String firstHtml = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String firstHtml = DOCTYPE_HTML + "First\n" + "
\n" + "\n" + "
\n" + ""; - final String secondHtml - = "Second"; + final String secondHtml = DOCTYPE_HTML + + "Second"; getMockWebConnection().setDefaultResponse(secondHtml); final WebDriver driver = loadPage2(firstHtml); @@ -630,8 +615,7 @@ public void setChecked() throws Exception { @Test @Alerts("Second") public void setChecked2() throws Exception { - final String firstHtml = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String firstHtml = DOCTYPE_HTML + "First\n" + "
\n" + "\n" + "
\n" + ""; - final String secondHtml - = "Second"; + final String secondHtml = DOCTYPE_HTML + + "Second"; getMockWebConnection().setDefaultResponse(secondHtml); final WebDriver driver = loadPage2(firstHtml); @@ -654,8 +638,7 @@ public void setChecked2() throws Exception { */ @Test public void preventDefault() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + ""; loadPageVerifyTitle2(html); @@ -103,7 +104,8 @@ public void addedFromDocumentFragment() throws Exception { @Test @Alerts("[object HTMLScriptElement]") public void simpleScriptable() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -476,8 +486,8 @@ public void setTextMultipleTextNodes() throws Exception { @Test @Alerts({"1", "2", "3"}) public void settingSrcAttribute() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" @@ -570,7 +917,7 @@ public void addEventListener_NoContent() throws Exception { + ""; getMockWebConnection().setResponse(scriptUrl, (String) null, - HttpStatus.NO_CONTENT_204, HttpStatus.NO_CONTENT_204_MSG, MimeType.TEXT_JAVASCRIPT, null); + statusCode, "test", MimeType.TEXT_JAVASCRIPT, null); loadPageVerifyTitle2(html); } @@ -580,7 +927,8 @@ public void addEventListener_NoContent() throws Exception { */ @Test public void badSrcUrl() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -594,7 +942,7 @@ public void badSrcUrl() throws Exception { */ @Test public void invalidJQuerySrcAttribute() throws Exception { - loadPage2(""); + loadPage2(DOCTYPE_HTML + ""); } /** @@ -603,8 +951,8 @@ public void invalidJQuerySrcAttribute() throws Exception { @Test @Alerts({"loaded", "§§URL§§abcd"}) public void lineBreaksInUrl() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" @@ -626,8 +974,8 @@ public void lineBreaksInUrl() throws Exception { @Alerts({"\u0623\u0647\u0644\u0627\u064b\u0623\u0647\u0644\u0627" + "\u064b\u0623\u0647\u0644\u0627\u064b\u0623\u0647\u0644\u0627\u064b", "§§URL§§"}) public void incorrectCharset() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" @@ -684,8 +1032,8 @@ public void onLoadOnErrorWithoutType() throws Exception { } private void onLoadOnError(final String attribs) throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " " + "" + "abc"; @@ -878,7 +1227,8 @@ public void whitespaceInSrc() throws Exception { @Test @Alerts({"loaded", "§§URL§§"}) public void controlCharsInSrc() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + " " + "" + "abc"; @@ -900,7 +1250,8 @@ public void tabCharInSrc() throws Exception { String url = URL_SECOND.toExternalForm(); url = url.replace("http", "http\t"); - final String html = "" + final String html = DOCTYPE_HTML + + "" + " " + "" + "abc"; @@ -918,8 +1269,8 @@ public void tabCharInSrc() throws Exception { */ @Test public void emptySrc() throws Exception { - final String html1 = "abc"; - final String html2 = "abc"; + final String html1 = DOCTYPE_HTML + "abc"; + final String html2 = DOCTYPE_HTML + "abc"; loadPageWithAlerts2(html1); loadPageWithAlerts2(html2); @@ -932,7 +1283,7 @@ public void emptySrc() throws Exception { */ @Test public void noContent() throws Exception { - final String html = "\n"; @@ -965,7 +1317,8 @@ public void srcAndContent() throws Exception { */ @Test public void emptySrcAndContent() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n"; @@ -981,7 +1334,8 @@ public void emptySrcAndContent() throws Exception { */ @Test public void blankSrcAndContent() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n"; @@ -997,7 +1351,8 @@ public void blankSrcAndContent() throws Exception { */ @Test public void attribSrcAndContent() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n"; @@ -1015,7 +1370,8 @@ public void attribSrcAndContent() throws Exception { @Test @Alerts({"first script", "second script"}) public void content() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + " \n"; diff --git a/src/test/java/org/htmlunit/html/HtmlScriptTest.java b/src/test/java/org/htmlunit/html/HtmlScriptTest.java index 0af1a8d983a..5e5f3fa758e 100644 --- a/src/test/java/org/htmlunit/html/HtmlScriptTest.java +++ b/src/test/java/org/htmlunit/html/HtmlScriptTest.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. @@ -26,7 +26,7 @@ import org.htmlunit.SimpleWebTestCase; import org.htmlunit.WebClient; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.MimeType; import org.junit.Test; import org.junit.runner.RunWith; @@ -52,7 +52,8 @@ public class HtmlScriptTest extends SimpleWebTestCase { */ @Test public void badExternalScriptReference() throws Exception { - final String html = "foo\n" + final String html = DOCTYPE_HTML + + "foo\n" + "\n" + ""; @@ -89,7 +90,7 @@ public void badExternalScriptReference() throws Exception { */ @Test public void asNormalizedText() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final HtmlPage page = loadPage(html); final HtmlScript script = page.getHtmlElementById("s"); assertEquals("", script.asNormalizedText()); @@ -101,8 +102,8 @@ public void asNormalizedText() throws Exception { @Test @Alerts("hello") public void asXml() throws Exception { - final String html - = "foo\n" + final String html = DOCTYPE_HTML + + "foo\n" + ""; @@ -122,7 +123,7 @@ public void asXml_scriptNestedInCData() throws Exception { final String script = "//"; - final String html = ""; + final String html = DOCTYPE_HTML + ""; final HtmlPage page = loadPage(html); final HtmlScript scriptElement = page.getHtmlElementById("s"); assertEquals("\r\n", @@ -136,7 +137,7 @@ public void asXml_scriptNestedInCData() throws Exception { @Test @Alerts("loaded") public void scriptCloneDoesNotReloadScript() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final String js = "alert('loaded')"; final WebClient client = getWebClient(); @@ -178,8 +179,8 @@ public void addEventListener_error_clientDoesNotThrow() throws Exception { private void addEventListener_error(final boolean throwOnFailingStatusCode) throws Exception { final URL fourOhFour = new URL(URL_FIRST, "/404"); - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; + final String html = DOCTYPE_HTML + + "Page A"; final HtmlPage page = loadPageWithAlerts(html); final HtmlScript script = page.getFirstByXPath("//script"); assertFalse(script.isDisplayed()); @@ -250,16 +253,16 @@ public void isDisplayed() throws Exception { @Test @Alerts({"First script executes", "Second page loading"}) public void changingLocationSkipsFurtherScriptsOnPage() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + "\n" + ""; - final String secondPage - = "\n" + final String secondPage = DOCTYPE_HTML + + "\n" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/html/HtmlSearchInput2Test.java b/src/test/java/org/htmlunit/html/HtmlSearchInput2Test.java index f7345fd6280..3f8575f7175 100644 --- a/src/test/java/org/htmlunit/html/HtmlSearchInput2Test.java +++ b/src/test/java/org/htmlunit/html/HtmlSearchInput2Test.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,7 +16,7 @@ import org.htmlunit.SimpleWebTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -34,8 +34,8 @@ public class HtmlSearchInput2Test extends SimpleWebTestCase { */ @Test public void patternValidation() throws Exception { - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "
\n" @@ -64,7 +64,8 @@ public void patternValidation() throws Exception { @Test @Alerts({"true", "true", "true", "", "foo"}) public void maxLengthValidation() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -91,7 +92,8 @@ public void maxLengthValidation() throws Exception { @Test @Alerts({"true", "false", "true", "", "foobar"}) public void minLengthValidation() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/html/HtmlSearchInputTest.java b/src/test/java/org/htmlunit/html/HtmlSearchInputTest.java index cb42e122ae2..57eac9e9a1c 100644 --- a/src/test/java/org/htmlunit/html/HtmlSearchInputTest.java +++ b/src/test/java/org/htmlunit/html/HtmlSearchInputTest.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,7 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.By; @@ -31,7 +31,7 @@ * @author Marc Guillemot * @author Anton Demydenko * @author Ronald Brill -*/ + */ @RunWith(BrowserRunner.class) public class HtmlSearchInputTest extends WebDriverTestCase { @@ -40,26 +40,40 @@ public class HtmlSearchInputTest extends WebDriverTestCase { */ @Test public void type() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final WebDriver webDriver = loadPage2(html); final WebElement input = webDriver.findElement(By.id("t")); + input.sendKeys("abc"); - assertEquals("abc", input.getAttribute("value")); + assertNull(input.getDomAttribute("value")); + assertEquals("abc", input.getDomProperty("value")); + input.sendKeys(Keys.BACK_SPACE); - assertEquals("ab", input.getAttribute("value")); + assertNull(input.getDomAttribute("value")); + assertEquals("ab", input.getDomProperty("value")); + input.sendKeys(Keys.BACK_SPACE); - assertEquals("a", input.getAttribute("value")); + assertNull(input.getDomAttribute("value")); + assertEquals("a", input.getDomProperty("value")); + input.sendKeys(Keys.BACK_SPACE); - assertEquals("", input.getAttribute("value")); + assertNull(input.getDomAttribute("value")); + assertEquals("", input.getDomProperty("value")); + input.sendKeys(Keys.BACK_SPACE); - assertEquals("", input.getAttribute("value")); + assertNull(input.getDomAttribute("value")); + assertEquals("", input.getDomProperty("value")); } + /** + * @throws Exception if an error occurs + */ @Test @Alerts({"--null", "--null", "--null"}) public void defaultValuesAfterClone() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "" @@ -276,8 +296,8 @@ public void typeOnChange() throws Exception { */ @Test public void setValueOnChange() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" + "\n" + "\n" @@ -680,7 +704,7 @@ public void objectInsideLabel() throws Exception { + " log(tmp.tagName);\n" + " tmp = tmp.firstChild.tagName;\n" + " log(tmp);\n" - + "} catch(e) { log('exception'); }\n" + + "} catch(e) { logEx(e); }\n" + "}\n" + "\n" + "\n" @@ -843,7 +867,7 @@ public void ieConditionalCommentsNotInDom() throws Exception { + " log(tmp.innerHTML);\n" + " tmp = document.getElementById('my2');\n" + " log(tmp.innerHTML);\n" - + "} catch(e) { log('exception'); }\n" + + "} catch(e) { logEx(e); }\n" + "}\n" + "\n" + "\n" @@ -977,7 +1001,7 @@ public void selfClosingIframe() throws Exception { + " log(child2.nodeName);\n" + " log(child2.nodeValue);\n" - + "} catch(e) { log('exception'); }\n" + + "} catch(e) { logEx(e); }\n" + "}\n" + "\n" + "\n" @@ -1015,7 +1039,7 @@ public void dlShouldCloseDt() throws Exception { + " var child2 = child.childNodes[0];\n" + " log(child2.childNodes.length + '-' + child2.nodeType + '#' +child2.nodeName);\n" - + "} catch(e) { log('exception'); }\n" + + "} catch(e) { logEx(e); }\n" + "}\n" + "\n" + "\n" @@ -1047,7 +1071,7 @@ public void innerHtmlParagraph() throws Exception { + " var child = tmp.childNodes[0];\n" + " log(child.childNodes.length + '-' + child.nodeType + '#' + child.nodeName);\n" - + "} catch(e) { log('exception'); }\n" + + "} catch(e) { logEx(e); }\n" + "}\n" + "\n" + "\n" @@ -1080,7 +1104,7 @@ public void styleInsideP() throws Exception { + " tmp = tmp.nextSibling;\n" + " log(tmp.textContent);\n" - + "} catch(e) { log('exception'); }\n" + + "} catch(e) { logEx(e); }\n" + "}\n" + "\n" + "\n" @@ -1107,7 +1131,7 @@ public void styleInsideTable() throws Exception { + " tmp = tmp.firstChild;\n" + " log(tmp.tagName);\n" - + "} catch(e) { log('exception'); }\n" + + "} catch(e) { logEx(e); }\n" + "}\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/html/parser/HTMLParser3Test.java b/src/test/java/org/htmlunit/html/parser/HTMLParser3Test.java index 15461a76ce6..24d4d140051 100644 --- a/src/test/java/org/htmlunit/html/parser/HTMLParser3Test.java +++ b/src/test/java/org/htmlunit/html/parser/HTMLParser3Test.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/test/java/org/htmlunit/html/parser/HTMLParser4Test.java b/src/test/java/org/htmlunit/html/parser/HTMLParser4Test.java index 83e73e4de48..c1cfa2ff8a5 100644 --- a/src/test/java/org/htmlunit/html/parser/HTMLParser4Test.java +++ b/src/test/java/org/htmlunit/html/parser/HTMLParser4Test.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. @@ -17,9 +17,9 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.html.HtmlPageTest; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.htmlunit.junit.BrowserRunner.NotYetImplemented; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.htmlunit.junit.annotation.NotYetImplemented; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.WebDriver; @@ -367,7 +367,7 @@ public void namespace2() throws Exception { + " try {\n" + " div = document.createElementNS('http://www.appcelerator.org', 'app:script');\n" + " debug(div);\n" - + " } catch (e) {log('createElementNS() is not defined')}\n" + + " } catch(e) {log('createElementNS() is not defined')}\n" + " debug(document.getElementById('script1'));\n" + " debug(document.getElementById('script2'));\n" + " }\n" @@ -743,7 +743,7 @@ public void setCompleteHtmlToHTML_innerHTML() throws Exception { + " document.getElementsByTagName('html')[0].innerHTML =" + " 'Inner Html" + "
Inner DIV
';\n" - + " } catch(e) { log('exception') }\n" + + " } catch(e) { logEx(e) }\n" + " \n" + "\n" + "\n"; diff --git a/src/test/java/org/htmlunit/html/parser/HTMLParser5Test.java b/src/test/java/org/htmlunit/html/parser/HTMLParser5Test.java index 5bb2cfdc7f7..1395fbd4a29 100644 --- a/src/test/java/org/htmlunit/html/parser/HTMLParser5Test.java +++ b/src/test/java/org/htmlunit/html/parser/HTMLParser5Test.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,7 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.JavascriptExecutor; @@ -38,6 +38,9 @@ public class HTMLParser5Test extends WebDriverTestCase { + " log(inp.id + '-' + (f?f.name:null))" + "}"; + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-f2"}) public void formEnclosure_table() throws Exception { @@ -62,6 +65,9 @@ public void formEnclosure_table() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-f2"}) public void formEnclosure_div() throws Exception { @@ -86,6 +92,9 @@ public void formEnclosure_div() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-f1"}) public void formEnclosure_table_nestedForms() throws Exception { @@ -110,6 +119,9 @@ public void formEnclosure_table_nestedForms() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-f1"}) public void formEnclosure_div_nestedForms() throws Exception { @@ -134,6 +146,9 @@ public void formEnclosure_div_nestedForms() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-f1", "i3-null", "i4-null"}) public void formEnclosure_nestedForms() throws Exception { @@ -156,6 +171,9 @@ public void formEnclosure_nestedForms() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-f1", "i3-f1", "i4-f1", "i5-f1", "i6-f1", "i7-null"}) public void formEnclosure_tree1() throws Exception { @@ -189,6 +207,9 @@ public void formEnclosure_tree1() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-f1", "i3-f1", "i4-f2", "i5-f2", "i6-f2", "i7-f1", "i8-null"}) public void formEnclosure_tree2() throws Exception { @@ -223,6 +244,9 @@ public void formEnclosure_tree2() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-null"}) public void formEnclosure_tree3() throws Exception { @@ -243,6 +267,9 @@ public void formEnclosure_tree3() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("xy
") public void unclosedForm() throws Exception { diff --git a/src/test/java/org/htmlunit/html/parser/HTMLParser6Test.java b/src/test/java/org/htmlunit/html/parser/HTMLParser6Test.java index 6b5e04f3e6c..6282c45a381 100644 --- a/src/test/java/org/htmlunit/html/parser/HTMLParser6Test.java +++ b/src/test/java/org/htmlunit/html/parser/HTMLParser6Test.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,8 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -108,11 +107,7 @@ public void fragmentParserHtmlInsideSelect() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "", - FF = "", - FF_ESR = "") - @HtmlUnitNYI(CHROME = "", - EDGE = "") + @Alerts("") public void fragmentParserHtmlInsideOption() throws Exception { final String fragment = ""; final String html = "\n" @@ -132,4 +127,79 @@ public void fragmentParserHtmlInsideOption() throws Exception { loadPageVerifyTitle2(html); } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("
xy
") + public void fragmentParserLtInAttributeName() throws Exception { + final String fragment = "
xy
"; + final String html = "\n" + + "\n" + + "
\n" + + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("
xy
") + public void fragmentParserLtFirstInAttributeName() throws Exception { + final String fragment = "
xy
"; + final String html = "\n" + + "\n" + + "
\n" + + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("
xy
") + public void fragmentParserNumericAttributeName() throws Exception { + final String fragment = "
xy
"; + final String html = "\n" + + "\n" + + "
\n" + + ""; + + loadPageVerifyTitle2(html); + } } diff --git a/src/test/java/org/htmlunit/html/parser/HTMLParserListenerTest.java b/src/test/java/org/htmlunit/html/parser/HTMLParserListenerTest.java index 016c4e42fd2..0c1f6a93e67 100644 --- a/src/test/java/org/htmlunit/html/parser/HTMLParserListenerTest.java +++ b/src/test/java/org/htmlunit/html/parser/HTMLParserListenerTest.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. @@ -67,7 +67,9 @@ static class MessageInfo { // ignore key } - /** @see Object#toString() */ + /** + * @see Object#toString() + */ @Override public String toString() { return message_ + " (" + url_ + " " + line_ + ":" + column_ + ")"; diff --git a/src/test/java/org/htmlunit/html/parser/HTMLParserTest.java b/src/test/java/org/htmlunit/html/parser/HTMLParserTest.java index 57dcd694f22..975e3dc9695 100644 --- a/src/test/java/org/htmlunit/html/parser/HTMLParserTest.java +++ b/src/test/java/org/htmlunit/html/parser/HTMLParserTest.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/test/java/org/htmlunit/html/parser/MalformedHtml2Test.java b/src/test/java/org/htmlunit/html/parser/MalformedHtml2Test.java index 7f487dc2433..f201c55abe4 100644 --- a/src/test/java/org/htmlunit/html/parser/MalformedHtml2Test.java +++ b/src/test/java/org/htmlunit/html/parser/MalformedHtml2Test.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/test/java/org/htmlunit/html/parser/MalformedHtmlTest.java b/src/test/java/org/htmlunit/html/parser/MalformedHtmlTest.java index 1066b9e3748..f0cf695b880 100644 --- a/src/test/java/org/htmlunit/html/parser/MalformedHtmlTest.java +++ b/src/test/java/org/htmlunit/html/parser/MalformedHtmlTest.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. @@ -17,8 +17,8 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.html.HtmlPageTest; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.By; @@ -184,9 +184,9 @@ public void wrongHtml_TagBeforeHtml() throws Exception { } /** - * Regression test for bug #889. - * @throws Exception if an error occurs - */ + * Regression test for bug #889. + * @throws Exception if an error occurs + */ @Test @Alerts("0") public void missingSingleQuote() throws Exception { @@ -207,9 +207,9 @@ public void missingSingleQuote() throws Exception { } /** - * Regression test for bug #889. - * @throws Exception if an error occurs - */ + * Regression test for bug #889. + * @throws Exception if an error occurs + */ @Test @Alerts("0") public void missingDoubleQuote() throws Exception { @@ -230,9 +230,9 @@ public void missingDoubleQuote() throws Exception { } /** - * Regression test for bug #1192. - * @throws Exception if an error occurs - */ + * Regression test for bug #1192. + * @throws Exception if an error occurs + */ @Test @Alerts({"submit", "button"}) public void brokenInputSingleQuote() throws Exception { @@ -253,9 +253,9 @@ public void brokenInputSingleQuote() throws Exception { } /** - * Regression test for bug #1192. - * @throws Exception if an error occurs - */ + * Regression test for bug #1192. + * @throws Exception if an error occurs + */ @Test @Alerts({"submit", "button"}) public void brokenInputDoubleQuote() throws Exception { @@ -300,6 +300,9 @@ public void nestedForms() throws Exception { assertTitle(driver, getExpectedAlerts()[0]); driver.findElement(By.id("button")).click(); + if (useRealBrowser()) { + Thread.sleep(400); + } assertEquals(URL_FIRST + "?FromDate=inFirst", driver.getCurrentUrl()); } @@ -320,7 +323,7 @@ public void li_div_li() throws Exception { } /** - * Regression test for bug 1564. + * Regression test for bug 1564. * @throws Exception if an error occurs */ @Test @@ -339,7 +342,7 @@ public void entityWithInvalidUTF16Code() throws Exception { } /** - * Regression test for bug 1562. + * Regression test for bug 1562. * @throws Exception if an error occurs */ @Test @@ -368,21 +371,21 @@ public void sectionWithUnknownClosingTag() throws Exception { "innerA", "DIV:null", "1", "#text:X", "false", "true"}) @HtmlUnitNYI( CHROME = {"4", "#text:\\n\\s\\s", "A:null", "A:null", "#text:YZ\\n\\n", - "2", "innerDiv", "A:null", "1", "#text:W", "exception", + "2", "innerDiv", "A:null", "1", "#text:W", "TypeError", "outerA", "BODY:null", "2", "#text:V", "true", "false", - "innerA", "BODY:null", "1", "#text:X", "false", "true", "exception"}, + "innerA", "BODY:null", "1", "#text:X", "false", "true", "TypeError"}, EDGE = {"4", "#text:\\n\\s\\s", "A:null", "A:null", "#text:YZ\\n\\n", - "2", "innerDiv", "A:null", "1", "#text:W", "exception", + "2", "innerDiv", "A:null", "1", "#text:W", "TypeError", "outerA", "BODY:null", "2", "#text:V", "true", "false", - "innerA", "BODY:null", "1", "#text:X", "false", "true", "exception"}, + "innerA", "BODY:null", "1", "#text:X", "false", "true", "TypeError"}, FF = {"4", "#text:\\n\\s\\s", "A:null", "A:null", "#text:YZ\\n\\n", - "2", "innerDiv", "A:null", "1", "#text:W", "exception", + "2", "innerDiv", "A:null", "1", "#text:W", "TypeError", "outerA", "BODY:null", "2", "#text:V", "true", "false", - "innerA", "BODY:null", "1", "#text:X", "false", "true", "exception"}, + "innerA", "BODY:null", "1", "#text:X", "false", "true", "TypeError"}, FF_ESR = {"4", "#text:\\n\\s\\s", "A:null", "A:null", "#text:YZ\\n\\n", - "2", "innerDiv", "A:null", "1", "#text:W", "exception", + "2", "innerDiv", "A:null", "1", "#text:W", "TypeError", "outerA", "BODY:null", "2", "#text:V", "true", "false", - "innerA", "BODY:null", "1", "#text:X", "false", "true", "exception"}) + "innerA", "BODY:null", "1", "#text:X", "false", "true", "TypeError"}) // Input: // VZ
// CHROME and IE generate: @@ -406,7 +409,7 @@ public void nestedAnchorInDivision() throws Exception { + " dump(document.body.childNodes[2]);\n" + " dump(document.body.childNodes[3]);\n" + " log(document.getElementsByTagName('a').length);\n" - + " } catch (e) { log('exception') }\n" + + " } catch(e) { logEx(e) }\n" + " try {\n" + " log(innerDiv.id);\n" @@ -415,7 +418,7 @@ public void nestedAnchorInDivision() throws Exception { + " dump(innerDiv.childNodes[0]);\n" + " dump(innerDiv.childNodes[1]);\n" + " dump(innerDiv.childNodes[2]);\n" - + " } catch (e) { log('exception') }\n" + + " } catch(e) { logEx(e) }\n" + " try {\n" + " log(anchors[0].id);\n" @@ -424,7 +427,7 @@ public void nestedAnchorInDivision() throws Exception { + " dump(anchors[0].childNodes[0]);\n" + " log(anchors[0] == outerA);\n" + " log(anchors[0] == innerA);\n" - + " } catch (e) { log('exception') }\n" + + " } catch(e) { logEx(e) }\n" + " try {\n" + " log(anchors[1].id);\n" @@ -433,7 +436,7 @@ public void nestedAnchorInDivision() throws Exception { + " dump(anchors[1].childNodes[0]);\n" + " log(anchors[1] == outerA);\n" + " log(anchors[1] == innerA);\n" - + " } catch (e) { log('exception') }\n" + + " } catch(e) { logEx(e) }\n" + " try {\n" + " log(anchors[2].id);\n" @@ -442,7 +445,7 @@ public void nestedAnchorInDivision() throws Exception { + " dump(anchors[2].childNodes[0]);\n" + " log(anchors[2] == outerA);\n" + " log(anchors[2] == innerA);\n" - + " } catch (e) { log('exception') }\n" + + " } catch(e) { logEx(e) }\n" + " }\n" + " function dump(e) {\n" + " log(e.nodeName + ':' + e.nodeValue);\n" @@ -456,7 +459,7 @@ public void nestedAnchorInDivision() throws Exception { } /** - * Regression test for bug 1598. + * Regression test for bug 1598. * @throws Exception if an error occurs */ @Test @@ -506,6 +509,20 @@ public void unknownTagInTbody() throws Exception { + "" + "" + "") public void formInTableData() throws Exception { final String html = "\n" @@ -544,6 +561,20 @@ public void formInTableData() throws Exception { + "" + "" + "") public void formInTableRow() throws Exception { final String html = "\n" @@ -591,8 +622,21 @@ public void formInTableRow() throws Exception { + "" + "" + "") - public void formInTable() throws Exception { final String html = "\n" + "\n" diff --git a/src/test/java/org/htmlunit/html/performance/HugePagePerformanceTest.java b/src/test/java/org/htmlunit/html/performance/HugePagePerformanceTest.java index af3c45146fb..253912fcb7b 100644 --- a/src/test/java/org/htmlunit/html/performance/HugePagePerformanceTest.java +++ b/src/test/java/org/htmlunit/html/performance/HugePagePerformanceTest.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. @@ -30,6 +30,11 @@ public final class HugePagePerformanceTest { private HugePagePerformanceTest() { } + /** + * Simple main for the moment. + * @param args ignored + * @throws IOException in case of error + */ public static void main(final String[] args) throws IOException { // final URL fileURL = WebClient.class.getClassLoader() // .getResource("testfiles/huge-pages/html-standard-2024-10-17.html"); diff --git a/src/test/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText2Test.java b/src/test/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText2Test.java index 5b5e50bf432..73be1a06f1d 100644 --- a/src/test/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText2Test.java +++ b/src/test/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText2Test.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,8 +16,8 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.By; @@ -95,8 +95,8 @@ public void getInnerTextWhiteSpaceBreakPreLine() throws Exception { } private void getInnerTextWhiteSpaceBreak(final String whiteSpace) throws Exception { - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "
\n" @@ -169,8 +169,8 @@ public void getInnerTextWhiteSpaceInputHiddenPreLine() throws Exception { } private void getInnerTextWhiteSpaceInputHidden(final String whiteSpace) throws Exception { - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "
\n" @@ -247,8 +247,8 @@ public void getInnerTextWhiteSpaceScriptPreLine() throws Exception { } private void getInnerTextWhiteSpaceScript(final String whiteSpace) throws Exception { - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" + + "\n" + + " \n" + + ""; + + loadPageVerifyTitle2(content); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"4", "null"}) + public void xPathUndefined() throws Exception { + final String content = DOCTYPE_HTML + + "\n" + + "\n" + + "\n" + + " \n" + + ""; + + loadPageVerifyTitle2(content); + } + /** * @throws Exception if the test fails */ @Test @Alerts({"102", "111", "111", "160", "97", "110", "100", "160", "102", "111", "111"}) public void optionText() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -63,7 +128,8 @@ public void optionText() throws Exception { @Test @Alerts("[object HTMLParagraphElement][object HTMLDivElement]") public void pipe() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -93,7 +159,8 @@ public void pipe() throws Exception { @Test @Alerts("a") public void math() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -254,6 +321,51 @@ public void number() throws Exception { compare("//p[@y=number(\" 13\t \")]"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("false") + public void startsWith() throws Exception { + compareBooleanValue("starts-with(\"haystack\", \"needle\")"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("true") + public void startsWithFound() throws Exception { + compareBooleanValue("starts-with(\"haystack\", \"hay\")"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("true") + public void startsWithWhole() throws Exception { + compareBooleanValue("starts-with(\"haystack\", \"haystack\")"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("true") + public void startsWithEmpty() throws Exception { + compareBooleanValue("starts-with(\"haystack\", \"\")"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("true") + public void startsWithEmptyEmpty() throws Exception { + compareBooleanValue("starts-with(\"\", \"\")"); + } + /** * @throws Exception if the test fails */ @@ -272,7 +384,9 @@ public void substringWithNegativeLength() throws Exception { compareStringValue("substring(\"HtmlUnit\", 2, -1)"); } - /** @throws Exception in case of problems */ + /** + * @throws Exception in case of problems + */ @Test @Alerts("''") public void substringNegativeStartWithLength() throws Exception { @@ -319,13 +433,32 @@ public void attrib() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("error") + @Alerts("SyntaxError/DOMException") public void lowerCaseNotSupported() throws Exception { - compare("//*[lower-case(@id) = \"a\"]"); + compareError("//*[lower-case(@id) = \"a\"]"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("SyntaxError/DOMException") + public void upperCaseNotSupported() throws Exception { + compareError("//*[upper-case(@id) = \"A\"]"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("SyntaxError/DOMException") + public void endsWithNotSupported() throws Exception { + compareError("ends-with(\"haystack\", \"haystack\")"); } private void compare(final String xpath) throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -352,7 +485,8 @@ private void compare(final String xpath) throws Exception { } private void compareStringValue(final String xpath) throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -376,7 +510,8 @@ private void compareStringValue(final String xpath) throws Exception { } private void compareBooleanValue(final String xpath) throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -399,13 +534,34 @@ private void compareBooleanValue(final String xpath) throws Exception { loadPageVerifyTitle2(content); } + private void compareError(final String xpath) throws Exception { + final String content = DOCTYPE_HTML + + "\n" + + "\n" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(content); + } + /** * @throws Exception if the test fails */ @Test @Alerts("mySpan") public void minimalParameters() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -434,7 +590,8 @@ public void minimalParameters() throws Exception { @Test @Alerts("mySpan") public void undefinedResult() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -462,9 +619,10 @@ public void undefinedResult() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("error") + @Alerts("TypeError") public void stringResult() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -494,7 +652,8 @@ public void stringResult() throws Exception { @Test @Alerts("mySpan") public void objectResult() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -526,7 +685,8 @@ public void objectResult() throws Exception { FF = "mySpan - myDiv - ", FF_ESR = "mySpan - myDiv - ") public void reuseResult() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -569,7 +729,8 @@ public void reuseResult() throws Exception { @Test @Alerts("myDiv1") public void documentEvaluateFirst() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/html/xpath/HtmlUnitXPathTest.java b/src/test/java/org/htmlunit/html/xpath/HtmlUnitXPathTest.java index 8179be8405c..a0e1cdb81ec 100644 --- a/src/test/java/org/htmlunit/html/xpath/HtmlUnitXPathTest.java +++ b/src/test/java/org/htmlunit/html/xpath/HtmlUnitXPathTest.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. @@ -49,7 +49,8 @@ public class HtmlUnitXPathTest extends SimpleWebTestCase { */ @Test public void simplePath() throws Exception { - final String content = "Test page\n" + final String content = DOCTYPE_HTML + + "Test page\n" + "foo\n" + ""; @@ -66,7 +67,8 @@ public void simplePath() throws Exception { */ @Test public void xpathFromElement() throws Exception { - final String content = "Test page\n" + final String content = DOCTYPE_HTML + + "Test page\n" + "foo\n" + ""; @@ -83,8 +85,8 @@ public void xpathFromElement() throws Exception { @Test @SuppressWarnings("unchecked") public void elementOrder() throws Exception { - final String content - = "First\n" + ""; @@ -105,8 +107,8 @@ public void elementOrder() throws Exception { */ @Test public void whenJSChangesPage() throws Exception { - final String content - = "foo"; + + loadPageVerifyTitle2(html); + } + + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("callee,length") + public void argumentsPropertyNamesStrict() throws Exception { + final String html = DOCTYPE_HTML + + "" + + ""; + + loadPageVerifyTitle2(html); + } + /** * @throws Exception if the test fails */ @Test @Alerts("2") public void passedCountDifferentFromDeclared() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"true", "true"}) + public void argumentsCalleeDifferentFunctions() throws Exception { + final String html = DOCTYPE_HTML + + "" + + ""; + + loadPageVerifyTitle2(html); + } } diff --git a/src/test/java/org/htmlunit/javascript/AttributeCaseTest.java b/src/test/java/org/htmlunit/javascript/AttributeCaseTest.java index 4df8a3a2dc6..215d0e14b9f 100644 --- a/src/test/java/org/htmlunit/javascript/AttributeCaseTest.java +++ b/src/test/java/org/htmlunit/javascript/AttributeCaseTest.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,7 +174,8 @@ private void setupAttributeTest(final String content, final String elementId) th private void setupGetAttributeTest(final String attributeName, final String attributeValue) throws Exception { final String elementId = "p-id"; - final String content = "AttributeCaseTest\n" + final String content = DOCTYPE_HTML + + "AttributeCaseTest\n" + "

\n" + ""; @@ -187,8 +188,8 @@ private void setupSetAttributeTest( throws Exception { final String elementId = "p-id"; - final String content - = "AttributeCaseTest\n" + final String content = DOCTYPE_HTML + + "AttributeCaseTest\n" + "

\n" + "\n" + ""; @@ -59,8 +59,8 @@ public void oneRestArg() throws Exception { @Test @Alerts("true-0") public void oneRestArgNothingProvided() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -72,7 +72,7 @@ public void oneRestArgNothingProvided() throws Exception { + "try {\n" + " var r = rest();\n" + " log('' + Array.isArray(r) + '-' + r.length);\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -85,8 +85,8 @@ public void oneRestArgNothingProvided() throws Exception { @Test @Alerts("true-1") public void oneRestArgOneProvided() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -98,7 +98,7 @@ public void oneRestArgOneProvided() throws Exception { + "try {\n" + " var r = rest('xy');\n" + " log('' + Array.isArray(r) + '-' + r.length);\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -111,8 +111,8 @@ public void oneRestArgOneProvided() throws Exception { @Test @Alerts("abc,2,##") public void twoRestArg() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -123,7 +123,7 @@ public void twoRestArg() throws Exception { + "}\n" + "try {\n" + " log(rest(1, 'abc', 2, '##').toString());\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -136,8 +136,8 @@ public void twoRestArg() throws Exception { @Test @Alerts("undefined - true-0") public void twoRestArgNothingProvided() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -148,7 +148,7 @@ public void twoRestArgNothingProvided() throws Exception { + "}\n" + "try {\n" + " log(rest());\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -161,8 +161,8 @@ public void twoRestArgNothingProvided() throws Exception { @Test @Alerts("77 - true-0") public void twoRestArgOneProvided() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -173,7 +173,7 @@ public void twoRestArgOneProvided() throws Exception { + "}\n" + "try {\n" + " log(rest('77'));\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -186,8 +186,8 @@ public void twoRestArgOneProvided() throws Exception { @Test @Alerts("1-4") public void arguments() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -198,7 +198,7 @@ public void arguments() throws Exception { + "}\n" + "try {\n" + " log('' + rest('77') + '-' + rest(1, 2, 3, 4));\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -211,8 +211,8 @@ public void arguments() throws Exception { @Test @Alerts("0-1") public void length() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -222,7 +222,7 @@ public void length() throws Exception { + "function foo2(arg, ...theArgs) {}\n" + "try {\n" + " log(foo1.length + '-' + foo2.length);\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -235,8 +235,8 @@ public void length() throws Exception { @Test @Alerts("2-1-0") public void argLength() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -247,7 +247,7 @@ public void argLength() throws Exception { + "}\n" + "try {\n" + " log(rest(1,2) + '-' + rest(1) + '-' + rest());\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -260,8 +260,8 @@ public void argLength() throws Exception { @Test @Alerts("function rest(...restArgs) { return restArgs.length; }") public void string() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -272,7 +272,7 @@ public void string() throws Exception { + "}\n" + "try {\n" + " log(rest.toString());\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/javascript/FunctionsTest.java b/src/test/java/org/htmlunit/javascript/FunctionsTest.java index 113c89c762b..3af31ecdf80 100644 --- a/src/test/java/org/htmlunit/javascript/FunctionsTest.java +++ b/src/test/java/org/htmlunit/javascript/FunctionsTest.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,8 +16,8 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.NotYetImplemented; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.NotYetImplemented; import org.junit.Test; import org.junit.runner.RunWith; @@ -35,8 +35,8 @@ public class FunctionsTest extends WebDriverTestCase { @Test @Alerts("function\\sfoo()\\s{\\s\\s\\s\\sreturn\\s\\t'a'\\s+\\s'b'\\s}") public void function_toString() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + ""; - loadPageWithAlerts2(html); + loadPageVerifyTitle2(html); } } diff --git a/src/test/java/org/htmlunit/javascript/HtmlUnitContextFactoryTest.java b/src/test/java/org/htmlunit/javascript/HtmlUnitContextFactoryTest.java index 6a41f84af1c..9cf81bfd2e5 100644 --- a/src/test/java/org/htmlunit/javascript/HtmlUnitContextFactoryTest.java +++ b/src/test/java/org/htmlunit/javascript/HtmlUnitContextFactoryTest.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. @@ -33,7 +33,7 @@ public class HtmlUnitContextFactoryTest extends SimpleWebTestCase { */ @Test public void customBrowserVersion() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final BrowserVersion browserVersion = new BrowserVersion.BrowserVersionBuilder(BrowserVersion.FIREFOX_ESR) diff --git a/src/test/java/org/htmlunit/javascript/HtmlUnitScriptable2Test.java b/src/test/java/org/htmlunit/javascript/HtmlUnitScriptable2Test.java index 7a12dba6129..1708ac8b6c6 100644 --- a/src/test/java/org/htmlunit/javascript/HtmlUnitScriptable2Test.java +++ b/src/test/java/org/htmlunit/javascript/HtmlUnitScriptable2Test.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,10 +15,9 @@ package org.htmlunit.javascript; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.html.HtmlPageTest; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; @@ -46,7 +45,7 @@ public class HtmlUnitScriptable2Test extends WebDriverTestCase { @Test @Alerts({"text/html", "text/html"}) public void setNonWritablePropertyContentType() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -70,7 +69,7 @@ public void setNonWritablePropertyContentType() throws Exception { @Test @Alerts({"CSS1Compat", "CSS1Compat"}) public void setNonWritablePropertyCompatMode() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -94,7 +93,7 @@ public void setNonWritablePropertyCompatMode() throws Exception { @Test @Alerts("[object Arguments]") public void arguments_toString() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -338,7 +337,7 @@ private void set_ReadOnly(final String expression) throws Exception { @HtmlUnitNYI(CHROME = {"function", "true", "function length() { [native code] }", "0", "0"}, EDGE = {"function", "true", "function length() { [native code] }", "0", "0"}) public void lookupGetter() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/HtmlUnitScriptableTest.java b/src/test/java/org/htmlunit/javascript/HtmlUnitScriptableTest.java index c35f9ac14f6..2260013ea30 100644 --- a/src/test/java/org/htmlunit/javascript/HtmlUnitScriptableTest.java +++ b/src/test/java/org/htmlunit/javascript/HtmlUnitScriptableTest.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. @@ -17,7 +17,7 @@ import org.htmlunit.SimpleWebTestCase; import org.htmlunit.html.HtmlPage; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -44,8 +44,8 @@ public class HtmlUnitScriptableTest extends SimpleWebTestCase { @Test @Alerts("past focus") public void callInheritedFunction() throws Exception { - final String html - = "foo\n" + ""; @@ -289,7 +296,8 @@ private void object(final String object) throws Exception { @Test @Alerts({"function", "function"}) public void inline() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -448,7 +464,8 @@ public void recursion() throws Exception { @Test @Alerts({"0", "false", "0"}) public void nativeFunction_toStringValue() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -492,8 +509,8 @@ public void onloadJavascriptFunction() throws Exception { @Test @Alerts("foo") public void alert() throws Exception { - final String html - = "foo\n" + "

hello world

\n" @@ -513,8 +530,8 @@ public void alert() throws Exception { @Test @Alerts("foo") public void scopeOfNewFunction() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + + " \n" + + "\n" + "\n" + "\n" + ""; - loadPageWithAlerts2(html); + loadPageVerifyTitle2(html); } /** @@ -704,7 +725,8 @@ public void comment() throws Exception { "rstlna-rstlne-rstlne", "rstlne-rstlne-rstlne", "rstlni-rstlni-rstlni", "rstlna-rstlna-rstlna"}) public void regExpSupport() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + "\n" @@ -972,7 +1001,8 @@ public void functioNamesExceptionsStrict() throws Exception { @Test @Alerts("false") public void ctorBooleanDocumentAll() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -1052,7 +1085,8 @@ public void javaNotAccessable() throws Exception { @Test @Alerts("Received: from worker - exception") public void javaNotAccessableFromWorker() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n"; final String workerJs = "var pi = 'from worker';\n" + "try {\n" + " pi = pi + ' - ' + java.lang.Math.PI\n" - + "} catch (e) { pi = pi + ' - ' + 'exception'; }\n" + + "} catch(e) { pi = pi + ' - ' + 'exception'; }\n" + "postMessage(pi);\n"; getMockWebConnection().setResponse(new URL(URL_FIRST, "worker.js"), workerJs, MimeType.TEXT_JAVASCRIPT); @@ -1081,7 +1115,8 @@ public void javaNotAccessableFromWorker() throws Exception { @Test @Alerts({"#0", "#1", "2"}) public void constInLoop() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; final WebDriver driver = loadPage2(html); - Thread.sleep(DEFAULT_WAIT_TIME); + Thread.sleep(DEFAULT_WAIT_TIME.toMillis()); verifyTitle2(driver, getExpectedAlerts()); } @@ -1182,7 +1220,8 @@ public void ensureOrder() throws Exception { @Test @Alerts({"false", "aa", "0", "aabbc", "false", "bb", "2", "aabbc", "true", "undefined"}) public void matchAll() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + "\n" + "

hello world

\n" @@ -105,8 +105,8 @@ public void setJavascriptEnabled_false() throws Exception { */ @Test public void setInputValue() throws Exception { - final String content - = "foo\n" @@ -214,8 +215,8 @@ public void scopeInInactivePage() throws Exception { @Test @Alerts("got here") public void externalScript() throws Exception { - final String html - = "foo\n" + "\n" + "\n" @@ -276,8 +277,8 @@ public void externalScriptWithApostrophesInComment() throws Exception { @Test public void scriptErrorContainsPageUrl() throws Exception { // embedded script - final String content1 - = "\n" + final String content1 = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -292,8 +293,8 @@ public void scriptErrorContainsPageUrl() throws Exception { final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); - final String content2 - = "foo\n" + "\n" @@ -360,8 +361,8 @@ public void externalScriptEmptyGZipEncoded() throws Exception { bytes.toByteArray(), 200, "OK", "text/javascript", headers); } - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "\n" @@ -388,8 +389,8 @@ public void externalScriptBrokenGZipEncoded() throws Exception { bytes.toByteArray(), 200, "OK", "text/javascript", headers); } - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "\n" @@ -412,8 +413,8 @@ public void referencingVariablesFromOneScriptToAnother_Regression() throws Excep final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "\n" @@ -439,8 +440,8 @@ public void referencingVariablesFromOneScriptToAnother_Regression() throws Excep */ @Test public void javaScriptUrl() throws Exception { - final String htmlContent - = "\n" @@ -468,8 +469,8 @@ public void javaScriptUrl() throws Exception { */ @Test public void thisDotInOnClick() throws Exception { - final String htmlContent - = "First\n" + final String htmlContent = DOCTYPE_HTML + + "First\n" + "
\n" + ""; @@ -491,8 +492,8 @@ public void functionDefinedInExternalFile_CalledFromInlineScript() throws Except final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + " \n" + ""; @@ -529,8 +530,8 @@ public void externalScriptWithNewLineBeforeClosingScriptTag() throws Exception { final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" // \n between opening and closing tag is important + ""; @@ -558,8 +559,8 @@ public void externalScriptWithNewLineBeforeClosingScriptTag() throws Exception { */ @Test public void functionDefinedInSameFile() throws Exception { - final String htmlContent - = "First\n" + "

hello world

\n" @@ -700,8 +702,8 @@ private static String getJavaScriptContent(final String javascript) { */ @Test public void scriptErrorIsolated() throws Exception { - final String content - = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -756,15 +758,15 @@ public void prototypeScope() throws Exception { } private void prototypeScope(final String name, final String value) throws Exception { - final String content1 - = "\n" + final String content1 = DOCTYPE_HTML + + "\n" + "\n" + ""; - final String content2 - = "\n" + final String content2 = DOCTYPE_HTML + + "\n" + ""; + final String content = DOCTYPE_HTML + ""; final MockWebConnection webConnection = new MockWebConnection(); webConnection.setDefaultResponse(content); client.setWebConnection(webConnection); @@ -883,22 +885,30 @@ public Object callFunction( return super.callFunction(page, javaScriptFunction, thisObject, args, htmlElementScope); } - /** @return the number of times that this engine has called functions */ + /** + * @return the number of times that this engine has called functions + */ public int getCallCount() { return scriptCallCount_; } - /** @return the number of times that this engine has executed code */ + /** + * @return the number of times that this engine has executed code + */ public int getExecutionCount() { return scriptExecutionCount_; } - /** @return the number of times that this engine has compiled code */ + /** + * @return the number of times that this engine has compiled code + */ public int getCompileCount() { return scriptCompileCount_; } - /** @return the number of times that this engine has executed a compiled script */ + /** + * @return the number of times that this engine has executed a compiled script + */ public int getExecuteScriptCount() { return scriptExecuteScriptCount_; } @@ -910,8 +920,8 @@ public int getExecuteScriptCount() { @Test @Alerts({"", "ex thrown"}) public void commentNoDoubleSlash() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -927,7 +937,7 @@ public void commentNoDoubleSlash() throws Exception { } catch (final ScriptException e) { exceptionThrown = "ex thrown"; - assertEquals(4, e.getFailingLineNumber()); + assertEquals(5, e.getFailingLineNumber()); } assertEquals(expectedExThrown, exceptionThrown); @@ -939,14 +949,14 @@ public void commentNoDoubleSlash() throws Exception { */ @Test public void compiledScriptCached() throws Exception { - final String content1 - = "foo\n" + final String content1 = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "to page 2\n" + ""; - final String content2 - = "page 2\n" + final String content2 = DOCTYPE_HTML + + "page 2\n" + "\n" + "\n" + ""; @@ -988,8 +998,8 @@ public void compiledScriptCached() throws Exception { */ @Test public void scriptTags_AllLocalContent() throws Exception { - final String content - = "\n" + final String content = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" // no language specified - assume JavaScript + "\n" @@ -1076,7 +1086,8 @@ protected void handleJavaScriptException(final ScriptException scriptException, }; webClient.setJavaScriptEngine(myEngine); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "Test page<\n" + "\n" @@ -1169,7 +1181,51 @@ private static ThreadLocal> getPostponedActions(final Abst @Retry @Alerts("starting") public void shutdownShouldKill() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + + "Test page\n" + + "\n" + + "\n" + + "\n" + + ""; + + try (WebClient webClient = getWebClient()) { + // there is no way to kill a thread in later JDK's + // to make the test running we need a final timeout for js stuff + webClient.setJavaScriptTimeout(DEFAULT_WAIT_TIME.toMillis() * 10); + + final List collectedAlerts = new ArrayList<>(); + webClient.setAlertHandler(new CollectingAlertHandler(collectedAlerts)); + + loadPage(html); + Thread.sleep(100); + assertEquals(getExpectedAlerts(), collectedAlerts); + + } + Thread.sleep(400); + try { + assertTrue(getJavaScriptThreads().isEmpty()); + } + catch (final AssertionError e) { + Thread.sleep(DEFAULT_WAIT_TIME.toMillis() * 10); + assertTrue(getJavaScriptThreads().isEmpty()); + } + } + + /** + * @throws Exception if the test fails + */ + @Test + @Retry + @Alerts("starting") + public void shutdownShouldKillJavaScriptTimeout() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + "Test page\n" + ""; + final String html = DOCTYPE_HTML + ""; getMockWebConnection().setDefaultResponse(html); webClient.getPage(URL_FIRST); assertEquals("org.htmlunit.corejs.javascript.EvaluatorException: " - + "Unexpected end of file (script in " + URL_FIRST + " from (1, 21) to (1, 37)#1)\n", + + "Unexpected end of file (script in " + URL_FIRST + " from (2, 21) to (2, 37)#2)\n", scriptExceptions.toString()); } } diff --git a/src/test/java/org/htmlunit/javascript/JavascriptErrorListenerTest.java b/src/test/java/org/htmlunit/javascript/JavascriptErrorListenerTest.java index 418621d0c04..ed7d5438300 100644 --- a/src/test/java/org/htmlunit/javascript/JavascriptErrorListenerTest.java +++ b/src/test/java/org/htmlunit/javascript/JavascriptErrorListenerTest.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. @@ -52,11 +52,12 @@ public void nullJavaScriptErrorListener() throws Exception { webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.setJavaScriptErrorListener(null); final MockWebConnection webConnection = new MockWebConnection(); - final String errorContent = "ERROR 500"; + final String errorContent = DOCTYPE_HTML + "ERROR 500"; webConnection.setResponse(URL_SECOND, errorContent, 500, "BOOM", MimeType.TEXT_HTML, Collections.emptyList()); // test script exception - String content = "Throw JavaScript Error\n" + String content = DOCTYPE_HTML + + "Throw JavaScript Error\n" + "\n" + ""; webConnection.setResponse(URL_FIRST, content); @@ -64,7 +65,8 @@ public void nullJavaScriptErrorListener() throws Exception { webClient.getPage(URL_FIRST); // test load script error - content = "Throw JavaScript Error\n" + content = DOCTYPE_HTML + + "Throw JavaScript Error\n" + "\n" + ""; webConnection.setResponse(URL_FIRST, content); @@ -77,7 +79,8 @@ public void nullJavaScriptErrorListener() throws Exception { } // test malformed script url error - content = "Throw JavaScript Error\n" + content = DOCTYPE_HTML + + "Throw JavaScript Error\n" + "\n" + ""; webConnection.setResponse(URL_FIRST, content); @@ -86,7 +89,8 @@ public void nullJavaScriptErrorListener() throws Exception { // test timeout error webClient.setJavaScriptTimeout(100); - content = "Throw JavaScript Timeout Error\n" + content = DOCTYPE_HTML + + "Throw JavaScript Timeout Error\n" + "\n" + ""; webConnection.setResponse(URL_FIRST, content); @@ -105,7 +109,8 @@ public void listenForScriptException() throws Exception { webClient.setJavaScriptErrorListener(javaScriptErrorListener); // test script exception - final String html = "Throw JavaScript Error" + final String html = DOCTYPE_HTML + + "Throw JavaScript Error" + "" + ""; loadPage(html); @@ -113,7 +118,7 @@ public void listenForScriptException() throws Exception { assertEquals("", javaScriptErrorListener.getWarnings()); assertEquals("org.htmlunit.ScriptException: " + "ReferenceError: \"unknown\" is not defined. " - + "(script in http://localhost:" + PORT + "/ from (1, 58) to (1, 81)#1)", + + "(script in http://localhost:" + PORT + "/ from (2, 58) to (2, 81)#2)", javaScriptErrorListener.getScriptExceptions()); assertEquals("", javaScriptErrorListener.getLoadScriptErrors()); assertEquals("", javaScriptErrorListener.getMalformedScriptURLErrors()); @@ -133,7 +138,8 @@ public void listenForLoadScriptError() throws Exception { getMockWebConnection().setDefaultResponse("", 500, "Server Error", MimeType.TEXT_HTML); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -165,7 +171,8 @@ public void listenForMalformedScriptUrl() throws Exception { final CollectingJavaScriptErrorListener javaScriptErrorListener = new CollectingJavaScriptErrorListener(); webClient.setJavaScriptErrorListener(javaScriptErrorListener); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "Throw JavaScript Error\n" + "\n" + "\n" @@ -195,7 +202,8 @@ public void listenForTimeoutError() throws Exception { webClient.setJavaScriptErrorListener(javaScriptErrorListener); webClient.setJavaScriptTimeout(100); - final String html = "Throw JavaScript Timeout Error\n" + final String html = DOCTYPE_HTML + + "Throw JavaScript Timeout Error\n" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/javascript/NativeArrayTest.java b/src/test/java/org/htmlunit/javascript/NativeArrayTest.java index c0cb8879e67..192220112e0 100644 --- a/src/test/java/org/htmlunit/javascript/NativeArrayTest.java +++ b/src/test/java/org/htmlunit/javascript/NativeArrayTest.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,8 +16,8 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; @@ -44,8 +44,8 @@ public class NativeArrayTest extends WebDriverTestCase { @HtmlUnitNYI(FF = {"5<>1", "2<>5", "2<>5", "2<>1", "1<>2", "1<>1", "9<>2", "9<>5"}, FF_ESR = {"5<>1", "2<>5", "2<>5", "2<>1", "1<>2", "1<>1", "9<>2", "9<>5"}) public void sortSteps() throws Exception { - final String html - = "\n" @@ -273,8 +274,8 @@ public void constructorToString() throws Exception { @Test @Alerts({"mandarin", "", "mandarin"}) public void shiftOneElement() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + + ""; + + loadPageVerifyTitle2(html); + } +} diff --git a/src/test/java/org/htmlunit/javascript/NativeDate2Test.java b/src/test/java/org/htmlunit/javascript/NativeDate2Test.java index fd0290b24db..ee50d3dc60a 100644 --- a/src/test/java/org/htmlunit/javascript/NativeDate2Test.java +++ b/src/test/java/org/htmlunit/javascript/NativeDate2Test.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. @@ -19,9 +19,9 @@ import org.htmlunit.BrowserVersion; import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.BuggyWebDriver; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.BuggyWebDriver; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; @@ -33,108 +33,162 @@ @RunWith(BrowserRunner.class) public class NativeDate2Test extends WebDriverTestCase { + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T22:23:00.000Z") public void ctorDateTimeStringGMT() throws Exception { ctorDateTimeString("new Date('2021-12-18T22:23:00.000+00:00').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T22:23:00.000Z") public void ctorDateTimeStringGMT2() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 GMT').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T22:23:00.000Z") public void ctorDateTimeStringUTC() throws Exception { ctorDateTimeString("new Date('2021-12-18T22:23:00.000+00:00').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T22:23:00.000Z") public void ctorDateTimeStringUTC2() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 UTC').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T22:23:00.000Z") public void ctorDateTimeStringUT() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 UT').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T12:23:00.000Z") public void ctorDateTimeStringEST() throws Exception { ctorDateTimeString("new Date('2021-12-18T17:23:00.000+05:00').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T03:23:00.000Z") public void ctorDateTimeStringEST2() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 EST').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T02:23:00.000Z") public void ctorDateTimeStringEDT() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 EDT').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T04:23:00.000Z") public void ctorDateTimeStringCST() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 CST').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T03:23:00.000Z") public void ctorDateTimeStringCDT() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 CDT').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T05:23:00.000Z") public void ctorDateTimeStringMST() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 MST').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T04:23:00.000Z") public void ctorDateTimeStringMDT() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 MDT').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T06:23:00.000Z") public void ctorDateTimeStringPST() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 PST').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T05:23:00.000Z") public void ctorDateTimeStringPDT() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 PDT').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T18:23:00.000Z") public void ctorDateTimeStringBerlin() throws Exception { ctorDateTimeString("new Date('2021-12-18T17:23:00.000-01:00').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T02:23:00.000Z") public void ctorDateTimeStringTokyo() throws Exception { ctorDateTimeString("new Date('2021-12-18T17:23:00.000-09:00').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T02:23:00.000Z") public void ctorDateTimeStringJST() throws Exception { ctorDateTimeString("new Date('2021-12-18T17:23:00.000-09:00').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T12:23:00.000Z") public void ctorDateTimeStringNewYork() throws Exception { @@ -142,8 +196,8 @@ public void ctorDateTimeStringNewYork() throws Exception { } private void ctorDateTimeString(final String js) throws Exception { - final String html - = "\n" @@ -152,6 +206,9 @@ private void ctorDateTimeString(final String js) throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T22:23:00.000Z") @BuggyWebDriver(FF = "2021-12-18T21:23:00.000Z", @@ -160,6 +217,9 @@ public void ctorDateTimeGMT() throws Exception { ctorDateTime("GMT"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T22:23:00.000Z") @BuggyWebDriver(FF = "2021-12-18T21:23:00.000Z", @@ -168,6 +228,9 @@ public void ctorDateTimeUTC() throws Exception { ctorDateTime("UTC"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T03:23:00.000Z") @BuggyWebDriver(FF = "2021-12-18T21:23:00.000Z", @@ -176,12 +239,18 @@ public void ctorDateTimeEST() throws Exception { ctorDateTime("EST"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T21:23:00.000Z") public void ctorDateTimeBerlin() throws Exception { ctorDateTime("Europe/Berlin"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T13:23:00.000Z") @BuggyWebDriver(FF = "2021-12-18T21:23:00.000Z", @@ -190,6 +259,9 @@ public void ctorDateTimeTokyo() throws Exception { ctorDateTime("Asia/Tokyo"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T13:23:00.000Z") @BuggyWebDriver(FF = "2021-12-18T21:23:00.000Z", @@ -198,6 +270,9 @@ public void ctorDateTimeJST() throws Exception { ctorDateTime("JST"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T03:23:00.000Z") @BuggyWebDriver(FF = "2021-12-18T21:23:00.000Z", @@ -207,8 +282,8 @@ public void ctorDateTimeNewYork() throws Exception { } private void ctorDateTime(final String tz) throws Exception { - final String html - = "\n" @@ -228,42 +303,63 @@ private void ctorDateTime(final String tz) throws Exception { } } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T00:00:00.000Z") public void ctorDateGMT() throws Exception { ctorDate("GMT"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T00:00:00.000Z") public void ctorDateUTC() throws Exception { ctorDate("UTC"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T00:00:00.000Z") public void ctorDateEST() throws Exception { ctorDate("EST"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T00:00:00.000Z") public void ctorDateBerlin() throws Exception { ctorDate("Europe/Berlin"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T00:00:00.000Z") public void ctorDateNewYork() throws Exception { ctorDate("America/New_York"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T00:00:00.000Z") public void ctorDateTokyo() throws Exception { ctorDate("Asia/Tokyo"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T00:00:00.000Z") public void ctorDateJST() throws Exception { @@ -271,8 +367,8 @@ public void ctorDateJST() throws Exception { } private void ctorDate(final String tz) throws Exception { - final String html - = "\n" @@ -292,11 +388,14 @@ private void ctorDate(final String tz) throws Exception { } } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2000-02-28T23:59:59.000Z") public void ctorInt() throws Exception { - final String html - = "\n" @@ -305,11 +404,14 @@ public void ctorInt() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2035-11-30T01:46:40.000Z") public void ctorDouble() throws Exception { - final String html - = "\n" @@ -318,6 +420,9 @@ public void ctorDouble() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("12/18/2021, 10:23:00 PM") @HtmlUnitNYI(CHROME = "12/18/21, 10:23 PM", @@ -328,6 +433,9 @@ public void toLocaleEnUs() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleString('en-US')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("12/18/2021") @HtmlUnitNYI(CHROME = "12/18/21", @@ -338,6 +446,9 @@ public void toLocaleEnUsDate() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleDateString('en-US')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("10:23:00 PM") @HtmlUnitNYI(CHROME = "10:23 PM", @@ -348,6 +459,9 @@ public void toLocaleEnUsTime() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleTimeString('en-US')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("18.12.2021, 22:23:00") @HtmlUnitNYI(CHROME = "18.12.21, 22:23", @@ -358,6 +472,9 @@ public void toLocaleDeDe() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleString('de-DE')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("18.12.2021") @HtmlUnitNYI(CHROME = "18.12.21", @@ -368,6 +485,9 @@ public void toLocaleDeDeDate() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleDateString('de-DE')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("22:23:00") @HtmlUnitNYI(CHROME = "22:23", @@ -378,6 +498,9 @@ public void toLocaleDeDeTime() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleTimeString('de-DE')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021/12/18 22:23:00") @HtmlUnitNYI(CHROME = "2021/12/18 22:23", @@ -388,12 +511,18 @@ public void toLocaleJaJp() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleString('ja-JP')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021/12/18") public void toLocaleJaJpDate() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleDateString('ja-JP')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("22:23:00") @HtmlUnitNYI(CHROME = "22:23", @@ -404,6 +533,9 @@ public void toLocaleJaJpTime() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleTimeString('ja-JP')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021/12/18 22:23:00") @HtmlUnitNYI(CHROME = "2021/12/18 22:23", @@ -414,12 +546,18 @@ public void toLocaleArray() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleString(['foo', 'ja-JP', 'en-US'])"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021/12/18") public void toLocaleArrayDate() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleDateString(['foo', 'ja-JP', 'en-US'])"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("22:23:00") @HtmlUnitNYI(CHROME = "22:23", @@ -431,8 +569,8 @@ public void toLocaleArrayTime() throws Exception { } private void toLocale(final String js) throws Exception { - final String html - = "\n" @@ -452,36 +590,54 @@ private void toLocale(final String js) throws Exception { } } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat Dec 18 2021") public void toDateStringGMT() throws Exception { toDateString("GMT"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat Dec 18 2021") public void toDateStringUTC() throws Exception { toDateString("UTC"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat Dec 18 2021") public void toDateStringEST() throws Exception { toDateString("EST"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat Dec 18 2021") public void toDateStringBerlin() throws Exception { toDateString("Europe/Berlin"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat Dec 18 2021") public void toDateStringNewYork() throws Exception { toDateString("America/New_York"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sun Dec 19 2021") @BuggyWebDriver(FF = "Sat Dec 18 2021", @@ -490,6 +646,9 @@ public void toDateStringTokyo() throws Exception { toDateString("Asia/Tokyo"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sun Dec 19 2021") @BuggyWebDriver(FF = "Sat Dec 18 2021", @@ -499,8 +658,8 @@ public void toDateStringJST() throws Exception { } private void toDateString(final String tz) throws Exception { - final String html - = "\n" @@ -520,6 +679,9 @@ private void toDateString(final String tz) throws Exception { } } + /** + * @throws Exception if the test fails + */ @Test @Alerts("22:23:00 GMT+0000 (Greenwich Mean Time)") @BuggyWebDriver(FF = "23:23:00 GMT+0100 (Central European Standard Time)", @@ -532,6 +694,9 @@ public void toTimeStringGMT() throws Exception { toTimeString("GMT"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("22:23:00 GMT+0000 (Coordinated Universal Time)") @BuggyWebDriver(FF = "23:23:00 GMT+0100 (Central European Standard Time)", @@ -544,8 +709,11 @@ public void toTimeStringUTC() throws Exception { toTimeString("UTC"); } + /** + * @throws Exception if the test fails + */ @Test - @Alerts("17:23:00 GMT-0500 (GMT-05:00)") + @Alerts("17:23:00 GMT-0500 (Eastern Standard Time)") @BuggyWebDriver(FF = "23:23:00 GMT+0100 (Central European Standard Time)", FF_ESR = "23:23:00 GMT+0100 (Central European Standard Time)") @HtmlUnitNYI(CHROME = "17:23:00 GMT-0500 (-05:00)", @@ -556,6 +724,9 @@ public void toTimeStringEST() throws Exception { toTimeString("EST"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("23:23:00 GMT+0100 (Central European Standard Time)") @HtmlUnitNYI(CHROME = "23:23:00 GMT+0100 (CET)", @@ -566,6 +737,9 @@ public void toTimeStringBerlin() throws Exception { toTimeString("Europe/Berlin"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("17:23:00 GMT-0500 (Eastern Standard Time)") @BuggyWebDriver(FF = "23:23:00 GMT+0100 (Central European Standard Time)", @@ -578,6 +752,9 @@ public void toTimeStringNewYork() throws Exception { toTimeString("America/New_York"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("07:23:00 GMT+0900 (Japan Standard Time)") @BuggyWebDriver(FF = "23:23:00 GMT+0100 (Central European Standard Time)", @@ -590,6 +767,9 @@ public void toTimeStringTokyo() throws Exception { toTimeString("Asia/Tokyo"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("07:23:00 GMT+0900 (Japan Standard Time)") @BuggyWebDriver(FF = "23:23:00 GMT+0100 (Central European Standard Time)", @@ -603,8 +783,8 @@ public void toTimeStringJST() throws Exception { } private void toTimeString(final String tz) throws Exception { - final String html - = "\n" @@ -624,42 +804,63 @@ private void toTimeString(final String tz) throws Exception { } } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat, 18 Dec 2021 22:23:00 GMT") public void toUTCStringGMT() throws Exception { toUTCString("GMT"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat, 18 Dec 2021 22:23:00 GMT") public void toUTCStringUTC() throws Exception { toUTCString("UTC"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat, 18 Dec 2021 22:23:00 GMT") public void toUTCStringEST() throws Exception { toUTCString("EST"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat, 18 Dec 2021 22:23:00 GMT") public void toUTCStringBerlin() throws Exception { toUTCString("Europe/Berlin"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat, 18 Dec 2021 22:23:00 GMT") public void toUTCStringNewYork() throws Exception { toUTCString("America/New_York"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat, 18 Dec 2021 22:23:00 GMT") public void toUTCStringTokyo() throws Exception { toUTCString("Asia/Tokyo"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat, 18 Dec 2021 22:23:00 GMT") public void toUTCStringJST() throws Exception { @@ -667,8 +868,8 @@ public void toUTCStringJST() throws Exception { } private void toUTCString(final String tz) throws Exception { - final String html - = "\n" @@ -688,6 +889,9 @@ private void toUTCString(final String tz) throws Exception { } } + /** + * @throws Exception if the test fails + */ @Test @Alerts("0") @BuggyWebDriver(FF = "-60", @@ -696,6 +900,9 @@ public void timezoneOffsetGMT() throws Exception { timezoneOffset("GMT"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("0") @BuggyWebDriver(FF = "-60", @@ -704,6 +911,9 @@ public void timezoneOffsetUTC() throws Exception { timezoneOffset("UTC"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("300") @BuggyWebDriver(FF = "-60", @@ -712,12 +922,18 @@ public void timezoneOffsetEST() throws Exception { timezoneOffset("EST"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("-60") public void timezoneOffsetBerlin() throws Exception { timezoneOffset("Europe/Berlin"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("300") @BuggyWebDriver(FF = "-60", @@ -726,6 +942,9 @@ public void timezoneOffsetNewYork() throws Exception { timezoneOffset("America/New_York"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("-540") @BuggyWebDriver(FF = "-60", @@ -734,6 +953,9 @@ public void timezoneOffsetTokyo() throws Exception { timezoneOffset("Asia/Tokyo"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("-540") @BuggyWebDriver(FF = "-60", @@ -743,8 +965,8 @@ public void timezoneOffsetJST() throws Exception { } private void timezoneOffset(final String tz) throws Exception { - final String html - = "\n" diff --git a/src/test/java/org/htmlunit/javascript/NativeDateTest.java b/src/test/java/org/htmlunit/javascript/NativeDateTest.java index cab218760c9..375ac3c171b 100644 --- a/src/test/java/org/htmlunit/javascript/NativeDateTest.java +++ b/src/test/java/org/htmlunit/javascript/NativeDateTest.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,7 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -40,8 +40,8 @@ public class NativeDateTest extends WebDriverTestCase { @Test @Alerts({"-13", "84", "109"}) public void getYear() throws Exception { - final String html - = "\n" + ""; @@ -420,7 +429,8 @@ public void commaOperatorFunctionTry() throws Exception { @Test @Alerts("my y var") public void commaOperatorFunctionCall() throws Exception { - final String html = "\n" + "\n" @@ -500,7 +512,8 @@ public void callWithNullContext() throws Exception { @Test @Alerts("a=[object Window]") public void callWithUndefinedContext() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -526,7 +539,8 @@ public void callWithUndefinedContext() throws Exception { @Test @Alerts({"configurable: true", "enumerable: false", "writable: false"}) public void functionLength() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/NativeMapTest.java b/src/test/java/org/htmlunit/javascript/NativeMapTest.java index 8685d2e8455..50fbe6e9392 100644 --- a/src/test/java/org/htmlunit/javascript/NativeMapTest.java +++ b/src/test/java/org/htmlunit/javascript/NativeMapTest.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,7 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -35,8 +35,8 @@ public class NativeMapTest extends WebDriverTestCase { @Test @Alerts({"key type string", "value type object"}) public void entries() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -262,7 +263,8 @@ public void toStringRhinoBug538172() throws Exception { @Test @Alerts("12,345") public void toLocaleString() throws Exception { - final String html = "\n" @@ -276,7 +278,8 @@ public void toLocaleString() throws Exception { @Test @Alerts("12.345") public void toLocaleStringDe() throws Exception { - final String html = "\n" @@ -290,7 +293,8 @@ public void toLocaleStringDe() throws Exception { @Test @Alerts("12,345") public void toLocaleStringEnUS() throws Exception { - final String html = "\n" @@ -304,7 +308,8 @@ public void toLocaleStringEnUS() throws Exception { @Test @Alerts("12,345") public void toLocaleStringNoParam() throws Exception { - final String html = "\n" + ""; loadPageVerifyTitle2(html); diff --git a/src/test/java/org/htmlunit/javascript/NativeObjectTest.java b/src/test/java/org/htmlunit/javascript/NativeObjectTest.java index 412865af91d..281d9b5d5cb 100644 --- a/src/test/java/org/htmlunit/javascript/NativeObjectTest.java +++ b/src/test/java/org/htmlunit/javascript/NativeObjectTest.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,8 +16,8 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; @@ -75,8 +75,8 @@ public void others() throws Exception { @Test @Alerts("1") public void assign() throws Exception { - final String html - = "\n" + "\n" @@ -254,14 +254,14 @@ public void getPrototypeOfString() throws Exception { @Test @Alerts("true") public void getPrototypeOfNumber() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -277,14 +277,14 @@ public void getPrototypeOfNumber() throws Exception { @Test @Alerts("true") public void getPrototypeOfBoolean() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -300,14 +300,14 @@ public void getPrototypeOfBoolean() throws Exception { @Test @Alerts("object") public void getTypeOfPrototypeOfNumber() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -323,7 +323,7 @@ public void getTypeOfPrototypeOfNumber() throws Exception { @Test @Alerts({"2", "true", "true"}) public void getOwnPropertySymbols() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -354,9 +354,9 @@ public void getOwnPropertySymbols() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("TypeError") public void getOwnPropertySymbolsEmpty() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -383,7 +383,7 @@ public void getOwnPropertySymbolsEmpty() throws Exception { FF = {"[object HTMLInputElement]", "[object HTMLInputElement]", "[object Object]", "function"}, FF_ESR = {"[object HTMLInputElement]", "[object HTMLInputElement]", "[object Object]", "function"}) public void getOwnPropertyDescriptor() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -428,7 +428,8 @@ public void getOwnPropertyDescriptor() throws Exception { "x.get = function value() { [native code] }", "x.get.call = function call() { [native code] }"}) public void getOwnPropertyDescriptorGetCall() throws Exception { - final String html = "\n" + "\n" @@ -200,7 +205,8 @@ public void ctorChangeableHasNoEffectForTypeOf() throws Exception { @Test @Alerts({"true", "false", "true", "ctor", "true"}) public void ctorChangeableHasNoEffectForTypeOfStrict() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -231,7 +237,8 @@ public void ctorChangeableHasNoEffectForTypeOfStrict() throws Exception { @Test @Alerts("true") public void ctorChangeableHasNoEffectForSealed() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/ThreadTest.java b/src/test/java/org/htmlunit/javascript/ThreadTest.java index 4a9404ea558..b8356417462 100644 --- a/src/test/java/org/htmlunit/javascript/ThreadTest.java +++ b/src/test/java/org/htmlunit/javascript/ThreadTest.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. @@ -95,7 +95,9 @@ private static class TestThread extends Thread { super(name); } - /** @see Thread#run() */ + /** + * @see Thread#run() + */ @Override public void run() { try { @@ -109,7 +111,9 @@ public void run() { } } - /** @return true if the test was successful */ + /** + * @return true if the test was successful + */ public boolean isSuccessful() { return successful_; } @@ -119,8 +123,8 @@ public boolean isSuccessful() { * @throws Exception if the test failed */ public void testCallInheritedFunction() throws Exception { - final String html - = "foo\n" + ""; - final String thirdContent = "Third"; + final String thirdContent = DOCTYPE_HTML + + "Third"; final MockWebConnection webConnection = getMockWebConnection(); webConnection.setResponse(URL_SECOND, secondContent); @@ -179,7 +184,8 @@ public void navigationStopThreadsInChildWindows() throws Exception { */ @Test public void interruptAllWithRecursiveSetTimeout() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + " test\n" + " "); + conn.setResponse(URL_FIRST, + DOCTYPE_HTML + ""); client.setWebConnection(conn); client.getPage(URL_FIRST); diff --git a/src/test/java/org/htmlunit/javascript/configuration/ClassConfigurationTest.java b/src/test/java/org/htmlunit/javascript/configuration/ClassConfigurationTest.java index 89db9de2330..84bf164bc4c 100644 --- a/src/test/java/org/htmlunit/javascript/configuration/ClassConfigurationTest.java +++ b/src/test/java/org/htmlunit/javascript/configuration/ClassConfigurationTest.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,9 @@ */ package org.htmlunit.javascript.configuration; -import org.htmlunit.SimpleWebTestCase; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + import org.htmlunit.javascript.HtmlUnitScriptable; import org.junit.Test; @@ -23,8 +25,9 @@ * * @author Chris Erskine * @author Ahmed Ashour + * @author Ronald Brill */ -public class ClassConfigurationTest extends SimpleWebTestCase { +public class ClassConfigurationTest { /** * @throws Exception on error diff --git a/src/test/java/org/htmlunit/javascript/configuration/JavaScriptConfigurationTest.java b/src/test/java/org/htmlunit/javascript/configuration/JavaScriptConfigurationTest.java index 2fb1fd227ec..a01f310c431 100644 --- a/src/test/java/org/htmlunit/javascript/configuration/JavaScriptConfigurationTest.java +++ b/src/test/java/org/htmlunit/javascript/configuration/JavaScriptConfigurationTest.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,6 +15,8 @@ package org.htmlunit.javascript.configuration; import static org.htmlunit.BrowserVersion.FIREFOX; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.File; @@ -36,8 +38,8 @@ import org.apache.commons.text.RandomStringGenerator; import org.htmlunit.BrowserVersion; import org.htmlunit.MockWebConnection; -import org.htmlunit.SimpleWebTestCase; import org.htmlunit.WebClient; +import org.htmlunit.WebTestCase; import org.htmlunit.javascript.HtmlUnitScriptable; import org.htmlunit.javascript.JavaScriptEngine; import org.junit.Test; @@ -51,7 +53,7 @@ * @author Frank Danek * @author Joerg Werner */ -public class JavaScriptConfigurationTest extends SimpleWebTestCase { +public class JavaScriptConfigurationTest { private static final Log LOG = LogFactory.getLog(JavaScriptConfigurationTest.class); @@ -317,7 +319,8 @@ public void clonedAndModified() throws Exception { private static void test(final BrowserVersion browserVersion) throws IOException { try (WebClient webClient = new WebClient(browserVersion)) { final MockWebConnection conn = new MockWebConnection(); - conn.setDefaultResponse(""); + conn.setDefaultResponse(WebTestCase.DOCTYPE_HTML + + ""); webClient.setWebConnection(conn); webClient.getPage("http://localhost/"); diff --git a/src/test/java/org/htmlunit/javascript/host/ActiveXObject2Test.java b/src/test/java/org/htmlunit/javascript/host/ActiveXObject2Test.java index b27f64e4824..dd0a5f600a1 100644 --- a/src/test/java/org/htmlunit/javascript/host/ActiveXObject2Test.java +++ b/src/test/java/org/htmlunit/javascript/host/ActiveXObject2Test.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,7 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -37,7 +37,8 @@ public class ActiveXObject2Test extends WebDriverTestCase { @Test @Alerts({"undefined", "undefined", "NaN", "false", "No", "No", "No", "No"}) public void browserDetection() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -87,7 +89,8 @@ public void xmlDocument() throws Exception { @Test @Alerts("ActiveXObject undefined") public void activex() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/javascript/host/ApplicationCacheTest.java b/src/test/java/org/htmlunit/javascript/host/ApplicationCacheTest.java index d0cc99d39d2..9023c1f9992 100644 --- a/src/test/java/org/htmlunit/javascript/host/ApplicationCacheTest.java +++ b/src/test/java/org/htmlunit/javascript/host/ApplicationCacheTest.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,8 @@ package org.htmlunit.javascript.host; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.html.HtmlPageTest; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -37,7 +36,7 @@ public class ApplicationCacheTest extends WebDriverTestCase { @Test @Alerts("undefined") public void scriptableToString() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + " \n" @@ -69,10 +69,10 @@ public void elementAttributes() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("TypeError") public void positionAndSizeAttributes() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + "
daniel
\n" @@ -85,7 +85,7 @@ public void positionAndSizeAttributes() throws Exception { + " log(box.x + '-' + box.y);\n" + " log(box.screenX + '-' + box.screenY);\n" + " log(box.width + '-' + box.height);\n" - + " } catch (e) {log('exception')}\n" + + " } catch(e) { logEx(e) }\n" + " }\n" + " \n" + " \n" diff --git a/src/test/java/org/htmlunit/javascript/host/ClientRectListTest.java b/src/test/java/org/htmlunit/javascript/host/ClientRectListTest.java index 75c0b582423..0eba744b518 100644 --- a/src/test/java/org/htmlunit/javascript/host/ClientRectListTest.java +++ b/src/test/java/org/htmlunit/javascript/host/ClientRectListTest.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,7 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -34,8 +34,8 @@ public class ClientRectListTest extends WebDriverTestCase { @Test @Alerts({"[object DOMRectList]", "1", "[object DOMRect]", "[object DOMRect]"}) public void getClientRects() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -91,8 +91,8 @@ public void itemOutside() throws Exception { @Test @Alerts({"[object DOMRectList]", "1", "undefined", "undefined"}) public void indexOutside() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -123,8 +123,8 @@ public void indexOutside() throws Exception { @Test @Alerts({"[object DOMRectList]", "0", "undefined", "undefined"}) public void empty() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/host/ClientRectTest.java b/src/test/java/org/htmlunit/javascript/host/ClientRectTest.java index 1f5ae385754..e18eedae18e 100644 --- a/src/test/java/org/htmlunit/javascript/host/ClientRectTest.java +++ b/src/test/java/org/htmlunit/javascript/host/ClientRectTest.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,7 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -34,7 +34,8 @@ public class ClientRectTest extends WebDriverTestCase { @Test @Alerts({"100", "400", "100", "450", "50", "0"}) public void properties() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "
\n" @@ -62,7 +63,8 @@ public void properties() throws Exception { @Test @Alerts({"true", "true"}) public void getBoundingClientRect_WidthPercent() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n"; loadPage(html); diff --git a/src/test/java/org/htmlunit/javascript/host/ConsoleTest.java b/src/test/java/org/htmlunit/javascript/host/ConsoleTest.java index d6d1bfd19f1..d28885360bf 100644 --- a/src/test/java/org/htmlunit/javascript/host/ConsoleTest.java +++ b/src/test/java/org/htmlunit/javascript/host/ConsoleTest.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,8 +18,8 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.BuggyWebDriver; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.BuggyWebDriver; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.WebDriver; @@ -44,8 +44,8 @@ public class ConsoleTest extends WebDriverTestCase { @Test @Alerts({"false", "object", "true"}) public void prototype() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; @@ -66,8 +66,8 @@ public void prototype() throws Exception { @Test @Alerts({"true", "undefined", "false"}) public void prototypeUppercase() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; @@ -88,8 +88,8 @@ public void prototypeUppercase() throws Exception { @Test @Alerts({}) public void timeStamp() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; @@ -153,8 +153,8 @@ public void windowProperty() throws Exception { @Test @Alerts("success") public void fromWindow() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; @@ -175,8 +175,8 @@ public void fromWindow() throws Exception { @Test @BuggyWebDriver public void simpleString() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -115,7 +116,8 @@ public void selectNodes() throws Exception { @Test @Alerts({"2", "1"}) public void removeChild() throws Exception { - final String html = "\n" @@ -217,7 +221,8 @@ public void selectNode_root() throws Exception { @Test @Alerts({"1", "1"}) public void getElementsByTagNameNS() throws Exception { - final String html = "\n" @@ -248,7 +253,8 @@ public void getElementsByTagNameNS() throws Exception { @Test @Alerts({"1", "2", "3"}) public void getElementsByTagNameNSAsterisk() throws Exception { - final String html = "\n" @@ -280,7 +286,8 @@ public void getElementsByTagNameNSAsterisk() throws Exception { @Test @Alerts({"2", "Three", "Four", "1", "Two", "0", "0"}) public void getElementsByTagNameXml() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; loadPageVerifyTitle2(html); @@ -325,7 +332,8 @@ public void getElementsByTagNameXml() throws Exception { @Test @Alerts("false") public void hasAttribute() throws Exception { - final String html = "\n" + "\n" @@ -755,7 +764,8 @@ public void enumeratedProperties() throws Exception { @Test @Alerts("finished") public void removeAttribute() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " "; loadPageVerifyTitle2(html); } @@ -805,7 +816,8 @@ public void getBoundingClientRect() throws Exception { @Test @Alerts("0") public void commentIsElement() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "
\n" + "\n" @@ -983,7 +998,8 @@ public void children() throws Exception { @Test @Alerts({"", "a b c"}) public void classList() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "\n" + "\n" @@ -1200,7 +1221,7 @@ public void prototypConstructor() throws Exception { @Alerts({"function Element() { [native code] }", "[object Element]", "function Element() { [native code] }"}) public void prototypConstructorStandards() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" @@ -1386,7 +1407,7 @@ public void matchesInvalidSelector() throws Exception { @Test @Alerts({"TypeError", "done"}) public void matchesWindow() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" @@ -1419,7 +1440,7 @@ public void matchesWindow() throws Exception { @Test @Alerts({"div-02", "div-03", "div-01", "article-01", "null"}) public void closest() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" @@ -375,7 +381,8 @@ public void pushStateLocationHref() throws Exception { "[object PopStateEvent]", "{\"hi2\":\"there2\"}", "[object PopStateEvent]", "{\"hi2\":\"there2\"}"}) public void replaceState() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -196,7 +198,8 @@ public void about_blank_query_attributes() throws Exception { @Test @Alerts({"", "about:blank?", "blank", "", "about:", ""}) public void about_blank_emptyquery_attributes() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -228,7 +231,8 @@ public void about_blank_emptyquery_attributes() throws Exception { @Test @Alerts({"#hash", "about:blank#hash", "blank", "", "about:", ""}) public void about_blank_hash_attributes() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -261,7 +265,8 @@ public void about_blank_hash_attributes() throws Exception { @Test @Alerts({"#hash", "about:blank?#hash", "blank", "", "about:", ""}) public void about_blank_emptyquery_hash_attributes() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -295,7 +300,8 @@ public void about_blank_emptyquery_hash_attributes() throws Exception { FF = {"#hash", "about:blank?query#hash", "blank", "", "about:", ""}, FF_ESR = {"#hash", "about:blank?query#hash", "blank", "", "about:", ""}) public void about_blank_query_hash_attributes() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -327,7 +333,8 @@ public void about_blank_query_hash_attributes() throws Exception { @Test @Alerts({"", "about:blank", "#foo", "about:blank#foo"}) public void about_blank_set_hash() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -381,7 +388,8 @@ public void noSearch() throws Exception { } private void checkSearch(final String url) throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; + final String html = DOCTYPE_HTML + + ""; loadPage2(html); } @@ -554,15 +567,16 @@ public void setHrefWithOnlyHash2() throws Exception { */ @Test public void replace() throws Exception { - final String html - = "First\n" + ""; - final String secondContent = "Second"; + final String secondContent = DOCTYPE_HTML + + "Second"; getMockWebConnection().setResponse(URL_SECOND, secondContent); final WebDriver driver = loadPage2(html); @@ -576,17 +590,19 @@ public void replace() throws Exception { */ @Test public void replaceLastInHistory() throws Exception { - final String startContent = "First Page"; + final String startContent = DOCTYPE_HTML + + "First Page"; - final String secondContent - = "Second Page\n" + ""; - final String thirdContent = "Third Page§"; + final String thirdContent = DOCTYPE_HTML + + "Third Page§"; getMockWebConnection().setResponse(URL_SECOND, secondContent); getMockWebConnection().setResponse(URL_THIRD, thirdContent); @@ -608,8 +624,8 @@ public void replaceLastInHistory() throws Exception { @Test @Alerts("on-load") public void replaceOnload() throws Exception { - final String html - = "First\n" + final String html = DOCTYPE_HTML + + "First\n" + "\n" + ""; - final String secondContent = "Second Page"; + final String secondContent = DOCTYPE_HTML + + "Second Page"; getMockWebConnection().setResponse(URL_SECOND, secondContent); @@ -658,15 +676,16 @@ public void replaceFirstInHistory() throws Exception { */ @Test public void assign() throws Exception { - final String firstContent - = "First\n" + ""; - final String secondContent = "Second"; + final String secondContent = DOCTYPE_HTML + + "Second"; getMockWebConnection().setResponse(URL_SECOND, secondContent); @@ -680,8 +699,8 @@ public void assign() throws Exception { @Test @Alerts("on-load") public void assignOnload() throws Exception { - final String firstContent - = "First\n" + ""; - final String secondContent = "Second"; + final String secondContent = DOCTYPE_HTML + + "Second"; getMockWebConnection().setResponse(URL_SECOND, secondContent); @@ -729,8 +750,8 @@ public void assingByEquals() throws Exception { @Test @Alerts("on-load") public void assingByEqualsOnload() throws Exception { - final String firstContent - = "First\n" @@ -775,8 +797,8 @@ public void changeLocationToNonHtml() throws Exception { @Test @Alerts("foo") public void jsLocation() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " "; + final String secondHtml = DOCTYPE_HTML + + ""; getMockWebConnection().setResponse(URL_SECOND, secondHtml); @@ -839,8 +863,8 @@ public void href_postponed() throws Exception { @Test @Alerts({"", "foo3.html", "foo2.html"}) public void onlick_set_location_WithHref() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " click me\n" + ""; @@ -861,8 +885,8 @@ public void onlick_set_location_WithHref() throws Exception { @Test @Alerts({"", "foo3.html"}) public void onlick_set_location_WithoutHref() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " click me\n" + ""; @@ -881,8 +905,8 @@ public void onlick_set_location_WithoutHref() throws Exception { @Test @Alerts({"supported", "onhashchange §§URL§§#1 §§URL§§"}) public void onHashChange() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; @@ -1132,8 +1167,8 @@ public void origin() throws Exception { @Test @Alerts("§§URL§§") public void documentOrigin() throws Exception { - final String html = - ""; @@ -1153,8 +1188,8 @@ public void documentOrigin() throws Exception { CHROME = "§§URL§§a.html?p1=sieben&p2", EDGE = "§§URL§§a.html?p1=sieben&p2") public void reloadGet() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + " reload\n" @@ -1193,8 +1228,8 @@ public void reloadGet() throws Exception { FF = "null", FF_ESR = "null") public void reloadGetNoHash() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + " \n" @@ -1231,8 +1266,8 @@ public void reloadGetNoHash() throws Exception { FF = "null", FF_ESR = "null") public void reloadGetHashDetails() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" @@ -249,10 +245,10 @@ public void constructorInt32Array() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("TypeError") public void constructorStringParam() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -273,10 +269,10 @@ public void constructorStringParam() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("TypeError") public void constructorSetParam() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -299,8 +295,8 @@ public void constructorSetParam() throws Exception { @Test @Alerts("2") public void constructorMapParam() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -365,8 +361,8 @@ public void constructorIteratorParam() throws Exception { "null", "key3", "[object Map]", "[object Window]", "undefined", "key4", "[object Map]", "[object Window]"}) public void forEach() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; - final String html2 = "\n" + final String html2 = DOCTYPE_HTML + + "\n" + "

iFrame body

\n" + "\n" + "\n" @@ -140,7 +139,8 @@ public void getNamedItem_HTML() throws Exception { @Test @Alerts({"myattr", "myattr2", "myattr", "myattr2", "myattr2"}) public void getNamedItem_HTML_Case() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -298,7 +301,8 @@ public void taintEnabled() throws Exception { * @throws Exception on test failure */ void attribute(final String name, final String value, final String... ignore) throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -341,8 +345,8 @@ public void language() throws Exception { @Test @Alerts("en-US,en") public void languages() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" @@ -359,8 +363,8 @@ public void languages() throws Exception { @Test @Alerts({"number", "number"}) public void mozilla() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; loadPageVerifyTitle2(html); @@ -58,13 +59,14 @@ public void netscape() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "TypeError", FF = {"true", "false", "true"}, FF_ESR = {"true", "false", "true"}) @HtmlUnitNYI(FF = {"undefined", "true", "true"}, FF_ESR = {"undefined", "true", "true"}) public void netscapeDescriptor() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; loadPageVerifyTitle2(html); diff --git a/src/test/java/org/htmlunit/javascript/host/NotificationTest.java b/src/test/java/org/htmlunit/javascript/host/NotificationTest.java index 8e25544606c..dec0cba6a44 100644 --- a/src/test/java/org/htmlunit/javascript/host/NotificationTest.java +++ b/src/test/java/org/htmlunit/javascript/host/NotificationTest.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,7 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -36,12 +36,13 @@ public class NotificationTest extends WebDriverTestCase { @Test @Alerts({"function", "true"}) public void prototype() throws Exception { - final String html = ""; loadPageVerifyTitle2(html); @@ -53,11 +54,12 @@ public void prototype() throws Exception { @Test @Alerts("default") public void permission() throws Exception { - final String html = ""; loadPageVerifyTitle2(html); @@ -69,11 +71,12 @@ public void permission() throws Exception { @Test @Alerts({}) public void minimalUsage() throws Exception { - final String html = ""; loadPageVerifyTitle2(html); @@ -85,11 +88,12 @@ public void minimalUsage() throws Exception { @Test @Alerts("function") public void requestPermission() throws Exception { - final String html = ""; loadPageVerifyTitle2(html); diff --git a/src/test/java/org/htmlunit/javascript/host/PluginTest.java b/src/test/java/org/htmlunit/javascript/host/PluginTest.java index 4e6d8e95ab9..4fcecb798d9 100644 --- a/src/test/java/org/htmlunit/javascript/host/PluginTest.java +++ b/src/test/java/org/htmlunit/javascript/host/PluginTest.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,7 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -28,6 +28,9 @@ @RunWith(BrowserRunner.class) public class PluginTest extends WebDriverTestCase { + /** + * @throws Exception if an error occurs + */ @Test @Alerts({"5", "PDF Viewer", "Portable Document Format", "internal-pdf-viewer", "undefined", @@ -36,7 +39,8 @@ public class PluginTest extends WebDriverTestCase { "Microsoft Edge PDF Viewer", "Portable Document Format", "internal-pdf-viewer", "undefined", "WebKit built-in PDF", "Portable Document Format", "internal-pdf-viewer", "undefined"}) public void plugins() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + ""; @@ -60,9 +61,10 @@ public void popup() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("TypeError") public void popupBodyStyle() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/javascript/host/PopupTest.java b/src/test/java/org/htmlunit/javascript/host/PopupTest.java index e529e0a1d0d..3fa15e1aa59 100644 --- a/src/test/java/org/htmlunit/javascript/host/PopupTest.java +++ b/src/test/java/org/htmlunit/javascript/host/PopupTest.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,7 +23,7 @@ import org.htmlunit.html.HtmlElement; import org.htmlunit.html.HtmlPage; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -42,7 +42,8 @@ public class PopupTest extends SimpleWebTestCase { @Test @Alerts("Pop-up window is Open") public void popupWindowBecomesCurrent() throws Exception { - final String content = "First\n" + final String content = DOCTYPE_HTML + + "First\n" + "Push me\n" + "\n" + "\n" @@ -284,14 +287,15 @@ public void orientation() throws Exception { FF = "landscape-primary", FF_ESR = "landscape-primary") public void mozOrientation() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "\n" @@ -309,13 +313,14 @@ public void mozOrientation() throws Exception { FF = "undefined", FF_ESR = "undefined") public void isExtended() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/host/SetTest.java b/src/test/java/org/htmlunit/javascript/host/SetTest.java index 35b8774042f..bf35ab4e6d9 100644 --- a/src/test/java/org/htmlunit/javascript/host/SetTest.java +++ b/src/test/java/org/htmlunit/javascript/host/SetTest.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. @@ -17,9 +17,8 @@ import java.util.Set; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.html.HtmlPageTest; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -38,8 +37,7 @@ public class SetTest extends WebDriverTestCase { @Test @Alerts({"3", "true"}) public void has() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -311,8 +307,8 @@ public void constructorIteratorParam() throws Exception { "undefined", "undefined", "[object Set]", "[object Window]", "null", "null", "[object Set]", "[object Window]"}) public void forEach() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; loadPageVerifyTitle2(html); } @@ -80,16 +80,16 @@ public void storageEquals() throws Exception { @Test @Alerts({"string", "1"}) public void localStorage() throws Exception { - final String firstHtml - = "\n" + final String firstHtml = DOCTYPE_HTML + + "\n" + "\n" + ""; - final String secondHtml - = "\n" + final String secondHtml = DOCTYPE_HTML + + "\n" + "\n" + + ""; + loadPageVerifyTitle2(html); + } + /** * @throws Exception if the test fails */ @Test @Alerts({"0", "2", "there", "world", "1", "0"}) public void sessionStorage() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; final WebDriver driver = loadPage2(html1); final List alerts = getCollectedAlerts(driver); - final String html2 = ""; + releaseResources(); + getMockWebConnection().setResponse(URL_FIRST, html2); - releaseResources(); // we have to control 2nd driver by ourself WebDriver driver2 = null; try { @@ -263,6 +294,7 @@ public void localStorageShouldBeShared() throws Exception { assertEquals(getExpectedAlerts(), alerts); } finally { + driver2.close(); if (!(driver2 instanceof HtmlUnitDriver)) { shutDownAll(); } @@ -275,7 +307,8 @@ public void localStorageShouldBeShared() throws Exception { @Test @Alerts({"undefined", "null", "extraMethod called", "null"}) public void prototypeIsExtensible() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; loadPageVerifyTitle2(html); } @@ -302,7 +335,8 @@ public void prototypeIsExtensible() throws Exception { @Test @Alerts({"function", "null", "function", "value", "1"}) public void prototypePropertiesAreVisible() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; loadPageVerifyTitle2(html); @@ -328,7 +362,8 @@ public void prototypePropertiesAreVisible() throws Exception { @HtmlUnitNYI(FF = {"function", "null", "string", "value", "1"}, FF_ESR = {"function", "null", "string", "value", "1"}) public void writeToPrototypeProperty() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; loadPageVerifyTitle2(html); } diff --git a/src/test/java/org/htmlunit/javascript/host/SymbolTest.java b/src/test/java/org/htmlunit/javascript/host/SymbolTest.java index f1b5514bbd6..cd6257b46c5 100644 --- a/src/test/java/org/htmlunit/javascript/host/SymbolTest.java +++ b/src/test/java/org/htmlunit/javascript/host/SymbolTest.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. @@ -17,7 +17,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.html.HtmlPageTest; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -130,8 +130,7 @@ public void toStringTag() throws Exception { } private void name(final String name) throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -183,8 +182,7 @@ public void string() throws Exception { @Test @Alerts({"Symbol()", "Symbol(foo)", "Symbol(Symbol.iterator)"}) public void defaultValue() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -211,8 +209,7 @@ public void defaultValue() throws Exception { @Test @Alerts({"function", "symbol", "symbol", "symbol"}) public void typeOf() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -240,8 +237,7 @@ public void typeOf() throws Exception { @Test @Alerts({"false", "true", "Symbol(mario)"}) public void symbolFor() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -270,8 +266,7 @@ public void symbolFor() throws Exception { @Test @Alerts({"true", "false"}) public void symbolForGlobal() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -298,10 +293,9 @@ public void symbolForGlobal() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"exception", "exception"}) + @Alerts({"TypeError", "TypeError"}) public void symbolNew() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -327,10 +321,9 @@ public void symbolNew() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"exception", "exception"}) + @Alerts({"TypeError", "TypeError"}) public void globalSymbolRegistry() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -358,7 +351,8 @@ public void globalSymbolRegistry() throws Exception { @Test @Alerts("called") public void inFunction() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -646,7 +648,8 @@ private void encoding(final String encoding) throws Exception { @Test @Alerts({"0", "8", "72", "116"}) public void encode() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -731,16 +736,17 @@ public void decode2() throws Exception { * @throws Exception on test failure */ @Test - @Alerts("ex") + @Alerts("RangeError") public void decodeReplacement() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -754,9 +760,10 @@ public void decodeReplacement() throws Exception { * @throws Exception on test failure */ @Test - @Alerts({"", "ex-null", "\uf7cf!"}) + @Alerts({"", "ex-null", "TypeError", "\uf7cf!"}) public void decodeXuserDefined() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/host/TextEncoderTest.java b/src/test/java/org/htmlunit/javascript/host/TextEncoderTest.java index 595f89238c3..6be0f9e745e 100644 --- a/src/test/java/org/htmlunit/javascript/host/TextEncoderTest.java +++ b/src/test/java/org/htmlunit/javascript/host/TextEncoderTest.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,7 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -35,7 +35,8 @@ public class TextEncoderTest extends WebDriverTestCase { @Test @Alerts("utf-8") public void encoding() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -386,8 +395,8 @@ public void stringMissingParam() throws Exception { "key=value&empty-key=undefined&key=overwrite", "key=value&empty-key=undefined&key=overwrite&key-null=null"}) public void append() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -956,8 +965,8 @@ public void forEachWrongParam() throws Exception { @Alerts({"true", "function entries() { [native code] }", "[object URLSearchParams Iterator]", "key1-val1", "key2-", "key1-val3", "-val4", "true"}) public void entries() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -689,6 +714,9 @@ public void protocol() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"https:", "http:", "http://mydomain.com/svn/Repos/", @@ -698,10 +726,10 @@ public void protocol() throws Exception { "http:", "http://mydomain.com/svn/Repos/", "http:", "http://mydomain.com/svn/Repos/", "http:", "http://mydomain.com/svn/Repos/", - "ex-unknown"}) + "ex-unknown", "ReferenceError"}) public void protocol2() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -755,6 +783,9 @@ public void protocol2() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"https:", "http:", "http://mydomain.com/svn/Repos/", @@ -764,10 +795,10 @@ public void protocol2() throws Exception { "http:", "http://mydomain.com/svn/Repos/", "http:", "http://mydomain.com/svn/Repos/", "http:", "http://mydomain.com/svn/Repos/", - "ex-unknown"}) + "ex-unknown", "ReferenceError"}) public void protocol3() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -821,6 +852,9 @@ public void protocol3() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts(DEFAULT = {"https:", "http:", "http://mydomain.com/svn/Repos/", @@ -864,8 +898,8 @@ public void protocol3() throws Exception { "wss:", "wss://mydomain.com/svn/Repos/", "file:", "file://mydomain.com/svn/Repos/"}) public void specialScheme() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -82,8 +82,8 @@ public void constructorSetParam() throws Exception { @Test @Alerts("true") public void constructorMapParam() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -109,8 +109,8 @@ public void constructorMapParam() throws Exception { @Test @Alerts("true") public void constructorIteratorParam() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/host/WeakSetTest.java b/src/test/java/org/htmlunit/javascript/host/WeakSetTest.java index 45d6ba3ce3c..d0f32b041a7 100644 --- a/src/test/java/org/htmlunit/javascript/host/WeakSetTest.java +++ b/src/test/java/org/htmlunit/javascript/host/WeakSetTest.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,7 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -35,8 +35,8 @@ public class WeakSetTest extends WebDriverTestCase { @Test @Alerts("true") public void constructorArray() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -227,7 +231,7 @@ public void chat() throws Exception { assertVisible("joined", driver); final WebElement chatE = driver.findElement(By.id("chat")); - long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME; + long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME.toMillis(); do { Thread.sleep(100); @@ -239,7 +243,7 @@ public void chat() throws Exception { driver.findElement(By.id("phrase")).sendKeys("Hope you are fine!"); driver.findElement(By.id("sendB")).click(); - maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME; + maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME.toMillis(); do { Thread.sleep(100); } @@ -358,7 +362,7 @@ public void cookies() throws Exception { driver.findElement(By.id("joinB")).click(); final WebElement chatE = driver.findElement(By.id("chat")); - long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME; + long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME.toMillis(); do { Thread.sleep(100); } @@ -369,7 +373,7 @@ public void cookies() throws Exception { driver.findElement(By.id("phrase")).sendKeys("Hope you are fine!"); driver.findElement(By.id("sendB")).click(); - maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME; + maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME.toMillis(); do { Thread.sleep(100); } @@ -463,13 +467,13 @@ public void events() throws Exception { driver.get(URL_FIRST + "WebSocketTest_events.html"); final WebElement logElement = driver.findElement(By.id("log")); - final long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME; + final long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME.toMillis(); String text; do { Thread.sleep(100); - text = logElement.getAttribute("value").trim().replaceAll("\r", ""); + text = logElement.getDomProperty("value").trim().replaceAll("\r", ""); } while (text.length() <= expected.length() && System.currentTimeMillis() < maxWait); @@ -535,13 +539,13 @@ public void wasClean() throws Exception { driver.get(URL_FIRST + "WebSocketTest_wasClean.html"); final WebElement logElement = driver.findElement(By.id("log")); - final long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME; + final long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME.toMillis(); String text; do { Thread.sleep(100); - text = logElement.getAttribute("value").trim().replaceAll("\r", ""); + text = logElement.getDomProperty("value").trim().replaceAll("\r", ""); } while (text.length() <= expected.length() && System.currentTimeMillis() < maxWait); @@ -569,9 +573,9 @@ public void eventsNoSocketServer() throws Exception { int counter = 0; String text; do { - Thread.sleep(DEFAULT_WAIT_TIME); + Thread.sleep(DEFAULT_WAIT_TIME.toMillis()); - text = logElement.getAttribute("value").trim().replaceAll("\r", ""); + text = logElement.getDomProperty("value").trim().replaceAll("\r", ""); } while (text.length() > 0 && counter++ < 10); @@ -658,7 +662,8 @@ public void onWebSocketBinary(final byte[] payload, final int offset, final int @Test @Alerts("true") public void prototypeUrl() throws Exception { - final String html = "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"SGVsbG8gV29ybGQh", "Hello World!"}) + public void atobTrailingWhitespace() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; loadPageVerifyTitle2(html); @@ -185,18 +205,141 @@ public void atob() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"exception", "exception"}) + @Alerts({"SGVsbG8gV29ybGQh", "Hello World!"}) + public void atobLeadingWhitespace() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"SGVsbG8gV29ybGQh", "Hello World!"}) + public void atobWhitespace() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"SGVsbG8gV29ybGQh", "InvalidCharacterError/DOMException", + "InvalidCharacterError/DOMException", "InvalidCharacterError/DOMException"}) + public void atobNbsp() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"SGVsbG8gV29ybGQh", "InvalidCharacterError/DOMException"}) + public void atobInvalid() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("InvalidCharacterError/DOMException") + public void atobMalformedInput() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("InvalidCharacterError/DOMException") + public void atobEmptyInput() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"InvalidCharacterError/DOMException", "InvalidCharacterError/DOMException"}) public void atobUnicode() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; loadPageVerifyTitle2(html); @@ -208,11 +351,11 @@ public void atobUnicode() throws Exception { @Test @Alerts({"M8OuwqY=", "3\u00C3\u00AE\u00C2\u00A6"}) public void atobUnicodeOutput() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -228,11 +371,11 @@ public void atobUnicodeOutput() throws Exception { @Test @Alerts({"CSAe", "\t \u001e"}) public void atobControlChar() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -248,13 +391,13 @@ public void atobControlChar() throws Exception { @Test @Alerts({"bnVsbA==", "null"}) public void atobNull() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; loadPageVerifyTitle2(html); @@ -266,13 +409,13 @@ public void atobNull() throws Exception { @Test @Alerts({"dW5kZWZpbmVk", "undefined"}) public void atobUndefined() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; loadPageVerifyTitle2(html); @@ -309,7 +452,8 @@ public void topLevelProperties() throws Exception { "NaN", "Infinity", "eval", "print", "parseInt", "parseFloat", "isNaN", "isFinite", "encodeURI", "encodeURIComponent", "decodeURI", "decodeURIComponent", "escape", "unescape"}; - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -364,14 +510,15 @@ public void execScript2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("TypeError") public void execScript_returnValue() throws Exception { - final String html = "\n" + ""; @@ -384,7 +531,8 @@ public void execScript_returnValue() throws Exception { @Test @Alerts("undefined") public void collectGarbage() throws Exception { - final String html = "\n" @@ -646,7 +799,8 @@ public void open() throws Exception { + " window.open('" + URL_SECOND + "');\n" + "\n" + ""; - final String windowContent = "\n" + final String windowContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -678,7 +833,8 @@ public void openWindowParams() throws Exception { + " window.open('" + URL_SECOND + "', 'New window', 'width=200,height=100');\n" + "\n" + ""; - final String windowContent = "\n" + final String windowContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; - final String windowContent = "\n" + final String windowContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + ""; @@ -795,17 +955,47 @@ public void IEScriptEngineXxx() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(CHROME = {"true", "true", "147", "true", "true", "16"}, - EDGE = {"true", "true", "136", "true", "true", "24"}, - FF = {"true", "true", "91", "true", "true", "12"}, - FF_ESR = {"true", "true", "91", "true", "true", "12"}) + @Alerts(CHROME = {"true", "621", "147", "true", "16", "16"}, + EDGE = {"true", "630", "138", "true", "16", "24"}, + FF = {"true", "675", "93", "true", "16", "16"}, + FF_ESR = {"true", "677", "91", "true", "16", "12"}) + @HtmlUnitNYI(CHROME = {"true", "605", "147", "true", "0", "16"}, + EDGE = {"true", "605", "138", "true", "0", "24"}, + FF = {"true", "605", "93", "true", "0", "16"}, + FF_ESR = {"true", "605", "91", "true", "0", "12"}) public void heightsAndWidths() throws Exception { - final String html - = "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * Regression test for bug 2897473. + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"true", "0", "147", "true", "true", "16"}, + EDGE = {"true", "0", "138", "true", "true", "24"}, + FF = {"true", "0", "93", "true", "true", "16"}, + FF_ESR = {"true", "0", "91", "true", "true", "12"}) + public void heightsAndWidthsQuirks() throws Exception { + final String html = + "\n" + + "\n" + + "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * Regression test for bug 2944261. + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"621", "1256", "606", "1241"}, + EDGE = {"630", "1248", "615", "1233"}, + FF = {"675", "1256", "658", "1239"}, + FF_ESR = {"677", "1260", "660", "1243"}) + // TODO width and height calculation needs to be reworked in HtmlUnit + // but as the calculation might be effected by e.g. current windows style it is not that simple + @HtmlUnitNYI(CHROME = {"605", "1256", "705", "1256"}, + EDGE = {"605", "1256", "705", "1256"}, + FF = {"605", "1256", "705", "1256"}, + FF_ESR = {"605", "1256", "705", "1256"}) + public void changeHeightsAndWidthsQuirks() throws Exception { + final String html = + "\n" + ""; @@ -1086,11 +1318,11 @@ public void typeof() throws Exception { */ @Test @Alerts(DEFAULT = {"undefined", "undefined"}, - FF = {"10", "89"}, + FF = {"12", "89"}, FF_ESR = {"10", "89"}) public void mozInnerScreen() throws Exception { - final String html - = "\n" + ""; @@ -1152,8 +1384,8 @@ public void eval() throws Exception { @Test @Alerts({"true", "I was here"}) public void firedEvent_equals_original_event() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; @@ -2150,8 +2394,8 @@ public void showModalDialog() throws Exception { @Test @Alerts("undefined") public void showModelessDialog() throws Exception { - final String html - = ""; @@ -2166,8 +2410,8 @@ public void showModelessDialog() throws Exception { @Test @Alerts("function") public void find() throws Exception { - final String html - = ""; @@ -2183,8 +2427,8 @@ public void find() throws Exception { @Test @Alerts("\"0.33\"") public void getComputedStylePseudo() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -2273,8 +2518,8 @@ public void getComputedStyleElementDocument() throws Exception { @Test @Alerts({"1", "false", "true", "false", "false"}) public void in() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -2317,15 +2563,16 @@ public void calledTwice() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception true") + @Alerts("TypeError") public void constructor() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -2343,7 +2590,8 @@ public void constructor() throws Exception { @Test @Alerts("0") public void constructorError() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -2366,7 +2614,8 @@ public void constructorError() throws Exception { @Test @Alerts({"false", "false", "test2 alert"}) public void objectCallOnFrameWindow() throws Exception { - final String firstContent = "\n" + final String firstContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -2455,8 +2706,8 @@ public void xmlNotInWindow() throws Exception { @Test @Alerts({"[object Window]", "true", "true"}) public void globalThis() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; @@ -2639,8 +2897,8 @@ public void isSecureContextLocalhost() throws Exception { @Test @Alerts("false") public void isSecureContextHttp() throws Exception { - final String html - = ""; @@ -2668,8 +2926,8 @@ public void isSecureContextHttpS() throws Exception { @Test @Alerts("true") public void isSecureContextFile() throws Exception { - final String html - = ""; @@ -2712,7 +2970,8 @@ public void isSecureContextAboutBlank() throws Exception { @Test @Alerts("inline") public void getComputedStyleShouldLoadOnlyStylesheets() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -2746,7 +3005,8 @@ public void getComputedStyleShouldLoadOnlyStylesheets() throws Exception { @Test @Alerts("length[GSCE]") public void lengthProperty() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + + "\n" + + ""; + + loadPage2(content); + verifyTitle2(DEFAULT_WAIT_TIME, getWebDriver(), getExpectedAlerts()); + } +} diff --git a/src/test/java/org/htmlunit/javascript/host/Window3Test.java b/src/test/java/org/htmlunit/javascript/host/Window3Test.java index 2d7bb53a7a4..f51952b5776 100644 --- a/src/test/java/org/htmlunit/javascript/host/Window3Test.java +++ b/src/test/java/org/htmlunit/javascript/host/Window3Test.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. @@ -27,10 +27,9 @@ import org.apache.commons.lang3.StringUtils; import org.htmlunit.HttpHeader; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.html.HtmlPageTest; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.NotYetImplemented; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.NotYetImplemented; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.By; @@ -62,7 +61,7 @@ public class Window3Test extends WebDriverTestCase { @Test @Alerts("about:blank") public void openWindow_emptyUrl() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + ""; - final String secondContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "Second\n" + + "\n" + + "\n" + "
\n" + ""; - final String thirdContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "Third\n" + final String firstContent = DOCTYPE_HTML + + "\n" + + "First\n" + + "\n" + + "\n" + + "\n" + ""; - final String secondContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "Second\n" + final String secondContent = DOCTYPE_HTML + + "\n" + + "Second\n" + + "\n" + + "\n" + + "\n" + + "\n" + ""; getMockWebConnection().setResponse(URL_SECOND, secondContent); - final String thirdContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "Third\n" + ""; getMockWebConnection().setResponse(urlThird, thirdContent); - final WebDriver driver = loadPageWithAlerts2(firstContent); + final WebDriver driver = loadPage2(firstContent); assertTitle(driver, "First"); + verifyWindowName2(driver, getExpectedAlerts()); } /** @@ -205,7 +223,7 @@ public void javascriptVariableFromNamedFrame() throws Exception { final URL urlThird = new URL(URL_FIRST, "third/"); final URL urlFourth = new URL(URL_FIRST, "fourth/"); - final String firstContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String firstContent = DOCTYPE_HTML + "first\n" + "\n" + " \n" @@ -215,30 +233,41 @@ public void javascriptVariableFromNamedFrame() throws Exception { + " \n" + ""; - final String secondContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "second

second

"; + final String secondContent = DOCTYPE_HTML + + "\n" + + "second\n" + + "\n" + + "\n" + + "

second

"; getMockWebConnection().setResponse(URL_SECOND, secondContent); - final String thirdContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "third

third

"; + final String thirdContent = DOCTYPE_HTML + + "\n" + + "third\n" + + "\n" + + "\n" + + "\n" + + "

third

"; getMockWebConnection().setResponse(urlThird, thirdContent); - final String fourthContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "fourth"; getMockWebConnection().setResponse(urlFourth, fourthContent); - final WebDriver driver = loadPageWithAlerts2(firstContent); + final WebDriver driver = loadPage2(firstContent); assertTitle(driver, "first"); + verifyWindowName2(driver, getExpectedAlerts()); } /** @@ -248,7 +277,7 @@ public void javascriptVariableFromNamedFrame() throws Exception { @Test @Alerts("true") public void javascriptVariableFromWindow_NotFound() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + ""; getMockWebConnection().setResponse(urlFourth, fourthContent); @@ -303,8 +336,9 @@ public void getFrameByName() throws Exception { } setExpectedAlerts(expectedAlerts); - final WebDriver driver = loadPageWithAlerts2(firstContent); + final WebDriver driver = loadPage2(firstContent); assertTitle(driver, "first"); + verifyWindowName2(driver, expectedAlerts); } /** @@ -314,7 +348,7 @@ public void getFrameByName() throws Exception { @Test @Alerts({"false", "false", "true"}) public void closed() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + + "\n" + + "\n" + ""; loadPageVerifyTitle2(html); } @@ -457,15 +492,17 @@ public void scrollBy() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"document", "body"}) + @Alerts({"document [object HTMLDocument]", "body", "window [object HTMLDocument]"}) public void scrollByEvents() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -484,17 +521,17 @@ public void scrollByEvents() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "TypeError", FF = {}, FF_ESR = {}) public void scrollByLines() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + ""; loadPageVerifyTitle2(html); @@ -505,17 +542,17 @@ public void scrollByLines() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "TypeError", FF = {}, FF_ESR = {}) public void scrollByPages() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + ""; loadPageVerifyTitle2(html); @@ -527,7 +564,7 @@ public void scrollByPages() throws Exception { */ @Test public void scrollTo() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" @@ -569,7 +607,7 @@ public void scrollToEvents() throws Exception { @Test @Alerts({"form1", "form1", "2", "2"}) public void formByName() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -1047,7 +1085,7 @@ public void execScript() throws Exception { @Test @Alerts({"test2", "test"}) public void onLoadFunction() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + ""; @@ -1152,9 +1190,9 @@ public void attachOnLoadEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("TypeError") public void detachEventInAttachEvent() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + ""; @@ -1180,7 +1218,9 @@ public void detachEventInAttachEvent() throws Exception { @Test @Alerts({"window.name before: ", "window.name after: main"}) public void windowName() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + shutDownAll(); + + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -1203,7 +1243,7 @@ public void windowName() throws Exception { @Test @Alerts({"number", "number", "number", "number"}) public void viewport() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -1227,13 +1267,13 @@ public void viewport() throws Exception { @Test @Alerts("§§URL§§") public void openWindow_refererHeader() throws Exception { - final String firstContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String firstContent = DOCTYPE_HTML + "\n" + "\n" + "
"}) + @Alerts({"a\\sb", "2", "InvalidCharacterError/DOMException", + "2", "a\\sb", "
"}) public void removeBlank() throws Exception { remove("a b", "' '"); } @@ -1047,7 +1137,8 @@ public void removeBlank() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"a\\sb", "2", "exception", "2", "a\\sb", "
"}) + @Alerts({"a\\sb", "2", "InvalidCharacterError/DOMException", + "2", "a\\sb", "
"}) public void removeTab() throws Exception { remove("a b", "'\t'"); } @@ -1056,7 +1147,8 @@ public void removeTab() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"a\\sb", "2", "exception", "2", "a\\sb", "
"}) + @Alerts({"a\\sb", "2", "InvalidCharacterError/DOMException", + "2", "a\\sb", "
"}) public void removeCr() throws Exception { remove("a b", "'\\r'"); } @@ -1065,7 +1157,8 @@ public void removeCr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"a\\sb", "2", "exception", "2", "a\\sb", "
"}) + @Alerts({"a\\sb", "2", "InvalidCharacterError/DOMException", + "2", "a\\sb", "
"}) public void removeNl() throws Exception { remove("a b", "'\\n'"); } @@ -1121,7 +1214,8 @@ public void removeDuplicated() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"a\\sb\\sa", "2", "exception", "2", "a\\sb\\sa", "
"}) + @Alerts({"a\\sb\\sa", "2", "InvalidCharacterError/DOMException", "2", "a\\sb\\sa", + "
"}) public void removeElementWithBlank() throws Exception { remove("a b a", "'a b'"); } @@ -1130,7 +1224,7 @@ public void removeElementWithBlank() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"a\\sb\\sa\\tb", "2", "exception", "2", "a\\sb\\sa\\tb", + @Alerts({"a\\sb\\sa\\tb", "2", "InvalidCharacterError/DOMException", "2", "a\\sb\\sa\\tb", ""}) public void removeElementWithTab() throws Exception { remove("a b a\tb", "'a\tb'"); @@ -1258,15 +1352,15 @@ public void removeTwoNull() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"a\\sb\\s7", "3", "exception", "3", "a\\sb\\s7", + @Alerts({"a\\sb\\s7", "3", "InvalidCharacterError/DOMException", "3", "a\\sb\\s7", ""}) public void removeTwoObject() throws Exception { remove("a b 7", "'b', { color: 'red' }"); } private void remove(final String in, final String toRemove) throws Exception { - String html - = "\n" + String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -68,9 +69,10 @@ public void createElementWithAngleBrackets() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("InvalidCharacterError/DOMException") public void createElementWithHtml() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -101,7 +103,8 @@ public void createElementWithHtml() throws Exception { @Test @Alerts("false") public void createElementPrototype() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; @@ -457,7 +467,8 @@ public void queryCommandEnabled() throws Exception { FF_ESR = {"false", "false", "false"}) @NotYetImplemented({FF, FF_ESR}) public void queryCommandEnabledDesignMode() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } + /** * @throws Exception if the test fails */ @Test @Alerts({"bar", "null"}) public void getElementById_resetId() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/host/dom/DocumentFragmentTest.java b/src/test/java/org/htmlunit/javascript/host/dom/DocumentFragmentTest.java index 741192f736f..13b94131c1c 100644 --- a/src/test/java/org/htmlunit/javascript/host/dom/DocumentFragmentTest.java +++ b/src/test/java/org/htmlunit/javascript/host/dom/DocumentFragmentTest.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,7 +16,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.junit.Test; import org.junit.runner.RunWith; @@ -41,7 +41,8 @@ public class DocumentFragmentTest extends WebDriverTestCase { FF = "[object CSS2Properties]", FF_ESR = "[object CSS2Properties]") public void getComputedStyleOnChild() throws Exception { - final String html = "\n" + "\n" @@ -52,7 +53,7 @@ public void getComputedStyleOnChild() throws Exception { + " var d = document.createElement('div');\n" + " frag.appendChild(d);\n" + " log(window.getComputedStyle(d, null));\n" - + " } catch (e) { log('exception'); }\n" + + " } catch(e) { logEx(e); }\n" + "\n" + "\n" + ""; @@ -65,8 +66,8 @@ public void getComputedStyleOnChild() throws Exception { */ @Test public void createElement() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + " \n" @@ -658,8 +643,8 @@ public void documentCreateElementUnknown() throws Exception { public void documentCreateElementValidTagNames() throws Exception { expandExpectedAlertsVariables("\\\\"); - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + "\n" @@ -1219,8 +1202,8 @@ public void appendChildAtDocumentLevel() throws Exception { @Test @Alerts("Some Text") public void appendChild_textNode() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -1346,8 +1329,8 @@ public void getElementById_scriptSrc() throws Exception { @Test @Alerts("parentDiv") public void parentNode_Nested() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; + final String html = DOCTYPE_HTML + + ""; final String script = "alert(document.getElementsByTagName('script').length);\n"; getMockWebConnection().setResponse(new URL(URL_FIRST, "script"), script, "text/javascript"); @@ -1831,7 +1817,8 @@ public void getElementsByTagName_LoadScript() throws Exception { @Test @Alerts({"2", "Three", "Four", "1", "Two", "0", "0"}) public void getElementsByTagNameXml() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; loadPageVerifyTitle2(html); @@ -1876,8 +1863,8 @@ public void getElementsByTagNameXml() throws Exception { @Test @Alerts({"HTML", "HEAD", "TITLE", "SCRIPT", "BODY"}) public void all_WithParentheses() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -2079,7 +2065,8 @@ public void all_tags() throws Exception { @Test @Alerts({"false", "false", "undefined"}) public void all() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -2122,7 +2109,8 @@ public void all_Caching() throws Exception { @Test @Alerts({"null", "null", "null"}) public void all_NotExisting() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -2187,7 +2176,8 @@ public void body_read() throws Exception { @Test @Alerts("FRAMESET") public void body_readFrameset() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; @@ -2202,8 +2192,8 @@ public void body_readFrameset() throws Exception { @Test @Alerts({"0", "3", "3", "true", "firstImage"}) public void images() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -2492,7 +2487,8 @@ public void scriptsArray() throws Exception { @Test @Alerts({"object", "FORM"}) public void precedence() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -2512,7 +2508,8 @@ public void precedence() throws Exception { @Test @Alerts({"true", "false"}) public void defaultViewAndParentWindow() throws Exception { - final String html = "\n" + ""; @@ -2601,25 +2597,25 @@ public void createStyleSheet() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("#document-fragment_null_11_null_0_") + @Alerts({"#document-fragment", "null", "11", "null", "0"}) public void createDocumentFragment() throws Exception { - final String html = "foo\n" - + "\n" + + LOG_TEXTAREA + ""; - final WebDriver driver = loadPage2(html); - final String expected = getExpectedAlerts()[0]; - assertEquals(expected, driver.findElement(By.id("myTextarea")).getAttribute("value")); + loadPageVerifyTextArea2(html); } /** @@ -2653,14 +2649,14 @@ public void createEvent_HTMLEvents() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("NotSupportedError/DOMException") public void createEvent_Bogus() throws Exception { createEvent("Bogus"); } private void createEvent(final String eventType) throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -2683,8 +2679,8 @@ private void createEvent(final String eventType) throws Exception { @Test @Alerts({"null", "null", "[object HTMLDivElement]"}) public void createEvent_target() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "
abc
\n" + " \n" + " \n" @@ -2712,8 +2708,8 @@ public void createEvent_target() throws Exception { @Test @Alerts("function onload(event) { log(\"hi\") }") public void createEvent_overridden() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "
abc
\n" + " \n" + " \n" @@ -2740,8 +2736,8 @@ public void createEvent_overridden() throws Exception { @Alerts("test") @NotYetImplemented public void createEvent_caller() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "
abc
\n" + " \n" + " \n" @@ -2767,8 +2763,8 @@ public void createEvent_caller() throws Exception { @Alerts("null") @NotYetImplemented public void caller() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + ""; @@ -2835,7 +2829,8 @@ public void createEventObject_IE() throws Exception { @Test @Alerts("null") public void elementFromPoint() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -3742,4 +3762,173 @@ public void newDoc() throws Exception { loadPageVerifyTitle2(html); } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"0", "0", "8", "1256"}, + EDGE = {"0", "0", "8", "1248"}, + FF = {"0", "0", "8", "1256"}, + FF_ESR = {"0", "0", "8", "1260"}) + @HtmlUnitNYI(EDGE = {"0", "0", "8", "1256"}, + FF_ESR = {"0", "0", "8", "1256"}) + public void documentElementBoundingClientRect() throws Exception { + final String html = DOCTYPE_HTML + + "" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"0", "0", "621", "1256"}, + EDGE = {"0", "0", "630", "1248"}, + FF = {"0", "0", "8", "1256"}, + FF_ESR = {"0", "0", "8", "1260"}) + @HtmlUnitNYI(CHROME = {"0", "0", "613", "1256"}, + EDGE = {"0", "0", "613", "1256"}, + FF = {"0", "0", "613", "1256"}, + FF_ESR = {"0", "0", "613", "1256"}) + public void documentElementBoundingClientRectQuirks() throws Exception { + final String html = + "" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } + + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"0", "0", "8", "1256"}, + EDGE = {"0", "0", "8", "1248"}, + FF = {"0", "0", "8", "1256"}, + FF_ESR = {"0", "0", "8", "1260"}) + @HtmlUnitNYI(EDGE = {"0", "0", "8", "1256"}, + FF_ESR = {"0", "0", "8", "1256"}) + public void documentElementOffset() throws Exception { + final String html = DOCTYPE_HTML + + "" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"0", "0", "621", "1256"}, + EDGE = {"0", "0", "630", "1248"}, + FF = {"0", "0", "8", "1256"}, + FF_ESR = {"0", "0", "8", "1260"}) + @HtmlUnitNYI(CHROME = {"0", "0", "613", "1256"}, + EDGE = {"0", "0", "613", "1256"}, + FF = {"0", "0", "613", "1256"}, + FF_ESR = {"0", "0", "613", "1256"}) + public void documentElementOffsetQuirks() throws Exception { + final String html = + "" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"0", "0", "621", "1256"}, + EDGE = {"0", "0", "630", "1248"}, + FF = {"0", "0", "675", "1256"}, + FF_ESR = {"0", "0", "677", "1260"}) + @HtmlUnitNYI(CHROME = {"0", "0", "605", "1256"}, + EDGE = {"0", "0", "605", "1256"}, + FF = {"0", "0", "605", "1256"}, + FF_ESR = {"0", "0", "605", "1256"}) + public void documentElementClientWidthHeight() throws Exception { + final String html = DOCTYPE_HTML + + "" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"0", "0", "621", "1256"}, + EDGE = {"0", "0", "630", "1248"}, + FF = {"0", "0", "8", "1256"}, + FF_ESR = {"0", "0", "8", "1260"}) + @HtmlUnitNYI(CHROME = {"0", "0", "605", "1256"}, + EDGE = {"0", "0", "605", "1256"}, + FF = {"0", "0", "605", "1256"}, + FF_ESR = {"0", "0", "605", "1256"}) + public void documentElementClientWidthHeightQuirks() throws Exception { + final String html = + "" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } } diff --git a/src/test/java/org/htmlunit/javascript/host/dom/DocumentTypeTest.java b/src/test/java/org/htmlunit/javascript/host/dom/DocumentTypeTest.java index 74cd6a4358d..34e60781df4 100644 --- a/src/test/java/org/htmlunit/javascript/host/dom/DocumentTypeTest.java +++ b/src/test/java/org/htmlunit/javascript/host/dom/DocumentTypeTest.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,8 @@ package org.htmlunit.javascript.host.dom; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.html.HtmlPageTest; import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.MimeType; import org.junit.Test; import org.junit.runner.RunWith; @@ -73,8 +72,8 @@ public void doctype() throws Exception { @Alerts({"[object DocumentType]", "greeting,10,null,undefined,undefined,undefined", "greeting,MyIdentifier,hello.dtd,undefined,undefined,undefined"}) public void doctype_xml() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + "\n" + " \n" + " \n" - + " \n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(html); @@ -120,23 +120,21 @@ public void clickEvents() throws Exception { driver.findElement(By.id("testInput")).click(); driver.findElement(By.id("testImage")).click(); driver.findElement(By.id("testTextarea")).click(); - final String expected = getExpectedAlerts()[0]; - assertEquals(expected, driver.findElement(By.id("myTextarea")).getAttribute("value")); + + verifyTextArea2(driver, getExpectedAlerts()); } /** * @throws Exception if the test fails */ @Test - @Alerts("mousedown label,mouseup label,click label,focus text,click text,") + @Alerts({"mousedown label", "mouseup label", "click label", "focus text", "click text"}) public void clickEventsLabel() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" + "