diff --git a/README.md b/README.md
index 81ccc900797..0bcba5911d4 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# HtmlUnit
-Version 4.2.0 / June 05, 2024
+Version 4.3.0 / June 27, 2024
:heart: [Sponsor](https://github.com/sponsors/rbri)
@@ -49,7 +49,7 @@ Add to your `pom.xml`:
org.htmlunit
htmlunit
- 4.2.0
+ 4.3.0
```
@@ -58,7 +58,7 @@ Add to your `pom.xml`:
Add to your `build.gradle`:
```groovy
-implementation group: 'org.htmlunit', name: 'htmlunit', version: '4.2.0'
+implementation group: 'org.htmlunit', name: 'htmlunit', version: '4.3.0'
```
## Vulnerabilities
@@ -132,7 +132,7 @@ Add the snapshot repository and dependency to your `pom.xml`:
org.htmlunit
htmlunit
- 4.3.0-SNAPSHOT
+ 4.4.0-SNAPSHOT
@@ -151,7 +151,7 @@ repositories {
}
// ...
dependencies {
- implementation group: 'org.htmlunit', name: 'htmlunit', version: '4.2.0-SNAPSHOT'
+ implementation group: 'org.htmlunit', name: 'htmlunit', version: '4.4.0-SNAPSHOT'
// ...
}
```
diff --git a/pom.xml b/pom.xml
index f1263245e29..a3443fcd38b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
4.0.0
org.htmlunit
htmlunit
- 4.2.0
+ 4.3.0
HtmlUnit
Gargoyle Software Inc.
@@ -25,17 +25,17 @@
8
8
- 4.2.0
- 4.2.0
- 4.2.1
- 4.2.0
- 4.2.0
- 4.2.0
+ 4.3.0
+ 4.3.0
+ 4.3.0
+ 4.3.0
+ 4.3.0
+ 4.3.0
4.5.14
- 4.21.0
- 4.21.0
+ 4.22.0
+ 4.22.0
9.4.54.v20240208
2.23.1
@@ -43,7 +43,7 @@
10.17.0
- 4.8.5
+ 4.8.6
6.55.0
4.13.2
1.3.0
@@ -65,7 +65,7 @@
org.apache.maven.plugins
maven-checkstyle-plugin
- 3.3.1
+ 3.4.0
checkstyle.xml
checkstyle_suppressions.xml
@@ -119,7 +119,7 @@
org.apache.maven.plugins
maven-jar-plugin
- 3.4.1
+ 3.4.2
@@ -183,7 +183,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.3.0
org.apache.maven.plugins
@@ -298,7 +298,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.3.0
false
@@ -328,7 +328,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.3.0
false
@@ -359,7 +359,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.3.0
false
@@ -387,7 +387,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.3.0
false
@@ -415,7 +415,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.3.0
false
@@ -445,7 +445,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.3.0
false
@@ -474,7 +474,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.3.0
false
@@ -503,7 +503,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.3.0
false
@@ -532,7 +532,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.3.0
false
@@ -560,7 +560,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.3.0
false
@@ -588,7 +588,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.3.0
false
@@ -616,7 +616,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.3.0
false
@@ -645,7 +645,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.3.0
false
@@ -686,7 +686,7 @@
org.apache.maven.plugins
maven-project-info-reports-plugin
- 3.5.0
+ 3.6.0
org.apache.maven.plugins
@@ -1257,7 +1257,7 @@
commons-net
commons-net
- 3.11.0
+ 3.11.1
commons-codec
@@ -1321,7 +1321,7 @@
com.twelvemonkeys.imageio
imageio-batik
- 3.10.1
+ 3.11.0
test
@@ -1376,7 +1376,7 @@
org.jfree
jfreechart
- 1.5.4
+ 1.5.5
test
@@ -1437,17 +1437,25 @@
${selenium.version}
test
+
+ org.seleniumhq.selenium
+ selenium-devtools-v126
+ ${selenium.version}
+ test
+
+
- sonatype-nexus-snapshots
+ s01-sonatype-nexus-snapshots
https://s01.oss.sonatype.org/content/repositories/snapshots
- sonatype-nexus-staging
+ s01-sonatype-nexus-staging
https://s01.oss.sonatype.org/service/local/staging/deploy/maven2
+
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 0b124c8fc42..3b8ff3f3431 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -7,6 +7,71 @@
+
+
+ Improved implementation of the hidden attribute setter.
+
+
+ core-js: another hack on the const handling (in most cases const no treated like let - this is not correct
+ but avoids the 'constant redefinition' parser error).
+
+
+ Sarissa 0.9.9.7 tests added.
+
+
+ DateTimeFormat.format now takes care of the current browser timezone and locale.
+
+
+ Fix some NPE in HtmlSerializer's.
+
+
+ Improved innerHTML content parsing for special tags like title, textarea, style, and script.
+
+
+ DocumentFragment append()/prepend()/replaceChildren() added.
+
+
+ URL.origin should include the port (if it is not the default one).
+
+
+ Calling new DocumentFragment() now creates a properly initialized object.
+
+
+ XPathEvaluator.createExpression() and XPathExpression.evaluate() added.
+
+
+ Various exceptions fixed when XPathEvaluator.evaluate() is called without some optional parameters.
+
+
+ Documentation for changing the browser timezone/language added.
+
+
+ File.lastModifiedDate formatting fixed.
+
+
+ Document.lastModified now takes care of the browser timezone.
+
+
+ Intl.DateTimeFormat().resolvedOptions().locale support added.
+
+
+ core-js: Date/Time format functions are now taking care of the browser locale.
+
+
+ core-js: Date.prototype.toLocaleString takes care of locales argument.
+
+
+ core-js: Object.defineProperty() has to take care of ConsString.
+
+
+ Upgrade Apache commons-net to 3.11.1.
+
+
+ Fix NPE during click processing when JavaScript engine disabled.
+
+
+
+
INCOMPATIBLE CHANGE: The signature of two methods from org.htmlunit.attachment.AttachmentHandler was changed.
diff --git a/src/main/java/org/htmlunit/BrowserVersion.java b/src/main/java/org/htmlunit/BrowserVersion.java
index 0e130688bd6..986473f86b4 100644
--- a/src/main/java/org/htmlunit/BrowserVersion.java
+++ b/src/main/java/org/htmlunit/BrowserVersion.java
@@ -22,6 +22,7 @@
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
+import java.util.Objects;
import java.util.Set;
import java.util.TimeZone;
@@ -84,7 +85,7 @@ public final class BrowserVersion implements Serializable {
private static final String PLATFORM_WIN32 = "Win32";
/** Latest Firefox. */
- public static final BrowserVersion FIREFOX = new BrowserVersion(126, "FF");
+ public static final BrowserVersion FIREFOX = new BrowserVersion(127, "FF");
private static final int FIREFOX_ESR_NUMERIC = 115;
@@ -92,10 +93,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(125, "Edge");
+ public static final BrowserVersion EDGE = new BrowserVersion(126, "Edge");
/** Latest Chrome. */
- public static final BrowserVersion CHROME = new BrowserVersion(125, "Chrome");
+ public static final BrowserVersion CHROME = new BrowserVersion(126, "Chrome");
/**
* Array with all supported browsers.
@@ -213,9 +214,9 @@ 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_ = "*/*";
- CHROME.secClientHintUserAgentHeader_ = "\"Google Chrome\";v=\""
- + CHROME.getBrowserVersionNumeric() + "\", \"Chromium\";v=\""
- + CHROME.getBrowserVersionNumeric() + "\", \"Not.A/Brand\";v=\"24\"";
+ CHROME.secClientHintUserAgentHeader_ = "\"Not/A)Brand\";v=\"8\", \"Chromium\";v=\""
+ + CHROME.getBrowserVersionNumeric() + "\", \"Google Chrome\";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,
@@ -259,9 +260,9 @@ 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_ = "*/*";
- EDGE.secClientHintUserAgentHeader_ = "\"Microsoft Edge\";v=\""
- + EDGE.getBrowserVersionNumeric() + "\", \"Chromium\";v=\""
- + EDGE.getBrowserVersionNumeric() + "\", \"Not.A/Brand\";v=\"24\"";
+ EDGE.secClientHintUserAgentHeader_ = "\"Not/A)Brand\";v=\"8\", \"Chromium\";v=\""
+ + EDGE.getBrowserVersionNumeric() + "\", \"Microsoft Edge\";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,
@@ -439,6 +440,10 @@ public final class BrowserVersion implements Serializable {
initFeatures();
}
+ public boolean isSameBrowser(final BrowserVersion other) {
+ return Objects.equals(nickname_, other.nickname_) && browserVersionNumeric_ == other.browserVersionNumeric_;
+ }
+
private void initFeatures() {
final SupportedBrowser expectedBrowser;
if (isEdge()) {
diff --git a/src/main/java/org/htmlunit/BrowserVersionFeatures.java b/src/main/java/org/htmlunit/BrowserVersionFeatures.java
index e73d4339ef1..426a628438c 100644
--- a/src/main/java/org/htmlunit/BrowserVersionFeatures.java
+++ b/src/main/java/org/htmlunit/BrowserVersionFeatures.java
@@ -461,7 +461,7 @@ public enum BrowserVersionFeatures {
/**
* The default display style of multicol is 'block'.
*/
- @BrowserFeature({FF, FF_ESR})
+ @BrowserFeature(FF_ESR)
MULTICOL_BLOCK,
/** The protocol setter does not check for special protocols. */
diff --git a/src/main/java/org/htmlunit/css/StyleAttributes.java b/src/main/java/org/htmlunit/css/StyleAttributes.java
index 4da84b245f3..49209c9799d 100644
--- a/src/main/java/org/htmlunit/css/StyleAttributes.java
+++ b/src/main/java/org/htmlunit/css/StyleAttributes.java
@@ -2202,6 +2202,9 @@ public enum Definition {
/** The style property {@code -moz-window-dragging}. */
MOZ_WINDOW_DRAGGING__("-moz-window-dragging", "-moz-window-dragging", ff("default")),
+ /** The style property {@code navigation}. */
+ NAVIGATION("navigation", "navigation", chromeAndEdgeEmpty()),
+
/** The style property {@code negative}. */
NEGATIVE("negative", "negative", chromeAndEdgeEmpty()),
@@ -3142,6 +3145,9 @@ public enum Definition {
/** The style property {@code translate}. */
TRANSLATE("translate", "translate", chromeAndEdgeNone(), ffNone()),
+ /** The style property {@code types}. */
+ TYPES("types", "types", chromeAndEdgeEmpty()),
+
/** The style property {@code unicodeBidi}. */
UNICODE_BIDI("unicodeBidi", "unicode-bidi",
ff("isolate"), chromeAndEdge("isolate")),
diff --git a/src/main/java/org/htmlunit/html/DomElement.java b/src/main/java/org/htmlunit/html/DomElement.java
index ef50b4763af..f98badff843 100644
--- a/src/main/java/org/htmlunit/html/DomElement.java
+++ b/src/main/java/org/htmlunit/html/DomElement.java
@@ -1002,7 +1002,9 @@ public P click(final boolean shiftKey, final boolean ctrlKey, f
}
final AbstractJavaScriptEngine> jsEngine = webClient.getJavaScriptEngine();
- jsEngine.holdPosponedActions();
+ if (webClient.isJavaScriptEnabled()) {
+ jsEngine.holdPosponedActions();
+ }
try {
if (handleFocus) {
// give focus to current element (if possible) or only remove it from previous one
@@ -1051,7 +1053,9 @@ else if (this instanceof HtmlOption) {
return click(event, shiftKey, ctrlKey, altKey, ignoreVisibility);
}
finally {
- jsEngine.processPostponedActions();
+ if (webClient.isJavaScriptEnabled()) {
+ jsEngine.processPostponedActions();
+ }
}
}
}
@@ -1663,7 +1667,6 @@ public void setInnerHtml(final String source) throws SAXException, IOException {
parseHtmlSnippet(source);
}
}
-
}
/**
diff --git a/src/main/java/org/htmlunit/html/DomNamespaceNode.java b/src/main/java/org/htmlunit/html/DomNamespaceNode.java
index ae2f0c7974a..ea62a5f5ff6 100644
--- a/src/main/java/org/htmlunit/html/DomNamespaceNode.java
+++ b/src/main/java/org/htmlunit/html/DomNamespaceNode.java
@@ -68,10 +68,11 @@ protected DomNamespaceNode(final String namespaceURI, final String qualifiedName
*/
@Override
public String getNamespaceURI() {
- if (getPage().isHtmlPage() && !(getPage() instanceof XHtmlPage)
+ if (getPage().isHtmlPage()
+ && !(getPage() instanceof XHtmlPage)
&& Html.XHTML_NAMESPACE.equals(namespaceURI_)
&& XPathHelper.isProcessingXPath()) {
- // for Xalan processing we have to strip the 'default' XHTML namespace for HTML pages to be able to find
+ // for xpath processing we have to strip the 'default' XHTML namespace for HTML pages to be able to find
// the elements by XPath without needing to add the namespace to it
return null;
}
@@ -84,7 +85,8 @@ public String getNamespaceURI() {
@Override
public String getLocalName() {
final boolean caseSensitive = getPage().hasCaseSensitiveTagNames();
- if (!caseSensitive && XPathHelper.isProcessingXPath()) { // and this method was called from Xalan
+ if (!caseSensitive
+ && XPathHelper.isProcessingXPath()) { // and this method was called from xpath processor
return localNameLC_;
}
return localName_;
diff --git a/src/main/java/org/htmlunit/html/HtmlElement.java b/src/main/java/org/htmlunit/html/HtmlElement.java
index f4ee0ba6f36..ec2b4056707 100644
--- a/src/main/java/org/htmlunit/html/HtmlElement.java
+++ b/src/main/java/org/htmlunit/html/HtmlElement.java
@@ -143,6 +143,8 @@ public String value() {
protected static final String ATTRIBUTE_REQUIRED = "required";
/** Constant 'checked'. */
protected static final String ATTRIBUTE_CHECKED = "checked";
+ /** Constant 'hidden'. */
+ protected static final String ATTRIBUTE_HIDDEN = "hidden";
/** The listeners which are to be notified of attribute changes. */
private final List attributeListeners_ = new ArrayList<>();
@@ -1211,7 +1213,34 @@ private String getXPathToken() {
* @return true if the hidden attribute is set.
*/
public boolean isHidden() {
- return ATTRIBUTE_NOT_DEFINED != getAttributeDirect("hidden");
+ return ATTRIBUTE_NOT_DEFINED != getAttributeDirect(ATTRIBUTE_HIDDEN);
+ }
+
+ /**
+ * Sets the {@code hidden} property.
+ * @param hidden the {@code hidden} property
+ */
+ public void setHidden(final String hidden) {
+ if ("false".equalsIgnoreCase(hidden)) {
+ removeAttribute(ATTRIBUTE_HIDDEN);
+ }
+
+ if (StringUtils.isNotEmpty(hidden)) {
+ setAttribute(ATTRIBUTE_HIDDEN, "");
+ }
+ }
+
+ /**
+ * Sets the {@code hidden} property.
+ * @param hidden the {@code hidden} property
+ */
+ public void setHidden(final boolean hidden) {
+ if (hidden) {
+ setAttribute("hidden", "");
+ return;
+ }
+
+ removeAttribute("hidden");
}
/**
diff --git a/src/main/java/org/htmlunit/html/HtmlTitle.java b/src/main/java/org/htmlunit/html/HtmlTitle.java
index 543db8decab..c49e6fc0089 100644
--- a/src/main/java/org/htmlunit/html/HtmlTitle.java
+++ b/src/main/java/org/htmlunit/html/HtmlTitle.java
@@ -79,4 +79,31 @@ protected boolean isEmptyXmlTagExpanded() {
public DisplayStyle getDefaultStyleDisplay() {
return DisplayStyle.NONE;
}
+
+ /**
+ * Returns the {@code text} attribute.
+ * @return the {@code text} attribute
+ */
+ public String getText() {
+ final DomNode firstChild = getFirstChild();
+ if (firstChild != null) {
+ return firstChild.getNodeValue();
+ }
+ return "";
+ }
+
+ /**
+ * Sets the {@code text} attribute.
+ * @param text the {@code text} attribute
+ */
+ public void setText(final String text) {
+ DomNode firstChild = getFirstChild();
+ if (firstChild == null) {
+ firstChild = new DomText(getPage(), text);
+ appendChild(firstChild);
+ }
+ else {
+ firstChild.setNodeValue(text);
+ }
+ }
}
diff --git a/src/main/java/org/htmlunit/html/ScriptElementSupport.java b/src/main/java/org/htmlunit/html/ScriptElementSupport.java
index af8f89f30b8..583211e3365 100644
--- a/src/main/java/org/htmlunit/html/ScriptElementSupport.java
+++ b/src/main/java/org/htmlunit/html/ScriptElementSupport.java
@@ -82,8 +82,8 @@ public static void onAllChildrenAddedToPage(final DomElement element, final bool
final ScriptElement script = (ScriptElement) element;
final String srcAttrib = script.getSrcAttribute();
- final boolean hasSrcAttrib = ATTRIBUTE_NOT_DEFINED == srcAttrib;
- if (!hasSrcAttrib && script.isDeferred()) {
+ final boolean hasNoSrcAttrib = ATTRIBUTE_NOT_DEFINED == srcAttrib;
+ if (!hasNoSrcAttrib && script.isDeferred()) {
return;
}
@@ -91,9 +91,9 @@ public static void onAllChildrenAddedToPage(final DomElement element, final bool
if (webWindow != null) {
final StringBuilder description = new StringBuilder()
.append("Execution of ")
- .append(hasSrcAttrib ? "inline " : "external ")
+ .append(hasNoSrcAttrib ? "inline " : "external ")
.append(element.getClass().getSimpleName());
- if (!hasSrcAttrib) {
+ if (!hasNoSrcAttrib) {
description.append(" (").append(srcAttrib).append(')');
}
final PostponedAction action = new PostponedAction(element.getPage(), description.toString()) {
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 3619e7d59b2..4b63eb689ef 100644
--- a/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java
+++ b/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java
@@ -575,7 +575,9 @@ else if (currentNode_ instanceof HtmlImage) {
@Override
public void endDocument() throws SAXException {
handleCharacters();
- page_.setEndLocation(locator_.getLineNumber(), locator_.getColumnNumber());
+ if (locator_ != null) {
+ page_.setEndLocation(locator_.getLineNumber(), locator_.getColumnNumber());
+ }
}
/** {@inheritDoc} */
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 7393a899727..595a6931afb 100644
--- a/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.java
+++ b/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.java
@@ -134,10 +134,13 @@ public void parseFragment(final DomNode parent, final DomNode context, final Str
node = node.getParentNode();
}
if (ancestors.isEmpty() || !"html".equals(ancestors.get(0).getLocalpart())) {
- ancestors.add(0, new QName(null, "html", null, null));
+ ancestors.add(new QName(null, "html", null, null));
+ ancestors.add(new QName(null, "body", null, null));
}
- if (ancestors.size() == 1 || !"body".equals(ancestors.get(1).getLocalpart())) {
- ancestors.add(1, new QName(null, "body", null, null));
+ else if (ancestors.size() == 1
+ || (!"body".equals(ancestors.get(1).getLocalpart())
+ && !"head".equals(ancestors.get(1).getLocalpart()))) {
+ ancestors.add(new QName(null, "body", null, null));
}
domBuilder.setFeature(HTMLScanner.ALLOW_SELFCLOSING_TAGS, true);
diff --git a/src/main/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText.java b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText.java
index f8e8ac178b5..2c4ab55c875 100644
--- a/src/main/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText.java
+++ b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText.java
@@ -18,7 +18,7 @@
import org.apache.commons.lang3.StringUtils;
import org.htmlunit.BrowserVersion;
-import org.htmlunit.Page;
+import org.htmlunit.SgmlPage;
import org.htmlunit.WebWindow;
import org.htmlunit.css.ComputedCssStyleDeclaration;
import org.htmlunit.css.StyleAttributes.Definition;
@@ -244,31 +244,34 @@ protected void appendDetails(final HtmlSerializerTextBuilder builder,
private static Mode whiteSpaceStyle(final DomNode domNode, final Mode defaultMode) {
if (domNode instanceof DomElement) {
- final Page page = domNode.getPage();
+ final SgmlPage page = domNode.getPage();
if (page != null) {
- final WebWindow window = page.getEnclosingWindow();
- if (window.getWebClient().getOptions().isCssEnabled()) {
+ if (page.getWebClient().getOptions().isCssEnabled()) {
DomNode node = domNode;
while (node != null) {
if (node instanceof DomElement) {
- final ComputedCssStyleDeclaration style =
- window.getComputedStyle((DomElement) domNode, null);
- final String value = style.getStyleAttribute(Definition.WHITE_SPACE, false);
- if (StringUtils.isNoneEmpty(value)) {
- if ("normal".equalsIgnoreCase(value)) {
- return Mode.WHITE_SPACE_NORMAL;
- }
- if ("nowrap".equalsIgnoreCase(value)) {
- return Mode.WHITE_SPACE_NORMAL;
- }
- if ("pre".equalsIgnoreCase(value)) {
- return Mode.WHITE_SPACE_PRE;
- }
- if ("pre-wrap".equalsIgnoreCase(value)) {
- return Mode.WHITE_SPACE_PRE;
- }
- if ("pre-line".equalsIgnoreCase(value)) {
- return Mode.WHITE_SPACE_PRE_LINE;
+ final WebWindow window = page.getEnclosingWindow();
+ if (window != null) {
+ final ComputedCssStyleDeclaration style =
+ window.getComputedStyle((DomElement) domNode, null);
+ final String value = style.getStyleAttribute(Definition.WHITE_SPACE, false);
+
+ if (StringUtils.isNoneEmpty(value)) {
+ if ("normal".equalsIgnoreCase(value)) {
+ return Mode.WHITE_SPACE_NORMAL;
+ }
+ if ("nowrap".equalsIgnoreCase(value)) {
+ return Mode.WHITE_SPACE_NORMAL;
+ }
+ if ("pre".equalsIgnoreCase(value)) {
+ return Mode.WHITE_SPACE_PRE;
+ }
+ if ("pre-wrap".equalsIgnoreCase(value)) {
+ return Mode.WHITE_SPACE_PRE;
+ }
+ if ("pre-line".equalsIgnoreCase(value)) {
+ return Mode.WHITE_SPACE_PRE_LINE;
+ }
}
}
}
@@ -347,6 +350,9 @@ public void appendRequiredLineBreak() {
// see https://drafts.csswg.org/css-text-3/#white-space
public void append(final String content, final Mode mode) {
+ if (content == null) {
+ return;
+ }
int length = content.length();
if (length == 0) {
return;
diff --git a/src/main/java/org/htmlunit/html/serializer/HtmlSerializerNormalizedText.java b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerNormalizedText.java
index 634d82a5de3..3a84d2ad2b1 100644
--- a/src/main/java/org/htmlunit/html/serializer/HtmlSerializerNormalizedText.java
+++ b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerNormalizedText.java
@@ -611,6 +611,9 @@ public HtmlSerializerTextBuilder() {
}
public void append(final String content, final Mode mode) {
+ if (content == null) {
+ return;
+ }
final int length = content.length();
if (length == 0) {
return;
diff --git a/src/main/java/org/htmlunit/html/serializer/HtmlSerializerVisibleText.java b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerVisibleText.java
index 776d9a283e8..3994d67cf16 100644
--- a/src/main/java/org/htmlunit/html/serializer/HtmlSerializerVisibleText.java
+++ b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerVisibleText.java
@@ -793,6 +793,9 @@ public HtmlSerializerTextBuilder() {
// see https://drafts.csswg.org/css-text-3/#white-space
public void append(final String content, final Mode mode) {
+ if (content == null) {
+ return;
+ }
int length = content.length();
if (length == 0) {
return;
diff --git a/src/main/java/org/htmlunit/html/xpath/HtmlUnitPrefixResolver.java b/src/main/java/org/htmlunit/html/xpath/HtmlUnitPrefixResolver.java
index 282e6b7a9c6..46fe6e3feda 100644
--- a/src/main/java/org/htmlunit/html/xpath/HtmlUnitPrefixResolver.java
+++ b/src/main/java/org/htmlunit/html/xpath/HtmlUnitPrefixResolver.java
@@ -29,13 +29,13 @@
* @author Ahmed Ashour
* @author Ronald Brill
*/
-final class HtmlUnitPrefixResolver extends PrefixResolverDefault {
+public final class HtmlUnitPrefixResolver extends PrefixResolverDefault {
/**
* Creates a new instance.
* @param xpathExpressionContext the context from which XPath expression prefixes will be resolved
*/
- HtmlUnitPrefixResolver(final Node xpathExpressionContext) {
+ public HtmlUnitPrefixResolver(final Node xpathExpressionContext) {
super(xpathExpressionContext);
}
diff --git a/src/main/java/org/htmlunit/html/xpath/XPathAdapter.java b/src/main/java/org/htmlunit/html/xpath/XPathAdapter.java
index 7c7b3831fc9..40878ebd579 100644
--- a/src/main/java/org/htmlunit/html/xpath/XPathAdapter.java
+++ b/src/main/java/org/htmlunit/html/xpath/XPathAdapter.java
@@ -35,7 +35,7 @@
* @author Ahmed Ashour
* @author Ronald Brill
*/
-class XPathAdapter {
+public class XPathAdapter {
private enum STATE {
DEFAULT,
@@ -58,22 +58,17 @@ private void initFunctionTable() {
* Constructor.
* @param exprString the XPath expression
* @param prefixResolver a prefix resolver to use to resolve prefixes to namespace URIs
- * @param errorListener the error listener, or {@code null} if default should be used
* @param caseSensitive whether the attributes should be case-sensitive
* @throws TransformerException if a syntax or other error occurs
*/
- XPathAdapter(final String exprString, final PrefixResolver prefixResolver,
- final ErrorListener errorListener, final boolean caseSensitive)
+ public XPathAdapter(final String exprString, final PrefixResolver prefixResolver, final boolean caseSensitive)
throws TransformerException {
initFunctionTable();
- ErrorListener errListener = errorListener;
- if (errListener == null) {
- errListener = new DefaultErrorHandler();
- }
- final XPathParser parser = new XPathParser(errListener);
- final Compiler compiler = new Compiler(errorListener, funcTable_);
+ final ErrorListener errorHandler = new DefaultErrorHandler();
+ final XPathParser parser = new XPathParser(errorHandler);
+ final Compiler compiler = new Compiler(errorHandler, funcTable_);
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 af75f928adf..7d5ce4a750c 100644
--- a/src/main/java/org/htmlunit/html/xpath/XPathHelper.java
+++ b/src/main/java/org/htmlunit/html/xpath/XPathHelper.java
@@ -58,22 +58,50 @@ private XPathHelper() {
* Evaluates an XPath expression from the specified node, returning the resultant nodes.
*
* @param the type class
- * @param node the node to start searching from
+ * @param contextNode the node to start searching from
* @param xpathExpr the XPath expression
- * @param resolver the prefix resolver to use for resolving namespace prefixes, or null
+ * @param prefixResolver the prefix resolver to use for resolving namespace prefixes, or null
* @return the list of objects found
*/
@SuppressWarnings("unchecked")
- public static List getByXPath(final DomNode node, final String xpathExpr,
- final PrefixResolver resolver) {
+ public static List getByXPath(final DomNode contextNode, final String xpathExpr,
+ final PrefixResolver prefixResolver) {
if (xpathExpr == null) {
throw new IllegalArgumentException("Null is not a valid XPath expression");
}
- PROCESS_XPATH_.set(Boolean.TRUE);
+ PrefixResolver resolver = prefixResolver;
+ if (resolver == null) {
+ final Node xpathExpressionContext;
+ if (contextNode.getNodeType() == Node.DOCUMENT_NODE) {
+ xpathExpressionContext = ((Document) contextNode).getDocumentElement();
+ }
+ else {
+ xpathExpressionContext = contextNode;
+ }
+
+ resolver = new HtmlUnitPrefixResolver(xpathExpressionContext);
+ }
+
+ try {
+ final boolean caseSensitive = contextNode.getPage().hasCaseSensitiveTagNames();
+ final XPathAdapter xpath = new XPathAdapter(xpathExpr, resolver, caseSensitive);
+ return getByXPath(contextNode, xpath, prefixResolver);
+ }
+ catch (final Exception e) {
+ throw new RuntimeException("Could not retrieve XPath >" + xpathExpr + "< on " + contextNode, e);
+ }
+ }
+
+ public static List getByXPath(final Node node, final XPathAdapter xpath,
+ final PrefixResolver prefixResolver) throws TransformerException {
final List list = new ArrayList<>();
+
+ PROCESS_XPATH_.set(Boolean.TRUE);
try {
- final XObject result = evaluateXPath(node, xpathExpr, resolver);
+ final XPathContext xpathSupport = new XPathContext();
+ final int ctxtNode = xpathSupport.getDTMHandleFromNode(node);
+ final XObject result = xpath.execute(xpathSupport, ctxtNode, prefixResolver);
if (result instanceof XNodeSet) {
final NodeList nodelist = result.nodelist();
@@ -94,12 +122,10 @@ else if (result instanceof XString) {
throw new RuntimeException("Unproccessed " + result.getClass().getName());
}
}
- catch (final Exception e) {
- throw new RuntimeException("Could not retrieve XPath >" + xpathExpr + "< on " + node, e);
- }
finally {
PROCESS_XPATH_.set(Boolean.FALSE);
}
+
return list;
}
@@ -111,35 +137,4 @@ public static boolean isProcessingXPath() {
return PROCESS_XPATH_.get().booleanValue();
}
- /**
- * Evaluates an XPath expression to an XObject.
- * @param contextNode the node to start searching from
- * @param str a valid XPath string
- * @param prefixResolver prefix resolver to use for resolving namespace prefixes, or null
- * @return an XObject, which can be used to obtain a string, number, nodelist, etc (should never be {@code null})
- * @throws TransformerException if a syntax or other error occurs
- */
- private static XObject evaluateXPath(final DomNode contextNode,
- final String str, final PrefixResolver prefixResolver) throws TransformerException {
- final XPathContext xpathSupport = new XPathContext();
- final Node xpathExpressionContext;
- if (contextNode.getNodeType() == Node.DOCUMENT_NODE) {
- xpathExpressionContext = ((Document) contextNode).getDocumentElement();
- }
- else {
- xpathExpressionContext = contextNode;
- }
-
- PrefixResolver resolver = prefixResolver;
- if (resolver == null) {
- resolver = new HtmlUnitPrefixResolver(xpathExpressionContext);
- }
-
- final boolean caseSensitive = contextNode.getPage().hasCaseSensitiveTagNames();
-
- final XPathAdapter xpath = new XPathAdapter(str, resolver, null, caseSensitive);
- final int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode);
- return xpath.execute(xpathSupport, ctxtNode, prefixResolver);
- }
-
}
diff --git a/src/main/java/org/htmlunit/javascript/HtmlUnitContextFactory.java b/src/main/java/org/htmlunit/javascript/HtmlUnitContextFactory.java
index baa0f9416a4..83c6dddec4e 100644
--- a/src/main/java/org/htmlunit/javascript/HtmlUnitContextFactory.java
+++ b/src/main/java/org/htmlunit/javascript/HtmlUnitContextFactory.java
@@ -244,6 +244,7 @@ protected Context makeContext() {
final TimeoutContext cx = new TimeoutContext(this);
cx.setLanguageVersion(Context.VERSION_ES6);
cx.setLocale(browserVersion_.getBrowserLocale());
+ cx.setTimeZone(browserVersion_.getSystemTimezone());
// make sure no java classes are usable from js
cx.setClassShutter(fullClassName -> {
diff --git a/src/main/java/org/htmlunit/javascript/JavaScriptEngine.java b/src/main/java/org/htmlunit/javascript/JavaScriptEngine.java
index e73896d1d7e..0c670ba113c 100644
--- a/src/main/java/org/htmlunit/javascript/JavaScriptEngine.java
+++ b/src/main/java/org/htmlunit/javascript/JavaScriptEngine.java
@@ -73,7 +73,6 @@
import org.htmlunit.javascript.configuration.JavaScriptConfiguration;
import org.htmlunit.javascript.configuration.ProxyAutoConfigJavaScriptConfiguration;
import org.htmlunit.javascript.host.ConsoleCustom;
-import org.htmlunit.javascript.host.DateCustom;
import org.htmlunit.javascript.host.NumberCustom;
import org.htmlunit.javascript.host.URLSearchParams;
import org.htmlunit.javascript.host.Window;
@@ -435,9 +434,6 @@ public static void configureRhino(final WebClient webClient,
NativeFunctionToStringFunction.installFix(scriptable, browserVersion);
- datePrototype.defineFunctionProperties(new String[] {"toLocaleDateString", "toLocaleTimeString"},
- DateCustom.class, ScriptableObject.DONTENUM);
-
numberPrototype.defineFunctionProperties(new String[] {"toLocaleString"},
NumberCustom.class, ScriptableObject.DONTENUM);
diff --git a/src/main/java/org/htmlunit/javascript/configuration/JavaScriptConfiguration.java b/src/main/java/org/htmlunit/javascript/configuration/JavaScriptConfiguration.java
index 610d4711408..398bf5c2ae4 100644
--- a/src/main/java/org/htmlunit/javascript/configuration/JavaScriptConfiguration.java
+++ b/src/main/java/org/htmlunit/javascript/configuration/JavaScriptConfiguration.java
@@ -67,7 +67,6 @@
import org.htmlunit.javascript.host.URLSearchParams;
import org.htmlunit.javascript.host.WebSocket;
import org.htmlunit.javascript.host.Window;
-import org.htmlunit.javascript.host.XPathExpression;
import org.htmlunit.javascript.host.animations.Animation;
import org.htmlunit.javascript.host.animations.AnimationEvent;
import org.htmlunit.javascript.host.animations.KeyframeEffect;
@@ -164,6 +163,7 @@
import org.htmlunit.javascript.host.dom.Text;
import org.htmlunit.javascript.host.dom.TreeWalker;
import org.htmlunit.javascript.host.dom.XPathEvaluator;
+import org.htmlunit.javascript.host.dom.XPathExpression;
import org.htmlunit.javascript.host.dom.XPathNSResolver;
import org.htmlunit.javascript.host.dom.XPathResult;
import org.htmlunit.javascript.host.event.AudioProcessingEvent;
@@ -715,7 +715,7 @@ public final class JavaScriptConfiguration extends AbstractJavaScriptConfigurati
WebkitSpeechRecognitionEvent.class,
WebSocket.class, WheelEvent.class, Window.class, Worker.class, XMLDocument.class,
XMLHttpRequest.class, XMLHttpRequestEventTarget.class, XMLHttpRequestUpload.class, XMLSerializer.class,
- XPathEvaluator.class, XPathExpression.class,
+ XPathEvaluator.class, XPathEvaluator.class, XPathExpression.class,
XPathNSResolver.class, XPathResult.class, XSLTProcessor.class
};
diff --git a/src/main/java/org/htmlunit/javascript/host/DateCustom.java b/src/main/java/org/htmlunit/javascript/host/DateCustom.java
deleted file mode 100644
index a49b5b13054..00000000000
--- a/src/main/java/org/htmlunit/javascript/host/DateCustom.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.htmlunit.javascript.host;
-
-import java.util.Date;
-
-import org.apache.commons.lang3.time.FastDateFormat;
-import org.htmlunit.BrowserVersion;
-import org.htmlunit.corejs.javascript.Context;
-import org.htmlunit.corejs.javascript.Function;
-import org.htmlunit.corejs.javascript.Scriptable;
-
-/**
- * Contains some missing features of Rhino NativeDate.
- *
- * @author Ahmed Ashour
- * @author Ronald Brill
- * @author Frank Danek
- */
-public final class DateCustom {
-
- private DateCustom() {
- }
-
- /**
- * Converts a date to a string, returning the "date" portion using the operating system's locale's conventions.
- * @param context the JavaScript context
- * @param scope the scope
- * @param thisObj the scriptable
- * @param args the arguments passed into the method
- * @param function the function
- * @return converted string
- */
- public static String toLocaleDateString(final Context context, final Scriptable scope,
- final Scriptable thisObj, final Object[] args, final Function function) {
- final BrowserVersion browserVersion = ((Window) thisObj.getParentScope()).getBrowserVersion();
- final String formatString = "M/d/yyyy";
- final FastDateFormat format = FastDateFormat.getInstance(formatString, browserVersion.getBrowserLocale());
- return format.format(getDateValue(thisObj));
- }
-
- /**
- * Converts a date to a string, returning the "time" portion using the current locale's conventions.
- * @param context the JavaScript context
- * @param scope the scope
- * @param thisObj the scriptable
- * @param args the arguments passed into the method
- * @param function the function
- * @return converted string
- */
- public static String toLocaleTimeString(final Context context, final Scriptable scope,
- final Scriptable thisObj, final Object[] args, final Function function) {
- final String formatString;
- final BrowserVersion browserVersion = ((Window) thisObj.getParentScope()).getBrowserVersion();
- formatString = "h:mm:ss a";
- final FastDateFormat format = FastDateFormat.getInstance(formatString, browserVersion.getBrowserLocale());
- return format.format(getDateValue(thisObj));
- }
-
- private static long getDateValue(final Scriptable thisObj) {
- final Date date = (Date) Context.jsToJava(thisObj, Date.class);
- return date.getTime();
- }
-}
diff --git a/src/main/java/org/htmlunit/javascript/host/URL.java b/src/main/java/org/htmlunit/javascript/host/URL.java
index ebe08c170c6..70503cf857b 100644
--- a/src/main/java/org/htmlunit/javascript/host/URL.java
+++ b/src/main/java/org/htmlunit/javascript/host/URL.java
@@ -260,7 +260,11 @@ public Object getOrigin() {
return null;
}
- return url_.getProtocol() + "://" + url_.getHost();
+ if (url_.getPort() < 0 || url_.getPort() == url_.getDefaultPort()) {
+ return url_.getProtocol() + "://" + url_.getHost();
+ }
+
+ return url_.getProtocol() + "://" + url_.getHost() + ':' + url_.getPort();
}
/**
diff --git a/src/main/java/org/htmlunit/javascript/host/XPathExpression.java b/src/main/java/org/htmlunit/javascript/host/XPathExpression.java
deleted file mode 100644
index 4cb7c84c4bd..00000000000
--- a/src/main/java/org/htmlunit/javascript/host/XPathExpression.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2002-2024 Gargoyle Software Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.htmlunit.javascript.host;
-
-import org.htmlunit.javascript.HtmlUnitScriptable;
-import org.htmlunit.javascript.configuration.JsxClass;
-import org.htmlunit.javascript.configuration.JsxConstructor;
-
-/**
- * A JavaScript object for {@code XPathExpression}.
- *
- * @author Ahmed Ashour
- * @author Ronald Brill
- */
-@JsxClass
-public class XPathExpression extends HtmlUnitScriptable {
-
- /**
- * Creates a new instance.
- */
- public XPathExpression() {
- }
-
- /**
- * JavaScript constructor.
- */
- @JsxConstructor
- public void jsConstructor() {
- }
-}
diff --git a/src/main/java/org/htmlunit/javascript/host/dom/Document.java b/src/main/java/org/htmlunit/javascript/host/dom/Document.java
index 420ef63e38d..01d89310e86 100644
--- a/src/main/java/org/htmlunit/javascript/host/dom/Document.java
+++ b/src/main/java/org/htmlunit/javascript/host/dom/Document.java
@@ -29,7 +29,8 @@
import java.io.IOException;
import java.io.Serializable;
import java.net.URL;
-import java.text.SimpleDateFormat;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
@@ -160,8 +161,9 @@ public class Document extends Node {
/** https://developer.mozilla.org/en/Rich-Text_Editing_in_Mozilla#Executing_Commands */
private static final Set EXECUTE_CMDS_FF = new HashSet<>();
private static final Set EXECUTE_CMDS_CHROME = new HashSet<>();
- /** The format to use for the lastModified attribute. */
- private static final String LAST_MODIFIED_DATE_FORMAT = "MM/dd/yyyy HH:mm:ss";
+ /** The formatter to use for the lastModified attribute. */
+ private static final DateTimeFormatter LAST_MODIFIED_DATE_FORMATTER
+ = DateTimeFormatter.ofPattern("MM/dd/yyyy HH:mm:ss");
/** Contains all supported DOM level 2 events. */
private static final Map> SUPPORTED_DOM2_EVENT_TYPE_MAP;
@@ -1857,7 +1859,9 @@ public String getLastModified() {
else {
lastModified = new Date();
}
- lastModified_ = new SimpleDateFormat(LAST_MODIFIED_DATE_FORMAT, Locale.ROOT).format(lastModified);
+
+ final ZoneId zoneid = Context.getCurrentContext().getTimeZone().toZoneId();
+ lastModified_ = LAST_MODIFIED_DATE_FORMATTER.format(lastModified.toInstant().atZone(zoneid));
}
return lastModified_;
}
diff --git a/src/main/java/org/htmlunit/javascript/host/dom/DocumentFragment.java b/src/main/java/org/htmlunit/javascript/host/dom/DocumentFragment.java
index c860a8ef3da..e354b9a53d7 100644
--- a/src/main/java/org/htmlunit/javascript/host/dom/DocumentFragment.java
+++ b/src/main/java/org/htmlunit/javascript/host/dom/DocumentFragment.java
@@ -14,9 +14,13 @@
*/
package org.htmlunit.javascript.host.dom;
+import org.htmlunit.corejs.javascript.Context;
+import org.htmlunit.corejs.javascript.Function;
+import org.htmlunit.corejs.javascript.Scriptable;
import org.htmlunit.cssparser.parser.CSSException;
import org.htmlunit.html.DomDocumentFragment;
import org.htmlunit.html.DomNode;
+import org.htmlunit.html.HtmlPage;
import org.htmlunit.javascript.HtmlUnitScriptable;
import org.htmlunit.javascript.JavaScriptEngine;
import org.htmlunit.javascript.configuration.JsxClass;
@@ -52,6 +56,55 @@ public DocumentFragment() {
@JsxConstructor
public void jsConstructor() {
super.jsConstructor();
+
+ final HtmlPage page = (HtmlPage) getWindow().getWebWindow().getEnclosedPage();
+ final DomDocumentFragment fragment = new DomDocumentFragment(page);
+ setDomNode(fragment);
+ }
+
+ /**
+ * Inserts a set of Node objects or string objects after the last child
+ * of the document fragment. String objects are inserted as equivalent Text nodes.
+ * @param context the context
+ * @param scope the scope
+ * @param thisObj this object
+ * @param args the arguments
+ * @param function the function
+ */
+ @JsxFunction
+ public static void append(final Context context, final Scriptable scope,
+ final Scriptable thisObj, final Object[] args, final Function function) {
+ Node.append(context, thisObj, args, function);
+ }
+
+ /**
+ * Inserts a set of Node objects or string objects before the first child
+ * of the document fragment. String objects are inserted as equivalent Text nodes.
+ * @param context the context
+ * @param scope the scope
+ * @param thisObj this object
+ * @param args the arguments
+ * @param function the function
+ */
+ @JsxFunction
+ public static void prepend(final Context context, final Scriptable scope,
+ final Scriptable thisObj, final Object[] args, final Function function) {
+ Node.prepend(context, thisObj, args, function);
+ }
+
+ /**
+ * Replaces the existing children of a DocumentFragment with a specified
+ * new set of children. These can be string or Node objects.
+ * @param context the context
+ * @param scope the scope
+ * @param thisObj this object
+ * @param args the arguments
+ * @param function the function
+ */
+ @JsxFunction
+ public static void replaceChildren(final Context context, final Scriptable scope,
+ final Scriptable thisObj, final Object[] args, final Function function) {
+ Node.replaceChildren(context, thisObj, args, function);
}
/**
diff --git a/src/main/java/org/htmlunit/javascript/host/dom/Node.java b/src/main/java/org/htmlunit/javascript/host/dom/Node.java
index 48773329af7..9c8364405b1 100644
--- a/src/main/java/org/htmlunit/javascript/host/dom/Node.java
+++ b/src/main/java/org/htmlunit/javascript/host/dom/Node.java
@@ -967,16 +967,16 @@ protected static void after(final Context context, final Scriptable thisObj, fin
*/
protected static void append(final Context context, final Scriptable thisObj, final Object[] args,
final Function function) {
- if (!(thisObj instanceof Element)) {
+ if (!(thisObj instanceof Node)) {
throw JavaScriptEngine.typeError("Illegal invocation");
}
- final DomNode thisDomNode = ((Node) thisObj).getDomNodeOrDie();
+ final Node thisNode = (Node) thisObj;
+ final DomNode thisDomNode = thisNode.getDomNodeOrDie();
for (final Object arg : args) {
- final Node node = toNodeOrTextNode((Node) thisObj, arg);
- final DomNode newNode = node.getDomNodeOrDie();
- thisDomNode.appendChild(newNode);
+ final Node node = toNodeOrTextNode(thisNode, arg);
+ thisDomNode.appendChild(node.getDomNodeOrDie());
}
}
@@ -990,14 +990,16 @@ protected static void append(final Context context, final Scriptable thisObj, fi
*/
protected static void prepend(final Context context, final Scriptable thisObj, final Object[] args,
final Function function) {
- if (!(thisObj instanceof Element)) {
+ if (!(thisObj instanceof Node)) {
throw JavaScriptEngine.typeError("Illegal invocation");
}
- final DomNode thisDomNode = ((Node) thisObj).getDomNodeOrDie();
+ final Node thisNode = (Node) thisObj;
+ final DomNode thisDomNode = thisNode.getDomNodeOrDie();
final DomNode firstChild = thisDomNode.getFirstChild();
+
for (final Object arg : args) {
- final Node node = toNodeOrTextNode((Node) thisObj, arg);
+ final Node node = toNodeOrTextNode(thisNode, arg);
final DomNode newNode = node.getDomNodeOrDie();
if (firstChild == null) {
thisDomNode.appendChild(newNode);
@@ -1018,15 +1020,16 @@ protected static void prepend(final Context context, final Scriptable thisObj, f
*/
protected static void replaceChildren(final Context context, final Scriptable thisObj, final Object[] args,
final Function function) {
- if (!(thisObj instanceof Element)) {
+ if (!(thisObj instanceof Node)) {
throw JavaScriptEngine.typeError("Illegal invocation");
}
- final DomNode thisDomNode = ((Node) thisObj).getDomNodeOrDie();
+ final Node thisNode = (Node) thisObj;
+ final DomNode thisDomNode = thisNode.getDomNodeOrDie();
thisDomNode.removeAllChildren();
for (final Object arg : args) {
- final Node node = toNodeOrTextNode((Node) thisObj, arg);
+ final Node node = toNodeOrTextNode(thisNode, arg);
thisDomNode.appendChild(node.getDomNodeOrDie());
}
}
diff --git a/src/main/java/org/htmlunit/javascript/host/dom/XPathEvaluator.java b/src/main/java/org/htmlunit/javascript/host/dom/XPathEvaluator.java
index ef8feef1d52..1b33d05d50d 100644
--- a/src/main/java/org/htmlunit/javascript/host/dom/XPathEvaluator.java
+++ b/src/main/java/org/htmlunit/javascript/host/dom/XPathEvaluator.java
@@ -14,13 +14,18 @@
*/
package org.htmlunit.javascript.host.dom;
+import org.htmlunit.corejs.javascript.Context;
+import org.htmlunit.corejs.javascript.Function;
import org.htmlunit.corejs.javascript.NativeFunction;
+import org.htmlunit.corejs.javascript.Scriptable;
+import org.htmlunit.html.DomNode;
import org.htmlunit.javascript.HtmlUnitScriptable;
import org.htmlunit.javascript.JavaScriptEngine;
import org.htmlunit.javascript.configuration.JsxClass;
import org.htmlunit.javascript.configuration.JsxConstructor;
import org.htmlunit.javascript.configuration.JsxFunction;
import org.htmlunit.javascript.host.NativeFunctionPrefixResolver;
+import org.htmlunit.javascript.host.Window;
import org.htmlunit.xpath.xml.utils.PrefixResolver;
/**
@@ -76,12 +81,6 @@ public XPathNSResolver createNSResolver(final Node nodeResolver) {
public XPathResult evaluate(final String expression, final Object contextNodeObj,
final Object resolver, final int type, final Object result) {
try {
- XPathResult xPathResult = (XPathResult) result;
- if (xPathResult == null) {
- xPathResult = new XPathResult();
- xPathResult.setParentScope(getParentScope());
- xPathResult.setPrototype(getPrototype(xPathResult.getClass()));
- }
// contextNodeObj can be either a node or an array with the node as the first element.
if (!(contextNodeObj instanceof Node)) {
throw JavaScriptEngine.reportRuntimeError("Illegal value for parameter 'context'");
@@ -96,6 +95,17 @@ else if (resolver instanceof NativeFunction) {
prefixResolver = new NativeFunctionPrefixResolver(
(NativeFunction) resolver, contextNode.getParentScope());
}
+
+ final XPathResult xPathResult;
+ if (result instanceof XPathResult) {
+ xPathResult = (XPathResult) result;
+ }
+ else {
+ xPathResult = new XPathResult();
+ xPathResult.setParentScope(getParentScope());
+ xPathResult.setPrototype(getPrototype(xPathResult.getClass()));
+ }
+
xPathResult.init(contextNode.getDomNodeOrDie().getByXPath(expression, prefixResolver), type);
return xPathResult;
}
@@ -104,4 +114,48 @@ else if (resolver instanceof NativeFunction) {
}
}
+ /**
+ * Compiles an XPathExpression which can then be used for (repeated) evaluations of the XPath expression.
+ * @param context the context
+ * @param scope the scope
+ * @param thisObj this object
+ * @param args the arguments
+ * @param function the function
+ * @return a XPathExpression representing the compiled form of the XPath expression.
+ */
+ @JsxFunction
+ public static XPathExpression createExpression(final Context context, final Scriptable scope,
+ final Scriptable thisObj, final Object[] args, final Function function) {
+ if (args.length < 1) {
+ throw JavaScriptEngine.reportRuntimeError("Missing 'expression' parameter");
+ }
+
+ PrefixResolver prefixResolver = null;
+ if (args.length > 1) {
+ final Object resolver = args[1];
+ if (resolver instanceof PrefixResolver) {
+ prefixResolver = (PrefixResolver) resolver;
+ }
+ else if (resolver instanceof NativeFunction) {
+ prefixResolver = new NativeFunctionPrefixResolver(
+ (NativeFunction) resolver, scope.getParentScope());
+ }
+ }
+
+ final XPathEvaluator evaluator = (XPathEvaluator) thisObj;
+
+ try {
+ final String xpath = JavaScriptEngine.toString(args[0]);
+ final DomNode doc = ((Window) scope).getDocument().getDocumentElement().getDomNodeOrDie();
+ final XPathExpression xPathExpression = new XPathExpression(xpath, prefixResolver, doc);
+ xPathExpression.setParentScope(evaluator.getParentScope());
+ xPathExpression.setPrototype(evaluator.getPrototype(xPathExpression.getClass()));
+
+ return xPathExpression;
+ }
+ catch (final Exception e) {
+ throw JavaScriptEngine.constructError("SyntaxError",
+ "Failed to compile xpath '" + args[0] + "' (" + e.getMessage() + ")");
+ }
+ }
}
diff --git a/src/main/java/org/htmlunit/javascript/host/dom/XPathExpression.java b/src/main/java/org/htmlunit/javascript/host/dom/XPathExpression.java
new file mode 100644
index 00000000000..4eda0f6577c
--- /dev/null
+++ b/src/main/java/org/htmlunit/javascript/host/dom/XPathExpression.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2002-2024 Gargoyle Software Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.htmlunit.javascript.host.dom;
+
+import javax.xml.transform.TransformerException;
+
+import org.htmlunit.corejs.javascript.Context;
+import org.htmlunit.corejs.javascript.Function;
+import org.htmlunit.corejs.javascript.Scriptable;
+import org.htmlunit.html.DomNode;
+import org.htmlunit.html.xpath.HtmlUnitPrefixResolver;
+import org.htmlunit.html.xpath.XPathAdapter;
+import org.htmlunit.html.xpath.XPathHelper;
+import org.htmlunit.javascript.HtmlUnitScriptable;
+import org.htmlunit.javascript.JavaScriptEngine;
+import org.htmlunit.javascript.configuration.JsxClass;
+import org.htmlunit.javascript.configuration.JsxConstructor;
+import org.htmlunit.javascript.configuration.JsxFunction;
+import org.htmlunit.xpath.xml.utils.PrefixResolver;
+import org.w3c.dom.Node;
+
+/**
+ * A JavaScript object for {@code XPathExpression}.
+ *
+ * @author Ahmed Ashour
+ * @author Ronald Brill
+ */
+@JsxClass
+public class XPathExpression extends HtmlUnitScriptable {
+
+ private final XPathAdapter xpath_;
+ private final PrefixResolver prefixResolver_;
+
+ /**
+ * Default constructor.
+ */
+ public XPathExpression() {
+ xpath_ = null;
+ prefixResolver_ = null;
+ }
+
+ /**
+ * JavaScript constructor.
+ */
+ @JsxConstructor
+ public void jsConstructor() {
+ }
+
+ XPathExpression(final String expression, final PrefixResolver prefixResolver,
+ final DomNode node) throws TransformerException {
+ PrefixResolver resolver = prefixResolver;
+ if (resolver == null) {
+ resolver = new HtmlUnitPrefixResolver(node);
+ }
+ prefixResolver_ = resolver;
+ final boolean caseSensitive = node.getPage().hasCaseSensitiveTagNames();
+ xpath_ = new XPathAdapter(expression, prefixResolver, caseSensitive);
+ }
+
+ /**
+ * Executes an XPath expression on the given node or document and returns an XPathResult.
+ * @param context the context
+ * @param scope the scope
+ * @param thisObj this object
+ * @param args the arguments
+ * @param function the function
+ * @return the result of the evaluation of the XPath expression
+ */
+ @JsxFunction
+ public static XPathResult evaluate(final Context context, final Scriptable scope,
+ final Scriptable thisObj, final Object[] args, final Function function) {
+ if (args.length < 1) {
+ throw JavaScriptEngine.reportRuntimeError("Missing 'contextNode' parameter");
+ }
+
+ int type = 0; // ANY
+ if (args.length > 1) {
+ type = (int) JavaScriptEngine.toInteger(args[1]);
+ }
+
+ Object result = null;
+ if (args.length > 2) {
+ result = args[2];
+ }
+
+ try {
+ final XPathExpression expression = (XPathExpression) thisObj;
+
+ final Object contextNodeObj = args[0];
+ if (!(contextNodeObj instanceof org.htmlunit.javascript.host.dom.Node)) {
+ throw JavaScriptEngine.reportRuntimeError("Illegal value for parameter 'context'");
+ }
+
+ final Node contextNode = ((org.htmlunit.javascript.host.dom.Node) contextNodeObj).getDomNodeOrDie();
+
+ final XPathResult xPathResult;
+ if (result instanceof XPathResult) {
+ xPathResult = (XPathResult) result;
+ }
+ else {
+ xPathResult = new XPathResult();
+ xPathResult.setParentScope(expression.getParentScope());
+ xPathResult.setPrototype(expression.getPrototype(xPathResult.getClass()));
+ }
+
+ xPathResult.init(XPathHelper.getByXPath(contextNode, expression.xpath_, expression.prefixResolver_), type);
+ return xPathResult;
+ }
+ catch (final Exception e) {
+ throw JavaScriptEngine.reportRuntimeError("Failed to execute 'evaluate': " + e.getMessage());
+ }
+ }
+}
diff --git a/src/main/java/org/htmlunit/javascript/host/file/File.java b/src/main/java/org/htmlunit/javascript/host/file/File.java
index 6dcb9b9c4db..2abbefbe329 100644
--- a/src/main/java/org/htmlunit/javascript/host/file/File.java
+++ b/src/main/java/org/htmlunit/javascript/host/file/File.java
@@ -19,13 +19,13 @@
import java.io.IOException;
import java.nio.charset.StandardCharsets;
-import java.util.Date;
-import java.util.Locale;
-import java.util.TimeZone;
+import java.time.Instant;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.time.FastDateFormat;
import org.htmlunit.BrowserVersion;
+import org.htmlunit.corejs.javascript.Context;
import org.htmlunit.corejs.javascript.NativeArray;
import org.htmlunit.corejs.javascript.ScriptableObject;
import org.htmlunit.javascript.JavaScriptEngine;
@@ -42,7 +42,8 @@
*/
@JsxClass
public class File extends Blob {
- private static final String LAST_MODIFIED_DATE_FORMAT = "EEE MMM dd yyyy HH:mm:ss 'GMT'Z (zzzz)";
+ private static final DateTimeFormatter LAST_MODIFIED_DATE_FORMATTER
+ = DateTimeFormatter.ofPattern("EEE MMM dd yyyy HH:mm:ss 'GMT'Z");
private static class FileBackend extends Backend {
private final java.io.File file_;
@@ -139,13 +140,14 @@ public String getName() {
*/
@JsxGetter({CHROME, EDGE})
public String getLastModifiedDate() {
- final Date date = new Date(getLastModified());
- final BrowserVersion browser = getBrowserVersion();
- final Locale locale = browser.getBrowserLocale();
- final TimeZone timezone = browser.getSystemTimezone();
-
- final FastDateFormat format = FastDateFormat.getInstance(LAST_MODIFIED_DATE_FORMAT, timezone, locale);
- return format.format(date);
+ final Context cx = Context.getCurrentContext();
+ final ZoneId zoneid = cx.getTimeZone().toZoneId();
+
+ // strange only the time zone is locale dependent
+ String date = LAST_MODIFIED_DATE_FORMATTER.format(Instant.ofEpochMilli(getLastModified()).atZone(zoneid));
+ date += DateTimeFormatter.ofPattern(" (zzzz)", cx.getLocale())
+ .format(Instant.ofEpochMilli(getLastModified()).atZone(zoneid));
+ return date;
}
/**
diff --git a/src/main/java/org/htmlunit/javascript/host/html/HTMLElement.java b/src/main/java/org/htmlunit/javascript/host/html/HTMLElement.java
index e580725d1ae..cc1b4d4c064 100644
--- a/src/main/java/org/htmlunit/javascript/host/html/HTMLElement.java
+++ b/src/main/java/org/htmlunit/javascript/host/html/HTMLElement.java
@@ -1607,13 +1607,12 @@ public boolean isHidden() {
* @param hidden the {@code hidden} value
*/
@JsxSetter
- public void setHidden(final boolean hidden) {
- if (hidden) {
- getDomNodeOrDie().setAttribute("hidden", "hidden");
- }
- else {
- getDomNodeOrDie().removeAttribute("hidden");
+ public void setHidden(final Object hidden) {
+ if (hidden instanceof Boolean) {
+ getDomNodeOrDie().setHidden((Boolean) hidden);
+ return;
}
+ getDomNodeOrDie().setHidden(JavaScriptEngine.toString(hidden));
}
/**
diff --git a/src/main/java/org/htmlunit/javascript/host/html/HTMLTitleElement.java b/src/main/java/org/htmlunit/javascript/host/html/HTMLTitleElement.java
index 3b601b3f738..ab7d927110a 100644
--- a/src/main/java/org/htmlunit/javascript/host/html/HTMLTitleElement.java
+++ b/src/main/java/org/htmlunit/javascript/host/html/HTMLTitleElement.java
@@ -14,8 +14,6 @@
*/
package org.htmlunit.javascript.host.html;
-import org.htmlunit.html.DomNode;
-import org.htmlunit.html.DomText;
import org.htmlunit.html.HtmlTitle;
import org.htmlunit.javascript.configuration.JsxClass;
import org.htmlunit.javascript.configuration.JsxConstructor;
@@ -53,11 +51,8 @@ public void jsConstructor() {
*/
@JsxGetter
public Object getText() {
- final DomNode firstChild = getDomNodeOrDie().getFirstChild();
- if (firstChild != null) {
- return firstChild.getNodeValue();
- }
- return "";
+ final HtmlTitle htmlTitle = (HtmlTitle) getDomNodeOrDie();
+ return htmlTitle.getText();
}
/**
@@ -66,14 +61,7 @@ public Object getText() {
*/
@JsxSetter
public void setText(final String text) {
- final DomNode htmlElement = getDomNodeOrDie();
- DomNode firstChild = htmlElement.getFirstChild();
- if (firstChild == null) {
- firstChild = new DomText(htmlElement.getPage(), text);
- htmlElement.appendChild(firstChild);
- }
- else {
- firstChild.setNodeValue(text);
- }
+ final HtmlTitle htmlTitle = (HtmlTitle) getDomNodeOrDie();
+ htmlTitle.setText(text);
}
}
diff --git a/src/main/java/org/htmlunit/javascript/host/intl/DateTimeFormat.java b/src/main/java/org/htmlunit/javascript/host/intl/DateTimeFormat.java
index f21623755ee..c9bf0f9bc98 100644
--- a/src/main/java/org/htmlunit/javascript/host/intl/DateTimeFormat.java
+++ b/src/main/java/org/htmlunit/javascript/host/intl/DateTimeFormat.java
@@ -27,6 +27,7 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import org.apache.commons.lang3.StringUtils;
import org.htmlunit.BrowserVersion;
import org.htmlunit.corejs.javascript.Context;
import org.htmlunit.corejs.javascript.Function;
@@ -69,7 +70,7 @@ public class DateTimeFormat extends HtmlUnitScriptable {
final String yyyyDotBlankDot = "\u200EYYYY\u200E. \u200EMM\u200E. \u200Edd.";
final Map commonFormats = new HashMap<>();
- commonFormats.put("", mmSlash);
+ commonFormats.put("", ddDot);
commonFormats.put("ar", "dd\u200F/MM\u200F/YYYY");
commonFormats.put("ar-SA", "d\u200F/M\u200F/YYYY هـ");
commonFormats.put("ban", mmSlash);
@@ -80,6 +81,7 @@ public class DateTimeFormat extends HtmlUnitScriptable {
commonFormats.put("da", ddDot);
commonFormats.put("de", ddDot);
commonFormats.put("el", ddSlash);
+ commonFormats.put("en", mmSlash);
commonFormats.put("en-CA", yyyyDash);
commonFormats.put("en-NZ", ddSlash);
commonFormats.put("en-PA", ddSlash);
@@ -173,8 +175,8 @@ else if (browserVersion.isFirefoxESR()) {
formats = FF_FORMATS_;
}
- String locale = "";
- String pattern = null;
+ String locale = browserVersion.getBrowserLocale().toLanguageTag();
+ String pattern = getPattern(formats, locale);
for (final String l : locales) {
pattern = getPattern(formats, l);
@@ -186,6 +188,7 @@ else if (browserVersion.isFirefoxESR()) {
if (pattern == null) {
pattern = formats.get("");
}
+
if (!locale.startsWith("ar")) {
pattern = pattern.replace("\u200E", "");
}
@@ -230,8 +233,9 @@ public static Scriptable jsConstructor(final Context cx, final Scriptable scope,
}
}
else {
- locales = new String[] {""};
+ locales = new String[0];
}
+
final Window window = getWindow(ctorObj);
final DateTimeFormat format = new DateTimeFormat(locales, window.getBrowserVersion());
format.setParentScope(window);
@@ -247,7 +251,7 @@ public static Scriptable jsConstructor(final Context cx, final Scriptable scope,
@JsxFunction
public String format(final Object object) {
final Date date = (Date) Context.jsToJava(object, Date.class);
- return formatter_.format(date);
+ return formatter_.format(date, Context.getCurrentContext().getTimeZone().toZoneId());
}
/**
@@ -256,7 +260,17 @@ public String format(final Object object) {
*/
@JsxFunction
public Scriptable resolvedOptions() {
- return Context.getCurrentContext().newObject(getParentScope());
+ final Context cx = Context.getCurrentContext();
+ final Scriptable options = cx.newObject(getParentScope());
+ options.put("timeZone", options, cx.getTimeZone().getID());
+
+ if (StringUtils.isEmpty(formatter_.locale_)) {
+ options.put("locale", options, cx.getLocale().toLanguageTag());
+ }
+ else {
+ options.put("locale", options, formatter_.locale_);
+ }
+ return options;
}
/**
@@ -266,8 +280,10 @@ static final class DateTimeFormatHelper {
private final DateTimeFormatter formatter_;
private Chronology chronology_;
+ private String locale_;
DateTimeFormatHelper(final String locale, final BrowserVersion browserVersion, final String pattern) {
+ locale_ = locale;
if (locale.startsWith("ar")
&& (!"ar-DZ".equals(locale)
&& !"ar-LY".equals(locale)
@@ -301,10 +317,11 @@ static final class DateTimeFormatHelper {
/**
* Formats a date according to the locale and formatting options of this {@code DateTimeFormat} object.
* @param date the JavaScript object to convert
+ * @param cx the current context
* @return the dated formated
*/
- String format(final Date date) {
- TemporalAccessor zonedDateTime = date.toInstant().atZone(ZoneId.systemDefault());
+ String format(final Date date, final ZoneId zoneId) {
+ TemporalAccessor zonedDateTime = date.toInstant().atZone(zoneId);
if (chronology_ != null) {
zonedDateTime = chronology_.date(zonedDateTime);
}
diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml
index 4fef4a595b7..7cd4e7b110c 100644
--- a/src/site/xdoc/index.xml
+++ b/src/site/xdoc/index.xml
@@ -67,9 +67,9 @@
- Latest release June 05, 2024
+ Latest release June 27, 2024
- version 4.2.0
+ version 4.3.0
Source code
@@ -194,7 +194,7 @@
org.htmlunit
htmlunit
- 4.2.0
+ 4.3.0
]]>
@@ -237,6 +237,7 @@
MochiKit 1.4.2: Full support (see unit tests here )
GWT 2.5.0: Full support (see unit test here )
Sarissa 0.9.9.3: Full support (see unit test here )
+ Sarissa 0.9.9.7: Full support (see unit test here )
MooTools 1.2.1: Full support (see unit test here )
Prototype 1.7.1 (1.6.0, 1.6.1): Full support (see unit test here )
Ext JS 2.2: Very good support (see unit test here )
diff --git a/src/site/xdoc/webclient.xml b/src/site/xdoc/webclient.xml
index aa571009ecb..66c50d7c1e7 100644
--- a/src/site/xdoc/webclient.xml
+++ b/src/site/xdoc/webclient.xml
@@ -35,8 +35,7 @@ try (final WebClient webClient = new WebClient()) {
Often you will want to simulate a specific browser. This is done by passing a
org.htmlunit.BrowserVersion into the WebClient constructor.
- Constants have been provided for some common browsers, but you can create your own specific
- version by instantiating a BrowserVersion.
+ Constants have been provided for some common browsers.
- Specifying this BrowserVersion will change the user agent header that is sent up to the
- server and will change the behavior of some of the JavaScript.
+ Specifying this BrowserVersion will change
+
+ the user agent HTTP header,
+ the values and the order of many other HTTP headers,
+ the list of supported mime types,
+ the behavior of the web client,
+ the supported javascript methods and and also the behaviour of some js functions,
+ the behavior of the web client, and
+ the default values for various css properties
+
+ to match the real browsers.
-
-
-
- There are various options available to make fine grained adjustments to the browser.
-
- In most cases, it should be sufficient to use the predefined BrowserVersion constants.
+
+
+
+ There are various options available to make fine grained adjustments to the browser.
+
+
-
- The default values for most options are similar to the default values
- of real browsers - but (as always) there is one important exception:
- HtmlUnit stops the Javascript execution at the first unhandled exception -
- Browsers do not stop. You can change this by changing the throwExceptionOnScriptError
- option to false.
-
-
+ The default values for most options are similar to the default values
+ of real browsers - but (as always) there is one important exception:
+ HtmlUnit stops the Javascript execution at the first unhandled exception -
+ Browsers do not stop. You can change this by changing the throwExceptionOnScriptError
+ option to false.
+
+
-
- For a complete list and more details please have a look at the
- WebClientOptions API .
-
+
+ For a complete list and more details please have a look at the
+ WebClientOptions API .
+
+
+
+
+
+ Changing the language/time zone cannot be done from the options, it must be done before the WebClient is created.
+ All Browser Versions are shipped with 'en-US' as language and 'America/New_York' as timezone.
+ To change these default settings, a customised copy of the corresponding BrowserVersion must be created using the
+ BrowserVersionBuilder. This new BrowserVersion can then be used to create a WebClient.
+
+
+
+ There is no support for changing the language/timezone after the WebClient has been created.
+ For more details please have a look at the
+ BrowserVersion.BrowserVersionBuilder API .
+
+
diff --git a/src/test/java/org/htmlunit/BrowserVersionTest.java b/src/test/java/org/htmlunit/BrowserVersionTest.java
index c01a2a83249..c719cdf1b91 100644
--- a/src/test/java/org/htmlunit/BrowserVersionTest.java
+++ b/src/test/java/org/htmlunit/BrowserVersionTest.java
@@ -38,10 +38,10 @@ public class BrowserVersionTest {
*/
@Test
public void getBrowserVersionNumeric() {
- assertEquals(126, BrowserVersion.FIREFOX.getBrowserVersionNumeric());
+ assertEquals(127, BrowserVersion.FIREFOX.getBrowserVersionNumeric());
assertEquals(115, BrowserVersion.FIREFOX_ESR.getBrowserVersionNumeric());
- assertEquals(125, BrowserVersion.CHROME.getBrowserVersionNumeric());
- assertEquals(125, BrowserVersion.EDGE.getBrowserVersionNumeric());
+ assertEquals(126, BrowserVersion.CHROME.getBrowserVersionNumeric());
+ assertEquals(126, BrowserVersion.EDGE.getBrowserVersionNumeric());
}
/**
diff --git a/src/test/java/org/htmlunit/ExternalTest.java b/src/test/java/org/htmlunit/ExternalTest.java
index 2668843647d..33397d9ef00 100644
--- a/src/test/java/org/htmlunit/ExternalTest.java
+++ b/src/test/java/org/htmlunit/ExternalTest.java
@@ -54,11 +54,11 @@ public class ExternalTest {
static String MAVEN_REPO_URL_ = "https://repo1.maven.org/maven2/";
/** Chrome driver. */
- static String CHROME_DRIVER_ = "125.0.6422";
+ static String CHROME_DRIVER_ = "126.0.6478";
static String CHROME_DRIVER_URL_ =
"https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json";
- static String EDGE_DRIVER_ = "125.0.2535";
+ static String EDGE_DRIVER_ = "126.0.2592";
static String EDGE_DRIVER_URL_ = "https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/";
/** Gecko driver. */
@@ -340,7 +340,8 @@ private static boolean isIgnored(@SuppressWarnings("unused") final String groupI
// pmd 7 has problems parsing our code
if ("maven-pmd-plugin".equals(artifactId)
- && ("3.22.0".equals(version))) {
+ && ("3.22.0".equals(version)
+ || "3.23.0".equals(version))) {
return true;
}
System.out.println(artifactId + " " + version);
diff --git a/src/test/java/org/htmlunit/WebClient3Test.java b/src/test/java/org/htmlunit/WebClient3Test.java
index 737b69495a7..a91a4a70389 100644
--- a/src/test/java/org/htmlunit/WebClient3Test.java
+++ b/src/test/java/org/htmlunit/WebClient3Test.java
@@ -29,6 +29,7 @@
import org.htmlunit.html.HtmlInlineFrame;
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.util.MimeType;
import org.htmlunit.util.NameValuePair;
@@ -581,4 +582,64 @@ private void encodingCharset(final String title,
assertEquals(title, driver.getTitle());
}
}
+
+ /**
+ * @throws Exception if the test fails
+ */
+ @Test
+ @Alerts({"en-US", "en-US,en"})
+ public void language() throws Exception {
+ final String html
+ = "\n"
+ + "";
+
+ shutDownAll();
+ try {
+ loadPageVerifyTitle2(html);
+ }
+ finally {
+ shutDownAll();
+ }
+ }
+
+ /**
+ * @throws Exception if the test fails
+ */
+ @Test
+ @Alerts(DEFAULT = {"de-DE", "de-DE,de,en-US,en"},
+ FF = {"de-DE", "de-DE,de"},
+ FF_ESR = {"de-DE", "de-DE,de"})
+ @HtmlUnitNYI(CHROME = {"de-DE", "de-DE,de"},
+ EDGE = {"de-DE", "de-DE,de"})
+ public void languageDE() throws Exception {
+ final String html
+ = "\n"
+ + "";
+
+ shutDownAll();
+ try {
+ final BrowserVersion.BrowserVersionBuilder builder
+ = new BrowserVersion.BrowserVersionBuilder(getBrowserVersion());
+ builder.setBrowserLanguage("de-DE");
+ builder.setAcceptLanguageHeader("de-DE,de");
+ setBrowserVersion(builder.build());
+
+ loadPageVerifyTitle2(html);
+ }
+ finally {
+ shutDownAll();
+ }
+ }
}
diff --git a/src/test/java/org/htmlunit/WebClient8Test.java b/src/test/java/org/htmlunit/WebClient8Test.java
index d720fa0e728..5d3de29667f 100644
--- a/src/test/java/org/htmlunit/WebClient8Test.java
+++ b/src/test/java/org/htmlunit/WebClient8Test.java
@@ -396,4 +396,22 @@ public void imageEventHandlersWithNoJs() throws Exception {
loadPage(webClient, html, null, URL_FIRST);
}
}
+
+ /**
+ * @throws Exception if something goes wrong
+ */
+ @Test
+ public void clickWithNoJs() throws Exception {
+ final String html = "\n"
+ + "\n"
+ + "\n"
+ + " \n"
+ + " \n"
+ + " \n"
+ + "";
+
+ try (WebClient webClient = new WebClient(getBrowserVersion(), false, null, -1)) {
+ loadPage(webClient, html, null, URL_FIRST);
+ }
+ }
}
diff --git a/src/test/java/org/htmlunit/WebDriverTestCase.java b/src/test/java/org/htmlunit/WebDriverTestCase.java
index 5cc63a10315..e3eaa0e5c64 100644
--- a/src/test/java/org/htmlunit/WebDriverTestCase.java
+++ b/src/test/java/org/htmlunit/WebDriverTestCase.java
@@ -89,6 +89,8 @@
import org.openqa.selenium.chrome.ChromeDriver;
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.edge.EdgeDriver;
import org.openqa.selenium.edge.EdgeDriverService;
import org.openqa.selenium.edge.EdgeOptions;
@@ -490,7 +492,7 @@ public void setUseStandards(final boolean useStandards) {
*/
protected WebDriver buildWebDriver() throws IOException {
if (useRealBrowser()) {
- if (BrowserVersion.EDGE == getBrowserVersion()) {
+ if (BrowserVersion.EDGE.isSameBrowser(getBrowserVersion())) {
final EdgeDriverService service = new EdgeDriverService.Builder()
.withLogOutput(System.out)
.usingDriverExecutable(new File(EDGE_BIN_))
@@ -500,14 +502,24 @@ protected WebDriver buildWebDriver() throws IOException {
.build();
+ final String locale = getBrowserVersion().getBrowserLocale().toLanguageTag();
+
final EdgeOptions options = new EdgeOptions();
- // options.addArguments("--lang=en-US");
- // options.addArguments("--remote-allow-origins=*");
+ options.addArguments("--lang=" + locale);
+ options.addArguments("--remote-allow-origins=*");
+
+ final EdgeDriver edge = new EdgeDriver(service, options);
+
+ final DevTools devTools = edge.getDevTools();
+ devTools.createSession();
- return new EdgeDriver(service, options);
+ final String tz = getBrowserVersion().getSystemTimezone().getID();
+ devTools.send(Emulation.setTimezoneOverride(tz));
+
+ return edge;
}
- if (BrowserVersion.CHROME == getBrowserVersion()) {
+ if (BrowserVersion.CHROME.isSameBrowser(getBrowserVersion())) {
final ChromeDriverService service = new ChromeDriverService.Builder()
.withLogOutput(System.out)
.usingDriverExecutable(new File(CHROME_BIN_))
@@ -517,18 +529,28 @@ protected WebDriver buildWebDriver() throws IOException {
.build();
+ final String locale = getBrowserVersion().getBrowserLocale().toLanguageTag();
+
final ChromeOptions options = new ChromeOptions();
- options.addArguments("--lang=en-US");
+ options.addArguments("--lang=" + locale);
options.addArguments("--remote-allow-origins=*");
- return new ChromeDriver(service, options);
+ final ChromeDriver chrome = new ChromeDriver(service, options);
+
+ final DevTools devTools = chrome.getDevTools();
+ devTools.createSession();
+
+ final String tz = getBrowserVersion().getSystemTimezone().getID();
+ devTools.send(Emulation.setTimezoneOverride(tz));
+
+ return chrome;
}
- if (BrowserVersion.FIREFOX == getBrowserVersion()) {
+ if (BrowserVersion.FIREFOX.isSameBrowser(getBrowserVersion())) {
return createFirefoxDriver(GECKO_BIN_, FF_BIN_);
}
- if (BrowserVersion.FIREFOX_ESR == getBrowserVersion()) {
+ if (BrowserVersion.FIREFOX_ESR.isSameBrowser(getBrowserVersion())) {
return createFirefoxDriver(GECKO_BIN_, FF_ESR_BIN_);
}
@@ -536,13 +558,17 @@ protected WebDriver buildWebDriver() throws IOException {
}
if (webDriver_ == null) {
+
+ final BrowserVersion browserVersion = getBrowserVersion();
+
final DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setBrowserName(Browser.HTMLUNIT.browserName());
- capabilities.setVersion(getBrowserName(getBrowserVersion()));
+ capabilities.setVersion(getBrowserName(browserVersion));
+
webDriver_ = new HtmlUnitDriver(capabilities) {
@Override
protected WebClient newWebClient(final BrowserVersion version) {
- final WebClient webClient = super.newWebClient(version);
+ final WebClient webClient = super.newWebClient(browserVersion);
if (isWebClientCached()) {
webClient.getOptions().setHistorySizeLimit(0);
}
@@ -559,7 +585,7 @@ protected WebClient newWebClient(final BrowserVersion version) {
return webDriver_;
}
- private static FirefoxDriver createFirefoxDriver(final String geckodriverBinary, final String binary) {
+ private FirefoxDriver createFirefoxDriver(final String geckodriverBinary, final String binary) {
final FirefoxDriverService service = new GeckoDriverService.Builder()
.withLogOutput(System.out)
.usingDriverExecutable(new File(geckodriverBinary))
@@ -568,9 +594,17 @@ private static FirefoxDriver createFirefoxDriver(final String geckodriverBinary,
final FirefoxOptions options = new FirefoxOptions();
options.setBinary(binary);
+ final String tz = getBrowserVersion().getSystemTimezone().getID();
+
+ String locale = getBrowserVersion().getBrowserLocale().toLanguageTag();
+ locale = locale + "," + getBrowserVersion().getBrowserLocale().getLanguage();
+
final FirefoxProfile profile = new FirefoxProfile();
- profile.setPreference("intl.accept_languages", "en-US,en");
+ profile.setPreference("intl.accept_languages", locale);
+ // no idea so far how to set this
+ // profile.setPreference("intl.tz", tz);
options.setProfile(profile);
+
return new FirefoxDriver(service, options);
}
diff --git a/src/test/java/org/htmlunit/general/ElementDefaultStyleDisplayTest.java b/src/test/java/org/htmlunit/general/ElementDefaultStyleDisplayTest.java
index da4f669a9e9..d20b883a715 100644
--- a/src/test/java/org/htmlunit/general/ElementDefaultStyleDisplayTest.java
+++ b/src/test/java/org/htmlunit/general/ElementDefaultStyleDisplayTest.java
@@ -940,7 +940,6 @@ public void meter() throws Exception {
*/
@Test
@Alerts(DEFAULT = {"", "inline"},
- FF = {"", "block"},
FF_ESR = {"", "block"})
public void multicol() throws Exception {
test("multicol");
diff --git a/src/test/java/org/htmlunit/general/ElementOwnPropertiesTest.java b/src/test/java/org/htmlunit/general/ElementOwnPropertiesTest.java
index 8c3e50e2685..4a238b6cea5 100644
--- a/src/test/java/org/htmlunit/general/ElementOwnPropertiesTest.java
+++ b/src/test/java/org/htmlunit/general/ElementOwnPropertiesTest.java
@@ -40,6 +40,7 @@
import org.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration;
import org.htmlunit.javascript.host.dom.CDATASection;
import org.htmlunit.javascript.host.dom.NodeList;
+import org.htmlunit.javascript.host.dom.XPathEvaluator;
import org.htmlunit.javascript.host.dom.XPathResult;
import org.htmlunit.javascript.host.html.HTMLCollection;
import org.htmlunit.javascript.host.performance.Performance;
@@ -85,7 +86,7 @@ private void testString(final String preparation, final String string) throws Ex
+ " var div = document.createElement('div');\n"
+ " var svg = document.getElementById('mySvg');\n"
+ " try{\n"
- + " " + preparation + "\n"
+ + " " + preparation + "\n"
+ " process(" + string + ");\n"
+ " } catch (e) {\n"
+ " log('exception');\n"
@@ -106,10 +107,11 @@ private void testString(final String preparation, final String string) throws Ex
// TODO remove if fixed in Rhino
+ " if ('__proto__' == property) continue;\n"
- + " if (typeof object[property] == 'function') {\n"
+
+ + " let desc = Object.getOwnPropertyDescriptor(object.constructor.prototype, property);\n"
+ + " if (desc.get === undefined && typeof object[property] == 'function') {\n"
+ " all.push(property + '()');\n"
+ " } else {\n"
- + " let desc = Object.getOwnPropertyDescriptor(object.constructor.prototype, property);\n"
+ " property += '[';\n"
+ " if (desc.get != undefined) property += 'G';\n"
+ " if (desc.set != undefined) property += 'S';\n"
@@ -935,7 +937,7 @@ public void event() throws Exception {
+ "ondragenter[GSCE],ondragleave[GSCE],ondragover[GSCE],ondragstart[GSCE],ondrop[GSCE],"
+ "ondurationchange[GSCE],onemptied[GSCE],onended[GSCE],onerror[GSCE],onfocus[GSCE],"
+ "ongotpointercapture[GSCE],onhashchange[GSCE],oninput[GSCE],oninvalid[GSCE],onkeydown[GSCE],"
- + "onkeypress[GSCE],onkeyup[GSCE],onlanguagechange[GSCE],onload(),onloadeddata[GSCE],"
+ + "onkeypress[GSCE],onkeyup[GSCE],onlanguagechange[GSCE],onload[GSCE],onloadeddata[GSCE],"
+ "onloadedmetadata[GSCE],onloadstart[GSCE],onlostpointercapture[GSCE],onmessage[GSCE],"
+ "onmousedown[GSCE],onmouseenter[GSCE],onmouseleave[GSCE],onmousemove[GSCE],onmouseout[GSCE],"
+ "onmouseover[GSCE],onmouseup[GSCE],onmousewheel[GSCE],onoffline[GSCE],ononline[GSCE],"
@@ -966,7 +968,7 @@ public void event() throws Exception {
+ "ondragenter[GSCE],ondragleave[GSCE],ondragover[GSCE],ondragstart[GSCE],ondrop[GSCE],"
+ "ondurationchange[GSCE],onemptied[GSCE],onended[GSCE],onerror[GSCE],onfocus[GSCE],"
+ "ongotpointercapture[GSCE],onhashchange[GSCE],oninput[GSCE],oninvalid[GSCE],onkeydown[GSCE],"
- + "onkeypress[GSCE],onkeyup[GSCE],onlanguagechange[GSCE],onload(),onloadeddata[GSCE],"
+ + "onkeypress[GSCE],onkeyup[GSCE],onlanguagechange[GSCE],onload[GSCE],onloadeddata[GSCE],"
+ "onloadedmetadata[GSCE],onloadstart[GSCE],onlostpointercapture[GSCE],onmessage[GSCE],"
+ "onmousedown[GSCE],onmouseenter[GSCE],onmouseleave[GSCE],onmousemove[GSCE],onmouseout[GSCE],"
+ "onmouseover[GSCE],onmouseup[GSCE],onmousewheel[GSCE],onoffline[GSCE],ononline[GSCE],"
@@ -998,7 +1000,7 @@ public void event() throws Exception {
+ "ondeviceorientation[GSCE],ondrag[GSCE],ondragend[GSCE],ondragenter[GSCE],"
+ "ondragleave[GSCE],ondragover[GSCE],ondragstart[GSCE],ondrop[GSCE],ondurationchange[GSCE],"
+ "onemptied[GSCE],onended[GSCE],onerror[GSCE],onfocus[GSCE],onhashchange[GSCE],oninput[GSCE],"
- + "oninvalid[GSCE],onkeydown[GSCE],onkeypress[GSCE],onkeyup[GSCE],onlanguagechange[GSCE],onload(),"
+ + "oninvalid[GSCE],onkeydown[GSCE],onkeypress[GSCE],onkeyup[GSCE],onlanguagechange[GSCE],onload[GSCE],"
+ "onloadeddata[GSCE],onloadedmetadata[GSCE],onloadstart[GSCE],onmessage[GSCE],onmousedown[GSCE],"
+ "onmouseenter[GSCE],onmouseleave[GSCE],onmousemove[GSCE],onmouseout[GSCE],onmouseover[GSCE],"
+ "onmouseup[GSCE],onmozfullscreenchange[GSCE],onmozfullscreenerror[GSCE],onoffline[GSCE],"
@@ -1025,7 +1027,7 @@ public void event() throws Exception {
+ "ondeviceorientation[GSCE],ondrag[GSCE],ondragend[GSCE],ondragenter[GSCE],"
+ "ondragleave[GSCE],ondragover[GSCE],ondragstart[GSCE],ondrop[GSCE],ondurationchange[GSCE],"
+ "onemptied[GSCE],onended[GSCE],onerror[GSCE],onfocus[GSCE],onhashchange[GSCE],oninput[GSCE],"
- + "oninvalid[GSCE],onkeydown[GSCE],onkeypress[GSCE],onkeyup[GSCE],onlanguagechange[GSCE],onload(),"
+ + "oninvalid[GSCE],onkeydown[GSCE],onkeypress[GSCE],onkeyup[GSCE],onlanguagechange[GSCE],onload[GSCE],"
+ "onloadeddata[GSCE],onloadedmetadata[GSCE],onloadstart[GSCE],onmessage[GSCE],onmousedown[GSCE],"
+ "onmouseenter[GSCE],onmouseleave[GSCE],onmousemove[GSCE],onmouseout[GSCE],onmouseover[GSCE],"
+ "onmouseup[GSCE],onmozfullscreenchange[GSCE],onmozfullscreenerror[GSCE],onoffline[GSCE],"
@@ -3269,14 +3271,14 @@ public void blockquote() throws Exception {
@Test
@Alerts(CHROME = "aLink[GSCE],background[GSCE],bgColor[GSCE],constructor(),link[GSCE],onafterprint[GSCE],"
+ "onbeforeprint[GSCE],onbeforeunload[GSCE],onblur[GSCE],onerror[GSCE],onfocus[GSCE],"
- + "onhashchange[GSCE],onlanguagechange[GSCE],onload(),onmessage[GSCE],onmessageerror[GSCE],"
+ + "onhashchange[GSCE],onlanguagechange[GSCE],onload[GSCE],onmessage[GSCE],onmessageerror[GSCE],"
+ "onoffline[GSCE],ononline[GSCE],onpagehide[GSCE],onpageshow[GSCE],onpopstate[GSCE],"
+ "onrejectionhandled[GSCE],onresize[GSCE],onscroll[GSCE],onstorage[GSCE],"
+ "onunhandledrejection[GSCE],onunload[GSCE],text[GSCE],"
+ "vLink[GSCE]",
EDGE = "aLink[GSCE],background[GSCE],bgColor[GSCE],constructor(),link[GSCE],onafterprint[GSCE],"
+ "onbeforeprint[GSCE],onbeforeunload[GSCE],onblur[GSCE],onerror[GSCE],onfocus[GSCE],"
- + "onhashchange[GSCE],onlanguagechange[GSCE],onload(),onmessage[GSCE],onmessageerror[GSCE],"
+ + "onhashchange[GSCE],onlanguagechange[GSCE],onload[GSCE],onmessage[GSCE],onmessageerror[GSCE],"
+ "onoffline[GSCE],ononline[GSCE],onpagehide[GSCE],onpageshow[GSCE],onpopstate[GSCE],"
+ "onrejectionhandled[GSCE],onresize[GSCE],onscroll[GSCE],onstorage[GSCE],"
+ "onunhandledrejection[GSCE],onunload[GSCE],text[GSCE],"
@@ -6118,13 +6120,13 @@ public void frame() throws Exception {
*/
@Test
@Alerts(CHROME = "cols[GSCE],constructor(),onafterprint[GSCE],onbeforeprint[GSCE],onbeforeunload[GSCE],"
- + "onblur[GSCE],onerror[GSCE],onfocus[GSCE],onhashchange[GSCE],onlanguagechange[GSCE],onload(),"
+ + "onblur[GSCE],onerror[GSCE],onfocus[GSCE],onhashchange[GSCE],onlanguagechange[GSCE],onload[GSCE],"
+ "onmessage[GSCE],onmessageerror[GSCE],onoffline[GSCE],ononline[GSCE],onpagehide[GSCE],"
+ "onpageshow[GSCE],onpopstate[GSCE],onrejectionhandled[GSCE],onresize[GSCE],onscroll[GSCE],"
+ "onstorage[GSCE],onunhandledrejection[GSCE],onunload[GSCE],"
+ "rows[GSCE]",
EDGE = "cols[GSCE],constructor(),onafterprint[GSCE],onbeforeprint[GSCE],onbeforeunload[GSCE],"
- + "onblur[GSCE],onerror[GSCE],onfocus[GSCE],onhashchange[GSCE],onlanguagechange[GSCE],onload(),"
+ + "onblur[GSCE],onerror[GSCE],onfocus[GSCE],onhashchange[GSCE],onlanguagechange[GSCE],onload[GSCE],"
+ "onmessage[GSCE],onmessageerror[GSCE],onoffline[GSCE],ononline[GSCE],onpagehide[GSCE],"
+ "onpageshow[GSCE],onpopstate[GSCE],onrejectionhandled[GSCE],onresize[GSCE],onscroll[GSCE],"
+ "onstorage[GSCE],onunhandledrejection[GSCE],onunload[GSCE],"
@@ -6514,16 +6516,18 @@ public void html() throws Exception {
*/
@Test
@Alerts(CHROME = "adAuctionHeaders[GSCE],align[GSCE],allow[GSCE],allowFullscreen[GSCE],allowPaymentRequest[GSCE],"
- + "constructor(),contentDocument[GCE],contentWindow[GCE],credentialless[GSCE],csp[GSCE],"
- + "featurePolicy[GCE],frameBorder[GSCE],getSVGDocument(),height[GSCE],loading[GSCE],longDesc[GSCE],"
- + "marginHeight[GSCE],marginWidth[GSCE],name[GSCE],privateToken[GSCE],referrerPolicy[GSCE],"
- + "sandbox[GSCE],scrolling[GSCE],sharedStorageWritable[GSCE],src[GSCE],srcdoc[GSCE],"
+ + "browsingTopics[GSCE],constructor(),contentDocument[GCE],contentWindow[GCE],credentialless[GSCE],"
+ + "csp[GSCE],featurePolicy[GCE],frameBorder[GSCE],getSVGDocument(),height[GSCE],loading[GSCE],"
+ + "longDesc[GSCE],marginHeight[GSCE],marginWidth[GSCE],name[GSCE],privateToken[GSCE],"
+ + "referrerPolicy[GSCE],sandbox[GSCE],scrolling[GSCE],sharedStorageWritable[GSCE],src[GSCE],"
+ + "srcdoc[GSCE],"
+ "width[GSCE]",
EDGE = "adAuctionHeaders[GSCE],align[GSCE],allow[GSCE],allowFullscreen[GSCE],allowPaymentRequest[GSCE],"
- + "constructor(),contentDocument[GCE],contentWindow[GCE],credentialless[GSCE],csp[GSCE],"
- + "featurePolicy[GCE],frameBorder[GSCE],getSVGDocument(),height[GSCE],loading[GSCE],longDesc[GSCE],"
- + "marginHeight[GSCE],marginWidth[GSCE],name[GSCE],privateToken[GSCE],referrerPolicy[GSCE],"
- + "sandbox[GSCE],scrolling[GSCE],sharedStorageWritable[GSCE],src[GSCE],srcdoc[GSCE],"
+ + "browsingTopics[GSCE],constructor(),contentDocument[GCE],contentWindow[GCE],credentialless[GSCE],"
+ + "csp[GSCE],featurePolicy[GCE],frameBorder[GSCE],getSVGDocument(),height[GSCE],loading[GSCE],"
+ + "longDesc[GSCE],marginHeight[GSCE],marginWidth[GSCE],name[GSCE],privateToken[GSCE],"
+ + "referrerPolicy[GSCE],sandbox[GSCE],scrolling[GSCE],sharedStorageWritable[GSCE],src[GSCE],"
+ + "srcdoc[GSCE],"
+ "width[GSCE]",
FF = "align[GSCE],allow[GSCE],allowFullscreen[GSCE],constructor(),contentDocument[GCE],"
+ "contentWindow[GCE],frameBorder[GSCE],getSVGDocument(),height[GSCE],loading[GSCE],longDesc[GSCE],"
@@ -13781,17 +13785,13 @@ public void var() throws Exception {
@Alerts(CHROME = "cancelVideoFrameCallback(),constructor(),disablePictureInPicture[GSCE],getVideoPlaybackQuality(),"
+ "height[GSCE],onenterpictureinpicture[GSCE],onleavepictureinpicture[GSCE],playsInline[GSCE],"
+ "poster[GSCE],requestPictureInPicture(),requestVideoFrameCallback(),videoHeight[GCE],"
- + "videoWidth[GCE],webkitDecodedFrameCount[GCE],webkitDisplayingFullscreen[GCE],"
- + "webkitDroppedFrameCount[GCE],webkitEnterFullScreen(),webkitEnterFullscreen(),"
- + "webkitExitFullScreen(),webkitExitFullscreen(),webkitSupportsFullscreen[GCE],"
+ + "videoWidth[GCE],webkitDecodedFrameCount[GCE],webkitDroppedFrameCount[GCE],"
+ "width[GSCE]",
EDGE = "cancelVideoFrameCallback(),constructor(),disablePictureInPicture[GSCE],getVideoPlaybackQuality(),"
+ "height[GSCE],msGetVideoProcessingTypes(),msVideoProcessing[GSCE],onenterpictureinpicture[GSCE],"
+ "onleavepictureinpicture[GSCE],playsInline[GSCE],poster[GSCE],requestPictureInPicture(),"
+ "requestVideoFrameCallback(),videoHeight[GCE],videoWidth[GCE],webkitDecodedFrameCount[GCE],"
- + "webkitDisplayingFullscreen[GCE],webkitDroppedFrameCount[GCE],webkitEnterFullScreen(),"
- + "webkitEnterFullscreen(),webkitExitFullScreen(),webkitExitFullscreen(),"
- + "webkitSupportsFullscreen[GCE],"
+ + "webkitDroppedFrameCount[GCE],"
+ "width[GSCE]",
FF = "constructor(),disablePictureInPicture[GSCE],getVideoPlaybackQuality(),height[GSCE],"
+ "mozDecodedFrames[GCE],mozFrameDelay[GCE],mozHasAudio[GCE],mozPaintedFrames[GCE],"
@@ -14785,9 +14785,9 @@ public void slot() throws Exception {
*/
@Test
@Alerts(CHROME = "activeElement[GCE],adoptedStyleSheets[GSCE],adoptNode(),alinkColor[GSCE],all[GCE],anchors[GCE],"
- + "append(),applets[GCE],bgColor[GSCE],body[GSCE],captureEvents(),caretRangeFromPoint(),"
- + "characterSet[GCE],charset[GCE],childElementCount[GCE],children[GCE],clear(),close(),"
- + "compatMode[GCE],constructor(),contentType[GCE],cookie[GSCE],createAttribute(),"
+ + "append(),applets[GCE],bgColor[GSCE],body[GSCE],browsingTopics(),captureEvents(),"
+ + "caretRangeFromPoint(),characterSet[GCE],charset[GCE],childElementCount[GCE],children[GCE],"
+ + "clear(),close(),compatMode[GCE],constructor(),contentType[GCE],cookie[GSCE],createAttribute(),"
+ "createAttributeNS(),createCDATASection(),createComment(),createDocumentFragment(),"
+ "createElement(),createElementNS(),createEvent(),createExpression(),createNodeIterator(),"
+ "createNSResolver(),createProcessingInstruction(),createRange(),createTextNode(),"
@@ -14838,9 +14838,9 @@ public void slot() throws Exception {
+ "xmlStandalone[GSCE],"
+ "xmlVersion[GSCE]",
EDGE = "activeElement[GCE],adoptedStyleSheets[GSCE],adoptNode(),alinkColor[GSCE],all[GCE],anchors[GCE],"
- + "append(),applets[GCE],bgColor[GSCE],body[GSCE],captureEvents(),caretRangeFromPoint(),"
- + "characterSet[GCE],charset[GCE],childElementCount[GCE],children[GCE],clear(),close(),"
- + "compatMode[GCE],constructor(),contentType[GCE],cookie[GSCE],createAttribute(),"
+ + "append(),applets[GCE],bgColor[GSCE],body[GSCE],browsingTopics(),captureEvents(),"
+ + "caretRangeFromPoint(),characterSet[GCE],charset[GCE],childElementCount[GCE],children[GCE],"
+ + "clear(),close(),compatMode[GCE],constructor(),contentType[GCE],cookie[GSCE],createAttribute(),"
+ "createAttributeNS(),createCDATASection(),createComment(),createDocumentFragment(),"
+ "createElement(),createElementNS(),createEvent(),createExpression(),createNodeIterator(),"
+ "createNSResolver(),createProcessingInstruction(),createRange(),createTextNode(),"
@@ -15287,14 +15287,6 @@ public void range() throws Exception {
FF_ESR = "append(),childElementCount[GCE],children[GCE],constructor(),firstElementChild[GCE],"
+ "getElementById(),lastElementChild[GCE],prepend(),querySelector(),querySelectorAll(),"
+ "replaceChildren()")
- @HtmlUnitNYI(CHROME = "childElementCount[GCE],children[GCE],constructor(),firstElementChild[GCE],"
- + "getElementById(),lastElementChild[GCE],querySelector(),querySelectorAll()",
- EDGE = "childElementCount[GCE],children[GCE],constructor(),firstElementChild[GCE],"
- + "getElementById(),lastElementChild[GCE],querySelector(),querySelectorAll()",
- FF_ESR = "childElementCount[GCE],children[GCE],constructor(),firstElementChild[GCE],"
- + "getElementById(),lastElementChild[GCE],querySelector(),querySelectorAll()",
- FF = "childElementCount[GCE],children[GCE],constructor(),firstElementChild[GCE],"
- + "getElementById(),lastElementChild[GCE],querySelector(),querySelectorAll()")
public void documentFragment() throws Exception {
testString("", "document.createDocumentFragment()");
}
@@ -17105,16 +17097,64 @@ public void cryptoSubtle() throws Exception {
testString("", "window.crypto.subtle");
}
+ /**
+ * Test {@link XPathEvaluator}.
+ *
+ * @throws Exception if the test fails
+ */
+ @Test
+ @Alerts(CHROME = "constructor(),createExpression(),createNSResolver(),evaluate()",
+ EDGE = "constructor(),createExpression(),createNSResolver(),evaluate()",
+ FF = "constructor(),createExpression(),createNSResolver(),evaluate()",
+ FF_ESR = "constructor(),createExpression(),createNSResolver(),evaluate()")
+ public void xPathEvaluator() throws Exception {
+ testString("", "new XPathEvaluator()");
+ }
+
+ /**
+ * Test {@link XPathExpression}.
+ *
+ * @throws Exception if the test fails
+ */
+ @Test
+ @Alerts(CHROME = "constructor(),evaluate()",
+ EDGE = "constructor(),evaluate()",
+ FF = "constructor(),evaluate()",
+ FF_ESR = "constructor(),evaluate()")
+ public void xPathExpression() throws Exception {
+ testString("var res = new XPathEvaluator().createExpression('//span')", "res");
+ }
+
/**
* Test {@link XPathResult}.
*
* @throws Exception if the test fails
*/
@Test
- @Alerts(CHROME = "exception",
- EDGE = "exception",
- FF = "exception",
- FF_ESR = "exception")
+ @Alerts(CHROME = "ANY_TYPE[E],ANY_UNORDERED_NODE_TYPE[E],BOOLEAN_TYPE[E],booleanValue[GCE],constructor(),"
+ + "FIRST_ORDERED_NODE_TYPE[E],invalidIteratorState[GCE],iterateNext(),NUMBER_TYPE[E],"
+ + "numberValue[GCE],ORDERED_NODE_ITERATOR_TYPE[E],ORDERED_NODE_SNAPSHOT_TYPE[E],resultType[GCE],"
+ + "singleNodeValue[GCE],snapshotItem(),snapshotLength[GCE],STRING_TYPE[E],stringValue[GCE],"
+ + "UNORDERED_NODE_ITERATOR_TYPE[E],"
+ + "UNORDERED_NODE_SNAPSHOT_TYPE[E]",
+ EDGE = "ANY_TYPE[E],ANY_UNORDERED_NODE_TYPE[E],BOOLEAN_TYPE[E],booleanValue[GCE],constructor(),"
+ + "FIRST_ORDERED_NODE_TYPE[E],invalidIteratorState[GCE],iterateNext(),NUMBER_TYPE[E],"
+ + "numberValue[GCE],ORDERED_NODE_ITERATOR_TYPE[E],ORDERED_NODE_SNAPSHOT_TYPE[E],resultType[GCE],"
+ + "singleNodeValue[GCE],snapshotItem(),snapshotLength[GCE],STRING_TYPE[E],stringValue[GCE],"
+ + "UNORDERED_NODE_ITERATOR_TYPE[E],"
+ + "UNORDERED_NODE_SNAPSHOT_TYPE[E]",
+ FF = "ANY_TYPE[E],ANY_UNORDERED_NODE_TYPE[E],BOOLEAN_TYPE[E],booleanValue[GCE],constructor(),"
+ + "FIRST_ORDERED_NODE_TYPE[E],invalidIteratorState[GCE],iterateNext(),NUMBER_TYPE[E],"
+ + "numberValue[GCE],ORDERED_NODE_ITERATOR_TYPE[E],ORDERED_NODE_SNAPSHOT_TYPE[E],resultType[GCE],"
+ + "singleNodeValue[GCE],snapshotItem(),snapshotLength[GCE],STRING_TYPE[E],stringValue[GCE],"
+ + "UNORDERED_NODE_ITERATOR_TYPE[E],"
+ + "UNORDERED_NODE_SNAPSHOT_TYPE[E]",
+ FF_ESR = "ANY_TYPE[E],ANY_UNORDERED_NODE_TYPE[E],BOOLEAN_TYPE[E],booleanValue[GCE],constructor(),"
+ + "FIRST_ORDERED_NODE_TYPE[E],invalidIteratorState[GCE],iterateNext(),NUMBER_TYPE[E],"
+ + "numberValue[GCE],ORDERED_NODE_ITERATOR_TYPE[E],ORDERED_NODE_SNAPSHOT_TYPE[E],resultType[GCE],"
+ + "singleNodeValue[GCE],snapshotItem(),snapshotLength[GCE],STRING_TYPE[E],stringValue[GCE],"
+ + "UNORDERED_NODE_ITERATOR_TYPE[E],"
+ + "UNORDERED_NODE_SNAPSHOT_TYPE[E]")
public void xPathResult() throws Exception {
testString("var res = document.evaluate('/html/body', document, null, XPathResult.ANY_TYPE, null);", "res");
}
diff --git a/src/test/java/org/htmlunit/general/ElementOwnPropertySymbolsTest.java b/src/test/java/org/htmlunit/general/ElementOwnPropertySymbolsTest.java
index 54af7f5f913..64b1911e8e3 100644
--- a/src/test/java/org/htmlunit/general/ElementOwnPropertySymbolsTest.java
+++ b/src/test/java/org/htmlunit/general/ElementOwnPropertySymbolsTest.java
@@ -40,6 +40,7 @@
import org.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration;
import org.htmlunit.javascript.host.dom.CDATASection;
import org.htmlunit.javascript.host.dom.NodeList;
+import org.htmlunit.javascript.host.dom.XPathEvaluator;
import org.htmlunit.javascript.host.dom.XPathResult;
import org.htmlunit.javascript.host.html.HTMLCollection;
import org.htmlunit.javascript.host.performance.Performance;
@@ -2839,6 +2840,28 @@ public void cryptoSubtle() throws Exception {
testString("", "window.crypto.subtle");
}
+ /**
+ * Test {@link XPathEvaluator}.
+ *
+ * @throws Exception if the test fails
+ */
+ @Test
+ @Alerts("Symbol(Symbol.toStringTag) [C] [XPathEvaluator]")
+ public void xPathEvaluator() throws Exception {
+ testString("", "new XPathEvaluator()");
+ }
+
+ /**
+ * Test {@link XPathExpression}.
+ *
+ * @throws Exception if the test fails
+ */
+ @Test
+ @Alerts("Symbol(Symbol.toStringTag) [C] [XPathExpression]")
+ public void xPathExpression() throws Exception {
+ testString("var res = new XPathEvaluator().createExpression('//span')", "res");
+ }
+
/**
* Test {@link XPathResult}.
*
diff --git a/src/test/java/org/htmlunit/general/ElementPropertiesTest.java b/src/test/java/org/htmlunit/general/ElementPropertiesTest.java
index 681b1722a83..3dfb9d909bb 100644
--- a/src/test/java/org/htmlunit/general/ElementPropertiesTest.java
+++ b/src/test/java/org/htmlunit/general/ElementPropertiesTest.java
@@ -39,6 +39,7 @@
import org.htmlunit.javascript.host.crypto.SubtleCrypto;
import org.htmlunit.javascript.host.dom.CDATASection;
import org.htmlunit.javascript.host.dom.NodeList;
+import org.htmlunit.javascript.host.dom.XPathEvaluator;
import org.htmlunit.javascript.host.dom.XPathResult;
import org.htmlunit.javascript.host.html.HTMLCollection;
import org.htmlunit.javascript.host.performance.Performance;
@@ -854,58 +855,54 @@ public void element() throws Exception {
+ "setAttribute(),setAttributeNode(),setAttributeNodeNS(),setAttributeNS(),setCapture(),"
+ "setPointerCapture(),shadowRoot,slot,tagName,toggleAttribute(),"
+ "webkitMatchesSelector()")
- @HtmlUnitNYI(CHROME = "after(),append(),attributes,before(),classList,className,clientHeight,clientLeft,clientTop,"
+ @HtmlUnitNYI(CHROME = "after(),attributes,before(),classList,className,clientHeight,clientLeft,clientTop,"
+ "clientWidth,closest(),getAttribute(),getAttributeNode(),getAttributeNodeNS(),getAttributeNS(),"
+ "getBoundingClientRect(),getClientRects(),getElementsByClassName(),getElementsByTagName(),"
+ "getElementsByTagNameNS(),getHTML(),getInnerHTML(),"
+ "hasAttribute(),hasAttributeNS(),hasAttributes(),id,innerHTML,"
+ "insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),localName,matches(),"
+ "namespaceURI,nextElementSibling,onbeforecopy,onbeforecut,onbeforepaste,"
- + "onsearch,onwebkitfullscreenchange,onwebkitfullscreenerror,outerHTML,prefix,prepend(),"
+ + "onsearch,onwebkitfullscreenchange,onwebkitfullscreenerror,outerHTML,prefix,"
+ "previousElementSibling,remove(),removeAttribute(),removeAttributeNode(),removeAttributeNS(),"
- + "replaceChildren(),replaceWith(),"
- + "scroll(),scrollBy(),scrollHeight,scrollIntoView(),scrollIntoViewIfNeeded(),"
+ + "replaceWith(),scroll(),scrollBy(),scrollHeight,scrollIntoView(),scrollIntoViewIfNeeded(),"
+ "scrollLeft,scrollTo(),scrollTop,"
+ "scrollWidth,setAttribute(),setAttributeNode(),setAttributeNS(),"
+ "tagName,toggleAttribute(),webkitMatchesSelector()",
- EDGE = "after(),append(),attributes,before(),classList,className,clientHeight,clientLeft,clientTop,"
+ EDGE = "after(),attributes,before(),classList,className,clientHeight,clientLeft,clientTop,"
+ "clientWidth,closest(),getAttribute(),getAttributeNode(),getAttributeNodeNS(),getAttributeNS(),"
+ "getBoundingClientRect(),getClientRects(),getElementsByClassName(),getElementsByTagName(),"
+ "getElementsByTagNameNS(),getHTML(),getInnerHTML(),"
+ "hasAttribute(),hasAttributeNS(),hasAttributes(),id,innerHTML,"
+ "insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),localName,matches(),"
+ "namespaceURI,nextElementSibling,onbeforecopy,onbeforecut,onbeforepaste,"
- + "onsearch,onwebkitfullscreenchange,onwebkitfullscreenerror,outerHTML,prefix,prepend(),"
+ + "onsearch,onwebkitfullscreenchange,onwebkitfullscreenerror,outerHTML,prefix,"
+ "previousElementSibling,remove(),removeAttribute(),removeAttributeNode(),removeAttributeNS(),"
- + "replaceChildren(),replaceWith(),"
- + "scroll(),scrollBy(),scrollHeight,scrollIntoView(),scrollIntoViewIfNeeded(),"
+ + "replaceWith(),scroll(),scrollBy(),scrollHeight,scrollIntoView(),scrollIntoViewIfNeeded(),"
+ "scrollLeft,scrollTo(),scrollTop,"
+ "scrollWidth,setAttribute(),setAttributeNode(),setAttributeNS(),"
+ "tagName,toggleAttribute(),webkitMatchesSelector()",
- FF_ESR = "after(),append(),attributes,before(),"
+ FF_ESR = "after(),attributes,before(),"
+ "classList,className,clientHeight,clientLeft,clientTop,clientWidth,"
+ "closest(),getAttribute(),getAttributeNode(),getAttributeNodeNS(),getAttributeNS(),"
+ "getBoundingClientRect(),"
+ "getClientRects(),getElementsByClassName(),getElementsByTagName(),getElementsByTagNameNS(),"
+ "hasAttribute(),hasAttributeNS(),hasAttributes(),id,innerHTML,insertAdjacentElement(),"
+ "insertAdjacentHTML(),insertAdjacentText(),localName,matches(),mozMatchesSelector(),namespaceURI,"
- + "nextElementSibling,outerHTML,prefix,prepend(),previousElementSibling,"
+ + "nextElementSibling,outerHTML,prefix,previousElementSibling,"
+ "releaseCapture(),remove(),removeAttribute(),removeAttributeNode(),removeAttributeNS(),"
- + "replaceChildren(),replaceWith(),"
- + "scroll(),scrollBy(),scrollHeight,"
+ + "replaceWith(),scroll(),scrollBy(),scrollHeight,"
+ "scrollIntoView(),scrollLeft,scrollTo(),scrollTop,scrollWidth,setAttribute(),setAttributeNode(),"
+ "setAttributeNS(),setCapture(),"
+ "tagName,toggleAttribute(),webkitMatchesSelector()",
- FF = "after(),append(),attributes,before(),"
+ FF = "after(),attributes,before(),"
+ "classList,className,clientHeight,clientLeft,clientTop,clientWidth,"
+ "closest(),getAttribute(),getAttributeNode(),getAttributeNodeNS(),getAttributeNS(),"
+ "getBoundingClientRect(),"
+ "getClientRects(),getElementsByClassName(),getElementsByTagName(),getElementsByTagNameNS(),"
+ "hasAttribute(),hasAttributeNS(),hasAttributes(),id,innerHTML,insertAdjacentElement(),"
+ "insertAdjacentHTML(),insertAdjacentText(),localName,matches(),mozMatchesSelector(),namespaceURI,"
- + "nextElementSibling,outerHTML,prefix,prepend(),previousElementSibling,"
- + "releaseCapture(),remove(),"
- + "removeAttribute(),removeAttributeNode(),removeAttributeNS(),replaceChildren(),replaceWith(),"
+ + "nextElementSibling,outerHTML,prefix,previousElementSibling,releaseCapture(),remove(),"
+ + "removeAttribute(),removeAttributeNode(),removeAttributeNS(),replaceWith(),"
+ "scroll(),scrollBy(),scrollHeight,"
+ "scrollIntoView(),scrollLeft,scrollTo(),scrollTop,scrollWidth,setAttribute(),setAttributeNode(),"
+ "setAttributeNS(),setCapture(),"
@@ -981,8 +978,8 @@ public void event() throws Exception {
+ "cdc_adoQpoasnfa76pfcZLmcfl_Promise(),cdc_adoQpoasnfa76pfcZLmcfl_Proxy(),"
+ "cdc_adoQpoasnfa76pfcZLmcfl_Symbol(),chrome,clearInterval(),clearTimeout(),clientInformation,"
+ "close(),closed,confirm(),cookieStore,createImageBitmap(),credentialless,crossOriginIsolated,"
- + "crypto,customElements,devicePixelRatio,dispatchEvent(),document,documentPictureInPicture,"
- + "external,fetch(),find(),focus(),frameElement,frames,getComputedStyle(),getScreenDetails(),"
+ + "crypto,customElements,devicePixelRatio,dispatchEvent(),document,documentPictureInPicture,event,"
+ + "external,fence,fetch(),find(),focus(),frameElement,frames,getComputedStyle(),getScreenDetails(),"
+ "getSelection(),history,indexedDB,innerHeight,innerWidth,isSecureContext,launchQueue,length,"
+ "localStorage,location,locationbar,log(),matchMedia(),menubar,moveBy(),moveTo(),name,navigation,"
+ "navigator,onabort,onafterprint,onanimationend,onanimationiteration,onanimationstart,"
@@ -1008,9 +1005,9 @@ public void event() throws Exception {
+ "queueMicrotask(),releaseEvents(),removeEventListener(),reportError(),requestAnimationFrame(),"
+ "requestIdleCallback(),resizeBy(),resizeTo(),scheduler,screen,screenLeft,screenTop,screenX,"
+ "screenY,scroll(),scrollbars,scrollBy(),scrollTo(),scrollX,scrollY,self,sessionStorage,"
- + "setInterval(),setTimeout(),showDirectoryPicker(),showOpenFilePicker(),showSaveFilePicker(),"
- + "sortFunction(),speechSynthesis,status,statusbar,stop(),structuredClone(),styleMedia,TEMPORARY,"
- + "test(),toolbar,top,trustedTypes,visualViewport,webkitCancelAnimationFrame(),"
+ + "setInterval(),setTimeout(),sharedStorage,showDirectoryPicker(),showOpenFilePicker(),"
+ + "showSaveFilePicker(),sortFunction(),speechSynthesis,status,statusbar,stop(),structuredClone(),"
+ + "styleMedia,TEMPORARY,test(),toolbar,top,trustedTypes,visualViewport,webkitCancelAnimationFrame(),"
+ "webkitRequestAnimationFrame(),webkitRequestFileSystem(),webkitResolveLocalFileSystemURL(),"
+ "window",
EDGE = "addEventListener(),alert(),atob(),blur(),btoa(),caches,cancelAnimationFrame(),"
@@ -1019,8 +1016,8 @@ public void event() throws Exception {
+ "cdc_adoQpoasnfa76pfcZLmcfl_Promise(),cdc_adoQpoasnfa76pfcZLmcfl_Proxy(),"
+ "cdc_adoQpoasnfa76pfcZLmcfl_Symbol(),chrome,clearInterval(),clearTimeout(),clientInformation,"
+ "close(),closed,confirm(),cookieStore,createImageBitmap(),credentialless,crossOriginIsolated,"
- + "crypto,customElements,devicePixelRatio,dispatchEvent(),document,documentPictureInPicture,"
- + "external,fetch(),find(),focus(),frameElement,frames,getComputedStyle(),getScreenDetails(),"
+ + "crypto,customElements,devicePixelRatio,dispatchEvent(),document,documentPictureInPicture,event,"
+ + "external,fence,fetch(),find(),focus(),frameElement,frames,getComputedStyle(),getScreenDetails(),"
+ "getSelection(),history,indexedDB,innerHeight,innerWidth,isSecureContext,launchQueue,length,"
+ "localStorage,location,locationbar,log(),matchMedia(),menubar,moveBy(),moveTo(),name,navigation,"
+ "navigator,onabort,onafterprint,onanimationend,onanimationiteration,onanimationstart,"
@@ -1046,9 +1043,9 @@ public void event() throws Exception {
+ "queueMicrotask(),releaseEvents(),removeEventListener(),reportError(),requestAnimationFrame(),"
+ "requestIdleCallback(),resizeBy(),resizeTo(),scheduler,screen,screenLeft,screenTop,screenX,"
+ "screenY,scroll(),scrollbars,scrollBy(),scrollTo(),scrollX,scrollY,self,sessionStorage,"
- + "setInterval(),setTimeout(),showDirectoryPicker(),showOpenFilePicker(),showSaveFilePicker(),"
- + "sortFunction(),speechSynthesis,status,statusbar,stop(),structuredClone(),styleMedia,TEMPORARY,"
- + "test(),toolbar,top,trustedTypes,visualViewport,webkitCancelAnimationFrame(),"
+ + "setInterval(),setTimeout(),sharedStorage,showDirectoryPicker(),showOpenFilePicker(),"
+ + "showSaveFilePicker(),sortFunction(),speechSynthesis,status,statusbar,stop(),structuredClone(),"
+ + "styleMedia,TEMPORARY,test(),toolbar,top,trustedTypes,visualViewport,webkitCancelAnimationFrame(),"
+ "webkitRequestAnimationFrame(),webkitRequestFileSystem(),webkitResolveLocalFileSystemURL(),"
+ "window",
FF = "addEventListener(),alert(),atob(),blur(),btoa(),caches,cancelAnimationFrame(),"
@@ -2041,14 +2038,14 @@ public void html() throws Exception {
* @throws Exception if the test fails
*/
@Test
- @Alerts(CHROME = "adAuctionHeaders,align,allow,allowFullscreen,allowPaymentRequest,contentDocument,contentWindow,"
- + "credentialless,csp,featurePolicy,frameBorder,getSVGDocument(),height,loading,longDesc,"
- + "marginHeight,marginWidth,name,privateToken,referrerPolicy,sandbox,scrolling,"
+ @Alerts(CHROME = "adAuctionHeaders,align,allow,allowFullscreen,allowPaymentRequest,browsingTopics,contentDocument,"
+ + "contentWindow,credentialless,csp,featurePolicy,frameBorder,getSVGDocument(),height,loading,"
+ + "longDesc,marginHeight,marginWidth,name,privateToken,referrerPolicy,sandbox,scrolling,"
+ "sharedStorageWritable,src,srcdoc,"
+ "width",
- EDGE = "adAuctionHeaders,align,allow,allowFullscreen,allowPaymentRequest,contentDocument,contentWindow,"
- + "credentialless,csp,featurePolicy,frameBorder,getSVGDocument(),height,loading,longDesc,"
- + "marginHeight,marginWidth,name,privateToken,referrerPolicy,sandbox,scrolling,"
+ EDGE = "adAuctionHeaders,align,allow,allowFullscreen,allowPaymentRequest,browsingTopics,contentDocument,"
+ + "contentWindow,credentialless,csp,featurePolicy,frameBorder,getSVGDocument(),height,loading,"
+ + "longDesc,marginHeight,marginWidth,name,privateToken,referrerPolicy,sandbox,scrolling,"
+ "sharedStorageWritable,src,srcdoc,"
+ "width",
FF = "align,allow,allowFullscreen,contentDocument,contentWindow,frameBorder,getSVGDocument(),height,"
@@ -3156,23 +3153,18 @@ public void var() throws Exception {
* @throws Exception if the test fails
*/
@Test
- @Alerts(CHROME = "addTextTrack(),autoplay,buffered,cancelVideoFrameCallback(),"
- + "canPlayType(),captureStream(),controls,controlsList,crossOrigin,currentSrc,currentTime,"
- + "defaultMuted,defaultPlaybackRate,disablePictureInPicture,disableRemotePlayback,duration,"
- + "ended,error,getVideoPlaybackQuality(),HAVE_CURRENT_DATA,HAVE_ENOUGH_DATA,"
- + "HAVE_FUTURE_DATA,HAVE_METADATA,HAVE_NOTHING,height,load(),loop,mediaKeys,muted,NETWORK_EMPTY,"
- + "NETWORK_IDLE,NETWORK_LOADING,NETWORK_NO_SOURCE,networkState,onencrypted,"
- + "onenterpictureinpicture,onleavepictureinpicture,"
- + "onwaitingforkey,pause(),paused,play(),playbackRate,played,playsInline,"
- + "poster,preload,preservesPitch,"
- + "readyState,remote,requestPictureInPicture(),requestVideoFrameCallback(),"
- + "seekable,seeking,setMediaKeys(),setSinkId(),sinkId,src,srcObject,"
- + "textTracks,videoHeight,videoWidth,"
- + "volume,webkitAudioDecodedByteCount,webkitDecodedFrameCount,"
- + "webkitDisplayingFullscreen,webkitDroppedFrameCount,"
- + "webkitEnterFullScreen(),webkitEnterFullscreen(),"
- + "webkitExitFullScreen(),webkitExitFullscreen(),"
- + "webkitSupportsFullscreen,webkitVideoDecodedByteCount,width",
+ @Alerts(CHROME = "addTextTrack(),autoplay,buffered,cancelVideoFrameCallback(),canPlayType(),captureStream(),"
+ + "controls,controlsList,crossOrigin,currentSrc,currentTime,defaultMuted,defaultPlaybackRate,"
+ + "disablePictureInPicture,disableRemotePlayback,duration,ended,error,getVideoPlaybackQuality(),"
+ + "HAVE_CURRENT_DATA,HAVE_ENOUGH_DATA,HAVE_FUTURE_DATA,HAVE_METADATA,HAVE_NOTHING,height,load(),"
+ + "loop,mediaKeys,muted,NETWORK_EMPTY,NETWORK_IDLE,NETWORK_LOADING,NETWORK_NO_SOURCE,networkState,"
+ + "onencrypted,onenterpictureinpicture,onleavepictureinpicture,onwaitingforkey,pause(),paused,"
+ + "play(),playbackRate,played,playsInline,poster,preload,preservesPitch,readyState,remote,"
+ + "requestPictureInPicture(),requestVideoFrameCallback(),seekable,seeking,setMediaKeys(),"
+ + "setSinkId(),sinkId,src,srcObject,textTracks,videoHeight,videoWidth,volume,"
+ + "webkitAudioDecodedByteCount,webkitDecodedFrameCount,webkitDroppedFrameCount,"
+ + "webkitVideoDecodedByteCount,"
+ + "width",
EDGE = "addTextTrack(),autoplay,buffered,cancelVideoFrameCallback(),canPlayType(),captureStream(),"
+ "controls,controlsList,crossOrigin,currentSrc,currentTime,defaultMuted,defaultPlaybackRate,"
+ "disablePictureInPicture,disableRemotePlayback,duration,ended,error,getVideoPlaybackQuality(),"
@@ -3183,9 +3175,7 @@ public void var() throws Exception {
+ "poster,preload,preservesPitch,readyState,remote,requestPictureInPicture(),"
+ "requestVideoFrameCallback(),seekable,seeking,setMediaKeys(),setSinkId(),sinkId,src,srcObject,"
+ "textTracks,videoHeight,videoWidth,volume,webkitAudioDecodedByteCount,webkitDecodedFrameCount,"
- + "webkitDisplayingFullscreen,webkitDroppedFrameCount,webkitEnterFullScreen(),"
- + "webkitEnterFullscreen(),webkitExitFullScreen(),webkitExitFullscreen(),webkitSupportsFullscreen,"
- + "webkitVideoDecodedByteCount,"
+ + "webkitDroppedFrameCount,webkitVideoDecodedByteCount,"
+ "width",
FF = "addTextTrack(),autoplay,buffered,canPlayType(),controls,crossOrigin,currentSrc,currentTime,"
+ "defaultMuted,defaultPlaybackRate,disablePictureInPicture,duration,ended,error,fastSeek(),"
@@ -4219,14 +4209,14 @@ public void slot() throws Exception {
*/
@Test
@Alerts(CHROME = "activeElement,addEventListener(),adoptedStyleSheets,adoptNode(),alinkColor,all,anchors,append(),"
- + "appendChild(),applets,ATTRIBUTE_NODE,baseURI,bgColor,body,captureEvents(),caretRangeFromPoint(),"
- + "CDATA_SECTION_NODE,characterSet,charset,childElementCount,childNodes,children,clear(),"
- + "cloneNode(),close(),COMMENT_NODE,compareDocumentPosition(),compatMode,contains(),contentType,"
- + "cookie,createAttribute(),createAttributeNS(),createCDATASection(),createComment(),"
- + "createDocumentFragment(),createElement(),createElementNS(),createEvent(),createExpression(),"
- + "createNodeIterator(),createNSResolver(),createProcessingInstruction(),createRange(),"
- + "createTextNode(),createTreeWalker(),currentScript,defaultView,designMode,dir,dispatchEvent(),"
- + "doctype,DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,"
+ + "appendChild(),applets,ATTRIBUTE_NODE,baseURI,bgColor,body,browsingTopics(),captureEvents(),"
+ + "caretRangeFromPoint(),CDATA_SECTION_NODE,characterSet,charset,childElementCount,childNodes,"
+ + "children,clear(),cloneNode(),close(),COMMENT_NODE,compareDocumentPosition(),compatMode,"
+ + "contains(),contentType,cookie,createAttribute(),createAttributeNS(),createCDATASection(),"
+ + "createComment(),createDocumentFragment(),createElement(),createElementNS(),createEvent(),"
+ + "createExpression(),createNodeIterator(),createNSResolver(),createProcessingInstruction(),"
+ + "createRange(),createTextNode(),createTreeWalker(),currentScript,defaultView,designMode,dir,"
+ + "dispatchEvent(),doctype,DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,"
+ "DOCUMENT_POSITION_CONTAINS,DOCUMENT_POSITION_DISCONNECTED,DOCUMENT_POSITION_FOLLOWING,"
+ "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC,DOCUMENT_POSITION_PRECEDING,DOCUMENT_TYPE_NODE,"
+ "documentElement,documentURI,domain,ELEMENT_NODE,elementFromPoint(),elementsFromPoint(),embeds,"
@@ -4268,14 +4258,14 @@ public void slot() throws Exception {
+ "webkitVisibilityState,write(),writeln(),xmlEncoding,xmlStandalone,"
+ "xmlVersion",
EDGE = "activeElement,addEventListener(),adoptedStyleSheets,adoptNode(),alinkColor,all,anchors,append(),"
- + "appendChild(),applets,ATTRIBUTE_NODE,baseURI,bgColor,body,captureEvents(),caretRangeFromPoint(),"
- + "CDATA_SECTION_NODE,characterSet,charset,childElementCount,childNodes,children,clear(),"
- + "cloneNode(),close(),COMMENT_NODE,compareDocumentPosition(),compatMode,contains(),contentType,"
- + "cookie,createAttribute(),createAttributeNS(),createCDATASection(),createComment(),"
- + "createDocumentFragment(),createElement(),createElementNS(),createEvent(),createExpression(),"
- + "createNodeIterator(),createNSResolver(),createProcessingInstruction(),createRange(),"
- + "createTextNode(),createTreeWalker(),currentScript,defaultView,designMode,dir,dispatchEvent(),"
- + "doctype,DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,"
+ + "appendChild(),applets,ATTRIBUTE_NODE,baseURI,bgColor,body,browsingTopics(),captureEvents(),"
+ + "caretRangeFromPoint(),CDATA_SECTION_NODE,characterSet,charset,childElementCount,childNodes,"
+ + "children,clear(),cloneNode(),close(),COMMENT_NODE,compareDocumentPosition(),compatMode,"
+ + "contains(),contentType,cookie,createAttribute(),createAttributeNS(),createCDATASection(),"
+ + "createComment(),createDocumentFragment(),createElement(),createElementNS(),createEvent(),"
+ + "createExpression(),createNodeIterator(),createNSResolver(),createProcessingInstruction(),"
+ + "createRange(),createTextNode(),createTreeWalker(),currentScript,defaultView,designMode,dir,"
+ + "dispatchEvent(),doctype,DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,"
+ "DOCUMENT_POSITION_CONTAINS,DOCUMENT_POSITION_DISCONNECTED,DOCUMENT_POSITION_FOLLOWING,"
+ "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC,DOCUMENT_POSITION_PRECEDING,DOCUMENT_TYPE_NODE,"
+ "documentElement,documentURI,domain,ELEMENT_NODE,elementFromPoint(),elementsFromPoint(),embeds,"
@@ -4419,14 +4409,14 @@ public void document() throws Exception {
*/
@Test
@Alerts(CHROME = "activeElement,addEventListener(),adoptedStyleSheets,adoptNode(),alinkColor,all,anchors,append(),"
- + "appendChild(),applets,ATTRIBUTE_NODE,baseURI,bgColor,body,captureEvents(),caretRangeFromPoint(),"
- + "CDATA_SECTION_NODE,characterSet,charset,childElementCount,childNodes,children,clear(),"
- + "cloneNode(),close(),COMMENT_NODE,compareDocumentPosition(),compatMode,contains(),contentType,"
- + "cookie,createAttribute(),createAttributeNS(),createCDATASection(),createComment(),"
- + "createDocumentFragment(),createElement(),createElementNS(),createEvent(),createExpression(),"
- + "createNodeIterator(),createNSResolver(),createProcessingInstruction(),createRange(),"
- + "createTextNode(),createTreeWalker(),currentScript,defaultView,designMode,dir,dispatchEvent(),"
- + "doctype,DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,"
+ + "appendChild(),applets,ATTRIBUTE_NODE,baseURI,bgColor,body,browsingTopics(),captureEvents(),"
+ + "caretRangeFromPoint(),CDATA_SECTION_NODE,characterSet,charset,childElementCount,childNodes,"
+ + "children,clear(),cloneNode(),close(),COMMENT_NODE,compareDocumentPosition(),compatMode,"
+ + "contains(),contentType,cookie,createAttribute(),createAttributeNS(),createCDATASection(),"
+ + "createComment(),createDocumentFragment(),createElement(),createElementNS(),createEvent(),"
+ + "createExpression(),createNodeIterator(),createNSResolver(),createProcessingInstruction(),"
+ + "createRange(),createTextNode(),createTreeWalker(),currentScript,defaultView,designMode,dir,"
+ + "dispatchEvent(),doctype,DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,"
+ "DOCUMENT_POSITION_CONTAINS,DOCUMENT_POSITION_DISCONNECTED,DOCUMENT_POSITION_FOLLOWING,"
+ "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC,DOCUMENT_POSITION_PRECEDING,DOCUMENT_TYPE_NODE,"
+ "documentElement,documentURI,domain,ELEMENT_NODE,elementFromPoint(),elementsFromPoint(),embeds,"
@@ -4468,14 +4458,14 @@ public void document() throws Exception {
+ "webkitVisibilityState,write(),writeln(),xmlEncoding,xmlStandalone,"
+ "xmlVersion",
EDGE = "activeElement,addEventListener(),adoptedStyleSheets,adoptNode(),alinkColor,all,anchors,append(),"
- + "appendChild(),applets,ATTRIBUTE_NODE,baseURI,bgColor,body,captureEvents(),caretRangeFromPoint(),"
- + "CDATA_SECTION_NODE,characterSet,charset,childElementCount,childNodes,children,clear(),"
- + "cloneNode(),close(),COMMENT_NODE,compareDocumentPosition(),compatMode,contains(),contentType,"
- + "cookie,createAttribute(),createAttributeNS(),createCDATASection(),createComment(),"
- + "createDocumentFragment(),createElement(),createElementNS(),createEvent(),createExpression(),"
- + "createNodeIterator(),createNSResolver(),createProcessingInstruction(),createRange(),"
- + "createTextNode(),createTreeWalker(),currentScript,defaultView,designMode,dir,dispatchEvent(),"
- + "doctype,DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,"
+ + "appendChild(),applets,ATTRIBUTE_NODE,baseURI,bgColor,body,browsingTopics(),captureEvents(),"
+ + "caretRangeFromPoint(),CDATA_SECTION_NODE,characterSet,charset,childElementCount,childNodes,"
+ + "children,clear(),cloneNode(),close(),COMMENT_NODE,compareDocumentPosition(),compatMode,"
+ + "contains(),contentType,cookie,createAttribute(),createAttributeNS(),createCDATASection(),"
+ + "createComment(),createDocumentFragment(),createElement(),createElementNS(),createEvent(),"
+ + "createExpression(),createNodeIterator(),createNSResolver(),createProcessingInstruction(),"
+ + "createRange(),createTextNode(),createTreeWalker(),currentScript,defaultView,designMode,dir,"
+ + "dispatchEvent(),doctype,DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,"
+ "DOCUMENT_POSITION_CONTAINS,DOCUMENT_POSITION_DISCONNECTED,DOCUMENT_POSITION_FOLLOWING,"
+ "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC,DOCUMENT_POSITION_PRECEDING,DOCUMENT_TYPE_NODE,"
+ "documentElement,documentURI,domain,ELEMENT_NODE,elementFromPoint(),elementsFromPoint(),embeds,"
@@ -4739,14 +4729,14 @@ public void htmlDocument() throws Exception {
*/
@Test
@Alerts(CHROME = "activeElement,addEventListener(),adoptedStyleSheets,adoptNode(),alinkColor,all,anchors,append(),"
- + "appendChild(),applets,ATTRIBUTE_NODE,baseURI,bgColor,body,captureEvents(),caretRangeFromPoint(),"
- + "CDATA_SECTION_NODE,characterSet,charset,childElementCount,childNodes,children,clear(),"
- + "cloneNode(),close(),COMMENT_NODE,compareDocumentPosition(),compatMode,contains(),contentType,"
- + "cookie,createAttribute(),createAttributeNS(),createCDATASection(),createComment(),"
- + "createDocumentFragment(),createElement(),createElementNS(),createEvent(),createExpression(),"
- + "createNodeIterator(),createNSResolver(),createProcessingInstruction(),createRange(),"
- + "createTextNode(),createTreeWalker(),currentScript,defaultView,designMode,dir,dispatchEvent(),"
- + "doctype,DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,"
+ + "appendChild(),applets,ATTRIBUTE_NODE,baseURI,bgColor,body,browsingTopics(),captureEvents(),"
+ + "caretRangeFromPoint(),CDATA_SECTION_NODE,characterSet,charset,childElementCount,childNodes,"
+ + "children,clear(),cloneNode(),close(),COMMENT_NODE,compareDocumentPosition(),compatMode,"
+ + "contains(),contentType,cookie,createAttribute(),createAttributeNS(),createCDATASection(),"
+ + "createComment(),createDocumentFragment(),createElement(),createElementNS(),createEvent(),"
+ + "createExpression(),createNodeIterator(),createNSResolver(),createProcessingInstruction(),"
+ + "createRange(),createTextNode(),createTreeWalker(),currentScript,defaultView,designMode,dir,"
+ + "dispatchEvent(),doctype,DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,"
+ "DOCUMENT_POSITION_CONTAINS,DOCUMENT_POSITION_DISCONNECTED,DOCUMENT_POSITION_FOLLOWING,"
+ "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC,DOCUMENT_POSITION_PRECEDING,DOCUMENT_TYPE_NODE,"
+ "documentElement,documentURI,domain,ELEMENT_NODE,elementFromPoint(),elementsFromPoint(),embeds,"
@@ -4788,14 +4778,14 @@ public void htmlDocument() throws Exception {
+ "webkitVisibilityState,write(),writeln(),xmlEncoding,xmlStandalone,"
+ "xmlVersion",
EDGE = "activeElement,addEventListener(),adoptedStyleSheets,adoptNode(),alinkColor,all,anchors,append(),"
- + "appendChild(),applets,ATTRIBUTE_NODE,baseURI,bgColor,body,captureEvents(),caretRangeFromPoint(),"
- + "CDATA_SECTION_NODE,characterSet,charset,childElementCount,childNodes,children,clear(),"
- + "cloneNode(),close(),COMMENT_NODE,compareDocumentPosition(),compatMode,contains(),contentType,"
- + "cookie,createAttribute(),createAttributeNS(),createCDATASection(),createComment(),"
- + "createDocumentFragment(),createElement(),createElementNS(),createEvent(),createExpression(),"
- + "createNodeIterator(),createNSResolver(),createProcessingInstruction(),createRange(),"
- + "createTextNode(),createTreeWalker(),currentScript,defaultView,designMode,dir,dispatchEvent(),"
- + "doctype,DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,"
+ + "appendChild(),applets,ATTRIBUTE_NODE,baseURI,bgColor,body,browsingTopics(),captureEvents(),"
+ + "caretRangeFromPoint(),CDATA_SECTION_NODE,characterSet,charset,childElementCount,childNodes,"
+ + "children,clear(),cloneNode(),close(),COMMENT_NODE,compareDocumentPosition(),compatMode,"
+ + "contains(),contentType,cookie,createAttribute(),createAttributeNS(),createCDATASection(),"
+ + "createComment(),createDocumentFragment(),createElement(),createElementNS(),createEvent(),"
+ + "createExpression(),createNodeIterator(),createNSResolver(),createProcessingInstruction(),"
+ + "createRange(),createTextNode(),createTreeWalker(),currentScript,defaultView,designMode,dir,"
+ + "dispatchEvent(),doctype,DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,"
+ "DOCUMENT_POSITION_CONTAINS,DOCUMENT_POSITION_DISCONNECTED,DOCUMENT_POSITION_FOLLOWING,"
+ "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC,DOCUMENT_POSITION_PRECEDING,DOCUMENT_TYPE_NODE,"
+ "documentElement,documentURI,domain,ELEMENT_NODE,elementFromPoint(),elementsFromPoint(),embeds,"
@@ -5378,7 +5368,7 @@ public void range() throws Exception {
+ "nodeType,nodeValue,normalize(),NOTATION_NODE,ownerDocument,parentElement,parentNode,prepend(),"
+ "previousSibling,PROCESSING_INSTRUCTION_NODE,querySelector(),querySelectorAll(),removeChild(),"
+ "removeEventListener(),replaceChild(),replaceChildren(),TEXT_NODE,textContent")
- @HtmlUnitNYI(CHROME = "addEventListener(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,"
+ @HtmlUnitNYI(CHROME = "addEventListener(),append(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,"
+ "childElementCount,childNodes,"
+ "children,cloneNode(),COMMENT_NODE,compareDocumentPosition(),contains(),"
+ "dispatchEvent(),DOCUMENT_FRAGMENT_NODE,"
@@ -5389,9 +5379,10 @@ public void range() throws Exception {
+ "firstChild,firstElementChild,getElementById(),getRootNode(),"
+ "hasChildNodes(),insertBefore(),isEqualNode(),isSameNode(),lastChild,"
+ "lastElementChild,nextSibling,nodeName,nodeType,nodeValue,normalize(),NOTATION_NODE,ownerDocument,"
- + "parentElement,parentNode,previousSibling,PROCESSING_INSTRUCTION_NODE,querySelector(),"
- + "querySelectorAll(),removeChild(),removeEventListener(),replaceChild(),TEXT_NODE,textContent",
- EDGE = "addEventListener(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,"
+ + "parentElement,parentNode,prepend(),previousSibling,PROCESSING_INSTRUCTION_NODE,querySelector(),"
+ + "querySelectorAll(),removeChild(),removeEventListener(),replaceChild(),replaceChildren(),"
+ + "TEXT_NODE,textContent",
+ EDGE = "addEventListener(),append(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,"
+ "childElementCount,childNodes,"
+ "children,cloneNode(),COMMENT_NODE,compareDocumentPosition(),contains(),"
+ "dispatchEvent(),DOCUMENT_FRAGMENT_NODE,"
@@ -5402,9 +5393,10 @@ public void range() throws Exception {
+ "firstChild,firstElementChild,getElementById(),getRootNode(),"
+ "hasChildNodes(),insertBefore(),isEqualNode(),isSameNode(),lastChild,"
+ "lastElementChild,nextSibling,nodeName,nodeType,nodeValue,normalize(),NOTATION_NODE,ownerDocument,"
- + "parentElement,parentNode,previousSibling,PROCESSING_INSTRUCTION_NODE,querySelector(),"
- + "querySelectorAll(),removeChild(),removeEventListener(),replaceChild(),TEXT_NODE,textContent",
- FF_ESR = "addEventListener(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,"
+ + "parentElement,parentNode,prepend(),previousSibling,PROCESSING_INSTRUCTION_NODE,querySelector(),"
+ + "querySelectorAll(),removeChild(),removeEventListener(),replaceChild(),replaceChildren(),"
+ + "TEXT_NODE,textContent",
+ FF_ESR = "addEventListener(),append(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,"
+ "childElementCount,childNodes,"
+ "children,cloneNode(),COMMENT_NODE,compareDocumentPosition(),contains(),"
+ "dispatchEvent(),DOCUMENT_FRAGMENT_NODE,"
@@ -5415,9 +5407,10 @@ public void range() throws Exception {
+ "firstChild,firstElementChild,getElementById(),getRootNode(),"
+ "hasChildNodes(),insertBefore(),isEqualNode(),isSameNode(),lastChild,"
+ "lastElementChild,nextSibling,nodeName,nodeType,nodeValue,normalize(),NOTATION_NODE,ownerDocument,"
- + "parentElement,parentNode,previousSibling,PROCESSING_INSTRUCTION_NODE,querySelector(),"
- + "querySelectorAll(),removeChild(),removeEventListener(),replaceChild(),TEXT_NODE,textContent",
- FF = "addEventListener(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,"
+ + "parentElement,parentNode,prepend(),previousSibling,PROCESSING_INSTRUCTION_NODE,querySelector(),"
+ + "querySelectorAll(),removeChild(),removeEventListener(),replaceChild(),replaceChildren(),"
+ + "TEXT_NODE,textContent",
+ FF = "addEventListener(),append(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,"
+ "childElementCount,childNodes,"
+ "children,cloneNode(),COMMENT_NODE,compareDocumentPosition(),contains(),"
+ "dispatchEvent(),DOCUMENT_FRAGMENT_NODE,"
@@ -5428,8 +5421,9 @@ public void range() throws Exception {
+ "firstChild,firstElementChild,getElementById(),getRootNode(),"
+ "hasChildNodes(),insertBefore(),isEqualNode(),isSameNode(),lastChild,"
+ "lastElementChild,nextSibling,nodeName,nodeType,nodeValue,normalize(),NOTATION_NODE,ownerDocument,"
- + "parentElement,parentNode,previousSibling,PROCESSING_INSTRUCTION_NODE,querySelector(),"
- + "querySelectorAll(),removeChild(),removeEventListener(),replaceChild(),TEXT_NODE,textContent")
+ + "parentElement,parentNode,prepend(),previousSibling,PROCESSING_INSTRUCTION_NODE,querySelector(),"
+ + "querySelectorAll(),removeChild(),removeEventListener(),replaceChild(),replaceChildren(),"
+ + "TEXT_NODE,textContent")
public void documentFragment() throws Exception {
testString("", "document.createDocumentFragment()");
}
@@ -6183,23 +6177,24 @@ public void nodeListButtonLabels() throws Exception {
+ "marginRight,marginTop,marker,markerEnd,markerMid,markerStart,mask,maskClip,maskComposite,"
+ "maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,mathDepth,mathShift,"
+ "mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxWidth,minBlockSize,minHeight,minInlineSize,"
- + "minWidth,mixBlendMode,negative,objectFit,objectPosition,objectViewBox,offset,offsetAnchor,"
- + "offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,"
- + "outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowClipMargin,overflowWrap,"
- + "overflowX,overflowY,overlay,overrideColors,overscrollBehavior,overscrollBehaviorBlock,"
- + "overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,pad,padding,paddingBlock,"
- + "paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,"
- + "paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,"
- + "pageBreakInside,pageOrientation,paintOrder,parentRule,perspective,perspectiveOrigin,placeContent,"
- + "placeItems,placeSelf,pointerEvents,position,positionAnchor,positionTry,positionTryOptions,"
- + "positionTryOrder,positionVisibility,prefix,quotes,r,range,removeProperty(),resize,right,rotate,"
- + "rowGap,rubyPosition,rx,ry,scale,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollBehavior,"
- + "scrollMargin,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginBottom,"
- + "scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollMarginLeft,"
- + "scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockEnd,"
- + "scrollPaddingBlockStart,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineEnd,"
- + "scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,"
- + "scrollSnapStop,scrollSnapType,scrollTimeline,scrollTimelineAxis,scrollTimelineName,setProperty(),"
+ + "minWidth,mixBlendMode,navigation,negative,objectFit,objectPosition,objectViewBox,offset,"
+ + "offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,"
+ + "outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowClipMargin,"
+ + "overflowWrap,overflowX,overflowY,overlay,overrideColors,overscrollBehavior,"
+ + "overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,pad,"
+ + "padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,"
+ + "paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,"
+ + "pageBreakBefore,pageBreakInside,pageOrientation,paintOrder,parentRule,perspective,"
+ + "perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,positionAnchor,"
+ + "positionTry,positionTryOptions,positionTryOrder,positionVisibility,prefix,quotes,r,range,"
+ + "removeProperty(),resize,right,rotate,rowGap,rubyPosition,rx,ry,scale,scrollbarColor,"
+ + "scrollbarGutter,scrollbarWidth,scrollBehavior,scrollMargin,scrollMarginBlock,"
+ + "scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginBottom,scrollMarginInline,"
+ + "scrollMarginInlineEnd,scrollMarginInlineStart,scrollMarginLeft,scrollMarginRight,scrollMarginTop,"
+ + "scrollPadding,scrollPaddingBlock,scrollPaddingBlockEnd,scrollPaddingBlockStart,"
+ + "scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,"
+ + "scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapStop,"
+ + "scrollSnapType,scrollTimeline,scrollTimelineAxis,scrollTimelineName,setProperty(),"
+ "shapeImageThreshold,shapeMargin,shapeOutside,shapeRendering,size,sizeAdjust,speak,speakAs,src,"
+ "stopColor,stopOpacity,stroke,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,"
+ "strokeMiterlimit,strokeOpacity,strokeWidth,suffix,symbols,syntax,system,tableLayout,tabSize,"
@@ -6209,7 +6204,7 @@ public void nodeListButtonLabels() throws Exception {
+ "textOverflow,textRendering,textShadow,textSizeAdjust,textSpacingTrim,textTransform,"
+ "textUnderlineOffset,textUnderlinePosition,textWrap,timelineScope,top,touchAction,transform,"
+ "transformBox,transformOrigin,transformStyle,transition,transitionBehavior,transitionDelay,"
- + "transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,"
+ + "transitionDuration,transitionProperty,transitionTimingFunction,translate,types,unicodeBidi,"
+ "unicodeRange,userSelect,vectorEffect,verticalAlign,viewTimeline,viewTimelineAxis,"
+ "viewTimelineInset,viewTimelineName,viewTransitionClass,viewTransitionName,visibility,"
+ "webkitAlignContent,webkitAlignItems,webkitAlignSelf,webkitAnimation,webkitAnimationDelay,"
@@ -6311,23 +6306,24 @@ public void nodeListButtonLabels() throws Exception {
+ "marginRight,marginTop,marker,markerEnd,markerMid,markerStart,mask,maskClip,maskComposite,"
+ "maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,mathDepth,mathShift,"
+ "mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxWidth,minBlockSize,minHeight,minInlineSize,"
- + "minWidth,mixBlendMode,negative,objectFit,objectPosition,objectViewBox,offset,offsetAnchor,"
- + "offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,"
- + "outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowClipMargin,overflowWrap,"
- + "overflowX,overflowY,overlay,overrideColors,overscrollBehavior,overscrollBehaviorBlock,"
- + "overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,pad,padding,paddingBlock,"
- + "paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,"
- + "paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,"
- + "pageBreakInside,pageOrientation,paintOrder,parentRule,perspective,perspectiveOrigin,placeContent,"
- + "placeItems,placeSelf,pointerEvents,position,positionAnchor,positionTry,positionTryOptions,"
- + "positionTryOrder,positionVisibility,prefix,quotes,r,range,removeProperty(),resize,right,rotate,"
- + "rowGap,rubyPosition,rx,ry,scale,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollBehavior,"
- + "scrollMargin,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginBottom,"
- + "scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollMarginLeft,"
- + "scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockEnd,"
- + "scrollPaddingBlockStart,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineEnd,"
- + "scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,"
- + "scrollSnapStop,scrollSnapType,scrollTimeline,scrollTimelineAxis,scrollTimelineName,setProperty(),"
+ + "minWidth,mixBlendMode,navigation,negative,objectFit,objectPosition,objectViewBox,offset,"
+ + "offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,"
+ + "outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowClipMargin,"
+ + "overflowWrap,overflowX,overflowY,overlay,overrideColors,overscrollBehavior,"
+ + "overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,pad,"
+ + "padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,"
+ + "paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,"
+ + "pageBreakBefore,pageBreakInside,pageOrientation,paintOrder,parentRule,perspective,"
+ + "perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,positionAnchor,"
+ + "positionTry,positionTryOptions,positionTryOrder,positionVisibility,prefix,quotes,r,range,"
+ + "removeProperty(),resize,right,rotate,rowGap,rubyPosition,rx,ry,scale,scrollbarColor,"
+ + "scrollbarGutter,scrollbarWidth,scrollBehavior,scrollMargin,scrollMarginBlock,"
+ + "scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginBottom,scrollMarginInline,"
+ + "scrollMarginInlineEnd,scrollMarginInlineStart,scrollMarginLeft,scrollMarginRight,scrollMarginTop,"
+ + "scrollPadding,scrollPaddingBlock,scrollPaddingBlockEnd,scrollPaddingBlockStart,"
+ + "scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,"
+ + "scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapStop,"
+ + "scrollSnapType,scrollTimeline,scrollTimelineAxis,scrollTimelineName,setProperty(),"
+ "shapeImageThreshold,shapeMargin,shapeOutside,shapeRendering,size,sizeAdjust,speak,speakAs,src,"
+ "stopColor,stopOpacity,stroke,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,"
+ "strokeMiterlimit,strokeOpacity,strokeWidth,suffix,symbols,syntax,system,tableLayout,tabSize,"
@@ -6337,7 +6333,7 @@ public void nodeListButtonLabels() throws Exception {
+ "textOverflow,textRendering,textShadow,textSizeAdjust,textSpacingTrim,textTransform,"
+ "textUnderlineOffset,textUnderlinePosition,textWrap,timelineScope,top,touchAction,transform,"
+ "transformBox,transformOrigin,transformStyle,transition,transitionBehavior,transitionDelay,"
- + "transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,"
+ + "transitionDuration,transitionProperty,transitionTimingFunction,translate,types,unicodeBidi,"
+ "unicodeRange,userSelect,vectorEffect,verticalAlign,viewTimeline,viewTimelineAxis,"
+ "viewTimelineInset,viewTimelineName,viewTransitionClass,viewTransitionName,visibility,"
+ "webkitAlignContent,webkitAlignItems,webkitAlignSelf,webkitAnimation,webkitAnimationDelay,"
@@ -6882,7 +6878,8 @@ public void nodeListButtonLabels() throws Exception {
+ "maskClip,maskComposite,maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,"
+ "maskType,mathDepth,mathShift,mathStyle,"
+ "maxBlockSize,maxHeight,maxInlineSize,maxWidth,minBlockSize,minHeight,"
- + "minInlineSize,minWidth,mixBlendMode,negative,objectFit,objectPosition,objectViewBox,offset,"
+ + "minInlineSize,minWidth,mixBlendMode,navigation,negative,"
+ + "objectFit,objectPosition,objectViewBox,offset,"
+ "offsetAnchor,offsetDistance,offsetPath,offsetPosition,"
+ "offsetRotate,opacity,order,orphans,outline,outlineColor,"
+ "outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowClipMargin,overflowWrap,"
@@ -6912,7 +6909,7 @@ public void nodeListButtonLabels() throws Exception {
+ "textTransform,textUnderlineOffset,textUnderlinePosition,textWrap,timelineScope,"
+ "top,touchAction,transform,transformBox,transformOrigin,"
+ "transformStyle,transition,transitionBehavior,transitionDelay,transitionDuration,transitionProperty,"
- + "transitionTimingFunction,translate,"
+ + "transitionTimingFunction,translate,types,"
+ "unicodeBidi,unicodeRange,userSelect,vectorEffect,verticalAlign,"
+ "viewTimeline,viewTimelineAxis,viewTimelineInset,viewTimelineName,"
+ "viewTransitionClass,viewTransitionName,"
@@ -7009,7 +7006,8 @@ public void nodeListButtonLabels() throws Exception {
+ "maskClip,maskComposite,maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,"
+ "maskType,mathDepth,mathShift,mathStyle,"
+ "maxBlockSize,maxHeight,maxInlineSize,maxWidth,minBlockSize,minHeight,"
- + "minInlineSize,minWidth,mixBlendMode,negative,objectFit,objectPosition,objectViewBox,offset,"
+ + "minInlineSize,minWidth,mixBlendMode,navigation,negative,"
+ + "objectFit,objectPosition,objectViewBox,offset,"
+ "offsetAnchor,offsetDistance,offsetPath,offsetPosition,"
+ "offsetRotate,opacity,order,orphans,outline,outlineColor,"
+ "outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowClipMargin,overflowWrap,"
@@ -7039,7 +7037,7 @@ public void nodeListButtonLabels() throws Exception {
+ "textTransform,textUnderlineOffset,textUnderlinePosition,textWrap,timelineScope,"
+ "top,touchAction,transform,transformBox,transformOrigin,"
+ "transformStyle,transition,transitionBehavior,transitionDelay,transitionDuration,transitionProperty,"
- + "transitionTimingFunction,translate,"
+ + "transitionTimingFunction,translate,types,"
+ "unicodeBidi,unicodeRange,userSelect,vectorEffect,verticalAlign,"
+ "viewTimeline,viewTimelineAxis,viewTimelineInset,viewTimelineName,"
+ "viewTransitionClass,viewTransitionName,"
@@ -7594,23 +7592,24 @@ public void computedStyle() throws Exception {
+ "marginRight,marginTop,marker,markerEnd,markerMid,markerStart,mask,maskClip,maskComposite,"
+ "maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,mathDepth,mathShift,"
+ "mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxWidth,minBlockSize,minHeight,minInlineSize,"
- + "minWidth,mixBlendMode,negative,objectFit,objectPosition,objectViewBox,offset,offsetAnchor,"
- + "offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,"
- + "outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowClipMargin,overflowWrap,"
- + "overflowX,overflowY,overlay,overrideColors,overscrollBehavior,overscrollBehaviorBlock,"
- + "overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,pad,padding,paddingBlock,"
- + "paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,"
- + "paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,"
- + "pageBreakInside,pageOrientation,paintOrder,parentRule,perspective,perspectiveOrigin,placeContent,"
- + "placeItems,placeSelf,pointerEvents,position,positionAnchor,positionTry,positionTryOptions,"
- + "positionTryOrder,positionVisibility,prefix,quotes,r,range,removeProperty(),resize,right,rotate,"
- + "rowGap,rubyPosition,rx,ry,scale,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollBehavior,"
- + "scrollMargin,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginBottom,"
- + "scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollMarginLeft,"
- + "scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockEnd,"
- + "scrollPaddingBlockStart,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineEnd,"
- + "scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,"
- + "scrollSnapStop,scrollSnapType,scrollTimeline,scrollTimelineAxis,scrollTimelineName,setProperty(),"
+ + "minWidth,mixBlendMode,navigation,negative,objectFit,objectPosition,objectViewBox,offset,"
+ + "offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,"
+ + "outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowClipMargin,"
+ + "overflowWrap,overflowX,overflowY,overlay,overrideColors,overscrollBehavior,"
+ + "overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,pad,"
+ + "padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,"
+ + "paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,"
+ + "pageBreakBefore,pageBreakInside,pageOrientation,paintOrder,parentRule,perspective,"
+ + "perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,positionAnchor,"
+ + "positionTry,positionTryOptions,positionTryOrder,positionVisibility,prefix,quotes,r,range,"
+ + "removeProperty(),resize,right,rotate,rowGap,rubyPosition,rx,ry,scale,scrollbarColor,"
+ + "scrollbarGutter,scrollbarWidth,scrollBehavior,scrollMargin,scrollMarginBlock,"
+ + "scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginBottom,scrollMarginInline,"
+ + "scrollMarginInlineEnd,scrollMarginInlineStart,scrollMarginLeft,scrollMarginRight,scrollMarginTop,"
+ + "scrollPadding,scrollPaddingBlock,scrollPaddingBlockEnd,scrollPaddingBlockStart,"
+ + "scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,"
+ + "scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapStop,"
+ + "scrollSnapType,scrollTimeline,scrollTimelineAxis,scrollTimelineName,setProperty(),"
+ "shapeImageThreshold,shapeMargin,shapeOutside,shapeRendering,size,sizeAdjust,speak,speakAs,src,"
+ "stopColor,stopOpacity,stroke,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,"
+ "strokeMiterlimit,strokeOpacity,strokeWidth,suffix,symbols,syntax,system,tableLayout,tabSize,"
@@ -7620,7 +7619,7 @@ public void computedStyle() throws Exception {
+ "textOverflow,textRendering,textShadow,textSizeAdjust,textSpacingTrim,textTransform,"
+ "textUnderlineOffset,textUnderlinePosition,textWrap,timelineScope,top,touchAction,transform,"
+ "transformBox,transformOrigin,transformStyle,transition,transitionBehavior,transitionDelay,"
- + "transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,"
+ + "transitionDuration,transitionProperty,transitionTimingFunction,translate,types,unicodeBidi,"
+ "unicodeRange,userSelect,vectorEffect,verticalAlign,viewTimeline,viewTimelineAxis,"
+ "viewTimelineInset,viewTimelineName,viewTransitionClass,viewTransitionName,visibility,"
+ "webkitAlignContent,webkitAlignItems,webkitAlignSelf,webkitAnimation,webkitAnimationDelay,"
@@ -7707,23 +7706,24 @@ public void computedStyle() throws Exception {
+ "marginRight,marginTop,marker,markerEnd,markerMid,markerStart,mask,maskClip,maskComposite,"
+ "maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,mathDepth,mathShift,"
+ "mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxWidth,minBlockSize,minHeight,minInlineSize,"
- + "minWidth,mixBlendMode,negative,objectFit,objectPosition,objectViewBox,offset,offsetAnchor,"
- + "offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,"
- + "outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowClipMargin,overflowWrap,"
- + "overflowX,overflowY,overlay,overrideColors,overscrollBehavior,overscrollBehaviorBlock,"
- + "overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,pad,padding,paddingBlock,"
- + "paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,"
- + "paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,"
- + "pageBreakInside,pageOrientation,paintOrder,parentRule,perspective,perspectiveOrigin,placeContent,"
- + "placeItems,placeSelf,pointerEvents,position,positionAnchor,positionTry,positionTryOptions,"
- + "positionTryOrder,positionVisibility,prefix,quotes,r,range,removeProperty(),resize,right,rotate,"
- + "rowGap,rubyPosition,rx,ry,scale,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollBehavior,"
- + "scrollMargin,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginBottom,"
- + "scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollMarginLeft,"
- + "scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockEnd,"
- + "scrollPaddingBlockStart,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineEnd,"
- + "scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,"
- + "scrollSnapStop,scrollSnapType,scrollTimeline,scrollTimelineAxis,scrollTimelineName,setProperty(),"
+ + "minWidth,mixBlendMode,navigation,negative,objectFit,objectPosition,objectViewBox,offset,"
+ + "offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,"
+ + "outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowClipMargin,"
+ + "overflowWrap,overflowX,overflowY,overlay,overrideColors,overscrollBehavior,"
+ + "overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,pad,"
+ + "padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,"
+ + "paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,"
+ + "pageBreakBefore,pageBreakInside,pageOrientation,paintOrder,parentRule,perspective,"
+ + "perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,positionAnchor,"
+ + "positionTry,positionTryOptions,positionTryOrder,positionVisibility,prefix,quotes,r,range,"
+ + "removeProperty(),resize,right,rotate,rowGap,rubyPosition,rx,ry,scale,scrollbarColor,"
+ + "scrollbarGutter,scrollbarWidth,scrollBehavior,scrollMargin,scrollMarginBlock,"
+ + "scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginBottom,scrollMarginInline,"
+ + "scrollMarginInlineEnd,scrollMarginInlineStart,scrollMarginLeft,scrollMarginRight,scrollMarginTop,"
+ + "scrollPadding,scrollPaddingBlock,scrollPaddingBlockEnd,scrollPaddingBlockStart,"
+ + "scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,"
+ + "scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapStop,"
+ + "scrollSnapType,scrollTimeline,scrollTimelineAxis,scrollTimelineName,setProperty(),"
+ "shapeImageThreshold,shapeMargin,shapeOutside,shapeRendering,size,sizeAdjust,speak,speakAs,src,"
+ "stopColor,stopOpacity,stroke,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,"
+ "strokeMiterlimit,strokeOpacity,strokeWidth,suffix,symbols,syntax,system,tableLayout,tabSize,"
@@ -7733,7 +7733,7 @@ public void computedStyle() throws Exception {
+ "textOverflow,textRendering,textShadow,textSizeAdjust,textSpacingTrim,textTransform,"
+ "textUnderlineOffset,textUnderlinePosition,textWrap,timelineScope,top,touchAction,transform,"
+ "transformBox,transformOrigin,transformStyle,transition,transitionBehavior,transitionDelay,"
- + "transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,"
+ + "transitionDuration,transitionProperty,transitionTimingFunction,translate,types,unicodeBidi,"
+ "unicodeRange,userSelect,vectorEffect,verticalAlign,viewTimeline,viewTimelineAxis,"
+ "viewTimelineInset,viewTimelineName,viewTransitionClass,viewTransitionName,visibility,"
+ "webkitAlignContent,webkitAlignItems,webkitAlignSelf,webkitAnimation,webkitAnimationDelay,"
@@ -8317,6 +8317,34 @@ public void xPathResult() throws Exception {
testString("var res = document.evaluate('/html/body', document, null, XPathResult.ANY_TYPE, null);", "res");
}
+ /**
+ * Test {@link XPathEvaluator}.
+ *
+ * @throws Exception if the test fails
+ */
+ @Test
+ @Alerts(CHROME = "createExpression(),createNSResolver(),evaluate()",
+ EDGE = "createExpression(),createNSResolver(),evaluate()",
+ FF = "createExpression(),createNSResolver(),evaluate()",
+ FF_ESR = "createExpression(),createNSResolver(),evaluate()")
+ public void xPathEvaluator() throws Exception {
+ testString("", "new XPathEvaluator()");
+ }
+
+ /**
+ * Test {@link XPathExpression}.
+ *
+ * @throws Exception if the test fails
+ */
+ @Test
+ @Alerts(CHROME = "evaluate()",
+ EDGE = "evaluate()",
+ FF = "evaluate()",
+ FF_ESR = "evaluate()")
+ public void xPathExpression() throws Exception {
+ testString("var res = new XPathEvaluator().createExpression('//span')", "res");
+ }
+
/**
* Test {@link CDATASection}.
*
@@ -8633,14 +8661,31 @@ public void cssStyleSheet() throws Exception {
* @throws Exception if the test fails
*/
@Test
- @Alerts(DEFAULT = "CHARSET_RULE,COUNTER_STYLE_RULE,cssText,FONT_FACE_RULE,FONT_FEATURE_VALUES_RULE,"
- + "IMPORT_RULE,KEYFRAME_RULE,KEYFRAMES_RULE,MEDIA_RULE,NAMESPACE_RULE,PAGE_RULE,parentRule,"
- + "parentStyleSheet,selectorText,style,STYLE_RULE,SUPPORTS_RULE,type",
+ @Alerts(CHROME = "CHARSET_RULE,COUNTER_STYLE_RULE,cssRules,cssText,deleteRule(),FONT_FACE_RULE,"
+ + "FONT_FEATURE_VALUES_RULE,IMPORT_RULE,insertRule(),KEYFRAME_RULE,KEYFRAMES_RULE,MEDIA_RULE,"
+ + "NAMESPACE_RULE,PAGE_RULE,parentRule,parentStyleSheet,selectorText,style,STYLE_RULE,SUPPORTS_RULE,"
+ + "type",
+ EDGE = "CHARSET_RULE,COUNTER_STYLE_RULE,cssRules,cssText,deleteRule(),FONT_FACE_RULE,"
+ + "FONT_FEATURE_VALUES_RULE,IMPORT_RULE,insertRule(),KEYFRAME_RULE,KEYFRAMES_RULE,MEDIA_RULE,"
+ + "NAMESPACE_RULE,PAGE_RULE,parentRule,parentStyleSheet,selectorText,style,STYLE_RULE,SUPPORTS_RULE,"
+ + "type",
FF = "CHARSET_RULE,COUNTER_STYLE_RULE,cssRules,cssText,deleteRule(),FONT_FACE_RULE,"
+ "FONT_FEATURE_VALUES_RULE,IMPORT_RULE,insertRule(),KEYFRAME_RULE,KEYFRAMES_RULE,MEDIA_RULE,"
+ "NAMESPACE_RULE,PAGE_RULE,parentRule,parentStyleSheet,selectorText,style,STYLE_RULE,SUPPORTS_RULE,"
+ + "type",
+ FF_ESR = "CHARSET_RULE,COUNTER_STYLE_RULE,cssText,FONT_FACE_RULE,"
+ + "FONT_FEATURE_VALUES_RULE,IMPORT_RULE,KEYFRAME_RULE,KEYFRAMES_RULE,MEDIA_RULE,"
+ + "NAMESPACE_RULE,PAGE_RULE,parentRule,parentStyleSheet,selectorText,style,STYLE_RULE,SUPPORTS_RULE,"
+ "type")
@HtmlUnitNYI(
+ CHROME = "CHARSET_RULE,COUNTER_STYLE_RULE,cssText,FONT_FACE_RULE,"
+ + "FONT_FEATURE_VALUES_RULE,IMPORT_RULE,KEYFRAME_RULE,KEYFRAMES_RULE,MEDIA_RULE,"
+ + "NAMESPACE_RULE,PAGE_RULE,parentRule,parentStyleSheet,selectorText,style,STYLE_RULE,SUPPORTS_RULE,"
+ + "type",
+ EDGE = "CHARSET_RULE,COUNTER_STYLE_RULE,cssText,FONT_FACE_RULE,"
+ + "FONT_FEATURE_VALUES_RULE,IMPORT_RULE,KEYFRAME_RULE,KEYFRAMES_RULE,MEDIA_RULE,"
+ + "NAMESPACE_RULE,PAGE_RULE,parentRule,parentStyleSheet,selectorText,style,STYLE_RULE,SUPPORTS_RULE,"
+ + "type",
FF = "CHARSET_RULE,COUNTER_STYLE_RULE,cssText,FONT_FACE_RULE,"
+ "FONT_FEATURE_VALUES_RULE,IMPORT_RULE,KEYFRAME_RULE,KEYFRAMES_RULE,MEDIA_RULE,"
+ "NAMESPACE_RULE,PAGE_RULE,parentRule,parentStyleSheet,selectorText,style,STYLE_RULE,SUPPORTS_RULE,"
diff --git a/src/test/java/org/htmlunit/html/HtmlElementTest.java b/src/test/java/org/htmlunit/html/HtmlElementTest.java
index 5b5bffd4c54..4b0ab27cac8 100644
--- a/src/test/java/org/htmlunit/html/HtmlElementTest.java
+++ b/src/test/java/org/htmlunit/html/HtmlElementTest.java
@@ -1219,13 +1219,35 @@ public void isDisplayedJsEngineDisabled() throws Exception {
+ "